substring from bash variable starting from character position -


simple question, sed command not working :(

echo "some_class" | sed -e 's/.+\_\(.+\)/\1/' 

i want happens after _ character. please, how can fix code work? thank you.

in case, "class" right answer.

you don't need sed; can use parameter expansion return substring beginning first _:

foo=some_class echo "${foo#*_}" 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -