run a bash for loop in parallel
问题 I've got this script that does a credential lookup for each host, in an on-premise vault system, and then runs an ansible-playbook for it. #!/bin/bash for host in `cat ~/.ansible/hosts` do SECRET=`/opt/vault/bin/get-admin-credential --tag=$host` HOST=`echo $SECRET | cut -d ';' -f1` LOGIN=`echo $SECRET | cut -d ';' -f2` DOMAIN=`echo $SECRET | cut -d ';' -f3` PWD=`echo $SECRET | cut -d ';' -f4` if [ -z "$DOMAIN" ]; then ansible-playbook -i ~/.ansible/hosts ~/.ansible/windows.yml -e "ansible