This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: echo and CYGWIN variable

On Wed, 21 May 2003 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
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]