Re: Clarification on Setting Environment Variables for Command Execution with or without env.

2024-06-05 Thread Bernhard Voelker
On 6/4/24 11:45, Hongyi Zhao wrote: Are there any functional differences between these two methods in terms of how the environment variables are set and utilized by my_command? No, the started process my_command will see the environment variables regardless whether they are set by the env progr

Re: Clarification on Setting Environment Variables for Command Execution with or without env.

2024-06-05 Thread Collin Funk
Hi, Hongyi Zhao writes: > Using env command: > > env PATH="/custom/path:$PATH" my_command > > Directly setting the environment variable: > > PATH="/custom/path:$PATH" my_command [...] > In what scenarios would it be more appropriate to use env versus > directly setting the environment variable?