HOME 生活记录运维/编程
作者/来源:yixinu.com
栏目:运维/编程
日期:2012-03-31 08:22:20

单选菜单 


#!/bin/bash

dialog --title "Menu demo" 
        --menu "Please choose a system " 12 60 4
        "linux" "Redhat Enterprise Linux 5.0" 
        "windows" "Windows 2008" 
        "unix" "IBM AIX" 
        2> ./menu.tmp

CHOOSE=$(cat ./menu.tmp)
case "$CHOOSE" in
        linux) echo "RHEL5.0";;
        windows) echo "windows 2008";;
        unix) echo "IBM AIX";;
esac



多选菜单


#!/bin/bash

dialog --title "Menu demo" 
        --checklist "Please choose a system " 12 60 4
        "linux" "Redhat Enterprise Linux 5.0" on 
        "windows" "Windows 2008" off 
        "unix" "IBM AIX" off 
        2> ./menu.tmp

for NAME in linux windows unix
do
        echo "chkconfig $NAME off"
done

for ON_NAME in $(cat ./menu.tmp)
do
        echo "$ON_NAME on"
done



消息框



#!/bin/bash

dialog --title "fsfafadsfasd"
        --inputbox "fsafasfas" 9 50 2>./1.tmp
dialog --clear



分享到:

Copyright © 2013-2014 yixinu.com 湘ICP备14004402号

QQ:316686606  Email: 316686606@qq.com