From: Pierre DOT Humblet AT eurecom DOT fr (Pierre A. Humblet) Subject: Re: Handling of CYGWIN=binmode by bash 17 Nov 1998 21:51:19 -0800 Message-ID: <3.0.5.32.19981117090439.0088fb10.cygnus.gnu-win32@pop.ne.mediaone.net> References: <3 DOT 0 DOT 5 DOT 32 DOT 19981116171548 DOT 00896100 AT pop DOT ne DOT mediaone DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: gnu-win32 AT cygnus DOT com To answer my own question, I found out that what matters with redirection is the value of CYGWIN at the time the shell is launched, not at the time redirection occurs. In the examples below I was changing CYGWIN inside bash (which had no immediate effect) then calling ash where the new settings became effective. Pierre At 05:15 PM 11/16/98 -0500, Pierre A. Humblet wrote: >I have noticed an inconsistency in the way ash & bash handle CYGWIN=binmode >in b20 on Win95. >Drive a: is not mounted. It contains a file "empty" and a >file "crnl" containing CR NL >The program "tell_mode" reports on stderr the modes of stdin and stdout. > >bash: mount >Device Directory Type Flags >\\.\tape1: /dev/st1 native text!=binary >\\.\tape0: /dev/st0 native text!=binary >\\.\b: /dev/fd1 native text!=binary >\\.\a: /dev/fd0 native text!=binary >c: / native text=binary > >The unexpected results occur with bash on line 5 below (compare with 2). >The redirected input/output are opened as TEXT (I expected BINARY). >Note that as expected the program "cat" opens BINARY under ash and bash >(lines 3 & 6, compared with 8). > >1 ash: echo $CYGWIN >tty binmode >2 ash: tell_mode < a:/empty > a:/out >fd = 0 BINARY >fd = 1 BINARY >3 ash: cat a:/crnl | od -c >0000000 \r \n > >4 bash: echo $CYGWIN >tty binmode >5 bash: tell_mode < a:/empty > a:/out >fd = 0 TEXT >fd = 1 TEXT >6 bash: cat a:/crnl | od -c >0000000 \r \n > >7 bash: CYGWIN=tty >8 bash: cat a:/crnl | od -c >0000000 \n > >I am happy to report that all other tests I have performed yield the >expected results. > >Pierre > >- >For help on using this list (especially unsubscribing), send a message to >"gnu-win32-request AT cygnus DOT com" with one line of text: "help". > - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".