The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
top output for six processes with the same name, output changed from column to row
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
top output for six processes with the same name, output changed from column to row
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
05-27-2009
reddysiva
Registered User
Join Date: Dec 2008
Posts: 11
try this
#!/bin/bash
outputFile=topOutput_`uname -n`
echo "Output: " $outputFile
for ((;;));
do
(date +%T | tr "\n" " " && ps -A ux | sort -rn -k 3 | awk 'NR<6 && $3!="%CPU"{printf "%s ",$3} END {printf "\n"}') >> $outputFile
sleep 30
done
reddysiva
View Public Profile
Find all posts by reddysiva
Find reddysiva's past nominations received
Find reddysiva's present nominations given