This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Contains common functions that can be sourced by other bash scripts | |
| function RunParallel | |
| # Usage: Set the PROCESSES and CONCURRENCY variables and invoke RunParallel without parameters | |
| # PROCESSES: An array of commands to execute | |
| # CONCURRENCY: The number of commands to execute concurrently | |
| # - Takes a list of processes in the PROCESSES variable, runs them in parallel, waits for | |
| # each to complete, and then serializes their output (i.e. not interleaved). | |
| # - If any process fails, then RunParallel will return a non-0 value. |
OlderNewer