When running the following
echo "abc>asf<tfg"|sed 's/.*>\(.*\)</\1/'
The output is:
I don't understand why
tfg gets printed? My expected result is asf. Though, it works fine in the following.
expr `echo "abc>asf<tfg"` : '.*>\(.*\)<'
Which gets me:
And help me to extract the string between
< when input is being received from a pipe.