program to repetively display command on crt
David Angier
dpa at ubu.UUCP
Sat Nov 24 08:23:41 AEST 1984
[Munch..Hmm...Yuck...]
I was quite suprised to see a C program to display the output of a
shell command string every n seconds. Surely this is an elementry
task in shell script. I'm sure that this is one of the main uses
of shell script files. It seems stupid to write such minor utilities
in C.
Here follows a quite adequate display program written in /bin/sh shell
script. It could be shortened by making the syntax simpler or
removing checks for invalid syntax (half the program.)
-----------------------CUT-HERE-----------------------------------------------
SLEEP=5
if test $# = 0
then
echo Usage: $0 [-seconds] command [command args]
exit
fi
if expr $1 : '-'[0123456789]>/dev/null
then
SLEEP=`echo $1|tail +2c`
shift
fi
if test $# = 0
then
echo Usage: $0 [-seconds] command [command args]
exit
fi
while true
do
clear
$*
sleep $SLEEP
done
Lets have no more silly C programs in net.sources.
Dave (Maths @ Warwick University, UK)
More information about the Comp.sources.bugs
mailing list