簡體   English   中英

無法從其他Shell腳本運行Shell腳本

[英]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 VirtualBoxubuntu 14.04 LTS上運行)

您在file2.sh中有類似#!/bin/sh的內容嗎? 如果不是,請使用sh file2.sh $k代替./file2.sh $k

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM