Skip to content

Instantly share code, notes, and snippets.

View mthomas's full-sized avatar

Michael Thomas mthomas

View GitHub Profile
@mthomas
mthomas / parallel-execution.sh
Created December 20, 2016 22:31
Run several commands in bash, in parallel. Let all complete regardless of return code. Return 1 if any fail.
#!/bin/bash
set -o errexit
set -o pipefail
pids=""
RESULT=0
(sleep 1; echo 'a'; exit 1) &
pids="$pids $!"