[net.followup] Merry Christmas in Bourne Shell

mat@hou5d.UUCP (M Terribile) (11/13/83)

Here is another Merry Christmas in the Bourne Shell.  It should have a
little less overhead for both the reader and the computer, tho' it isn't
quite as general.

	for a in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
		echo 'Merry Christmas'
	done

res@cbosgd.UUCP (Robert Stampfli) (11/16/83)

Actually, we wrote a program called 'range' and installed it in /usr/bin
on our project's machines. The 'range' program is fairly easy to write
and simply prints out increasing (or decreasing) sequences
from the first argument to the second (incremented by the third, if present).
Thus, the merry christmas thing would become:

for i in `range 1 15`
do
    echo Merry Christmas
done

The beauty is that range is executed only once in the above. (We also
limit the output to 250 values.) It is surprising how much it simplifies
some shellscripts. Perhaps it ought to be a standard Unix feature, or
even a shell built-in command.
-- 
				- Robert Stampfli (cbosgd!res)