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 X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Wed, 21 May 2003 10:39:43 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Rolf DOT Guigas AT t-online DOT de cc: cygwin AT cygwin DOT com Subject: Re: echo and CYGWIN variable In-Reply-To: <1053516754.3ecb63d27128b@webmail.t-online.de> Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 21 May 2003 Rolf DOT Guigas AT t-online DOT de wrote: > I am using CYGWIN bash 2.05b-9 under W2K and want to force output of > echo to be always textmode. > > Echo to a Windows-File (Drive or UNC-Specification) results in unix NL > format, despite setting of CYGWIN=nobinmode before invoking bash: > > bash> echo "something" >> 'd:/tmp/file.log' > bash> echo "something" >> '//server/share/file.log' > > > Echo to mounted filesystem results as expected in DOS CR+LF format: > > bash> echo "something" >> '/cygwin/d/file.log' > > > Does echo - utility disregard CYGWIN - Variable ? > > Thanks in advance for your help. > Rolf Guigas Rolf, Whenever you redirect to a file, the mount table is consulted, and the appropriate mode is selected (i.e., CYGWIN has no effect). If you use Win32 paths, there are no entries in the mount table, so I'm not quite sure what's going on. You could try using backslashes instead of forward slashes (I think those force textmode), i.e., use ">> 'd:\tmp\file.log'" instead of ">> 'd:/tmp/file.log'". Other things to try would be /bin/echo or "echo something | cat >> 'd:/tmp/file.log'" and see if that works. If all else fails, try running "strace" on the echo command (you'll need to trace the redirection as well, so you might be better off using "strace bash -c 'echo something >> d:/tmp/file.log'"), and see if it provides any clues. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/