in reply to Re: Re: Re: Need one-liner to s///g in all sub-dirs
in thread Need one-liner to s///g in all sub-dirs
Okay: Encourged by your insistence, I finally found this bit in Camel 3, page 496: The -p loop also contains an implicit select(ARGVOUT); for each file. perlrun just says, "Note that the lines are printed automatically." It omits to say at that point "to the file in question". It's probably there somewhere. And it's clear once you know it. I just missed it.
All of which brings my to my tired question (revised a little each time). And I ask again because this part is still not clear. Assuming that the files are already backed up, does not this simple line: %perl -pie 's/old/new/g' ./*/* do everything I need without the use of find.... When I am doing things on unfamiliar turf, I like (if possible) to keep it simple and clear.
Update: Still reading... perlrun does contain the explanation of the implicit select(ARGVOUT);. But, as in Camel 3 (which simply reprints the whole section) it is under the -i, not -p. IMHO, the briefer code given under -p is misleading since it claims to explain what -p does but fails to mention the implicit 'select'. This is a crucial detail and the reason I deliberately chose not to use it at first. I had no need to print to STDOUT (which is what the code under -p, as given, would do).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Need one-liner to s///g in all sub-dirs
by blakem (Monsignor) on Aug 25, 2001 at 09:32 UTC | |
by dvergin (Monsignor) on Aug 25, 2001 at 10:01 UTC | |
by blakem (Monsignor) on Aug 25, 2001 at 10:34 UTC | |
|
Re: Re: Re: Re: Re: Need one-liner to s///g in all sub-dirs
by rob_au (Abbot) on Aug 25, 2001 at 09:47 UTC | |
by dvergin (Monsignor) on Aug 25, 2001 at 10:08 UTC | |
|
Re: Re(4): Need one-liner to s///g in all sub-dirs
by chipmunk (Parson) on Aug 25, 2001 at 16:47 UTC |