Run three shell script simultaneously

后端 未结 4 935
暖寄归人
暖寄归人 2020-12-28 16:29

I have three shell script which I am running as below-

sh -x script1.sh

sh -x script2.sh

sh -x script3.sh

So each script is executed sequ

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-28 17:13

    you want this?

    $ sh -x script1.sh & sh -x script2.sh & sh -x script3.sh &
    

    Update explanation :

    • Run each script in background mode so that next command is run without waiting for current command to complete.
    • '&' makes the scripts run in background so that prompt does not wait for it to complete
    • '&' also can be used to chain commands on one line similar to running commands one by one on command line.

提交回复
热议问题