#!/bin/bash parssh () { [[ "$1" == -[0-9]* && "$1" != *[^0-9-]* ]] && { parssh_concurrency=${1#-} shift } while read host; do while (( $(jobs -pr | wc -l) >= ${parssh_concurrency:-4} )); do sleep 1; done; ssh -no StrictHostKeyChecking=no $host "$@" & done }