Re: parallel bash scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxx
> 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
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
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


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux