2 ms·
Quickly, I can think of one reason - command line arguments override environment variables whenever conflicting options are present (programs should be written
by newscracker 10y ago
Quickly, I can think of one reason - command line arguments override environment variables whenever conflicting options are present (programs should be written so that this is true). This gives flexibility to run a one-off command with specific options without having to reset and re-reset environment variables (of course, you can also deal with this by launching new shells that'll have the one-off environment variable settings without tampering parent shells).
There's a longer debate about this topic on Stackoverflow titled "Argument passing strategy - environment variables vs. command line". [1]
[1]: http://stackoverflow.com/questions/7443366/argument-passing-strategy-environment-variables-vs-command-line http://stackoverflow.com/questions/7443366/argument-passing-...