September 11, 2020

Aync execution for bash

Easy way to manage scripts in the background

# in order to use in bash scripts add "set -m" to enable job control

echo > job-status
command1 || echo false > job-status &
command2 || echo false > job-status &
# repeat as much as needed
while [[ $(jobs) ]]; do fg; done
[[ $(cat job-status) != "false" ]]