delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/04/07/08:26:32

From: marcus AT bighorn DOT dr DOT lucent DOT com
Subject: Re: echo is wrong...
7 Apr 1998 08:26:32 -0700 :
Message-ID: <199803311455.HAA21961.cygnus.gnu-win32@chorus.dr.lucent.com>
To: gnu-win32 AT cygnus DOT com

> In the Linux
> 
> [nagyl AT piheno nagyl]$ echo  "aaa"|od -c
> 0000000   a   a   a  \n
> 0000004
> 
> In the windows NT bash
> 
> bash-2.01$ echo aaa|od -c
> 0000000   a   a   a  \r  \n
> 0000005
> 
> 
> What the hell is the \r ????? 

In the DOS/Win32 world, text files have CR LF line endings, as opposed to
Unix's LF only.  Since echo generates text, it is simply following the
convention of the operating system and outputting a proper text file.

> I'm running ./configure script (under cygwin bash) and this is failed, because
> the echo isn't compatible with the Unixs echo...
> 
> How to setup (configure etc..) my bash or my echo ?

Actually, I think that configure needs to be fixed, since it aparently
isn't compatible with the DOS/Win32 world.  Failing that, I think that there
is some way to set cygwin so that pipes are created in a binary-only mode,
which will give you Unix style text files.  This is similar to mounting
filesystems with -b, which forces opens to be in binary-only mode.  You
will want to do that as well if you want Unix style text files consistently
throughout.  Note that you will no longer be able to read and write DOS/Win32
text files, so compatibility with the rest of the DOS/Win32 world will be
given up.  Although *most* DOS/Win32 applications can read Unix style text
files, they will almost always write DOS/Win32 style text files.

marcus hall
-
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".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019