#!/bin/bash
dialog –msgbox “This is test” 10 20
x=$?
if [ “$x” –eq 0 ];then
echo “you press enter”
elif [ “$x” –eq 255 ];then
echo “you press Esc”
else
echo “you press ctrl+c“
fi
Dialog --backtitle "This a test" --title "delete a file" --msgbox "Do you want delete a file?" 10 25
dialog --title "daojishi" --pause last ten 10 30 100 (100秒倒计时)

dialog --title "About name" --inputbox "input your name" 8 30(显示的高度)
--menu 选择菜单
dialog --title “pick a choice” --menu “Choose one” 12 35 3 1 “Display the disk usage” 2 “Display the meminfo”3 “Exit”
--menu 文本高宽 菜单高 1+内容 2+内容...
dialog --title "pick one file" --fselect /root 7 40编程
Dialog --gauge "test" 10 30 30 (--gauage是显示进度条的,最后一个30是30%)安全
--passwordbox 密码框 --insecure 密码显示为*
dialog --passwordbox text height width [init]
dialog --title "Password" --insecure --passwordbox "Please give a password for the new user:" 10 35
Dialog --title "the fstab" --exit-lable "quit" --textbox /etc/fstab 20 40更改退出菜单为quitbash
Dialog --colors --title "Delete" --ok-lable "Submit" --msgbox "\Z1/delete a file\Zn" 7 25
--colors 定义颜色 --oklable 更换ok为Submit Z1为红色ide
--inputbox 显示输入框,并把输入的信息赋值给name测试
--gauge 进度条,显示进度
dialog --gauge text height width[<percent>]
用脚本实现动态进度条,使拷贝文件时以进度条显示进度ui