Basically this is my code:
bay=$(prog -some flags)
while [ $bay = "Another instance of this program is running, please exit it first" ]
do
echo "Awaiting Access to program"
do
.....
I have program which will only allow one instance to be run at one time due to the way it interacts with my hardware, when another instance is running it kicks out the following message "Another instance of this program is running, please exit it first".
I need to beable to run multiple scripts which will utilise this same program so I've decided to use the above code. My problem is that when I run my two scripts one will gain access to the program and run as desired but the other will notice the error and then get stuck in an infinate loop echoing "Awaiting Access to program".
Have missed some thing? Is the Statement executing the CLI command or just reffering back to its origanal execution? Or is my problem else where?