I know that I can pass an env variable to a command by prepending it like this:
but today I accidentally put
&& between the variable and the command:
env_variable=value && command exactly ^ ^
and I got curious how is it different to the correct way. I know that you can use
&& to chain commands together. But what's interesting is that the command didn't receive the variable, why? I'd be grateful if anyone explained how exactly the second variant is different from the first one and why the command didn't see the variable. Thanks
a += 2or
a *= 2is the "correct" one.