X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: trouble with bash / if in recent release / update ? Date: Tue, 6 Feb 2007 03:08:09 +0000 (UTC) Lines: 46 Message-ID: References: <200702060155 DOT RAA19602 AT mina DOT soco DOT agilent DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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/