Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site ubu.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!ukc!qtlon!flame!ubu!dpa From: dpa@ubu.UUCP (David Angier) Newsgroups: net.sources.bugs Subject: Re: program to repetively display command on crt Message-ID: <336@ubu.UUCP> Date: Fri, 23-Nov-84 17:23:41 EST Article-I.D.: ubu.336 Posted: Fri Nov 23 17:23:41 1984 Date-Received: Sun, 25-Nov-84 09:15:29 EST Organization: Computer Science, Warwick University, UK Lines: 40 [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)