In a given shell, normally I\'d set a variable or variables and then run a command. Recently I learned about the concept of prepending a variable definition to a command:
How about exporting the variable, but only inside the subshell?:
(export FOO=bar && somecommand someargs | somecommand2)
Keith has a point, to unconditionally execute the commands, do this:
(export FOO=bar; somecommand someargs | somecommand2)