Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I insert strings in a file with SED?

Status
Not open for further replies.

whatisthis987

IS-IT--Management
Apr 24, 2007
34
US
Hi,
I have a script that does substituion with s command.

eg:
#!/bin/sed -f
s/regexp/replacement/

so at Unix/Linux prompt,
%>./script original_file >new_file
It works like a charm but I also need to add strings/texts to the new_file. How do I do it in the same script?

Please help.
 
In the sed man page have a look at the i and a commands.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top