Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!ukma!usenet.ins.cwru.edu!odin!chet From: chet@odin.INS.CWRU.Edu (Chet Ramey) Newsgroups: comp.unix.shell Subject: Re: for loops Keywords: sh: for i to $FILES Message-ID: <1991Apr6.220218.7740@usenet.ins.cwru.edu> Date: 6 Apr 91 22:02:18 GMT References: <3693@ux.acs.umn.edu> <2816@maestro.htsa.aha.nl> Sender: news@usenet.ins.cwru.edu Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 21 Nntp-Posting-Host: odin.ins.cwru.edu In article <2816@maestro.htsa.aha.nl> miquels@maestro.htsa.aha.nl (Miquel van Smoorenburg) writes: $ POSIX states that sh(1) should be able to evaluate expressions, $ so you can do something like $ while [ $FILES != 0 ] $ do $ echo -n '* ' $ FILES=$[$FILES - 1] $ done $ $ But I haven't seen a sh anywhere that is already capable of doing this Bash can do this, at least as of version 1.07. Chet -- Chet Ramey Internet: chet@po.CWRU.Edu Case Western Reserve University NeXT Mail: chet@macbeth.INS.CWRU.Edu ``Now, somehow we've brought our sins back physically -- and they're pissed.''