system_clearenv(3f) - [M_system:ENVIRONMENT] clear environment by calling clearenv(3c) (LICENSE:PD)
Synopsis
Description
Return Values
Examples
Author
License
subroutine system_clearenv(ierr)
integer,intent(out),optional :: ierr
The clearenv() procedure clears the environment of all name-value pairs. Typically used in security-conscious applications or ones where configuration control requires ensuring specific variables are set.
ierr returns zero on success, and a nonzero value on failure. Optional. If not present and an error occurs the program stops.
Sample program:
program demo_system_clearenv use M_system, only : system_clearenv implicit none ! environment before clearing call execute_command_line(env|wc) ! environment after clearing (not necessarily blank!) call system_clearenv() call execute_command_line(env) end program demo_system_clearenvTypical output:
89 153 7427 PWD=/home/urbanjs/V600 SHLVL=1
John S. Urban
Public Domain
Nemo Release 3.1 | system_clearenv (3m_system) | March 07, 2025 |