home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!destroyer!ncar!mimbres.cs.unm.edu!cs.sandia.gov!jhgreen
- From: jhgreen@cs.sandia.gov (Jethro H. Greene)
- Subject: Re: Is there a "foreach" loop control in ksh?
- Message-ID: <1993Jan19.222513.8127@cs.sandia.gov>
- Sender: usenet@cs.sandia.gov (Another name for news)
- Organization: Sandia National Laboratories, Albuquerque, NM
- References: <1304@alsys1.aecom.yu.edu>
- Date: Tue, 19 Jan 93 22:25:13 GMT
- Lines: 18
-
- In article <1304@alsys1.aecom.yu.edu> manaster@yu1.yu.edu (Chaim Manaster) writes:
- >I want to do a series of comands on each file in the current
- >directory, with some sort of "foreach" construct that will loop
- >over every file in some list (something like in perl), or in some
- >cases every file in the current directory. How would one do this in
- >ksh?
-
- for i in *; do
- echo $i
- done # This is a simple example.
-
- I hope that this helps.
-
- --
- Jethro H. Greene
- Massively Parallel Computing Research Laboratory,
- Sandia National Laboratories, Albuquerque, New Mexico
-
-