- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- printing in awk
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-21-2004 05:30 AM
тАО10-21-2004 05:30 AM
printing in awk
awk '/Start/?????/ {print $0}'
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 05:36 AM
тАО10-21-2004 05:36 AM
Re: printing in awk
Try this awk one liner.
http://www.sap-basis-abap.com/unix/awk-one-liner-tips.htm
If it helps, print and keep a copy for future reference.
Hope this helps.
regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 05:45 AM
тАО10-21-2004 05:45 AM
Re: printing in awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 05:49 AM
тАО10-21-2004 05:49 AM
Re: printing in awk
Give us an example of what the line looks like at present and what you want it look like after awk. Are you trying to get a string after a column position or a match_case position.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 06:00 AM
тАО10-21-2004 06:00 AM
Re: printing in awk
7856545 458458454 9987787
0.0 0.0 0.0 0.0
0.1 0.2
0.2
79 RSSD Logical thread
2154845 542154 2154325
0.0 0.1 0.0 0.10
0.1 0.0
0.10
80 RSSD_thread RSSD
4578512 2154215 2154687
100.6 110.8 0.1 0.1
1645.88 2489.01
2489.10
The last two lines of the file are always going to be the lines I want so I guess if we could print out just the last two lines that would work also...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 06:09 AM
тАО10-21-2004 06:09 AM
Re: printing in awk
here
cat file_name
0 Awaiting Message
7856545 458458454 9987787
0.0 0.0 0.0 0.0
0.1 0.2
0.2
79 RSSD Logical thread
2154845 542154 2154325
0.0 0.1 0.0 0.10
0.1 0.0
0.10
80 RSSD_thread RSSD
4578512 2154215 2154687
100.6 110.8 0.1 0.1
1645.88 2489.01
2489.10
And the results of "tail -2 file_name" would be
1645.88 2489.01
2489.10
Is this what you want.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 06:11 AM
тАО10-21-2004 06:11 AM
Re: printing in awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 06:15 AM
тАО10-21-2004 06:15 AM
Re: printing in awk
Just for reference, you can get awk to print from a specific line to the end of the file. I got it to work like this, there may be a better way:
awk '/Start/,/\*/ {print}' somefile
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 06:18 AM
тАО10-21-2004 06:18 AM
Re: printing in awk
I have another question though...
I get output like this...
1654.28
2498.07
How do I subtract those two numbers? They're on seperate lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 06:20 AM
тАО10-21-2004 06:20 AM
Re: printing in awk
Try this,
awk '{y=x "\n" $0; x=$0};END{print y}' file_name
Hope this helps.
regds