delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/30/23:52:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Robert Mark Bram" <relaxedrob AT optushome DOT com DOT au>
To: <cygwin AT cygwin DOT com>
Subject: RE: Difference between Sun OS and cygwin?
Date: Fri, 31 May 2002 13:51:44 +1000
Message-ID: <AHENJAAPGAHKCFPLDPOJCEKJCGAA.relaxedrob@optushome.com.au>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
In-Reply-To: <20020531033213.GA11456@redhat.com>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

Howdy Christopher!

Well, I get this when I do od:

Robert Mark Bram AT DIJONG /home/Rob
$ cat >file
one.doc

Robert Mark Bram AT DIJONG /home/Rob
$ od -c file
0000000   o   n   e   .   d   o   c  \r  \n
0000011

Robert Mark Bram AT DIJONG /home/Rob
$ grep .doc$ file
one.doc

Robert Mark Bram AT DIJONG /home/Rob
$



So my question then is: why doesn't \r\n count as end of the line for $ in
grep?

And then.. is there a way I can fix it so it works the same in Cygwin as it
would for Sun?

Rob

:)

> -----Original Message-----
> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf
> Of Christopher Faylor
> Sent: Friday, 31 May 2002 1:32 PM
> To: cygwin AT cygwin DOT com
> Subject: Re: Difference between Sun OS and cygwin?
>
>
> On Fri, May 31, 2002 at 01:23:05PM +1000, Robert Mark Bram wrote:
> >Can anyone tell me why I am seeing this difference between Sun
> and Cygwin?
> >
> >On a Sun machine
> >
> >bash-2.03$ cat > filter
> >one.doc
> >^C
> >bash-2.03$ cat filter
> >one.doc
> >bash-2.03$ grep .doc$ filter
> >one.doc
> >bash-2.03$ cat filter | grep .doc$
> >one.doc
> >bash-2.03$
> >
> >Robert Mark Bram AT DIJONG /home/Rob/
> >$ cat > filter
> >one.doc
> >
> >
> >On Cygwin
> >
> >Robert Mark Bram AT DIJONG /home/Rob/
> >$ cat filter
> >one.doc
> >
> >Robert Mark Bram AT DIJONG /home/Rob/
> >$ grep .doc$ filter
> >one.doc
> >
> >Robert Mark Bram AT DIJONG /home/Rob/
> >$ cat filter | grep .doc$
>
> one.doc undoubtedly has a CRLF line ending.  od -c would probably
> demonstrate
> this.
>
> cgf
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019