# phpman > info > pam_getenv

[PAM_GETENV(8)](https://www.chedong.com/phpMan.php/man/PAMGETENV/8/markdown)         User Contributed Perl Documentation        [PAM_GETENV(8)](https://www.chedong.com/phpMan.php/man/PAMGETENV/8/markdown)

NAME
       pam_getenv - get environment variables from /etc/environment

SYNOPSIS
       pam_getenv [-l] [-s] env_var

DESCRIPTION
       This tool  will print out the value of env_var from /etc/environment.
       It will attempt to expand environment variable references in the
       definition of env_var but will fail if PAM items are expanded.

       The -l option indicates the script should return an environment
       variable related to default locale information.

       The -s option indicates that the script should return an system default
       environment variable.

       Currently neither the -l or -s options do anything.  They are included
       because future versions of Debian may have a separate repository for
       the initial environment used by init scripts and for system locale
       information.  These options will allow this script to be a stable
       interface even in that environment.

Debian GNU/Linux                  2025-06-12                     [PAM_GETENV(8)](https://www.chedong.com/phpMan.php/man/PAMGETENV/8/markdown)
[PAM_GETENV(3)](https://www.chedong.com/phpMan.php/man/PAMGETENV/3/markdown)                  Linux-PAM Manual                  [PAM_GETENV(3)](https://www.chedong.com/phpMan.php/man/PAMGETENV/3/markdown)

NAME
       pam_getenv - get a PAM environment variable

SYNOPSIS
       #include <security/pam_appl.h>

       const char *pam_getenv(pam_handle_t *pamh, const char *name);

DESCRIPTION
       The pam_getenv function searches the PAM environment list as associated
       with the handle pamh for an item that matches the string pointed to by
       name and returns a pointer to the value of the environment variable.
       The application is not allowed to free the data.

RETURN VALUES
       The pam_getenv function returns NULL on failure.

SEE ALSO
       [pam_start(3)](https://www.chedong.com/phpMan.php/man/pamstart/3/markdown), [pam_getenvlist(3)](https://www.chedong.com/phpMan.php/man/pamgetenvlist/3/markdown), [pam_putenv(3)](https://www.chedong.com/phpMan.php/man/pamputenv/3/markdown), [pam(7)](https://www.chedong.com/phpMan.php/man/pam/7/markdown)

Linux-PAM Manual                  06/08/2020                     [PAM_GETENV(3)](https://www.chedong.com/phpMan.php/man/PAMGETENV/3/markdown)
