开发者

Threading a shell script

开发者 https://www.devze.com 2023-04-09 16:13 出处:网络
I have a small shell script that executes ~30 Java commands consecutively. Each one pulls data from a MySQL db then j开发者_StackOverflow中文版ams it into a BI tool. Is there any way to execute >1 of

I have a small shell script that executes ~30 Java commands consecutively. Each one pulls data from a MySQL db then j开发者_StackOverflow中文版ams it into a BI tool. Is there any way to execute >1 of these commands from within said shell script? Unfortunately, I only have access to the script itself, I cannot change the frequency or method of execution.

THANKS


Generally, a construct like this:

command_1 &
command_2 &
command_3 &
# ...

wait

will run all of the commands with & at the end in parallel, and then wait for all of them to finish before continuing. Without knowing more about what these commands look like, I can't be more specific.

0

精彩评论

暂无评论...
验证码 换一张
取 消