{
    "content": [
        {
            "type": "text",
            "text": "# environ(7) (man)\n\n**Summary:** environ - user environment\n\n**Synopsis:** extern char environ;\n\n## See Also\n\n- bash(1)\n- csh(1)\n- env(1)\n- login(1)\n- printenv(1)\n- sh(1)\n- tcsh(1)\n- execve(2)\n- clearenv(3)\n- exec(3)\n- getenv(3)\n- putenv(3)\n- setenv(3)\n- unsetenv(3)\n- locale(7)\n- ld.so(8)\n- pamenv(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (89 lines)\n- **NOTES** (3 lines)\n- **BUGS** (11 lines)\n- **SEE ALSO** (3 lines)\n- **COLOPHON** (7 lines)\n\n## Full Content\n\n### NAME\n\nenviron - user environment\n\n### SYNOPSIS\n\nextern char environ;\n\n### DESCRIPTION\n\nThe variable environ points to an array of pointers to strings called the \"environment\".  The\nlast pointer in this array has the value NULL.  (This variable must be declared in  the  user\nprogram,  but is declared in the header file <unistd.h> if the GNUSOURCE feature test macro\nis defined.)  This array of strings is made available to the process by the exec(3) call that\nstarted  the process.  When a child process is created via fork(2), it inherits a copy of its\nparent's environment.\n\nBy convention the strings in environ have the form \"name=value\".  Common examples are:\n\nUSER   The name of the logged-in user (used by some BSD-derived programs).\n\nLOGNAME\nThe name of the logged-in user (used by some System-V derived programs).\n\nHOME   A user's login directory, set by login(1) from the password file passwd(5).\n\nLANG   The name of a locale to use for locale categories when not  overridden  by  LCALL  or\nmore specific environment variables such as LCCOLLATE, LCCTYPE, LCMESSAGES, LCMON‐‐\nETARY, LCNUMERIC, and LCTIME (see locale(7) for further details of the LC* environ‐\nment variables).\n\nPATH   The sequence of directory prefixes that sh(1) and many other programs apply in search‐\ning for a file known by an incomplete pathname.  The prefixes are  separated  by  ':'.\n(Similarly one has CDPATH used by some shells to find the target of a change directory\ncommand, MANPATH used by man(1) to find manual pages, and so on)\n\nPWD    The current working directory.  Set by some shells.\n\nSHELL  The pathname of the user's login shell.\n\nTERM   The terminal type for which output is to be prepared.\n\nPAGER  The user's preferred utility to display text files.\n\nEDITOR/VISUAL\nThe user's preferred utility to edit text files.\n\nNames may be placed in the shell's environment by the export command  in  sh(1),  or  by  the\nsetenv command if you use csh(1).\n\nThe  initial  environment of the shell is populated in various ways, such as definitions from\n/etc/environment that are processed by pamenv(8) for all users at  login  time  (on  systems\nthat  employ pam(8)).  In addition, various shell initialization scripts, such as the system-\nwide /etc/profile script and per-user initializations script may include  commands  that  add\nvariables  to  the  shell's  environment; see the manual page of your preferred shell for de‐\ntails.\n\nBourne-style shells support the syntax\n\nNAME=value command\n\nto create an environment variable definition only in the scope of the process  that  executes\ncommand.  Multiple variable definitions, separated by white space, may precede command.\n\nArguments  may also be placed in the environment at the point of an exec(3).  A C program can\nmanipulate its environment using the  functions  getenv(3),  putenv(3),  setenv(3),  and  un‐‐\nsetenv(3).\n\nNote that the behavior of many programs and library routines is influenced by the presence or\nvalue of certain environment variables.  Examples include the following:\n\n*  The variables LANG, LANGUAGE, NLSPATH, LOCPATH, LCALL, LCMESSAGES, and so  on  influence\nlocale handling; see catopen(3), gettext(3), and locale(7).\n\n*  TMPDIR  influences  the path prefix of names created by tempnam(3) and other routines, and\nthe temporary directory used by sort(1) and other programs.\n\n*  LDLIBRARYPATH, LDPRELOAD, and other LD* variables influence the behavior  of  the  dy‐\nnamic loader/linker.\n\n*  POSIXLYCORRECT  makes  certain  programs and library routines follow the prescriptions of\nPOSIX.\n\n*  The behavior of malloc(3) is influenced by MALLOC* variables.\n\n*  The variable HOSTALIASES gives the name of a file containing aliases to be used with geth‐‐\nostbyname(3).\n\n*  TZ and TZDIR give timezone information used by tzset(3) and through that by functions like\nctime(3), localtime(3), mktime(3), strftime(3).  See also tzselect(8).\n\n*  TERMCAP gives information on how to address a given terminal (or gives the name of a  file\ncontaining such information).\n\n*  COLUMNS  and LINES tell applications about the window size, possibly overriding the actual\nsize.\n\n*  PRINTER or LPDEST may specify the desired printer to use.  See lpr(1).\n\n### NOTES\n\nThe prctl(2) PRSETMMENVSTART and PRSETMMENVEND operations can be used to control  the\nlocation of the process's environment.\n\n### BUGS\n\nClearly  there is a security risk here.  Many a system command has been tricked into mischief\nby a user who specified unusual values for IFS or LDLIBRARYPATH.\n\nThere is also the risk of name space pollution.  Programs like make and autoconf allow  over‐\nriding  of  default  utility names from the environment with similarly named variables in all\ncaps.  Thus one uses CC to select the desired C compiler (and similarly MAKE, AR, AS, FC, LD,\nLEX,  RM,  YACC, etc.).  However, in some traditional uses such an environment variable gives\noptions for the program instead of a pathname.  Thus, one has MORE, LESS, and GZIP.  Such us‐\nage  is  considered  mistaken, and to be avoided in new programs.  The authors of gzip should\nconsider renaming their option to GZIPOPT.\n\n### SEE ALSO\n\nbash(1), csh(1), env(1),  login(1),  printenv(1),  sh(1),  tcsh(1),  execve(2),  clearenv(3),\nexec(3), getenv(3), putenv(3), setenv(3), unsetenv(3), locale(7), ld.so(8), pamenv(8)\n\n### COLOPHON\n\nThis  page  is  part  of  release  5.10 of the Linux man-pages project.  A description of the\nproject, information about reporting bugs, and the latest version of this page, can be  found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nLinux                                        2020-08-13                                   ENVIRON(7)\n\n"
        }
    ],
    "structuredContent": {
        "command": "environ",
        "section": "7",
        "mode": "man",
        "summary": "environ - user environment",
        "synopsis": "extern char environ;",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "bash",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/bash/1/json"
            },
            {
                "name": "csh",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/csh/1/json"
            },
            {
                "name": "env",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/env/1/json"
            },
            {
                "name": "login",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/login/1/json"
            },
            {
                "name": "printenv",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/printenv/1/json"
            },
            {
                "name": "sh",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/sh/1/json"
            },
            {
                "name": "tcsh",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/tcsh/1/json"
            },
            {
                "name": "execve",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/execve/2/json"
            },
            {
                "name": "clearenv",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/clearenv/3/json"
            },
            {
                "name": "exec",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/exec/3/json"
            },
            {
                "name": "getenv",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/getenv/3/json"
            },
            {
                "name": "putenv",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/putenv/3/json"
            },
            {
                "name": "setenv",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/setenv/3/json"
            },
            {
                "name": "unsetenv",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/unsetenv/3/json"
            },
            {
                "name": "locale",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/locale/7/json"
            },
            {
                "name": "ld.so",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ld.so/8/json"
            },
            {
                "name": "pamenv",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/pamenv/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 89,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COLOPHON",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}