Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- To: tlug@example.com
- Subject: Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- From: Scott Perlman <perlman@example.com>
- Date: Mon, 5 Oct 1998 18:20:56 +0900
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <19981005174824.B10329@example.com>; from Rex Walters on Mon, Oct 05, 1998 at 05:48:24PM +0900
- References: <36175E56.CF2B701@example.com> <Pine.LNX.3.96LJ1.1b7.981005093914.621j-100000@example.com <3.0.6.32.19981005123400.0095c7c0@example.com> <19981005134228.A10159@example.com> <19981005143016.C3664@example.com> <19981005151819.A10276@example.com> <19981005155210.H3664@example.com> <19981005174824.B10329@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
> > No, what? An inode-walk/find within perl or getting the filenames from > stdin wouldn't be better than invoking a perl process for every html > file found? > > I think I may have somehow irritated you. Apologies if so. No its just been a weird day. Sorry. The no is its a trivial aspect and not messy in this case. Piping through xargs doesn7t require any extra work on anyones part. I had interpreted your sayign that it would messy/difficult to mean that you didn't know of a simple inline like I presented. My apologies. > > find . -name '*.html' -print | xargs perl -pi.bak -e "s/match/replace/" > > This is exactly what I meant about feeding the filenames to stdin. > You've chosen to use another external program (xargs), but I > would probably do the same for a one-off like this. > > > Now you've got one perl process (or one per however many arguments > > xargs supports) > > To be pedantic, one find process, n xargs processes, and n perl > processes. Absolutely better than the original, but it can still all be > done in perl (I refuse to think about any problems that *CAN'T* be done > in perl :-). Exactly where n is incremented each time xargs gives up on what it will take for one pass. > > And the question was how to find the files in recursed directories, > > with a followup of how to operate on them.. > > No, as I was so careful to quote in my previous message, the question I > was responding to mentioned nothing about recursed directories, it was > purely a "by the way, how do I do this" question. Hmm, my misread, I included the subject in the question as a matter of course. -Scott -- Today is Thursday, actually I think yesterday was thursday. Wait a minute, the day before that was thursday also!! I never could get the hang of Thursdays! || perlman@example.com --------------------------------------------------------------- Next Meeting: 10 October, 12:30 Tokyo Station Yaesu central gate Featuring the IMASY Eng. Team on "IPv6 - The Next Generation IP" Next Nomikai: 20 November, 19:30 Tengu TokyoEkiMae 03-3275-3691 --------------------------------------------------------------- Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
- References:
- tlug: Grep for subdirectories?
- From: Neil Booth <NeilB@example.com>
- tlug: Re: search & replace (was: Grep for subdirectories?)
- From: Rex Walters <rex@example.com>
- Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- From: Scott Perlman <perlman@example.com>
- Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- From: Rex Walters <rex@example.com>
- Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- From: Scott Perlman <perlman@example.com>
- Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- From: Rex Walters <rex@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: tlug: tlug server latency
- Next by Date: Batman (was Re: tlug: tlug server latency)
- Prev by thread: Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- Next by thread: Re: tlug: Grep for subdirectories?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links