Sample Header Ad - 728x90

Asynchronous background jobs in linux can interfere to each other?

0 votes
1 answer
480 views
I was trying to use a linux command repeatedly and I decided to use bash scripting. The command is curl and it has blue screen given to the target web server. I was doing this as a pentester in my company. So I wanted to repeat this curl command infinite times and I was successful with bash script loop commands. The final command is in the following: Ubuntu 14.04 LTS Terminal: while :; do $(curl -v Image -H "Range: bytes=18-18446744073709551615" & sleep 5 & pkill curl); done But there is a something which I couldn't understand clearly: According to some articles and question-answers, each command in (command1 & command2 & command3 as single line) runs asynchronously and therefore they are running simultaneously without waiting one another. But in the above attacking code's result, curl's output is repeated in "every 5 seconds". That is, curl is running, then 5 seconds is waited, then curl is aborted. After that, curl is executed again. Therefore, the output is appeared again after every 5 seconds. So these commands interfere to each other. But internet articles and question-answers says its opposite. Can anyone make this point clear? Note: By force of curl's attacking parameter, curl is pending. Not completing. Therefore, I am using sleep and then pkill command, respectively. Thereby, I can use curl command properly and repeatedly with attacking parameter. Related Links: 1) (command1 & command2 & command3 &) Runs multiple jobs in parallel https://unix.stackexchange.com/questions/423805/how-to-run-multiple-background-jobs-in-linux 2) (command1 & command2 & command3 &) Runs at the same time, in separate sub-shells https://bashitout.com/2013/05/18/Ampersands-on-the-command-line.html 3) Asynchronous (multi-Threaded) Diagram Sample https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean
Asked by Hasan (101 rep)
Aug 17, 2018, 07:36 AM
Last activity: Aug 17, 2018, 09:18 AM