delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/02/05/22:08:52

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: Re: trouble with bash / if in recent release / update ?
Date: Tue, 6 Feb 2007 03:08:09 +0000 (UTC)
Lines: 46
Message-ID: <loom.20070206T040030-886@post.gmane.org>
References: <200702060155 DOT RAA19602 AT mina DOT soco DOT agilent DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Darryl Okahata <darrylo <at> soco.agilent.com> writes:

>      While I understand the reasoning, this seems to have caused a
> regression.  With cygwin-1.5.24-2 and textmode mounts:
> 
> 	$ echo '0' > x ; ( exit `cat x` )
> 	: numeric argument required

If you MUST use text modes, and don't realize that cat always operates in 
binary mode, and aren't willing to use d2u, then all I can tell you is to use 
the igncr shellopt, and this won't be an issue for you.  It is not a 
regression, but an intentional design decision.

$ set -o igncr
$ echo 42 > text/x; (exit `cat text/x`); echo $?
42
$ set +o igncr
$ echo 42 > text/x; (exit `cat text/x`); echo $?
: numeric argument required
255

> 
> With 1.5.18 (yeah, I know, it's ancient)

Actually, it's not the version of cygwin, but the version of bash that matters 
in this instance.  Get your facts straight, and don't rehash something that has 
already been beaten to death on this list if you don't want to receive our 
annoyed responses.

> linux, the above
> works as expected (with either binmode or textmode mounts).

Linux doesn't have textmode mounts (thank goodness).  But if it did, this would 
likewise fail there as well, until upstream bash is patched to support an 
option to disobey POSIX by ignoring carriage returns.

> DISCLAIMER: this message is the author's personal opinion and does not
> constitute the support, opinion, or policy of Agilent Technologies, or
> of the little green men that have been following him all day.

Sweet disclaimer - it made it almost worth reading your gripe.  At any rate, it 
made it worth my time to reply.

-- 
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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