How can I set a one-shot variable that affects an entire compound command?
E.g., something like:
FOO=1 ./foo.sh && ./foo.sh
echo "FOO=$FOO" will print:
I would like the value of
FOO to be set for entire pipeline (but I don't want to set or export it in my current shell). A subshell works:
( export FOO=1; ./foo.sh && ./foo.sh )
... but is there a way w/o a subshell?