i-bash/examples/scripts.v2/pmtop

26 lines
334 B
Text
Raw Normal View History

1996-12-23 17:02:34 +00:00
#! /bin/bash
#
# pmtop - poor man's `top' for SunOS 4.x
#
CLEAR=clear # could also be 'tput clear'
HEADER="USER PID %CPU %MEM SZ RSS TT STAT START TIME COMMAND"
if [ -n "$LINES" ]; then
SS=$(( $LINES - 2 ))
else
SS=20
fi
while :
do
$CLEAR
echo "$HEADER"
2002-07-17 14:10:11 +00:00
ps -aux | sort -nr -k 3 | sed ${SS}q
1996-12-23 17:02:34 +00:00
sleep 5
done
exit 0