作者/来源:yixinu.com
栏目:运维/编程
日期:2012-03-31 07:40:49
BASH编程:dialog --menu 单选
#!/bin/bash
dialog --backtitle "demo"
--title "demo title"
--menu "My demo" 20 40 10
"ntp" "Open NTP service"
"httpd" "Open http service "
"mysqld" "Open mysqld service"
2>/tmp/4.tmp
CH=`cat /tmp/4.tmp`
case $CH in
ntp) echo "NTP service is running..." ;;
httpd) echo "HTTP service is running..." ;;
mysqld) echo "MySQL service is running..." ;;
esac