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

2024-06-06 Thread Hongyi Zhao
On Wed, Jun 5, 2024 at 5:24 PM Collin Funk wrote: > > 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 mor

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

2024-06-06 Thread enh
i'd argue that env(1)'s name has mislead you --- it's most _commonly_ used just for the "do a $PATH lookup" side-effect, so a shell script only has assume that it knows where _env_ lives, without having to assume that it knows where (say) python lives. so `#!/usr/bin/env python` rather than `#!/usr