source: vendor/bash/3.1-p17/examples/scripts.v2/pmtop

Last change on this file was 3228, checked in by bird, 18 years ago

bash 3.1

File size: 334 bytes
Line 
1#! /bin/bash
2#
3# pmtop - poor man's `top' for SunOS 4.x
4#
5
6CLEAR=clear # could also be 'tput clear'
7HEADER="USER PID %CPU %MEM SZ RSS TT STAT START TIME COMMAND"
8
9if [ -n "$LINES" ]; then
10 SS=$(( $LINES - 2 ))
11else
12 SS=20
13fi
14
15while :
16do
17 $CLEAR
18 echo "$HEADER"
19 ps -aux | sort -nr -k 3 | sed ${SS}q
20 sleep 5
21done
22
23exit 0
24
25
Note: See TracBrowser for help on using the repository browser.