I want to do something like:
Code:
echo "/1_one/2_two/3_three.xyz" | sed 's/[/].*$/$$$/'
except that I only want to replace "3_three.xyz" and not the whole string, which the above will do. I've tried:
Code:
sed 's/[/].*?$/$$$/'
and tried moving the "?" into different locations, and every permutation of that and parentheses as well. No luck.
How can I do this (with sed)?
Thanks.