top in batch mode, cpu info is wrong


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Old 08-20-2008
Your output has 2 sections beginning with the word top and we want to print the second one.
After we met the second top i has the value 2.
i==2 is a condition here for awk, if it's true awk print the record per default so awk begins to print after we've reach the second top.
i==2 is similar to {if i == 2 {print $0}}

Have a read of an awk tutorial, you can find some links here:

https://www.unix.com/answers-frequent...tutorials.html

Hope this helps.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Test if Remote server is up and running before SFTP'ing files (in batch mode) Dippu Shell Programming and Scripting 2 04-28-2016 04:17 AM
How to use gpg to encrypt data in batch/non-interactive mode? calredd Shell Programming and Scripting 2 07-31-2015 03:37 PM
tftp batch mode within bash script yildiz.a Shell Programming and Scripting 1 09-27-2012 11:50 AM
FTP in batch mode cvsanthosh Shell Programming and Scripting 6 04-18-2012 03:50 AM
how to run glance over ssh in batch mode delphys HP-UX 5 10-20-2011 04:47 PM
How to run VI in batch mode grossgermany Shell Programming and Scripting 5 04-04-2010 10:12 AM
Need a list of top 10 CPU using processes (also top 10 memory hogs, separately) thenomad AIX 5 09-23-2009 09:42 PM
CPU Info yoavbe HP-UX 3 09-12-2009 12:45 PM
how to get persistant cpu utilization values per process per cpu in linux (! top,ps) pankajd UNIX for Dummies Questions & Answers 3 10-09-2008 12:26 PM
top %CPU. praveen_b744 UNIX for Advanced & Expert Users 3 09-11-2007 08:37 AM
cpu info vijayca HP-UX 1 08-27-2007 09:51 AM
Sftp in Batch Mode sivaemn UNIX for Advanced & Expert Users 2 07-01-2007 07:52 AM
SSH in batch mode and File-Handles in a loop DaveCutler Shell Programming and Scripting 3 04-03-2007 07:39 AM
su command in batch mode Rajesh Gohad Shell Programming and Scripting 3 01-26-2007 12:54 AM
Help ! How to get elm to send multiple attachments - in batch mode anarvan UNIX for Dummies Questions & Answers 1 09-14-2005 09:41 AM