Unix/Linux Go Back    

Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

sed to remove next 15 lines after pattern in Solaris

Shell Programming and Scripting

Thread Tools Search this Thread Display Modes
Old Unix and Linux 01-09-2018   -   Original Discussion by Nagaraj R
rdrtx1's Unix or Linux Image
rdrtx1 rdrtx1 is offline Forum Advisor  
Registered Pusher
Join Date: Sep 2012
Last Activity: 25 May 2018, 3:54 PM EDT
Location: Houston, Texas, USA
Posts: 1,142
Thanks: 0
Thanked 421 Times in 398 Posts
Is variable SUN_PERSONALITY set? If so, unset variable and try sed again.

try also splitting the script. something like:

sed -e '/\/table/{}' -e '//,+15 d' status.html

Last edited by rdrtx1; 01-09-2018 at 09:59 AM..
Sponsored Links
Old Unix and Linux 01-09-2018   -   Original Discussion by Nagaraj R
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is offline Forum Staff  
Join Date: May 2012
Last Activity: 25 May 2018, 6:53 PM EDT
Location: Simplicity
Posts: 4,084
Thanks: 351
Thanked 1,379 Times in 1,243 Posts
The +15 requires GNU sed.
But perhaps you better match the next HTML tag anyway, that's easy with a standard sed

sed '/<\/table>/,/<table.*>/ d' status.html

Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to remove the lines with this pattern? nengcheng Shell Programming and Scripting 2 04-05-2017 01:39 PM
sed Range Pattern and 2 lines before Start Pattern y2jacky Shell Programming and Scripting 3 11-12-2015 10:25 AM
sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern Klasform Shell Programming and Scripting 9 10-12-2015 04:00 PM
Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern essem Shell Programming and Scripting 11 06-05-2014 04:59 AM
sed pattern to delete lines containing a pattern, except the first occurance gary_w Shell Programming and Scripting 8 10-09-2011 06:47 PM

All times are GMT -4. The time now is 10:32 PM.