I can append text below current line, using the sed
editor:
$ foo=bar
$ echo "some text"|sed "a\bar"
some text
bar
But when I try to append text from variable below current line, using sed
, I am not able to do it:
$ foo=bar
$ echo "some text"|sed "a\$foo"
some text
$foo
Escape the dollar sign using a backslash (
\
):Works fine here.