Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!daver!genco!rad From: rad@genco.bungi.com (Bob Daniel) Newsgroups: comp.unix.shell Subject: Re: for loops Keywords: sh: for i to $FILES Message-ID: <619@genco.bungi.com> Date: 4 Apr 91 19:20:42 GMT References: <3693@ux.acs.umn.edu> Reply-To: rad@genco.bungi.com (Bob Daniel) Organization: Gentry & Assoc. Excelsior Springs, MO Lines: 15 In article <3693@ux.acs.umn.edu> edh@ux.acs.umn.edu (Merlinus Ambrosius) writes: >In sh, I'd like to do something like a BASIC for loop. 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? > for i in $FILES do ls -l $i .... or whatever to do with that file done If FILES="/etc/inittab /etc/passwd /etc/mnttab etc...", each file will be treated individually in the example above.