Score:1

Appending text, written in variable, below current line using sed

br flag

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
Score:2
sd flag

Escape the dollar sign using a backslash (\):

$ echo "some text"|sed "a\\$foo"
some text
bar

Works fine here.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.