I have this code:
sed -i -s "1i${var}" $file
I need to copy all the content of the variable var into the top of the file without deleting the content of the file. When var has one line, the command works well, but when var has multiple lines I get this error:
sed: -e expression #1, character 28: extra characters after command
I need to use sed.
Any idea?
Thanks.