2017-08-25 50 views
0
echo "Gateway: 192.168.0.1 | Interface: Wlan0" 
echo "###########################" 
echo "1) Update Kali     4) Thanks too.." 
echo "2) Software and System Tools  5) Must View" 
echo "3) Install Hacking Tools 6) Terminate Program" 
echo "" 
read Option1 Option2 Option3 Option4 Option4 Option5 Option6 

if [ "$Option1" = "1" ]; then 
echo "Test" 
clear 
if [ "$Option2" = "2" ]; then 
echo "test" 
clear 
if [ "$Option3" = "3" ]; then 
echo "Test" 
clear 
if [ "$Option4" = "4" ]; then 
echo "chicken" 
clear 
if [ "$Option5" = "5" ]; then 
echo "Test" 
clear 
if [ "$Option6" = "6" ]; then 
echo "The End" 
clear 
+3

你需要使用'fi'關鍵詞(並根據你也可能需要你試圖實現'elif'。 –

回答

2

更強大的方式來呈現菜單是select命令

choices=(
    "Update Kali" 
    "Software and System Tools" 
    "Install Hacking Tools" 
    "Thanks too.." 
    "Must View" 
    "Terminate Program" 
) 
PS3="Your choice: " 
select choice in "${choices[@]}"; do 
    case $choice in 
     "${choices[0]}") 
      echo "Test" 
      ;; 
     "${choices[1]}") 
      echo "test" 
      ;; 
     "${choices[2]}") 
      echo "Test" 
      ;; 
     "${choices[3]}") 
      echo "chicken" 
      ;; 
     "${choices[4]}") 
      echo "Test" 
      ;; 
     "${choices[5]}") 
      echo "The End" 
      ;; 
    esac 
    break 
done 
clear 
相關問題