开发者

running shell script within shell script in a nested for loop

开发者 https://www.devze.com 2023-02-11 03:12 出处:网络
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 scri

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

精彩评论

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