3

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

my 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

1 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.