[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: expr ... and `expr ...` return different results on QNX 4.2.5
From: |
Akim Demaille |
Subject: |
Re: expr ... and `expr ...` return different results on QNX 4.2.5 |
Date: |
30 Nov 2000 09:48:35 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
>>>>> "Pavel" == Pavel Roskin <address@hidden> writes:
>> > b=`false` || echo Ok > > It should print "Ok". If it doesn't, we
>> are in trouble.
>>
>> We are in trouble - no response.
Pavel> :-(
I concur.
Pavel> Well, one consequence is that some errors will not be
Pavel> detected. For example, missing Makefile.in will not be
Pavel> reported.
Exactly :(
Pavel> It's a "developer error", i.e. it shouldn't happen with
Pavel> packages that came through "make distcheck", however I don't
Pavel> feel good about it.
Same here. I wonder how many times we depend upon this in configure.
Without looking at the sources I can only think about the same example
as you do.
Pavel> I don't know how many times we rely on similar
Pavel> constructs. There may be more serious problems. To fix them, we
Pavel> should never use $? after _any_ assignments.
That's really bad in theory, I hope its impact is not too strong. For
instance in the case you mention, the error message is still
displayed, which softens the issue.
Pavel> I don't see any other way to get the output and the exit status
Pavel> from a the same command without using temporary files or sed or
Pavel> set + for loop. Anybody knows how to rewrite this:
Pavel> ac_output=`command`; ac_status=$?
Pavel> in a way that it works even on QNX but doesn't cause
Pavel> significant slowdown?
ac_output=`command; echo $? >confstat`; ac_status=`cat confstat`
? Gross.
Re: expr ... and `expr ...` return different results on QNX 4.2.5, Akim Demaille, 2000/11/30