Jonny87
September 14th, 2010, 03:21 AM
*please move this wrong place for this thread*
I'm currently practicing and learning some basic scripting and was hoping that someone can help me with something.
basically I'm trying to get an "if" statement to read from the output of a zenity command, and then go on to execute another command based on the result of the if. I've tried heaps of different things and tried looking it (though not 100% what to look for) so far what is as shown below.
zenity --list --radiolist \
--title="Choose the Bugs You Wish to View" \
--column="select" --column="Severity" --column="Description" \
1 normal "GtkTreeView crashes on multiple selections" \
2 high "GNOME Dictionary does not handle proxy" \
3 critical "Menu editing does not work in GNOME 2.0"
if [ "$VAR" == normal ]; then
zenity --info --title='Test' text='You selected normal'
elif [ "$VAR" == high ]; then
zenity --info --title='Test' text='You selected high'
elif [ "$VAR" == critical ]; then
zenity --info --title='Test' text='You selected critical'
fi
I'm still learning this stuff so my apologies if I've missed something obvious. So can any one give me an example of what to put into this script to merge the two sections together so that they work.
I'm currently practicing and learning some basic scripting and was hoping that someone can help me with something.
basically I'm trying to get an "if" statement to read from the output of a zenity command, and then go on to execute another command based on the result of the if. I've tried heaps of different things and tried looking it (though not 100% what to look for) so far what is as shown below.
zenity --list --radiolist \
--title="Choose the Bugs You Wish to View" \
--column="select" --column="Severity" --column="Description" \
1 normal "GtkTreeView crashes on multiple selections" \
2 high "GNOME Dictionary does not handle proxy" \
3 critical "Menu editing does not work in GNOME 2.0"
if [ "$VAR" == normal ]; then
zenity --info --title='Test' text='You selected normal'
elif [ "$VAR" == high ]; then
zenity --info --title='Test' text='You selected high'
elif [ "$VAR" == critical ]; then
zenity --info --title='Test' text='You selected critical'
fi
I'm still learning this stuff so my apologies if I've missed something obvious. So can any one give me an example of what to put into this script to merge the two sections together so that they work.