I am new to vi I found this script but can not get it to work. I created the directory under my id then created a file
#!/bin/sh
############################################################
PS=/bin/ps
CUT=/usr/bin/cut
SORT=/usr/bin/sort
HEAD=/usr/bin/head
if [ -x $PS -a -x $CUT -a -x $SORT -a -x $HEAD ]
then
echo
echo " %CPU PID TIME VSZ USER COMMAND"
echo
$PS -aef -o pcpu= -o pid= -o time= -o vsz= -o user= -o args= |
$CUT -c -130 | $SORT -r | $HEAD -10
else
exit 1
fi
==========================================================
This is what i get
$ stat
stat: =/bin/ps: not found
$ pwd
/home/frober01/test
here is the ls command
$ ls -ltr
total 8
-rwx------ 1 frober01 staff 337 Sep 24 14:39 stat
$
can anyone help
#!/bin/sh
############################################################
PS=/bin/ps
CUT=/usr/bin/cut
SORT=/usr/bin/sort
HEAD=/usr/bin/head
if [ -x $PS -a -x $CUT -a -x $SORT -a -x $HEAD ]
then
echo
echo " %CPU PID TIME VSZ USER COMMAND"
echo
$PS -aef -o pcpu= -o pid= -o time= -o vsz= -o user= -o args= |
$CUT -c -130 | $SORT -r | $HEAD -10
else
exit 1
fi
==========================================================
This is what i get
$ stat
stat: =/bin/ps: not found
$ pwd
/home/frober01/test
here is the ls command
$ ls -ltr
total 8
-rwx------ 1 frober01 staff 337 Sep 24 14:39 stat
$
can anyone help