parallel bash scripts
bruce
badouglas at gmail.com
Tue Mar 27 21:53:21 UTC 2012
HI Mateusz
Yeah, tried the basic "&" ... but the issue is the shell scripts run
as infinite loops.. and therefore, the dog.sh doesn't really
exit/complete.
So I can't really run them sequentially.
If I open up separate term/windows, then of course, I can manually run
them (one in each window)..
thanks
On Tue, Mar 27, 2012 at 5:46 PM, Mateusz Marzantowicz
<mmarzantowicz at osdf.com.pl> wrote:
> W dniu 27.03.2012 23:25, bruce pisze:
>> hi.
>>
>> got a couple of test bash scripts.
>>
>> dog.sh, cat.sh
>> each script runs the underlying php in an endless loop.
>>
>> I'm trying to figure out how to run the scripts in parallel, from the
>> same parent shell script. something like:
>>
>> test.sh
>>
>> dog.sh > &2
>> cat.sh > &2
>>
>> where dog.sh would be :
>> --------------------------------
>> while true
>> do
>> pgrep dog
>> if [ $? -ne 0 ]
>> then
>> /dog.php
>> fi
>> sleep 5
>> done
>>
>> my current tests, run dog.sh, which runs the dog.php ... but the test
>> never gets to run cat.sh
>>
>> thoughts/comments...
>>
>> thanks
> Did you try:
>
> command1 & command2
>
> where command1 and command2 are bash built in commands or scripts (in
> your case dog.sh and cat.sh)?
>
>
> Mateusz Marzantowicz
> --
> users mailing list
> users at lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
More information about the users
mailing list