简体   繁体   中英

Run more sh in terminal

How can I run multiple files in one sh file?

I tried this but without any luck, seems like it only run the first one. Can someone please help me though?

sh ./robots.sh
sh ./update_robots.sh
sh ./update_auctions_end.sh
sh ./auto_bidders.sh

Best regards

My files of the .sh files containing while..

while [ true ] do php /Applications/XAMPP/xamppfiles/htdocs/xxxx/cronjob/auction.end.php sleep 30 done

Create single file all.sh

Inside all.sh

 ./robots.sh
 ./update_robots.sh
 ./update_auctions_end.sh
 ./auto_bidders.sh

ultimately, I am asking to remove sh word in all.sh

If you are trying to get them to run at the same time (as mentioned in your comment), use & .

In your case:

#!/bin/bash
./robots.sh &
./update_robots.sh &
./update_auctions_end.sh &
./auto_bidders.sh &

This will run each of the scripts in the background.

Make sure that you've given all the scripts execute permission (easiest way probably chmod +x script ).

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