I have linux machine red-hat 5.1
how to replace only the right single char (most side of string)
example from my sed syntax (not good because its replaced both "a" chars)
l
echo machine1a | sed s'/a/b/g'
mbchine1b
But the requested answer should be – machine1b
and not mbchine1b
Best Answer
You can use the end-of-pattern-space pattern. The pattern
$
matches the null string at the end of the pattern space. With this pattern you can avoid usingrev
as advised above.