Next: GET_ENVIRONMENT_VARIABLE, Previous: GETCWD, Up: Intrinsic Procedures
GETENV
— Get an environmental variableThis 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.
CALL GETENV(ENVVAR, VALUE)
ENVVAR | Shall be of type CHARACTER(*) .
|
VALUE | Shall be of type CHARACTER(*) .
|
PROGRAM test_getenv CHARACTER(len=255) :: homedir CALL getenv("HOME", homedir) WRITE (*,*) TRIM(homedir) END PROGRAM