On Fri, 16 Nov 2018, Dmitry Bogatov wrote:
> [2018-11-15 12:43] Cristian Ionescu-Idbohrn 
> <cristian.ionescu-idbo...@axis.com>
> > The point I was trying to make is that with code like this:
> > 
> >     cd /var/log && {
> >             ... do stuff ...
> >     }
> >     ^
> > after the closed curly bracket above, if $? is _not_ 0 either the `cd' 
> > command failed or some stuff inside the command list.  But with:
> > 
> >     ! cd /var/log || {
> >             ... do stuff ...
> >     }
> >     ^
> > at this point, if $? is _not_ 0 then you can be sure some stuff inside 
> > the command list failed.
> 
> Your proposal changes semantics. For my uneducated view, considering failed
> `cd /var/log' as `$? = 0' is strange.

I agree, after reading the code again.
The exit status is saved in the ES variable and shown if $VERBOSE != no.
Still, as the last command in the script is ':', the script returns 
exit status success, which might be a lie.


Cheerrs,

-- 
Cristian

Reply via email to