On Thursday, September 9, 2021 at 3:01:00 AM UTC-7, Gary Scott wrote:
(snip, I wrote)
> > You can change an EV within the program. Exactly when its value is needed,
> > isn't so obvious. It might be not read until an actual I/O operations is needed.
> Depends on the operating system.
OK, back to the start.
As it says above: "I did want to avoid depending on the shell for this because
different shells have different syntax for this, and I don't want to explain
that to users or tell them which shell to use."
That happens if one asks the user to add variables to the system.
But the other way is to supply a shell script that the user runs, which then runs
the actual program. Unix-like systems run such in a Bourne (sh) shell, unless told
otherwise, independent of the user's actual shell. It does that just for the reason
given: that it works independent of the user's actual shell.
(Except that csh and descendants, if it starts with # and not #!, will run it
in a shell like itself.)
The other other way is to start with #! and the path of a program (shell)
to use to run it.
Of course DOS/Windows use a different system, but the executable file has
to be different, too.