- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sed cmd to find a constant and get ALL lines after...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 02:05 AM
тАО10-13-2005 02:05 AM
cat PHSS_37232.text | sed -n -e '/^Special Installation Instructions/{N;N;N;p;}'
will get me 3 lines but is there a way to tell it to give me all the remaining lines in a file ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 02:12 AM
тАО10-13-2005 02:12 AM
Re: sed cmd to find a constant and get ALL lines after it
http://www.student.northpark.edu/pemente/sed/sed1line.txt
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 02:13 AM
тАО10-13-2005 02:13 AM
Re: sed cmd to find a constant and get ALL lines after it
# print paragraph if it contains AAA (blank lines separate paragraphs)
# HHsed v1.5 must insert a 'G;' after 'x;' in the next 3 scripts below
sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;'
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 02:39 AM
тАО10-13-2005 02:39 AM
Solutioncreate a file called useme.awk
BEGIN{daflag=0;}
/^Special Installation Instructions/{daflag=1;}
daflag==1 {print $0}
Then what you do is:
awk -f useme.awk < my_patch_file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 02:39 AM
тАО10-13-2005 02:39 AM
Re: sed cmd to find a constant and get ALL lines after it
LINE=`grep -n "Special Installation Instructions" PHSS_37232|cut -d: -f1`
cat PHSS_37232|sed -e "1,${LINE}d" > PHSS_37232.meat
2 lines instead of one for simplistic understanding. they can be combined into a single line if needed by command substitution.
HTH
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 03:44 AM
тАО10-13-2005 03:44 AM
Re: sed cmd to find a constant and get ALL lines after it
cat PHSS_37232.text | sed -n -e '/^Special Installation Instructions/,999999p'
Just put a large number for the ending line number.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 04:05 AM
тАО10-13-2005 04:05 AM
Re: sed cmd to find a constant and get ALL lines after it
# print section of file from regular expression to end of file
sed -n '/regexp/,$p'
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 04:07 AM
тАО10-13-2005 04:07 AM
Re: sed cmd to find a constant and get ALL lines after it
or more evil
# perl -pe'/^Special Installation Instructions//..eof or$_=""' PHSS_37232.text
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 03:47 PM
тАО10-13-2005 03:47 PM
Re: sed cmd to find a constant and get ALL lines after it
sed -e '/^Special Installation Instructions/,$p' < [input file] > [output file]
OR
for file in `ls PH*`
do
sed -e '/^Special Installation Instructions/,$p' <${file} > ${file}.spcl
done
pls excuse the typo's - sitting in an airport waiting for the red-eye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2005 03:52 PM
тАО10-13-2005 03:52 PM
Re: sed cmd to find a constant and get ALL lines after it
see - i told you i was tired ;-)