RE: Grep and matching end of line (anchoring)

2004-11-22 Thread Dalton, Barnaby
file listed, convert in place. If none specified, then use stdin/stdout > -Original Message- > From: Buchbinder, Barry (NIH/NIAID) [mailto:[EMAIL PROTECTED] > Sent: 19 November 2004 15:17 > To: '[EMAIL PROTECTED]' > Subject: RE: Grep and matching

RE: Grep and matching end of line (anchoring)

2004-11-19 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Shankar Unni > Sent: 19 November 2004 19:22 > Dave Korn wrote: > > > What makes you think grep understands ^ notation to > indicate control > > chars? It doesn't say so in the info page. (It doesn't > recognize [\r] > > either.)

Re: Grep and matching end of line (anchoring)

2004-11-19 Thread Shankar Unni
Dave Korn wrote: What makes you think grep understands ^ notation to indicate control chars? It doesn't say so in the info page. (It doesn't recognize [\r] either.) Umm, you're probably jumping to the wrong conclusion about the OP's intent. He probably meant the literal character ^M, which you

RE: Grep and matching end of line (anchoring)

2004-11-19 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Buchbinder, Barry (NIH/NIAID) > Sent: 19 November 2004 18:53 > >> This should work whether or not one is on a text mount or for > >> the file has DOS or Unix line endings: > >> > >>cat files.txt | grep -E '\.h^M?$' > > > > Alway

RE: Grep and matching end of line (anchoring)

2004-11-19 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Dave Korn > Sent: 19 November 2004 18:30 > Actually, it seems that grep > ... cannot be blamed for failing to spot _that_ unexpected EOL! What I was going to say is that it seems egrep doesn't properly handle the ^ symbol at al

RE: Grep and matching end of line (anchoring)

2004-11-19 Thread Buchbinder, Barry (NIH/NIAID)
At Friday, November 19, 2004 1:30 PM, Dave Korn wrote: >> -Original Message- >> From: cygwin-owner On Behalf Of Buchbinder, Barry (NIH/NIAID) >> Sent: 19 November 2004 15:17 > >> This should work whether or not one is on a text mount or for >> the file has DOS or Unix line endings: >> >>

RE: Grep and matching end of line (anchoring)

2004-11-19 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Buchbinder, Barry (NIH/NIAID) > Sent: 19 November 2004 15:17 > This should work whether or not one is on a text mount or for > the file has DOS or Unix line endings: > > cat files.txt | grep -E '\.h^M?$' Always test before po

RE: Grep and matching end of line (anchoring)

2004-11-19 Thread Buchbinder, Barry (NIH/NIAID)
At Friday, November 19, 2004 7:41 AM, Reini Urban wrote: > Dalton, Barnaby schrieb: >> I'm having trouble getting grep to match end of line when used with >> files/utilities that use DOS linefeeds. For example: >> >> cat files.txt | grep '\.h$' >> >> produces no output. However, if I stick a filt

Re: Grep and matching end of line (anchoring)

2004-11-19 Thread Reini Urban
Dalton, Barnaby schrieb: I'm having trouble gettting grep to match end of line when used with files/utlilities that use DOS linefeeds. For example: cat files.txt | grep '\.h$' produces no output. However, if I stick a filter in the middle to change the line endings: cat files.txt | perl -pe 's/\r\n