Run parallel multiple commands at once in the same terminal

前端 未结 6 778
礼貌的吻别
礼貌的吻别 2020-11-28 19:15

I want to run a few commands, each of which doesn\'t quit until Ctrl-C is pressed. Is there something I can run to run all of them at once, and Ctrl-C will quit them all? Th

6条回答
  •  孤城傲影
    2020-11-28 19:31

    I am suggesting a much simpler utility I just wrote. It's currently called par, but will be renamed soon to either parl or pll, haven't decided yet.

    https://github.com/k-bx/par

    API is as simple as:

    par "script1.sh" "script2.sh" "script3.sh"
    

    Prefixing commands can be done via:

    par "PARPREFIX=[script1] script1.sh" "script2.sh" "script3.sh"
    

提交回复
热议问题