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

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!csn!cherokee!uswmrg!engineer.mrg.uswest.com!chris
  3. From: chris@engineer.mrg.uswest.com (Chris Fedde)
  4. Subject: Re: Is there a "foreach" loop control in ksh?
  5. Message-ID: <1993Jan20.233510.20061@uswmrg.mrg.uswest.com.mrg.uswest.com>
  6. Organization: USWEST Marketing Resources
  7. NntpPostingHost: engineer.mrg.uswest.com
  8. References: <1304@alsys1.aecom.yu.edu> <1993Jan19.173407.7128@cid.aes.doe.CA> <8673@charon.cwi.nl>
  9. Date: 21 Jan 93 04:35:10 GMT
  10. Lines: 15
  11.  
  12. In article <8673@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes:
  13. >    for file in `ls | sed '/.Z$/d'` ; do compress $file ; done
  14.  
  15.  
  16. avoid the process overhead by doing
  17.  
  18.     for file in *.[!Z]
  19.     do
  20.         something_with_uncompressed_files
  21.     done
  22.  
  23.     See ya
  24.     chris
  25.  
  26. Chris Fedde, USWEST MRG, chris@mrg.uswest.com, voice +13037842823
  27.