This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Difference between Sun OS and cygwin?


Howdy Christopher!

Well, I get this when I do od:

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

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

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

Robert Mark Bram@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@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Christopher Faylor
> Sent: Friday, 31 May 2002 1:32 PM
> To: cygwin@cygwin.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@DIJONG /home/Rob/
> >$ cat > filter
> >one.doc
> >
> >
> >On Cygwin
> >
> >Robert Mark Bram@DIJONG /home/Rob/
> >$ cat filter
> >one.doc
> >
> >Robert Mark Bram@DIJONG /home/Rob/
> >$ grep .doc$ filter
> >one.doc
> >
> >Robert Mark Bram@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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]