So I'm stuck doing a lot of cross-compiling and am typing stuff like this a lot
FOO=bar command --some-args BAZ=qxt other-command --other-args
But obviously the real shell variables are long and cumbrous to type. Bash is not a dynamic language, so backticks won't work (it tries to run the command FOO=bar). xargs is wrong though something like it that works before command evaluation would be good. Setting the shell variables I want as env variables hits the same problem as backticks if I just put them before the command; changing envs explicitly every time leaves me with the same cumbrous typing problem as shell variables, with the added fun of polluting my later environment. Is there something like pushenv and popenv?
Is there any way I can store and retrieve through a short handle all the shell variables I might need, so I can do something like
shellvars1 command --some-args shellvars2 other-command --other-args
The different combinations of shell variables is large but finite, so if there's a way of offloading that to a helper script I can type them all there once, I just can't figure out a way to do that.
Bonus points: does bash have something like tcsh's ability to do
That could also help (though not as much). I mostly want to remove opportunities for my preternatural skill at typos to show itself.