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: "$(dothis)" construct acts as a text tool in pipe (\r removed)

On Sun, Feb 24, 2002 at 10:24:41PM -0600, Tom Rodman wrote:
>I see inconsistent behavior between the two below 1.3.9 commands.  Why
>does the "\r" pass through the pipe in :
>   echo X$'\r'|od -a # \r preserved
>; but not in:
>   echo "$(echo X$'\r')" |od -a  # \r deleted


>Earlier this month I pointed out that grep, and sed will strip out \r
>at EOL, but awk, cat, tac, perl, awk, head, tail, and tee pass it
>through.  I believe grep, and sed have been designated "Cygwin text
>tools".  I find this inconsistent, and hard to remember; will someone
>pls explain the reasoning?  Is this stable and intended?

It is intended.

>I would like to see someone smarter than me argue that:
>   "\r" at EOL should never being stripped out of a 
>   cygwin binary pipe.  

Dunno if smarter than you but I'm not going to argue that.  I've just
been around long enough to know what results in the fewest number of "It
doesn't work for me!" messages.  The current behavior is close, although
it looks like head, tail, and awk should probably be modified to strip
\r, too.  I don't recall many complaints about them, though, so I guess
it doesn't really matter.

Luckily, if you don't like this behavior, you can build your own
versions of the above commands which do whatever you like.  You don't
have to live with my ideas of how things should work.

It should be pretty trivial to just build the packages and then forget
about it.

In case it isn't obvious, this has been discussed before.  It's pretty
much a general rule in a project this old, that there are reasons for
most things.  That's what the mailing list archives are good for.


Unsubscribe info:
Bug reporting:

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