Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for cmd in "$@"; do {
- echo "Process \"$cmd\" started";
- $cmd & pid=$!
- PID_LIST+=" $pid";
- } done
- trap "kill $PID_LIST" SIGINT
- echo "Parallel processes have started";
- wait $PID_LIST
- echo
- echo "All processes have completed";
Advertisement
Add Comment
Please, Sign In to add comment