I need to replace the first line of a file with the complete content from another file. Does on see what I'm missing?
$ cat old.txt --- foo bar $ cat append.txt --- 123 <321> $ cat process.sh old=old.txt append=append.txt sed -i "1s/.*/$append/" $old cat $old
$ bash process.sh --- 123 <321> foo bar
Though instead I got
sed: -e expression #1, char 9: unterminated `s' command
when trying to sed with a variable inside my script
while this one works (without variable) sed -i "1s/.*/loremipsum/" $old