Reputation: 29
I am using Ubuntu to write c++ programs. I am using a bash file to run my program multiple times using different arguments. However, only the first run is executed !
This is my bash file
#!/bin/bash
cd ~/Desktop/MyCodeWorkspace
g++ a.cpp b.cpp c.cpp main.cpp -o myProgram
./myProgram 8 0
./myProgram 8 20
./myProgram 8 40
./myProgram 8 60
Upvotes: 0
Views: 248
Reputation: 29
Thanks for your help. It is my mistake. At the end of my main I have ( int x; cin>>x) so I can pause the terminal(a problem that suddenly happen, and I could not solve). I forgot that I added this line.
Upvotes: 0
Reputation: 199
Probably that your bash program is stuck in the first program. Make sure that myProgram returns when it is executed.
Upvotes: 1