[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian Reproducible Live images Wiki page



On 30/12/2021 05:13, Roland Clobus wrote:
On 28/12/2021 09:20, Daniel Lewart wrote:
3) Hook scripts
    You could change all instances of:
     if [ ! -e FILE ];
     then
       exit 0
     fi
    to:
     [ -e FILE ] || exit 0

It is more compact. However, I'd rather read if-statements, similar to C, so I don't have to remember how the '||' works.
'if not exists file then exit 0' reads for me clearer than 'if file exists returns with non-zero (i.e. does not exists) then exit 0;

Somewhat off-topic, but I find it easy to remember '||' as 'or' or perhaps 'or else' (and '&&' as 'and' of course).
eg
'File exists or exit 0'

--
John


Reply to: