This is the mail archive of the cygwin@cygwin.com 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)


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?

I would like to see someone smarter than me argue that:

   "\r" at EOL should never being stripped out of a 
   cygwin binary pipe.  

Why shouldn't binary pipes behave the same in Cygwin and UNIX?

respectfully/regards,

Tom Rodman

--v-v------------------C-U-T---H-E-R-E-------------------------v-v--
PS

  I find it significant that the design spec for the code in 
  this area has changed since "beta 21.0" - that version was 
  the one and only shipped and sold CD version ie "Cygwin V1.0". 

BTW, here is the same test under Linux:

  > 13:03:46 Sun Feb 24    /u/rodmant
  > 1091 4 olive root # uname -a;echo "$(echo X$'\r')" |od -a ; echo X$'\r'|od -a
  Linux olive.pounder.sol.net 2.4.9-21 #1 Thu Jan 17 14:16:30 EST 2002 i686 unknown
  0000000   X  cr  nl
  0000003
  0000000   X  cr  nl
  0000003

On Sun 2/24/02 16:23 PST "Michael A Chase" wrote:
>----- Original Message -----
>From: <trodman@nyx.net>
>To: <cygwin@cygwin.com>
>Sent: Sunday, February 24, 2002 04:43
>Subject: "$(dothis)" construct acts as a text tool in pipe (\r removed)
>
>
>> at first glance, this seems inconsistent to me; comments anyone?:
>> --v-v------------------C-U-T---H-E-R-E-------------------------v-v--
>> > 06:36:47 Sun Feb 24  /adm/bin/sys/s
>> > WS011206 adm > uname -a;echo "$(echo X$'\r')" |od -a ; echo X$'\r'|od -a
>> CYGWIN_NT-4.0 WS011206 1.3.9(0.51/3/2) 2002-01-21 12:48 i686 unknown
>> 0000000   X  nl
>> 0000002
>> 0000000   X  cr  nl
>> 0000003
>> --v-v------------------C-U-T---H-E-R-E-------------------------v-v--
>> > 06:34:32 Sun Feb 24  ~
>> > CMKE755 adm > uname -a;echo "$(echo X$'\r')" |od -a ; echo X$'\r'|od -a
>> CYGWIN_NT-4.0 CMKE755 21.0 (0.14/2/2) 1999-9-13 20:44:35 i686 unknown
>> 0000000   X  cr  nl
>> 0000003
>> 0000000   X  cr  nl
>> 0000003
>
>It looks like the second machine has a seriously outdated version of Cygwin.
>I wouldn't expect Win 3.1 and WinXP to behave identically in all situations,
>why should Cygwin 1.3.9 act identically to Beta 21?  The handling of pipes
>has changed several times in the interim.
>--
>Mac :})
>** I normally forward private questions to the appropriate mail list. **
>Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
>Give a hobbit a fish and he eats fish for a day.
>Give a hobbit a ring and he eats fish for an age.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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