[英]Can't run shell script from other shell script
我正在嘗試運行一個調用另一個Shell腳本的Shell腳本:
#!/bin/sh
for k in `cat ../config/file1.keywords`
do
echo "*** keyword: $k ***"
./file2.sh $k
done
我收到以下錯誤:
./file2.sh: Permission denied
我嘗試使用: chmod +x file2.sh
當我再次運行腳本時,出現了另一個錯誤:
./file2.sh: not found
我在這里想念什么...? 謝謝。
(我在Oracle VM VirtualBox
的ubuntu 14.04 LTS
上運行)
您在file2.sh中有類似#!/bin/sh
的內容嗎? 如果不是,請使用sh file2.sh $k
代替./file2.sh $k
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.