Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 31 May 2002 00:41:20 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Difference between Sun OS and cygwin? Message-ID: <20020531044120.GA14436@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20020531033213 DOT GA11456 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23.1i On Fri, May 31, 2002 at 01:51:44PM +1000, Robert Mark Bram wrote: >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? I spent the last hour trying to track down this "cygwin bug". It sure didn't seem to be working the way that I expected. What I found is that this is a cat "feature": /* If stdin is a terminal device, and it is the ONLY input file (i.e. we didn't write anything to the output yet), switch the output back to TEXT mode. This is so "cat > xyzzy" creates a DOS-style text file, like people expect. */ if (tty_in && optind <= argc) setmode (output_desc, O_TEXT); This is from the cat sources. I'm a person but I wouldn't expect that particular behavior. A workaround may be to do: cat /dev/tty > filter That tricks cat into thinking it has an argument so it won't do any help binmode/textmode conversions. 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/