home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 16006 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.0 KB

  1. Path: sparky!uunet!ulowell!m2c!nic.umass.edu!dime!williams
  2. From: williams@cs.umass.edu
  3. Newsgroups: comp.unix.questions
  4. Subject: Sun 'find' is missing '-maxdepth'!
  5. Message-ID: <59161@dime.cs.umass.edu>
  6. Date: 26 Jan 93 17:54:59 GMT
  7. Sender: news@dime.cs.umass.edu
  8. Organization: COINS, UMass, Amherst
  9. Lines: 25
  10.  
  11. The find program on Sun OS does not contain the -maxdepth option.  How
  12. can I get the effect of -maxdepth 1 in a directory containing
  13. subdirectories?  I want find to -exec a command on all of the files in
  14. the directory, but NOT on the files contained in the subdirectories.
  15. If I use -prune, nothing is done since the file I'm specifying is a
  16. directory.  I've tried various combinations of -prune, -depth, and
  17. -type to no avail.
  18.  
  19. /dira/dirb/file1
  20.        file2
  21.        file3
  22.        file4
  23.        dirc/
  24.         file5
  25.         file6
  26.         file7
  27.  
  28. 'find /dira/dirb -print -maxdepth 1' does what I want - prints file1
  29. thru file4, but not file5 thru file7.
  30.  
  31. How can I do the same thing on the current version of Sun OS on a
  32. Sparc 2? 
  33.  
  34. Thanks for any help!!
  35. Leo
  36.