This is the mail archive of the
mailing list for the Cygwin project.
Re: echo and CYGWIN variable
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Rolf dot Guigas at t-online dot de
- Cc: cygwin at cygwin dot com
- Date: Wed, 21 May 2003 10:39:43 -0400 (EDT)
- Subject: Re: echo and CYGWIN variable
- Reply-to: cygwin at cygwin dot com
On Wed, 21 May 2003 Rolf.Guigas@t-online.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
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
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,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