Displaying a dialog box using terminal commands

Hello,
I used the command
osascript -e 'tell app "Finder" to display dialog "Hey!"'
to display a dialog box..it works fine, it displays a dialog box with 'OK' and 'CANCEL' buttons..i want to get the button returned value how can i do that using terminal command?
is there any command to get the button returned value??

there is dialog utility available with shell, check if it can help.

  • nilesh