Reputation: 699
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.
Upvotes: 1
Views: 31
Reputation: 12679
#!/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.
Upvotes: 2