Get autocompletion when invoking a “read” inside a Bash script

后端 未结 1 1822
天涯浪人
天涯浪人 2020-12-09 07:27

Inside my Bash script, I\'m reading some variables entered by the user with read:

read -p \"Glassfish Path:\" GF_DIR

Now I wan

相关标签:
1条回答
  • 2020-12-09 08:17

    Try:

    read -e -p "Glassfish Path:" GF_DIR
    

    -e enables readline:

     -e 
        If the standard input is coming from a terminal, Readline is used
        to obtain the line.
    
    0 讨论(0)
提交回复
热议问题