I'm trying to insert a new line into a file just before the last line. The new line includes tab
and a variable.
Using the following. This inserts the line at the correct place, includes the tab but doesn't expand the variable.
sed '$i \\tnewline = $newvalue' file
If I wrap it in double quotes instead of single quotes I get errors.
sed: -e expression #1, char 13: unterminated address regex
How do I do this ?
Thanks