{
    "content": [
        {
            "type": "text",
            "text": "# read (perldoc)\n\n## TLDR\n\n> Shell builtin for retrieving data from `stdin`.\n\n- Store data that you type from the keyboard:\n  `read {{variable}}`\n- Store each of the next lines you enter as values of an array:\n  `read -a {{array}}`\n- Specify the number of maximum characters to be read:\n  `read -n {{character_count}} {{variable}}`\n- Assign multiple values to multiple variables:\n  `read <<< \"{{The surname is Bond}}\" {{_ variable1 _ variable2}}`\n- Do not let backslash (`\\`) act as an escape character:\n  `read -r {{variable}}`\n- Display a prompt before the input:\n  `read -p \"{{Enter your input here: }}\" {{variable}}`\n- Do not echo typed characters (silent mode):\n  `read -s {{variable}}`\n- Read `stdin` and perform an action on every line:\n  `cat {{/dev/stdin|path/to/file|...}} | while read line; do {{echo|ls|rm|...}} \"$line\"; done`\n\n*Source: tldr-pages*\n\n---\n\n## Full Content\n\n"
        }
    ],
    "structuredContent": {
        "command": "read",
        "section": "-f",
        "mode": "perldoc",
        "summary": null,
        "synopsis": null,
        "tldr_summary": "Shell builtin for retrieving data from `stdin`.",
        "tldr_examples": [
            {
                "description": "Store data that you type from the keyboard",
                "command": "read {{variable}}"
            },
            {
                "description": "Store each of the next lines you enter as values of an array",
                "command": "read -a {{array}}"
            },
            {
                "description": "Specify the number of maximum characters to be read",
                "command": "read -n {{character_count}} {{variable}}"
            },
            {
                "description": "Assign multiple values to multiple variables",
                "command": "read <<< \"{{The surname is Bond}}\" {{_ variable1 _ variable2}}"
            },
            {
                "description": "Do not let backslash (`\\`) act as an escape character",
                "command": "read -r {{variable}}"
            },
            {
                "description": "Display a prompt before the input",
                "command": "read -p \"{{Enter your input here: }}\" {{variable}}"
            },
            {
                "description": "Do not echo typed characters (silent mode)",
                "command": "read -s {{variable}}"
            },
            {
                "description": "Read `stdin` and perform an action on every line",
                "command": "cat {{/dev/stdin|path/to/file|...}} | while read line; do {{echo|ls|rm|...}} \"$line\"; done"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [],
        "sections": []
    }
}