Is it possible for bash commands to continue before the result of the previous command?

后端 未结 6 1389
心在旅途
心在旅途 2020-11-27 16:39

When running commands from a bash script, does bash always wait for the previous command to complete, or does it just start the command then go on to the next one?

i

6条回答
  •  余生分开走
    2020-11-27 16:55

    add '&' at the end of a command to run it parallel. However, it is strange because in your case the second command depends on the final result of the first one. Either use sequential commands or copy to b and c from a like this:

    cp /tmp/a /tmp/b &
    cp /tmp/a /tmp/c &
    

提交回复
热议问题