Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!nucsrl!tellab5!vpnet!dattier From: dattier@vpnet.chi.il.us (David W. Tamkin) Newsgroups: comp.unix.shell Subject: Re: for loops Keywords: sh: for i to $FILES Message-ID: <1991Apr05.041709.5586@vpnet.chi.il.us> Date: 5 Apr 91 04:17:09 GMT References: <3693@ux.acs.umn.edu> <2816@maestro.htsa.aha.nl> Organization: VPnet Public Access Unix, Villa Park, Illinois 60181-2206 Lines: 22 miquels@maestro.htsa.aha.nl (Miquel van Smoorenburg) wrote in <2816@maestro.htsa.aha.nl>: | 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 | (not even the one I am writing myself for Minix... yet.). | Maybe somebody knows if a new ksh can do this? Even an old ksh can do let FILES = $FILES - 1 or (( FILES = FILES - 1 )) David Tamkin PO Box 7002 Des Plaines IL 60018-7002 dattier@vpnet.chi.il.us GEnie:D.W.TAMKIN CIS:73720,1570 MCIMail:426-1818 708 518 6769 312 693 0591