1. In shell, you can run the Env or set command to view the environment variable information of the current system.
2. Get the environment variable value: Extern char * getenv (_ const char * _ name) If the execution is successful, this function returns the value of the specified environment variable. Otherwise, null is returned.
3. Add environment variables: Extern int putenv (char * _ string ); If the execution is successful, add the specified string information to the environment variable. The string format is "name = value" and 0 is returned. If no equal sign is followed, this environment variable is deleted.
4. Set environment variables: Extern int setenv (_ const char * _ name, _ const char * _ value, int _ replace ); The first parameter is the name of the environment variable to be set. The second parameter is the value of the environment variable to be set. If the third parameter is not 0 and the first specified environment variable has an existing value, the original value will be overwritten; if the third parameter is 0 and the first specified environment variable has a value, the original value is retained without returning an error.
5. Delete environment variables: Extern int unsetenv (_ const char * _ name ); Deletes a specified environment variable. The parameter is the name of the environment variable to be deleted.