- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: printing in awk
Operating System - HP-UX
1755385
Members
7384
Online
108832
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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 06:58 AM
тАО10-21-2004 06:58 AM
Re: printing in awk
hi,
Try
echo `cat file_name |awk '{y=x "\n" $0; x=$0};END{print y}'|awk '{for (i=1; i<=NF; i++) s=-$1-s}; END{print s}'`
This will subract the last line from the last-1 line. They have to be numeric values.
someone might have a shorter way.
Hope this helps.
Regds
Try
echo `cat file_name |awk '{y=x "\n" $0; x=$0};END{print y}'|awk '{for (i=1; i<=NF; i++) s=-$1-s}; END{print s}'`
This will subract the last line from the last-1 line. They have to be numeric values.
someone might have a shorter way.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 08:29 AM
тАО10-21-2004 08:29 AM
Re: printing in awk
Here is something pretty straight forward-
awk '/Start/{a=1};{if (a) print $0}' file
(how about assigning points to all that have helped...)
HTH
-- Rod Hills
awk '/Start/{a=1};{if (a) print $0}' file
(how about assigning points to all that have helped...)
HTH
-- Rod Hills
There be dragons...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2004 02:13 PM
тАО10-21-2004 02:13 PM
Re: printing in awk
awk '{y=x; x=$1} END {print x-y}' inputfile
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP