Example 1 (export and tee):
$ export var=1 | tee /dev/null
$ echo $var
$
Example 2 (null command between export and pipe):
$ export var=1 && : | tee /dev/null
$ echo $var
1
export sets var only if there is an intermediate command between export and pipe.
The problem seems to be in the pipe, because I reproduced this not only with “tee” command, but also with “xargs echo” for example.
Why?