for loops

Steven P. Mazurek smazu at ameris.UUCP
Thu Apr 4 05:35:43 AEST 1991


In article <3693 at ux.acs.umn.edu>, edh at ux.acs.umn.edu (Merlinus Ambrosius) writes:
> .....Say I have $FILES set to some number, and I'd like to go through
> a loop $FILES times.  Can this be done in sh?
> 

You don't mention the type of shell your using, but for
Bourne investigate the command expr(1).

	while [ $FILES -ne 0 ]		# use strings if its more comfortable
	do  .... things ....
	    FILES=`expr $FILES - 1`
	done



-- 
Steven P. Mazurek	 | Email: {uunet,bcr,lbesac}!ameris!smazu
Ameritech Services	 | 
Schaumburg, IL USA 60010 | Phone : (708) 605-2858



More information about the Comp.unix.shell mailing list