Integrating command-line options and environment variables
The general policy for environment variables is that they are configuration inputs, similar to command-line options and arguments. For the most part, we use environment variables for settings that rarely change. We'll often set them via the .bashrc
or .bash_profile
files so that the values apply every time we log in. We may set the environment variables more globally in an /etc/bashrc
file so that they apply to all users. We can also set environment variables on the command line, but these settings only last as long as the session is logged in.
In some cases, all of our configuration settings can be provided on the command line. In this case, the environment variables could be used as a kind of backup syntax for slowly changing variables.
In other cases, the configuration values we provide may be segregated into settings provided by environment variables different from settings provided by command-line options. We may need to get some...