How to make ${x:?} return non-zero in case of empty $x? By default, it exits the shell (subshell in this example) with 0.
function sth() {
local url="${1:?}"
...
}
(sth) ; echo $? # shows 0
Update: As Stéphane Chazelas says, this only happens in interactive usage.
1withzsh5.8. Which version are you using?1in scripts (non-interactive shells), but0in interactive shells. That sounds related to zsh.org/mla/users/2016/msg00755.html