read -r -p "put an option: " option echo $option
这有效,但 shellcheck 给了我:
In POSIX sh, read -p is undefined.
如何以符合 posix 的方式通过提示获取用户输入到变量中?
shell-script posix read shellcheck
posix ×1
read ×1
shell-script ×1
shellcheck ×1