代码改变世界

gdialog

2024-03-11 09:01  @学无止境  阅读(11)  评论(0编辑  收藏  举报
#! /bin/sh
#gdialog --title "Question" --msgbox "Welcometo my survey" 9 18
gdialog --title "Confirm" --yesno "Are you willing to take part?" 9 18
#echo $? 
if [ $? != 0 ] 
then
  gdialog --infobox "thank you " 5 20
  sleep 2
  gdialog --clear
  exit 0
fi

gdialog --title "Quest" --inputbox "please enter your name " 9 20 2>_1.txt
Q_NAME=$( cat '_1.txt' )
echo $Q_NAME

gdialog --menu "$Q_NAME,whate do you like best?" 15 30 4 1 "classic" 2 "Jazz" 3 "Country" 4 "Other" 2>_1.txt
Q_MUSIC=$(cat _1.txt)
echo $Q_MUSIC
sleep 2
gdialog --clear 
exit 0