Zenity If else statement question?
Hi guys,
I'm currently using zenity to write a proram that will display a radiolist, and then based off of your answer to the radio list display a set of question for the box that appears after it. For example it will first ask you who want to learn about either DOGS or CATS, if you say cats it will show you all types of cats like tabby, persian etc. However if you say dogs it will show you a different zenity radiolist which shows german spheards, golden receiver, etc. Is there anything like a if then statement I can use withen xenity to accomplish this task? I would really appreciate anyones help, below is what I have so far: ans=$(zenity --list --title "Selection Utility" --text "Choose Animal" --radiolist --column "Select" --column "Available Options" true "CATS" false "DOGS"); echo "Platform = $ans" >> USE.txt ans1=$(zenity --list --title "Selection Utility" --text "Choose type" --radiolist --column "Select" --column "Available Options" true "golden retriever" false "persian" false "tabby" false "Shepard" false "Doberman"); echo "cattype = $ans1" >> USE.txt |
Welcome to LQ!!
I don't think you are going to run an "if" construct inside of Zenity. My hunch is that you want a "case" construct which takes the output of one Zenity call and uses it to determine the structure of the next call. If you don't already have it, go to http://tldp.org and get the Bash Guide for Beginners and Maybe also the Advanced Bash Scripitng Guide. |
Case Construct
Quote:
|
Quote:
Here it is in the Bash Guide for Beginners: http://tldp.org/LDP/Bash-Beginners-G...ect_07_03.html |
This did the trick!
Quote:
|
All times are GMT -5. The time now is 07:56 PM. |