[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Is it reasonable to let zero numeric value results in no
From: |
Eduardo A . Bustamante López |
Subject: |
Re: [Help-bash] Is it reasonable to let zero numeric value results in non zero exit status? |
Date: |
Sun, 21 Oct 2018 14:33:16 -0700 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sun, Oct 21, 2018 at 04:18:31PM -0500, Peng Yu wrote:
(...)
> I am not sure whether it is a good idea to return non zero exit status
> when a numeric variable is zero, as this can cause problems when `set
> -e` is used. Is there is a strong justification why this behavior is
> reasonable?
I understand what you're saying. I do have to ask though, how else would these
examples work?
if ((a > b)); then
...
fi
while ((i--)); do
...
done
((x)) && echo hi
What rule would you use to know when to discard the return code?