I have a bash script . getStnList.sh
echo "Getting Radio Station IDs ..."
grep "<station name=" stations.xml | sed 's_\&_\&_' | sed 's/<station name=".*" id="//' | sed 's/" br=".*ion>//' >stnID.txt
echo "Getting Radio Station Names ..."
grep "<station name=" stations.xml | sed 's_\&_\&_' | sed 's/<station name="//' | sed 's/\" mt=".*ion>//' >stnList.txt
What the lines do is not important ...(actually it extracts 2 lists from an xml file and saves to 2 separate txt files).
The script works perfectly when I type:
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.