www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/02/06:31:53

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
Message-ID: <3E8AC9F4.3060604@gre.fr>
Date: Wed, 02 Apr 2003 13:31:00 +0200
From: =?ISO-8859-1?Q?Fr=E9d=E9ric_Bazin?= <fb AT gre DOT fr>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a; MultiZilla v1.3.1.2) Gecko/20030325
X-Accept-Language: fr, en-us, en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: CYGWIN: bug with 'tee' mxing UNIX and DOS text file mode
References: <Pine DOT GSO DOT 4 DOT 44 DOT 0304011050400 DOT 21921-100000 AT slinky DOT cs DOT nyu DOT edu>
In-Reply-To: <Pine.GSO.4.44.0304011050400.21921-100000@slinky.cs.nyu.edu>

I got some more specific information

the problem is not about 'tee' but actually about writing to a text 
file  through redirection or tee or...;
when you write to 100% unix path the text mode will be OK (DOS) but when 
you write path such as d:/.... or //10.0.0.132/share/....
the text mode will be wrong (UNIX). See the following example.

i wrote a script
Test.sh :
echo word1 >> $1
echo word2 >> $1

the working directory is /cygdrive/d

the following command will produce a DOS text file
bash-2.05b$ bash test.sh testlog
bash-2.05b$ bash test.sh /cygdrive/d/testlog
 
the following
bash-2.05b$ bash test.sh d:/testlog
bash-2.05b$ bash test.sh //10.0.0.132/echange/testlog


I can convert d:/ style  to /cydrive/d/... using cygpath command
but the //10.0.0.132/share/... style cannot be converted to anything.
What can I do to make it work ?

Igor Pechtchanski wrote:

>On Tue, 1 Apr 2003, Frédéric Bazin wrote:
>
>  
>
>>Hello,
>>I experience some amazing behaviour with tee and text files.
>>
>>I installed cygwin  ( various release during the past three months )
>>with DOS text file mode.
>>
>>most of the command tools seems to work fine except 'tee'
>>
>>when I type
>>
>>echo blablalbalbal | tee  test.txt
>>echo blablalbalbal | tee -a test.txt
>>echo blablalbalbal | tee -a test.txt
>>
>>test.txt is a UNIX mode text file !!
>>
>>when I type
>>
>>cat > tee test.txt
>>
>>and then type several line and finally ctrl-C
>>test.txt is a DOS mode text file :D
>>
>>when I type
>>echo blablalbalbal > test.txt
>>echo blablalbalbal >> test.txt
>>echo blablalbalbal >> test.txt
>>
>>test.txt is a DOS mode text file :D
>>    
>>
>
><http://cygwin.com/cygwin-ug-net/using-cygwinenv.html>, section on
>"binmode".
>	Igor
>  
>



--
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