Linux 从msgbox覆盖挥鞭样出肌状态
是否可以从Linux 从msgbox覆盖挥鞭样出肌状态,linux,bash,whiptail,Linux,Bash,Whiptail,是否可以从msgbox覆盖exitstatus?默认情况下,点击OK按钮存在whiptail应用程序。理想情况下,我希望回到我的主菜单页面,因为这是我应用程序的焦点: #! /bin/bash OPTION=$(whiptail --title "Configuration Menu" --menu "Choose an option" 40 78 30 \ "1" "Return to main menu." \ "2" "Show current configuration
msgbox
覆盖exitstatus?默认情况下,点击OK按钮存在whiptail应用程序。理想情况下,我希望回到我的主菜单页面,因为这是我应用程序的焦点:
#! /bin/bash
OPTION=$(whiptail --title "Configuration Menu" --menu "Choose an option" 40 78 30 \ "1" "Return to main menu." \ "2" "Show current configuration." \ "3" "Enter Neo Serial Number." \ "4" "Change Neo IP Address." \ "5" "Change Neo Gateway." 3>&1 1>&2 2>&3)
exitstatus=$?
case "$OPTION" in 2)
whiptail --title "Current Configuration" --msgbox "Your current Neo configuration \n
IP Address: `ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` \n
Gateway: `ip route | awk '/default/ { print $3 }'` \n
DNS Server(s): `ifconfig eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | g$
;; esac
主菜单
选项2菜单
此时点击“OK”完全存在于我的应用程序中。相反,我希望它退出回到主菜单。结果表明,它比预期的简单得多,只是包装在一个while循环中:
while true
do
.....
done