sed appears to find and replace from right to left.
for example:
echo "a_b_c_d" | sed 's/.*\(_.*\)/\1/'
outputs
_d
but why doesn't
echo "a_b_c_d" | sed 's/^.*\(_.*\)/\1/'
or
echo "a_b_c_d" | sed 's/.*\(_.*$\)/\1/'
output
_b_c_d
since these do not output _b_c_d
how should this be done?
How should sed be used to find on first character and not last character when performing a find and replace?