I am writing a script that runs occasionally and pulls jobs out of a mysql db. When I do this, I run something like the following:
job="/tmp/blah.sh arg1 arg2 arg3"
eval $job
I need it to move on right after I run the eval, and not wait for the other script to complete though. What is an easy way to do that? I tried
exec $job &
based on a thread I found here, but that did the opposite, it ran the script, and then just stalled after the "job" completed, and stopped my entire script.
EDIT:
The problem I am running in to with separating my args and script is that jobs has multiple lines and looks like:
/tmp/blah1.sh arg1 arg2 arg3 arg4
/tmp/blah2.sh null null null arg4
/tmp/blah3.sh arg1 null arg3 arg4
So currently I have it running just : eval $jobs : if there is only one line, and if there are multiples, I do a for loop and run each line. What is the best way to run this in a for loop to pull out and separate the args and scripts?