Implementing basic parallel execution
So far, this chapter has been completely theoretical. This section will dive into the practical side and teach you how to implement basic parallel processing in Bash. Practical examples will be used to help you understand and learn this topic.
In Bash scripting, the ability to run commands or scripts in the background is a fundamental aspect of parallel processing. When a process is sent to the background, it allows the user to continue other work in the foreground. This is especially useful in a cybersecurity context where certain tasks such as network scans or data monitoring need to run continuously without tying up the terminal.
The simplest way to send a process to the background in Bash is by appending an ampersand (&
) to the end of a command, as in this example:
$ ping google.com &
This command starts pinging google.com
and immediately returns the command prompt to the user, allowing further commands to be entered without...