GETENV(3f)

DESCRIPTION
Get the VALUE of the environmental variable NAME.

This intrinsic routine is provided for backwards compatibility with GNU Fortran 77. In new code, programmers should consider the use of the GET_ENVIRONMENT_VARIABLE intrinsic defined by the Fortran 2003 standard.

Note that GETENV need not be thread-safe. It is the responsibility of the user to ensure that the environment is not being updated concurrently with a call to the GETENV intrinsic.

STANDARD
GNU extension

CLASS
Subroutine

SYNTAX
CALL GETENV(NAME, VALUE)

ARGUMENTS

NAME Shall be of type CHARACTER and of default kind. VALUE Shall be of type CHARACTER and of default kind.

RETURN VALUE
Stores the value of NAME in VALUE. If VALUE is not large enough to hold the data, it is truncated. If NAME is not set, VALUE will be filled with blanks.

EXAMPLE
          PROGRAM test_getenv
            CHARACTER(len=255) :: homedir
            CALL getenv("HOME", homedir)
            WRITE (*,*) TRIM(homedir)
          END PROGRAM

SEE ALSO
GET_ENVIRONMENT_VARIABLE

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).