There is
Other implementations are reported to exist:
If you use gpm
, you can even use the mouse in a console environment. It requires a tty, so it will work over ssh, screen, xterm etc. but not when piping/redirecting.
Both sport more or less the same interface so you can switch depending on whether an X display is available
Here is a dialog script that displays a simple YES/NO box:
#!/bin/bash
DIALOG=${DIALOG=dialog}
$DIALOG --title " My first dialog" --clear
--yesno "Hello , this is my first dialog program" 10 30
case $? in
0)
echo "Yes chosen.";;
1)
echo "No chosen.";;
255)
echo "ESC pressed.";;
esac
Replacing dialog
by xdialog
:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…