How much delay does two linux commands have in between? If the first one is run with &

StackOverflow https://stackoverflow.com/questions/20943395

سؤال

Basically I am writing a report to convince the audience that the following Linux commands

$ a.sh &
$ b.sh &
$ c.sh &

are all started almost at the same time. I couldn't find a good explanation or reliable source to convince the audience. Is there any books or articles that specifically discussed about this? Thanks.

هل كانت مفيدة؟

المحلول

From the Bash docs

If a command is terminated by the control operator ‘&’, the shell executes the command asynchronously in a subshell. This is known as executing the command in the background. The shell does not wait for the command to finish, and the return status is 0 (true). When job control is not active (see Job Control), the standard input for asynchronous commands, in the absence of any explicit redirections, is redirected from /dev/null.

For more details take a look at the Bash tutorial

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top