GETENV — Get an environmental variable¶
- GETENV()¶
Get the
VALUEof the environmental variableNAME.- Parameters
NAME – Shall be of type
CHARACTERand of default kind.VALUE – Shall be of type
CHARACTERand of default kind.
- Returns
Stores the value of
NAMEinVALUE. IfVALUEis not large enough to hold the data, it is truncated. IfNAMEis not set,VALUEwill be filled with blanks.
Standard:GNU extension
Class:Subroutine
Syntax:CALL GETENV(NAME, VALUE)
Example:PROGRAM test_getenv CHARACTER(len=255) :: homedir CALL getenv("HOME", homedir) WRITE (*,*) TRIM(homedir) END PROGRAM
See also:GET_ENVIRONMENT_VARIABLE