I am trying to replace a line of my file. I used
line=" abc"
sed -i "3c ${line}" test.txt
It works but the first space doesn't show up. I want the line 3 in test.txt to be
abc
rather than
abc
notice there is a space before abc. thanks for any suggestions!