Re: grep "\" ... how

1999-06-12 Thread Jan Muszynski
ry 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. > > ---

Re: grep "\" ... how

1999-06-12 Thread Ole J. Tetlie
>[EMAIL PROTECTED] > > cat file |tr '\\' '/' >outfile or even: tr '\\' '/' outfile which saves a process. -- Do you want to crack root? Elite-hacker-tip-of-the-day: echo 'yPnrrfq fvonryz lpnbpah grobreI q ban lnqnzrt' | tr n-za-m a-z | \ dd conv=swab 2>/dev/null | mail -s Urgen

Re: grep "\" ... how

1999-06-11 Thread Kenneth Scharf
Yup this works, though you can't save the output to the original file (it blanks it). So I first copy the original to a backup, and then run the backup through sed and overwrite the original (then delete the copy). I can wrap all this in a batch script to fix the entire directory. I have a book

Re: grep "\" ... how

1999-06-11 Thread rp941372
> I this case the '\'s that appear in #include statements are the ONLY > ones that need to be changed, so I can look for #include. Good. So you need to change `\` to `/` in lines that start with '#include': cat file.c |sed -e '/^[ \t]*#include/ s,\\,/,g' >outfile.c That I think should d

Re: grep "\" ... how

1999-06-11 Thread Michael Stenner
On Fri, 11 Jun 1999, Kenneth Scharf wrote: >Yeah I guess I really need to order a copy of the 'camel' book from >amazon. I heartily recommend it! I have been extremely impressed with perl. In hindsight, it was one of my best investments (time and money).

Re: grep "\" ... how

1999-06-11 Thread Kenneth Scharf
Yeah I guess I really need to order a copy of the 'camel' book from amazon. --- Michael Stenner <[EMAIL PROTECTED]> wrote: > >--- [EMAIL PROTECTED] wrote: > >> > I need to write a script to replace '\'s with > '/', > >> > but how can I get grep to accept '\' as a > regular > >> > expression (it a

Re: grep "\" ... how

1999-06-11 Thread Kenneth Scharf
I this case the '\'s that appear in #include statements are the ONLY ones that need to be changed, so I can look for #include. --- [EMAIL PROTECTED] wrote: > > > If backslashes will only appear in file paths, > you > > > are set. If they > > > appear in some other contents where they need to > be

Re: grep "\" ... how

1999-06-11 Thread Alvis W Tabner III
On Fri, Jun 11, 1999 at 07:09:45AM -0700, Kenneth Scharf 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)? You can use sed (if I understand you cor

Re: grep "\" ... how

1999-06-11 Thread Michael Stenner
>--- [EMAIL PROTECTED] 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 o

Re: grep "\" ... how

1999-06-11 Thread rp941372
> > 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"); Ok... You're goi

Re: grep "\" ... how

1999-06-11 Thread Kenneth Scharf
--- [EMAIL PROTECTED] 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)? > > Come to think of it, if you're trying to _replace_ > charca

Re: grep "\" ... how

1999-06-11 Thread rp941372
> 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)? Come to think of it, if you're trying to _replace_ charcacters, instead of just locating them, you might

Re: grep "\" ... how

1999-06-11 Thread rp941372
> 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)? You need to escape the '\' with another one: grep '\\' file

Re: grep "\" ... how

1999-06-11 Thread rp941372
> On Fri Jun 11, 1999, Kenneth Scharf 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)? > > Put the expression in single quotes? This doesn'

Re: grep "\" ... how

1999-06-11 Thread Immanuel Yap
On Fri Jun 11, 1999, Kenneth Scharf 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)? Put the expression in single quotes? Noel

grep "\" ... how

1999-06-11 Thread Kenneth Scharf
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)? this is to port a windows program to linux. === Amateur Radio, when all else fails! http://www.qsl.net/wa2mz