我使用亚德在bash脚本中创建“是”或“否”对话框:
yad --image "dialog-question" --title "Alert" --button=gtk-yes:0 --button=gtk-no:1 --text "Are you sure you want to do this?"如果对问题单击“否”,我希望bash脚本终止。如果我单击“是”,我希望bash脚本中的其余操作能够执行。
我应该添加什么代码来完成这个任务?
发布于 2014-11-12 17:53:43
这里是一个完整的工作示例:
if yad \
--image "dialog-question" \
--title "Alert" \
--button=gtk-yes:0 \
--button=gtk-no:1 \
--text "Are you sure you want to do this?"
then
do_the_rest...
...
...
else
exit 1
fihttps://unix.stackexchange.com/questions/167613
复制相似问题