简体   繁体   中英

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.

#!/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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM