When I want to issue multiple command by using bash test statement with subshell, this works:
a=255
b=0
[[ a -eq 255 ]] && ( echo $a;echo $b )
255
0
But why assign values not work?
[[ a -eq 255 ]] && ( a=0;b=255 )
echo $a
255
echo $b
0
I know if I change the parenthesis to bracket, it works, and I just want to know why it doesn't work when assigning values.