Environment Variables
In the shell, the environment variables are a set of strings that stores the settings, for example, PATH
variable stores the path searching setting and http_proxy
sets the proxy server setting.
There are many ways to get environment variables. One of the ways is from the argument of main
function.
Take a note of the main
function parameter. There is an extra item of char * envp[]
. This allows the program to retrieve the system environment variable.
Last updated