Of course... My own stupidity. It did raise the question for me, what would be the recommended way to 'group' expressions, where other languages would use brackets, like:
if (((q==1)) || [[ $r ]]) && grep -q $s $file then echo "$s is in $file, and either q is 1 or r is not empty" fi I guess this works, but it spawns a subshell. Is there a better way? Thanks, Peter On 29/12/2559 08:38, Chet Ramey wrote: > On 12/28/16 8:09 PM, Peter & Kelly Passchier wrote: >> Is this a bug? These both output "q=1" >> >> q=1 >> [[ ((q==1)) ]] && echo q=1 >> >> q=0 >> [[ ((q==1)) ]] && echo q=1 >> > > No. These both end up checking whether the length of the string "q==1" is > non-zero, which it is. >