![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| insert a line after specific line | namishtiwari | Shell Programming and Scripting | 8 | 05-21-2008 02:16 PM |
| how to delete text from line starting pattern1 up to line before pattern2? | repudi8or | Shell Programming and Scripting | 5 | 04-15-2008 09:25 PM |
| how to delete line with matching text and line immediately after | orahi001 | UNIX for Dummies Questions & Answers | 6 | 01-15-2008 12:34 AM |
| how to insert a line number on every line | mopimp | UNIX for Dummies Questions & Answers | 3 | 03-25-2006 01:35 PM |
| Insert a line as the first line into a very huge file | shriek | UNIX for Advanced & Expert Users | 3 | 03-09-2005 01:22 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
pls try below sed command
Code:
sed -n '/pqr/ !{
p
}
/pqr/ {
p
n
p
n
p
i\
best
}' filename
Code:
sed '/pqr/a\ ------------------ /^t$/a\ ------------------ ' filename Code:
sed '/pqr/i\ ------------------ /^t$/i\ ------------------ ' filename Last edited by summer_cherry; 10-21-2008 at 01:23 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|