M
M
Mouvdy2016-07-11 15:46:05
linux
Mouvdy, 2016-07-11 15:46:05

How to append "&" to the end of a line in sed?

There is a command
sed -i -e 's#$# log1.txt &#' $outfile
It should add log1.txt & at the end of each line. The command works fine, but the &
icon is not added Please help to solve this issue

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-07-11
@Mouvdy

Need to escape &
sed -i -e 's#$# log1.txt \&#' $outfile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question