how to get the second word (string) after "=" separator by sed (need to ignore spaces)
for example
echo " bla bla word word1 = strin1 string2 " | sed .....
I should get string2
another example
echo " bla bla word word1 =swhsw 123 " | sed .....
I should get 123
$ echo " bla bla word word1 = strin1 string2 " | sed 's/.[^=]*=\(.[^ \t]*\)[ \t]*\(.[^ \t]*\)\(.*\)/\2/'
string2
$ echo " bla bla word word1 =swhsw 123 " | awk -F"=" '{split($2,a," ");print a[2]}'
123
And how about you start reading up on how to use sed/awk ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With