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 1 Week Ago   -   Original Discussion by Nagaraj R
rdrtx1's Unix or Linux Image
rdrtx1 rdrtx1 is offline
Registered User
Join Date: Sep 2012
Last Activity: 21 January 2018, 10:35 PM EST
Location: Houston, Texas, USA
Posts: 1,021
Thanks: 0
Thanked 352 Times in 333 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; 1 Week Ago at 10:59 AM..
Sponsored Links
Old Unix and Linux 1 Week Ago   -   Original Discussion by Nagaraj R
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is online now Forum Staff  
Join Date: May 2012
Last Activity: 22 January 2018, 3:00 AM EST
Location: Simplicity
Posts: 3,947
Thanks: 335
Thanked 1,322 Times in 1,192 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 02:39 PM
sed Range Pattern and 2 lines before Start Pattern y2jacky Shell Programming and Scripting 3 11-12-2015 11:25 AM
sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern Klasform Shell Programming and Scripting 9 10-12-2015 05:00 PM
Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern essem Shell Programming and Scripting 11 06-05-2014 05:59 AM
sed pattern to delete lines containing a pattern, except the first occurance gary_w Shell Programming and Scripting 8 10-09-2011 07:47 PM

All times are GMT -4. The time now is 04:29 AM.