home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!ogicse!reed!romulus!merlyn
- From: merlyn@ora.com (Randal L. Schwartz)
- Newsgroups: comp.lang.perl
- Subject: Re: Help -- why doesn't it work?
- Message-ID: <MERLYN.92Dec23081925@romulus.reed.edu>
- Date: 23 Dec 92 16:19:28 GMT
- Article-I.D.: romulus.MERLYN.92Dec23081925
- References: <1992Dec8.141905.35130@Lehigh.EDU> <ljfcamINNvn@exodus.Eng.Sun.COM>
- Sender: news@reed.edu (USENET News System)
- Organization: Stonehenge Consulting Services; Portland, Oregon, USA
- Lines: 22
- In-Reply-To: patl@bodacia.Eng.Sun.COM's message of 23 Dec 92 00:22:46 GMT
-
- In article <ljfcamINNvn@exodus.Eng.Sun.COM> patl@bodacia.Eng.Sun.COM (Pat Lashley) writes:
- If you have xargs, it is usually better to use:
-
- system ("find . -user $olduid -print | xargs chown $newuid");
-
- If you have Perl, why even use xargs?
-
- $newuid = getpwnam($newuid) unless $newuid =~ /^\d+$/; # force number
- open(F,"find . -user $olduid -print|");
- while(<F>) {
- chop;
- chown($newuid,(stat($_)[5]),$_);
- }
-
- There. Two processes. If you wanna even be weirder, use "find2perl"
- to do the whole thing in Perl.
-
- sub r{print pack("c*",reverse (unpack("c*",$_[0])),32);}&r("tsuJ");&r("rehtona");&r("lreP");print"hacker,"
- --
- Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
- merlyn@ora.com (semi-permanent) merlyn@reed.edu (for newsreading only)
- factoid: "Portland, Oregon, home of the California Raisins and Lone-Star Beer!"
-