parallel-sh
was heavily inspired by Rust Parallel (parallel) parallelizing 'otherwise non-parallel command-line tasks.' But instead of trying to recreate the full functionality of GNU Parallel parallel-sh
will simply execute (lines of) commands in the platform's preferred shell ('sh -c' on Unix systems, and 'powershell.exe -c' on Windows) in separate threads.
What to expect:
What is not part of parallel-sh
:
--file
option and stdin are ignored.--file
is provided anything on stdin is ignored.If you need any of these to be part of your parallelizing tool please check GNU Parallel or Rust Parallel.
Most of the effects of these features can be achieved by processing the commands before passing them to parallel-sh
.
```text parallel-sh 0.1.1 Execute commands in parallel
USAGE: parallel-sh [FLAGS] [OPTIONS] [clijobs]...
FLAGS:
--dry-run Perform a trial run, only print what would be done (with -vv)
--halt-on-error Stop execution if an error occurs in any thread
-h, --help Prints help information
-q, --quiet Do not print parallel-sh
warnings
-v, --verbose Sets the level of verbosity
-V, --version Prints version information
OPTIONS:
-f, --file
ARGS:
Pass commands as arguments:
shell
parallel-sh "sleep 2 && echo first" "sleep 1 && echo second"
Pass a file with one command (-line) per line: ```shell parallel-sh -f /tmp/commands
$ cat /tmp/commands sleep 2 && echo first sleep 1 && echo second ```
Pass commands via stdin:
shell
echo -e 'sleep 2 && echo first\nsleep 1 && echo second' |parallel-sh