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?
|
feedback
|
| |||
|
feedback
|
Update: even shorter:
Update: and even shorter (but must be on many lines as
| ||||
feedback
|
|
Well you could use a Here document
And then rename. | ||||
|
feedback
|
|
This seems to work in
or in one line:
(I think this should work in EDIT: Using echo -e this also works in
| |||||||
feedback
|
'header',(gc $file),'footer'|Out-File $file:-P – Joey Jul 20 '11 at 21:37