...
| Wiki Markup |
|---|
Sanitize the environment by setting required variables to safe values and removing extraneous environment variables. Set {{IFS}} to its default of "{{" \t\n"}}" (the first character is a space character). Set the {{PATH}} environment variable to the string returned by calling {{confstr()}} with the first argument {{\_CS_PATH}}. Preserve the {{TZ}} environment variable (if present) which denotes the time zone (see the Open Group Base Specifications Issue 6 specifies for the format for this variable \[[Open Group 04|AA. C References#Open Group 04]\]). |
| Wiki Markup |
|---|
One way to clear the environment is to use the {{clearenv()}} function. The function {{clearenv()}} has an odd history; it was supposed to be defined in POSIX.1, but never made it into the standard. However, it is defined in POSIX.9 (the Fortran 77 bindings to POSIX), so there is a quasi-official status for it \[[Wheeler 03|AA. C References#Wheeler 03]\]. |
...