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

Re: PRINT_EXIT_VALUE problems



[> zsh-workers]

On Dec 26, 11:40pm, Bart Schaefer wrote:
}
} } 1. I don't think the value should be printed in the case of a program
} } before ||, because the goal of || is to ignore or handle the error.
} 
} 	execode()
} 	execlist()	<- here we know the state of "&&"/"||"
} 	execpline()	<- here we print exit of external jobs [*]
} 	execpline2()
} 	execcmd()	<- here we print exit of builtins/functions

While we're on the subject:

torch% setopt printexitvalue
torch% () { false } || true
torch% 

Functions always begin with printexitvalue reset to off, so anonymous
functions have the side-effect of suppressing printing of their exit
value.  This doesn't affect non-anonymous functions:

torch% fail() { /bin/false }
torch% fail || true
zsh: exit 1
torch% 



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