This sed command inserts a tag to the beginning of a file:
sed -i "1s/^/<?php /" file
How can I insert something to the end of each file with sed?
sed
This sed command inserts a tag to the beginning of a file:
sed -i "1s/^/<?php /" file
How can I insert something to the end of each file with sed?
Best Answer
The simplest way is:
How it works
$
matches the last line (it's a normalsed
address;4aTEXTTOEND
would insert after the fourth line),a
is the append command, andTEXTTOEND
is what to append,filename
is the file where theTEXTTOEND
will be inserted