- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: PID Number in the TOP
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
тАО02-07-2007 09:53 PM
тАО02-07-2007 09:53 PM
Re: PID Number in the TOP
Thanks everbody for all answers!!!
Arturo,
I liked your tips but happens:
host:~> top -h -f top.out
host:~>awk 'NF>12&&!/^CPU/ {print $3}' top.out | head -1
/: Event not found.
Do you know why this happens (Event not found)
Please, could you explain what means the parameters "NF>12&&!/^CPU/" because I didn't understand.
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2007 10:08 PM
тАО02-07-2007 10:08 PM
Re: PID Number in the TOP
Is this in the file top.out? Or from awk?
>could you explain what means the parameters "NF>12&&!/^CPU/"
For all lines that have more than 12 fields and don't have the string "CPU" starting in column 1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2007 10:13 PM
тАО02-07-2007 10:13 PM
Re: PID Number in the TOP
Ah! Are you using the scummy C shell?
This occurs because of the !/, even in single quotes. You can suppress it by going to a real shell or in this case by adding a space between ! and /. Or you can quote it:
% echo '\!/'
!/
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2007 10:34 PM
тАО02-07-2007 10:34 PM
Re: PID Number in the TOP
Success using the command:
awk 'NF>12&& ! / ^CPU / {print $3}' top.out | head -1 (Thanks Arturo e Dennis)
One last question... Using the above command I received the result:
PID
If I use with ... | head -2 I receive the result:
PID
13538
How can I get only 13538?? Is it possible?
Sorry for many questions....
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2007 10:41 PM
тАО02-07-2007 10:41 PM
Re: PID Number in the TOP
Hi:
you could add to the sentence, "| grep -v PID"
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2007 10:42 PM
тАО02-07-2007 10:42 PM
Re: PID Number in the TOP
PID
You added too many spaces. You should not have fiddled with the /^CPU/. Treat that if it was in quotes. (That is a regular expression matching expression.)
% awk 'NF>12 && ! /^CPU/ {print $3}' top.out | head -1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2007 11:33 PM
тАО02-07-2007 11:33 PM
Re: PID Number in the TOP
Thank you very much!!!!!
You all right...
Thanks everbody!
Best regards,
clefeitosa!
- « Previous
-
- 1
- 2
- Next »