Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [Brian May] zsh random behaviour



>>>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:

    Bart> On Jul 11, 11:32am, Brian May wrote:
    Bart> }
    Bart> } Is a return value of 255 treated specially by zsh?

    Bart> A return value > 127 is interpreted as "killed by a signal"
    Bart> where the signal number is the return value minus 127.  This
    Bart> is pretty standard for shells, though not well-documented by
    Bart> any of them.

    Bart> } I was about to start pulling my hair out, but I will let
    Bart> you pull your } hair out instead <grin>.

    Bart> See the "subtle 'echo' bug" thread from last month in the
    Bart> zsh-workers archive, finishing with the patch in article
    Bart> 21391.

I assume you mean the thread starting at
<URL:http://www.zsh.org/mla/workers/2005/msg00690.html>.

I am not sure how it is related, in this case there appears to be a
process (echo) writing its output to another process (echo) that never
reads it's stdin.

In my case though, one process is writing (or maybe not) to another
process (read) that always reads it's stdin. This second process is
suppose to return 1 if it gets EOF. So, AFAIK, SIGPIPE should not be
getting generated.

Or is it a matter that zsh is getting confused when the first process
returns 255, and aborts because it thinks the program was killed due
to a signal?

Also, there was the comment "...this only effects interactive shells",
but it my case I first encountered the problem in a shell script.
-- 
Brian May <bam@xxxxxxxxxxxxxxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author