- 论坛徽章:
- 0
|
- #!/bin/sh
- #Answer some questions and connect the answer.
-
- #消息框msgbox
- gdialog --title "Question" --msgbox "Welcome to linux gdialog!" 9 18
-
- #是否框yesno
- gdialog --title "Confirm" --yesno "Are you willing to take part ?" 9 18
- if [ $? != 0 ]; then
- gdialog --infobox "Thank you anyway!" 5 20
- sleep 3s
- gdialog --clear
- exit 0
- fi
-
- #输入框inputbox
- gdialog --title "Question" --inputbox "Please enter your name:" 9 30 [color=Red]2>[/color]_1.txt
- Q_NAME=$(cat _1.txt)
- #菜单框menu
- gdialog --menu "Q_NAME, what music do you like best ?" 15 30 4 1 "Classical" 2 "Jazz" 3 "Country" 4 "Others" 2>_1.txt
- Q_MUSIC=$(cat _1.txt)
-
- #消息框,用于测试
- if [ Q_MUSIC = 1 ]; then
- gdialog --title "Likes Classical" --msgbox "Good choice!" 12 25
- else
- gdialog --title "Don't Likes Classical" --msgbox "Not Good choice!" 12 25
- fi
-
- #清除对话框,并退出脚本程序
- sleep 5s
- gdialog --clear
- exit 0
复制代码 问题:
gdialog --title "Question" --inputbox "Please enter your name:" 9 30 2>_1.txt——这句中的2> , 是重定向标准错误流2到文件_1.txt ,如何理解? |
|