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 14:30:16 +0900
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <19981005134228.A10159@example.com>; from Rex Walters on Mon, Oct 05, 1998 at 01:42:28PM +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>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
actually, just in the spirit of the subdirectories it should probably be find . -name '*.html' -e 'perl -pi.bak -e "s/match/replace/" {} ;' (all that is is wrapping The provided perl witha find) -Scott Rex Walters did state upon Mon, Oct 05, 1998 at 01:42:28PM +0900: > On Mon, Oct 05, 1998 at 12:34:00PM +0000, Darren Cook wrote: > > > > I've a similar question: How do I do a search and replace operation on > > files? I'm sure I've read/been told that you use grep to do this, but I > > can't find any mention when I do man grep. > > > > I've got about 200 HTML files which contain a double-width underline > > (probably in shift-jis) in an IMG tag and it should be a single-width > > underline. > > If you can define the pattern match as a regular expression, perl is > probably the best way to do this: > > perl -pi.bak -e "s/match/replace/" *.html > > Where "match" is the RE matching what you want, and "replace" is what > you want to replace it with. The "-pi.bak" options tell perl to save > the original files with a .bak extension ("file47.html.bak") and to act > as a sed/awk-like filter. > > I'm not sure what you mean by a "double-width underline". If you can't > figure out a suitable regular expression, post some sample before & > after lines. > > Regards, > -- > Rex > --------------------------------------------------------------- > 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 >>>end -- Life is a Terminal Illness, | an apple a day keeps the Noone has survived it yet. | produce farmers very happy perlman@example.com | apply disclaimers liberally! --------------------------------------------------------------- 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
- Follow-Ups:
- Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- From: Rex Walters <rex@example.com>
- 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>
Home | Main Index | Thread Index
- Prev by Date: tlug: Last attempt at this (was: Linux for the masses)
- Next by Date: tlug: Bound Gimp manual?
- Prev by thread: tlug: Re: search & replace (was: Grep for subdirectories?)
- Next by thread: Re: tlug: Re: search & replace (was: Grep for subdirectories?)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links