Artificial intelligent assistant

How to get "FOO=bar.cpp meld a/$FOO b/$FOO" to work the way I expect it to? As far as I understand, to compare the same file in separate directories I should be able to do this: FOO=bar.cpp meld a/$FOO b/$FOO However, it doesn't work, as if `$FOO` is an empty string. This not surprisingly works: (FOO=bar.cpp && meld a/$FOO b/$FOO) My question is why does the first example not work?

In:


FOO=bar.cpp meld a/$FOO b/$FOO


It's a Simple Command, so `FOO=bar.cpp` isn't executed at the time `$FOO` was expanded.

In:


FOO=bar.cpp && meld a/$FOO b/$FOO


There're 2 commands:


FOO=bar.cpp


and:


meld a/$FOO b/$FOO


When parameter substitution performed in `meld a/$FOO b/$FOO`, `FOO=bar.cpp` was executed, so `FOO` was set to `bar.cpp`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 31ea5a15a53a09223fb1371ab78e1661