按任意键继续

按任意键继续

任意

脚本代码:any.sh

[root@localhost ~]# cat insert.sh 
#!/bin/bash
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 "Press any key to continue!"
#char=`get_char`
get_char ;
echo ""
echo "Hello!"
echo "press any key to continue^^^^^"
get_char ; 
echo "hello1"
原文地址:https://www.cnblogs.com/hanxing/p/4269792.html