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!

sed question 1

Status
Not open for further replies.

zaxxon

MIS
Dec 12, 2001
226
DE
Hi,

is it possible to make a "one-liner" of the following sed script?

sed '/PATTERN/ athis text is the added line
'

I tried many variations but non worked to get it on one line at shell prompt. Any help is welcome, thank you.

laters
zaxxon
 
In ksh -o vi:
sed '/PATTERN/a\^Jthis text is the added line^J'
To have ^J you type Ctrl-V Ctrl-J


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top