{
    "mode": "man",
    "parameter": "envsubst",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/envsubst/1/json",
    "generated": "2026-06-12T00:52:58Z",
    "synopsis": "envsubst [OPTION] [SHELL-FORMAT]",
    "sections": {
        "NAME": {
            "content": "envsubst - substitutes environment variables in shell format strings\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "envsubst [OPTION] [SHELL-FORMAT]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Substitutes the values of environment variables.\n",
            "subsections": [
                {
                    "name": "Operation mode:",
                    "content": ""
                },
                {
                    "name": "-v --variables",
                    "content": "output the variables occurring in SHELL-FORMAT\n",
                    "flag": "-v",
                    "long": "--variables"
                },
                {
                    "name": "Informative output:",
                    "content": ""
                },
                {
                    "name": "-h --help",
                    "content": "display this help and exit\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-V --version",
                    "content": "output version information and exit\n\nIn normal operation mode, standard input is copied to standard output, with references to en‐\nvironment variables of the form $VARIABLE or ${VARIABLE} being replaced with the  correspond‐\ning values.  If a SHELL-FORMAT is given, only those environment variables that are referenced\nin SHELL-FORMAT are substituted; otherwise all environment variables references occurring  in\nstandard input are substituted.\n\nWhen  --variables is used, standard input is ignored, and the output consists of the environ‐\nment variables that are referenced in SHELL-FORMAT, one per line.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Bruno Haible.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "Report bugs in the bug tracker at <https://savannah.gnu.org/projects/gettext> or by email  to\n<bug-gettext@gnu.org>.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright  ©  2003-2020  Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or\nlater <https://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "The  full  documentation for envsubst is maintained as a Texinfo manual.  If the info and en‐‐\nvsubst programs are properly installed at your site, the command\n\ninfo envsubst\n\nshould give you access to the complete manual.\n\n\n\nGNU gettext-runtime 0.21                     March 2022                                  ENVSUBST(1)",
            "subsections": []
        }
    },
    "summary": "envsubst - substitutes environment variables in shell format strings",
    "flags": [
        {
            "flag": "-v",
            "long": "--variables",
            "arg": null,
            "description": "output the variables occurring in SHELL-FORMAT"
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "display this help and exit"
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit In normal operation mode, standard input is copied to standard output, with references to en‐ vironment variables of the form $VARIABLE or ${VARIABLE} being replaced with the correspond‐ ing values. If a SHELL-FORMAT is given, only those environment variables that are referenced in SHELL-FORMAT are substituted; otherwise all environment variables references occurring in standard input are substituted. When --variables is used, standard input is ignored, and the output consists of the environ‐ ment variables that are referenced in SHELL-FORMAT, one per line."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Substitutes environment variables with their value in shell format strings.",
        "examples": [
            {
                "description": "Replace environment variables in `stdin` and output to `stdout`",
                "command": "echo '{{$HOME}}' | envsubst"
            },
            {
                "description": "Replace environment variables in an input file and output to `stdout`",
                "command": "envsubst < {{path/to/input_file}}"
            },
            {
                "description": "Replace environment variables in an input file and output to a file",
                "command": "envsubst < {{path/to/input_file}} > {{path/to/output_file}}"
            },
            {
                "description": "Replace environment variables in an input file from a space-separated list",
                "command": "envsubst < {{path/to/input_file}} '{{$USER $SHELL $HOME}}'"
            }
        ]
    }
}