Newsgroups: comp.unix.shell Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.edu!att!cbnews!ask From: ask@cbnews.att.com (Arthur S. Kamlet) Subject: Re: for loops Reply-To: ask@cblph.att.com Organization: AT&T Bell Laboratories, Columbus, Ohio Distribution: na Date: Fri, 5 Apr 91 21:57:07 GMT Message-ID: <1991Apr5.215707.2937@cbnews.att.com> Keywords: sh: for i to $FILES References: <3693@ux.acs.umn.edu> <2816@maestro.htsa.aha.nl> Lines: 20 In article robtu@itx.isc.com (Rob Tulloh) writes: >In the version of ksh running on the RS/6000, the following is possible: > >typeset -i FILES=10 >while [ $i -gt 0 ] ; do > # body of loop > FILES=FILES-1 >done > >The typeset -i forces FILES to be interpreted as an integer and allows >you to forgo the use of $var and the let syntax. In fact, my ksh comes with an exported alias for typeset -i named "integer" So I can say: integer FILES=10 -- Art Kamlet a_s_kamlet@att.com AT&T Bell Laboratories, Columbus