{
    "mode": "perldoc",
    "parameter": "select",
    "section": "-f",
    "url": "https://www.chedong.com/phpMan.php/perldoc/select/json",
    "generated": "2026-06-03T05:22:59Z",
    "sections": [],
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Bash builtin construct for creating menus.",
        "examples": [
            {
                "description": "Create a menu out of individual words",
                "command": "select {{word}} in {{apple orange pear banana}}; do echo ${{word}}; done"
            },
            {
                "description": "Create a menu from the output of another command",
                "command": "select {{line}} in $({{command}}); do echo ${{line}}; done"
            },
            {
                "description": "Specify the prompt string for `select` and create a menu for picking a file or folder from the current directory",
                "command": "PS3=\"{{Select a file: }}\"; select {{file}} in *; do echo ${{file}}; done"
            },
            {
                "description": "Create a menu from a Bash array",
                "command": "{{fruits}}=({{apple orange pear banana}}); select {{word}} in ${{{fruits[@}}}; do echo ${{word}}; done"
            }
        ]
    }
}