buser 发表于 2018-8-19 06:55:19

接受键盘输入的Linux shell脚本

get_char(){  SAVEDSTTY=`stty -g`
  stty -echo
  stty raw
  dd if=/dev/tty bs=1 count=1 2> /dev/null
  stty -raw
  stty echo
  stty $SAVEDSTTY
  }

页: [1]
查看完整版本: 接受键盘输入的Linux shell脚本