bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exit status issue


From: Steven W. Orr
Subject: Re: exit status issue
Date: Tue, 22 Nov 2011 22:27:44 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Thunderbird/3.1.16

On 11/22/2011 6:49 PM, Bob Proulx wrote:
Dallas Clement wrote:
This doesn't (yet) look like a problem with bash.

Admittedly bash seems to do the right thing if you go by the set -x
execution trace.  If you go by that, it would indeed seem that the
call to touch is failing.

I have a higher level of trust in -x output since I haven't found any
problems with it.  But I have found a lot of programs that do not
handle file errors correctly.  Those are way too common.  Therefore I
am much more suspicous of them.  For example:

   $ perl -le 'print "hello";'>/dev/full
   $ echo $?
   0

Perl ate that error and never said anything about it.  One of a very
many programs with this problem.  BTW...  Bash gets it right.

   $ echo "hello">/dev/full
   bash: echo: write error: No space left on device
   $ echo $?
   1


I think we're beating this one to death, but I have point out that telling perl to run a print command whose output is redirected by bash is not the same as telling bash to run a builtin echo command that is redirected as an integral operation of the same interpreter. IOW, the perl command did succeed. If you want to be fair, you need to write a perl command that writes to /dev/null


--
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]