想測試下跑腳本暫停功能抄了個網(wǎng)上腳本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"運(yùn)行結(jié)果是這樣,搞不懂也百度不到答案。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謝謝大神了。
shell stty : command not found
人到中年有點(diǎn)甜
2018-11-13 08:28:20