Given a file like this:
a b a b
I\'d like to be able to use sed to replace just the last line that contains an instance of \"a
sed
Another one:
tr '\n' ' ' | sed 's/\(.*\)a/\1c/' | tr ' ' '\n'
in action:
$ printf "%s\n" a b a b a b | tr '\n' ' ' | sed 's/\(.*\)a/\1c/' | tr ' ' '\n' a b a b c b