Bash script exits halfway ?
Hi,
I have a bash script . getStnList.sh thus: Code:
#!/usr/bin/env bash The script works perfectly when I type: ./getStnList.sh from the prompt. Now I execute this script from a C program using popen. When I do this, only the 1st grep command is executed. The 2nd grep line is never executed. To repeat, the script works as intended when typed at the prompt, but not when called from an application. Any help would be appreciated ! Thanks. |
I think it is going to depend on the C program. What is the code for reading the input from popen?
|
Solved !
jpollard ,
Thanks for replying... yes you were right ... I was closing popen prematurely, before the script finished, based on a time delay. Now I check if the script has actually finished then I pclose and it works. Thank You. |
All times are GMT -5. The time now is 08:13 PM. |