dialog是在shell中实现图形化界面的一种方式,
#! /bin/sh
dialog --title "Question" --msgbox "welcom to our home" 9 18
dialog --title "good" --yesno "Are you coming?" 9 18
if [ $? != 0 ]
then
dialog --infobox "thank you anyway" 5 20
sleep 2
dialog --clear
exit 0
fi
示例2:
#! /bin/sh
dialog --title "name input" --inputbox "please input your name" 9 30 2> 1.txt
cat 1.txt