The 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?
|
feedback
|
This question came from our site for computer enthusiasts and power users.
|
| |||||||
feedback
|
|
Assuming you want to put the ending php tag to the files, then
should do the trick | |||
|
feedback
|
|
No need to use sed in that case. How about
? | |||||||||||
feedback
|
|
See your original post http://superuser.com/questions/36575/unix-add-a-tag-to-the-beginning-of-each-file for the all in one sed command.
| |||
|
feedback
|
{ cat file; echo 'END OF FILE'; } > newFile, this works also thanks to sh.*. (not sed but works and simple) – hhh Dec 12 '11 at 14:20