小编Mar*_*n R的帖子

读取的静默选项被忽略?

我在 bash shell 脚本中运行一个循环,直到按下某个键为止(Ctrl-C 对我来说总是很残酷)。尽管我使用 -s 选项read,但单个字符显示在终端中。为什么 -s 选项没有read达到我的预期!

until read -s -n 1 -t 0.01; do 
    echo -n "."
    sleep .5    # actual script code goes here
    done 
echo 
Run Code Online (Sandbox Code Playgroud)

shell bash shell-script

0
推荐指数
1
解决办法
555
查看次数

标签 统计

bash ×1

shell ×1

shell-script ×1