码迷,mamicode.com
首页 > 其他好文 > 详细

按任意键继续

时间:2015-02-03 14:45:22      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

按任意键继续

任意

脚本代码:any.sh

  1. #!/bin/bash
  2. get_char()
  3. {
  4. SAVEDSTTY=`stty -g`
  5. stty -echo
  6. stty cbreak
  7. dd if=/dev/tty bs=1 count=1 2> /dev/null
  8. stty -raw
  9. stty echo
  10. stty $SAVEDSTTY
  11. }
  12. echo "Press any key to continue!"
  13. char=`get_char`
  14. echo ""
  15. echo "Hello!"
  16. echo ""

按任意键继续

标签:

原文地址:http://www.cnblogs.com/hanxing/p/4269792.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!