Ing*_*her 35 bash bash-completion
在我的Bash脚本中,我正在阅读用户使用READ输入的一些变量:
read -p "Glassfish Path:" GF_DIR
Run Code Online (Sandbox Code Playgroud)
现在我希望用户在必须进入目录时获得自动完成功能,就像你在Bash shell上一样.所以当他输入目录的第一个字母时,他可以通过点击TAB自动填充它.那可能吗?
mik*_*iku 59
尝试:
read -e -p "Glassfish Path:" GF_DIR
Run Code Online (Sandbox Code Playgroud)
-e 启用readline:
-e
If the standard input is coming from a terminal, Readline is used
to obtain the line.
Run Code Online (Sandbox Code Playgroud)