Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cbosgd.UUCP Path: utzoo!linus!philabs!seismo!harpo!floyd!clyde!ihnp4!cbosgd!res From: res@cbosgd.UUCP (Robert Stampfli) Newsgroups: net.followup Subject: Re: Merry Christmas in Bourne Shell Message-ID: <603@cbosgd.UUCP> Date: Tue, 15-Nov-83 17:26:55 EST Article-I.D.: cbosgd.603 Posted: Tue Nov 15 17:26:55 1983 Date-Received: Wed, 16-Nov-83 07:49:43 EST References: <592@ihuxx.UUCP>, <742@hou5d.UUCP> Organization: AT&T Bell Laboratories, Columbus Lines: 17 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)