Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: Bourne Shell (/bin/sh) counting? Keywords: shell Message-ID: <1990Mar21.144238.868@athena.mit.edu> Date: 21 Mar 90 14:42:38 GMT References: <22788@adm.BRL.MIL> <63524@srcsip.UUCP> <3350@hcx1.SSD.CSD.HARRIS.COM> Sender: news@athena.mit.edu (News system) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 24 In all this talk about the various ways to count in a shell script, I'm surprised that no one has mentioned the "jot" program, which I believes comes standard with BSD nowadays (at least with BSD 4.3 and up -- I don't know about 4.2). The first paragraph of the description in the man page says: Jot is used to print out increasing, decreasing, random, or redundant data, usually numbers, one per line. If I wanted a loop to execute 10 times, I would just do "for i in `jot 10`; do" (or whatever the correct syntax is -- I use csh primarily, so I don't claim to know the sh syntax off the top of my head :-). Alas, it isn't freely redistributable, or at least I assume it isn't, because it isn't in the bsd-sources archives on uunet.uu.net. Somebody could probably rewrite it in perl pretty easily :-) Hell, it would even be easy to rewrite from scratch in C. Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710