I've a command that outputs the environment variable to run particular program.
Say
$ outputenv --name <program name>
ENV_VARIABLE_1=<value1>;ENV_VARIABLE_2=<value2>
I want to use this output while running this program only for that instance.
$ <output of outputenv command> myprogram --options
Similar how I would run a program with env variables like.
$ ENV_VARIABLE_1=<value1>;ENV_VARIABLE_2=<value2> myprogram --options
Is there any way I can do it?
I tried
$ (outputenv --name myprogram) myprogram --options
and didn't help.
)in that command:$(outputenv --name myprogram) myprogram --options). Remove that and it should work?VAR1=x VAR2=y ./executable, with env vars separated by spaces not;. Well in that case,$(outputenv --name myprogram | tr ';' ' ')to translate;to spaces as desired$(echo MYVAR=hello) env, and you'll see it not work.