About Me

My photo
Working as Technical Lead in CollabNET software private limited.

Tuesday 11 March, 2008

About Zenity, a linux command.

Need GTK+ support for the command or shell. Yes this is the right command. It's almost belong to similar family like Xdisplay, display, cDisplay.

Try this, it's awesome. I do no whether it's inbuilt in redhat but it's there in ubuntu.

Some quick cracks on that.

To get the calendar !
zenity --calendar
To get the input from the user !
zenity --entry
To get Yes or No
zenity --question --text "Do you need to proceed reading?"

Use the ouput of the above command to input of another command using echo $?.

The echo$? returns status of the previous command.

answer=`zenity --question --text "You appear to have an AMD64 architecture. Do you want to install the 64-bit version of Songbird?"; echo $?`

if [ $anw = 0 ] ; then
....
....
....
fi

I've missed this command lot or else I would've used in most of my scripting languages to get the user inputs :)

No comments: