From expect script, I am calling two other shell scripts. But only the second shell script seems to get executed properly. Because the output statements of the first shell script is not seen in the screen. This is my expect script: Why is this happening? And what is the fix? Answer You have to wait for the first spawned process