![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help to replace character strings | rahulrathod | UNIX for Dummies Questions & Answers | 5 | 12-18-2008 05:26 AM |
| Find lines with space between strings | Galt | Shell Programming and Scripting | 5 | 05-07-2008 03:06 PM |
| How to print only lines in between two strings using awk | jisha | Shell Programming and Scripting | 4 | 01-11-2008 04:13 AM |
| Extracting the lines between 2 strings of a file | babloo | Shell Programming and Scripting | 2 | 02-14-2007 11:27 AM |
| many strings against 5million lines | r0sc0 | Shell Programming and Scripting | 2 | 01-19-2006 09:04 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
replace 2 identical strings on different lines
I am looking to replace two or more strings on different lines using sed, but not with the same variable. IE Code:
# cat xxx.file <abc> abc def ghi abc def ghi abc def ghi currently I can only change each line with the same pattern: Code:
# sed -e '/<abc>/!s/abc\(.*\)/jkl mno/' xxx.file abc jkl mno abc jkl mno abc jkl mno I would like the output to be: abc jkl mno abc pqr stu abc vwx yz thanks Last edited by prkfriryce; 06-06-2007 at 03:30 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|