I have a bash script with a code like this:
echo "EXECUTING TASK 1"
sort -r scripts/sh/test-list | while read fn; do
sh -vx scripts/sh/test-web-task.sh "$fn"
done
echo "EXECUTING TASK 2"
sort -r scripts/sh/test-unit-list | while read fn; do
sh -vx scripts/sh/test-unit-task.sh "$fn"
done
In test-web-task and test-unit-task I have some calls to grails to run some tests and then do some packaging stuff. Something like this:
grails test-app $1
mv results backup/$1
In files scripts/sh/test-unit-list and scripts/sh/test-list I have a list of tests to run. Something like this:
Person
Book
The first loop breaks without running all the lines of the file scripts/sh/test-list and then it starts to run the second loop.
As you can see I have added -vx to sh to see what may be the problem. But I can't find what I doing wrong.
I think maybe something in scripts/sh/test-list is crashing, and breaking the loop. If this is the case I want to know what is crashing, and I want the loop to keep going without break.
Can you give me any pointer?