help-bash
[Top][All Lists]
Advanced

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

Re: condition to execute


From: David
Subject: Re: condition to execute
Date: Tue, 6 Jul 2021 13:13:42 +1000

On Tue, 6 Jul 2021 at 13:00, <lisa-asket@perso.be> wrote:

> > >  (( $f == 1 )) && source ${HOME}/.bashrc

> > A relatively minor consideration is that this list has a nonzero
> > exit status if f != 1. This suggests failure, even if it is not
> > actually a failure condition.

> What do you mean by a failure?

Restating what is written above:
"has a nonzero exit status"

Read about it here:
http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Exit_Status

Demo:
$ f=0; (( f == 1 )); echo $?
1
$ f=1; (( f == 1 )); echo $?
0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]