我遇到了這個腳本的問題,不知道到底發生了什麼。[::整數表達式預計錯誤
#Main Menu
clear
while [ "$input" -eq "0" ];
do
clear
#$input == 0
echo "Hello, What would you like me to do?"
echo ""
echo "1 = ALL TEH THINGZ!"
echo "2 = Find the enemy postions and villages"
echo "3 = Set the firewalls to my liking"
echo "4 = Confuse the enemy"
echo "5 = Deploy the spies!"
echo "6 = DISABLED Run the TOP SECRET STUFF! (Note password is required)"
echo "81 = Burn the bridges! (Cautian: Last Resort)"
echo "96 = Install/Update Software (locally)"
echo "97 = Install/Update Software (remotely)"
echo "98 = Update and add new Kali tools"
echo "99 = I am done with you for now"
read -p "Select an operation for me to do: " $input
我知道我有fi和結束右,但我在while [「$ input」-eq「0」];
此外,替換'讀-p「選擇一個操作爲我做:」$輸入「與'讀-p」選擇一個操作對我來說:「輸入' – John1024 2014-09-30 00:59:53
從http://stackoverflow.com/ help/mcve - 「儘可能少使用代碼」(而不是將90%的代碼作爲與問題無關的「echo」語句)。如果您「發現錯誤」,請在問題本身中提供* exact *錯誤。理想情況下,這可能只有兩行 - 一個設置'input =「something」'和另一個正在運行的'[「$ input」-eq「0」]'(如果'read'的行爲被正確診斷,問題)。 – 2017-03-07 03:44:51