help-bash
[Top][All Lists]
Advanced

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

Re: Checking if variable is not zero with (())


From: Alex fxmbsw7 Ratchev
Subject: Re: Checking if variable is not zero with (())
Date: Wed, 1 Dec 2021 12:58:52 +0100

!= is an overall, (( and [[ supported op

(( num ))
is alike a short to (( num != 0 ))
you can also invert the exit code of your this old code

! (( v == 0 ))

On Wed, Dec 1, 2021, 12:44 fatiparty--- via <help-bash@gnu.org> wrote:

>
> I have been using integer comparisons with standard approach
>
> (( n == 0 ))
>
> But this time I want to check if the variable is not zero.  But some
> people have insisted that != is only for strings.  Is this correct?  How is
> this integer comparison customarily approached?
>
>
>


reply via email to

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