我正在编写一个 bash 脚本,在脚本开始之前提示输入几个用户条目。我正在寻找使用对话框让用户验证信息的最佳方式。我正在尝试修改以下示例:
#!/bin/bash
# dynbox.sh - Yes/No box demo
dialog --title "Delete file" \
--backtitle "Linux Shell Script Tutorial Example" \
--yesno "Are you sure you want to permanently delete \"/tmp/foo.txt\"?" 7 60
# Get exit status
# 0 means user hit [yes] button.
# 1 means user hit [no] button.
# 255 means user hit [Esc] key.
response=$?
case $response in
0) echo "File deleted.";;
1) echo "File not deleted.";;
255) echo "[ESC] key pressed.";;
esac
尽管在尝试创建它时,我运行它时出现了一些错误。基本上我想要一个是/否对话框说
Please verify your entered information:
Install SSL : $InstallSSL
Domain Name : $DomainName
etc
左侧将是静态文本,右侧将显示变量。