help-bash
[Top][All Lists]
Advanced

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

Re: confusing syntax error using <= within [[ ]]


From: Greg Wooledge
Subject: Re: confusing syntax error using <= within [[ ]]
Date: Mon, 6 Oct 2025 08:26:19 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Mon, Oct 06, 2025 at 06:17:46 +0000, w f wrote:
> if [[ (-n $a && $c <= $d) || (-n $b && $c == $d) ]] ; then echo ok ; else 
> echo no ; fi
> -bash: expected ')'
> -bash: syntax error near `$d)'
> 
> Why does this give a syntax error?

Because you need spaces around ( and ) in that command.



reply via email to

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