What's the shortest code that does this? I've been doing something like
echo "header" > tmpfile cat $file >> tmpfile echo "footer" >> tmpfile mv tmpfile $file
. Is there a more compact way?
Update: even shorter:
Update: and even shorter (but must be on many lines as
Well you could use a Here document
And then rename.
This seems to work in
or in one line:
(I think this should work in
Using echo -e this also works in