Skip to content
Advertisement

linux running few scripts launch from a central script

I have several bash script which contain in them infinite while loop. I would like to run all of them from a single script:

#!/bin/bash
# rsync using variables

./agent_monitor.sh
./engine_monitor.sh
./kafka_monitor.sh
./zk_monitor.sh

what I get is that it stuck on the first script and it does not proceed to the next one to run them simultaneous.

Advertisement

Answer

#!/bin/bash
# rsync using variables

./agent_monitor.sh &
./engine_monitor.sh &
./kafka_monitor.sh &
./zk_monitor.sh &

echo "All scripts launched in background"

Notice the & symble at the end of each line, that tells it to run that task in background.

Advertisement