This is the mail archive of the cygwin 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: trouble with bash / if in recent release / update ?


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/


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