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