In your example &&
is functioning as a command separator (specifically only execute the second command if the first succeeds). This is probably not what you want consider the following examples:
name=value;$command
name=value||$command
name=value&&$command
in all three of these cases name is set to value in the current shell and in the first and third cases the command $command is then executed because assignment will never fail and in the second case $command is not executed because assignment will never fail (possible exceptions in odd shells with reserved variables). In no case is the variable passed to $command.
name=value;export name;$command
export name=value;$command
Omitting similar examples with the other command separators, these examples add an export which passed the variable to $command and every other command executed hereafter in the current session.
name=value $command
Note the absence of a command separator. In this case the variable is passed to $command and only command, it is not used in the current shell.
&&
for? – thrig Jan 01 '18 at 17:35