home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / shell / 5509 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1020 b   |  30 lines

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