Use echo:
$ echo "$a" | sed ' s@a @ o@g '
In bash, you can also perform simple substitutions with the syntax ${parameter/pattern/string}
. For example:
$ v='aoeua' $ echo ${v/a/o} ooeua
Note that this only replaces the first occurrence of the pattern.
Laurence gonsalves
source share