Shell script exiting the loop after calling another script

Posted by Johnyy on Stack Overflow See other posts from Stack Overflow or by Johnyy
Published on 2011-01-14T10:16:12Z Indexed on 2011/01/14 10:53 UTC
Read the original article Hit count: 171

Filed under:
|

Hi Guys,

I have a shell script s1 calling another script s2 in a loop.

However s1 can not seem to continue the loop after s2 returns.

Commenting out the line that calls s2 will enable the loop to continue.

s2 does copy of one file, s1 checks conditions and copy several files using s2.

Can anyone give a pointer what is going on here?

...
while read line
    s2 param1 param2 param3
    echo "copy done"
done < $tempfile

echo "out of loop"
...

"copy done" is printed, so is "out of loop"

© Stack Overflow or respective owner

Related posts about shell

Related posts about unix