Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!ameris!smazu From: smazu@ameris.UUCP (Steven P. Mazurek) Newsgroups: comp.unix.shell Subject: Re: for loops Summary: Have you looked into expr(1)? Keywords: sh: for i to $FILES Message-ID: <949@ameris.UUCP> Date: 3 Apr 91 19:35:43 GMT Article-I.D.: ameris.949 References: <3693@ux.acs.umn.edu> Organization: Ameritech Services, Schaumburg, IL Lines: 19 In article <3693@ux.acs.umn.edu>, edh@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