开发者

running shell script within shell script in a nested for loop

hi everyone I've got a simple script which executes another script in a nested for loop

m开发者_如何学Goy problem is that while the double for loop is executing fine without the addition of the script which needs to be run at each iteration, if i add the script the execution only happens once.

any ideas why?

for ((i = 0; i<10; i++))
do  
echo "outer forloop $i"
for ((j = 0; j<6; j++))
do
    exec ./run.sh
    done
done

thanks andreas


exec replaces the current process with a new process. Use ./run.sh

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜