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
Reply to: