[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: grep "\" ... how



You might also want a copy of O'Relly's 'Mastering Regular 
Expressions'

And instead of Amazon check out <http://www.bookpool.com>. They offer 
techbooks at probably the best discounts I've seen (O'Reilly at about 
35% off), and their shipping charges are very good as well - 
especially if you order multiple books (They charge actual cost for 
shipping).

On 11 Jun 99, at 10:41,  Kenneth Scharf 
 wrote about Re: grep "\" ... how :

> Yeah I guess I really need to order a copy of the 'camel' book from
> amazon.
> 
> --- Michael Stenner <mstenner@phy.duke.edu> wrote:
> > >--- rp941372@rrpac.upr.clu.edu wrote:
> > >> > I need to write a script to replace '\'s with
> > '/',
> > >> > but how can I get grep to accept '\' as a
> > regular 
> > >> > expression (it assumes it to be line continue 
> > >> > character, at least from the sh prompt)?
> > 
> > -- stuff about tr and sed --
> > 
> > >> 
> > >> If backslashes will only appear in file paths,
> > you
> > >> are set.  If they
> > >> appear in some other contents where they need to
> > be
> > >> kept, then look at a
> > >> more sophisticated tool like sed.
> > >> 
> > >This it true... the '\' also appears in printf's
> > >IE: fprintf("\t hello \n");
> > 
> > At this point, it might be worth your time to learn
> > a little perl.  I
> > know that sed and awk are rather powerful, too, but
> > if you're porting a
> > program, you must be reasonably proficient at
> > programming.
> > 
> > you will find a little time learning perl's regular
> > expressions rather
> > useful later on, too.
> > 
> > 					-Michael
> > 
> > I (and many others) can give you a little help with
> > a perl script (less
> > than 10 lines) that would correctly modify 99% of
> > your backslashes.
> > 
> >   Michael Stenner			Office Phone: 919-660-2513
> >   Duke University, Dept. of Physics	 
> > mstenner@phy.duke.edu
> >   Box 90305, Durham N.C. 27708-0305
> > 
> > 
> 
> 
> 
> 
> ===
> Amateur Radio, when all else fails!
> 
> http://www.qsl.net/wa2mze
> 
> Debian Gnu Linux, Live Free or .....
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> 
> 
> 


==============================
   Jan M.        -  mailto:jancm@bigfoot.com

   PGP key mailto:jancm@bigfoot.com?Subject=send%20pgp%20key
       Fingerprint:397D 093C E802 964E  5316 B90A 93CE 6696
  
Thought for the day:
    People make their own history, but they do not make it just as
    they please; they do not make it under circumstances chosen by
    themselves, but under circumstances directly encountered, given
    and transmitted from the past. The tradition of all the dead
    generations weighs like a nightmare on the brain of the living.
            -- Karl Marx



Reply to: