-3
我想創建一個腳本,以便在一個自助服務終端時間使用。我得到的錯誤,意外的文件結束,並不能找出我出錯的地方
以下secipt給我的錯誤:
「行30:語法錯誤:文件意外結束」
我看了一下沒有結束的循環可能導致此錯誤,但我不能確定我的位置出錯。
#!/bin/bash
#time notifications
while true
xmessage "Click OK to begin your session." -buttons OK -center
start=$SECONDS
answer=0
while $answer = 0
while [`echo "($SECONDS - $start) % 300" | bc` != 0]
end
answer=$[xmessage "You started (($SECONDS - $start)/60) minutes ago." -buttons continue:0,done:1 -center]
end
end
嘗試使用雖然..做......做 – 2014-09-22 16:31:45
/usr/src目錄/計時器腳本:行20:語法錯誤附近意外的標記'做」 – adgelbfish 2014-09-22 16:35:30
也同時$答案= 0將不斷地分配0到$答案,你可能想要使用比較運算符== – 2014-09-22 16:37:24