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

Re: Function code breaking out of if then ...fi



This looks like also a inconsistency (or I'm missing something again):

Though both 'print nosuchfile*' and 'ls nosuchfile*' return non-zero vaules,
but the internal command one won't trigger ZERR trap, but the external
one does:

    #!/usr/local/bin/zsh -feu
    
    trap 'echo caught a error' ZERR
    
    ls nosuchfile*

will fail with 

    ./t3.sh:5: no matches found: nosuchfile*
    caught a error

but this one

    #!/usr/local/bin/zsh -feu
    
    trap 'echo caught a error' ZERR
    
    print nosuchfile*

will fail only with 
    
    ./t3.sh:5: no matches found: nosuchfile*



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