每當我嘗試運行我的shell腳本時,如果測試中出現4個不同的錯誤,當條件測試時拒絕Shell腳本權限
script.sh 45: script.sh: : Permission denied
script.sh 52: script.sh: : Permission denied
script.sh 59: script.sh: : Permission denied
script.sh 324: script.sh: : Permission denied
我在我的腳本上做了一個chmod 777,所以每個人都有權限。該腳本的運行是這樣的:
./script fileToUse
這裏是那些它給了錯誤信息行的樣子:
if ("$VAR" == "Condition_1")
then
do stuff
elif ("$VAR" == "Condition_2")
then
do stuff
elif ("$VAR" == "Condition_3")
then
do stuff
else
do stuff
fi
和324線是這樣的:
if ("$flagIsSet" -eq 0)
then
do stuff
fi
任何想法,爲什麼我可能會得到這個錯誤信息,它是什麼意思?
無法重現。我猜想你的訪問資源的權限被拒絕了。很難多說,只給出僞碼。 – DevSolar
你在運行什麼外殼? – choroba
@choroba#!/ bin/sh –