该脚本鞭尾无法正常工作

该脚本鞭尾无法正常工作
#!/bin/bash
variabile = $(whiptail --title "EXALL" --menu "Inserisci il tipo di comando da eseguire" 25 78 16 \
"Apri" "per aprire un programma in background" \
"Esegui" "per aprire un programma in background" \
"Aprire" "per aprire un file" \
"Eseguire" "per eseguire un file" \
"Esci" "Esci dal programma" 3>&1 1>&2 2>&3)

case $variabile in
    "Esci")   
$(echo whiptail --inputbox "What is your favorite Color?" 8 78 Blue --title "Example Dialog" 3>&1 1>&2 2>&3)
    ;;
  esac 

当我选择选项“Esci”时,它不会打开输入框对话框,但脚本会结束。谢谢

答案1

为了使其正常工作,它应该是:(并且使用 ShellCheck 是一个很好的建议!)

#!/bin/bash
variabile="$(whiptail --title 'EXALL' --menu 'Inserisci il tipo di comando da eseguire' 25 78 16 \
'Apri' 'per aprire un programma in background' \
'Esegui' 'per aprire un programma in background' \
'Aprire' 'per aprire un file' \
'Eseguire' 'per eseguire un file' \
'Esci' 'Esci dal programma' 3>&1 1>&2 2>&3)"

case $variabile in
    "Esci")   
echo whiptail --inputbox "What is your favorite Color?" 8 78 Blue --title "Example Dialog" 3>&1 1>&2 2>&3
;;
esac

相关内容