zoukankan      html  css  js  c++  java
  • 在SHELL程序中实现“按任意键继续”

    #!/bin/sh

    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
    }

    echo "Press any key to continue..."
    char=`get_char`

  • 相关阅读:
    编程心得5
    编程心得2
    心得2
    心得1
    7-11
    7-13
    7-9
    7-8
    7-12
    7-14
  • 原文地址:https://www.cnblogs.com/phoenix/p/74001.html
Copyright © 2011-2022 走看看