home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / perl / 7582 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!male.EBay.Sun.COM!exodus.Eng.Sun.COM!bodacia!patl
  2. From: patl@bodacia.Eng.Sun.COM (Pat Lashley)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Help -- why doesn't it work?
  5. Date: 23 Dec 1992 00:22:46 GMT
  6. Organization: Sun Microsystems, Inc.
  7. Lines: 27
  8. Distribution: world
  9. Message-ID: <ljfcamINNvn@exodus.Eng.Sun.COM>
  10. References: <1992Dec8.141905.35130@Lehigh.EDU>
  11. Reply-To: patl@bodacia.Eng.Sun.COM
  12. NNTP-Posting-Host: bodacia
  13.  
  14. In article 35130@Lehigh.EDU, lusol@Lehigh.EDU (Stephen O. Lidie) writes:
  15. |>Too many backslashes.... you just need two:
  16. |>
  17. |>system("find . -user $olduid -exec chown $newuid {} \\;");
  18. |>
  19. |>Might need a space after the {} as well - I do on AIXches.
  20. |>
  21. |>
  22. |>Just anovice Perl hacker,
  23.  
  24. If you have xargs, it is usually better to use:
  25.  
  26.     system ("find . -user $olduid -print | xargs chown $newuid");
  27.  
  28. Using -exec forks a chown process for every file found; but xargs will
  29. append several file names to each chown process.
  30.  
  31.  
  32.  
  33. -Pat
  34.  
  35.  
  36.  
  37. ---
  38. PMLashley    plashley@Sun.COM    SunSoft:NeWS/TNT
  39. "Those who do not understand NeWS are doomed to recreate it - badly"
  40.  
  41.