想测试下跑脚本暂停功能抄了个网上脚本https://www.cnblogs.com/zqb-a...#!/bin/bash#!/bin/sttyPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATH#test function get_char()
{
SAVEDSTTY="stty -g" stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null stty -raw
stty echo
stty $SAVEDSTTY
}
echo "1"echo "2"get_char
echo "3"运行结果是这样,搞不懂也百度不到答案。12test1.sh: line 10: SAVEDSTTY=stty -g: command not foundtest1.sh: line 11: stty: command not foundtest1.sh: line 12: stty: command not foundtest1.sh: line 14: stty: command not foundtest1.sh: line 15: stty: command not foundtest1.sh: line 16: stty: command not found3谢谢大神了。
目前暂无任何回答
- 0 回答
- 0 关注
- 1238 浏览
添加回答
举报
0/150
提交
取消