bash: start multiple chained commands in background

前端 未结 15 741
生来不讨喜
生来不讨喜 2020-12-07 22:47

I\'m trying to run some commands in paralel, in background, using bash. Here\'s what I\'m trying to do:

forloop {
  //this part is actually written in perl
          


        
15条回答
  •  时光说笑
    2020-12-07 23:29

    I haven't tested this but how about

    print `(touch .file1.lock; cp bigfile1 /destination; rm .file1.lock;) &`;
    

    The parentheses mean execute in a subshell but that shouldn't hurt.

提交回复
热议问题