diff options
-rw-r--r-- | pars.sh | 29 |
1 files changed, 14 insertions, 15 deletions
@@ -81,20 +81,6 @@ _parssh.out () { done } -_parssh.savecmd () { - CMDLINE=$(fc -ln -0) - CMDLINE="${CMDLINE#[[:space:]][[:space:]]}" - printf "### # ##\n" - printf "### %s: %s\n"\ - date "$(date +%F@%R%z)"\ - user "$USER($UID)"\ - pwd "$PWD"\ - cmdline "$CMDLINE" - printf "### BEGIN parssh remote commands ###\n" - printf "%s\n### END parssh remote commands ###\n### ## #\n"\ - "$@" -} - # fd handlers _parssh.serverlist_fd () { [[ -z "$_parssh_servers" ]] && { @@ -212,7 +198,20 @@ parssh () { # run main command loop / capture outputs { - [[ "$_parssh_savecmd" == "true" ]] && _parssh.savecmd + [[ "$_parssh_savecmd" == "true" ]] && { + CMDLINE=$(fc -ln -0) + CMDLINE="${CMDLINE#[[:space:]][[:space:]]}" + printf "### # ##\n" + printf "### %s: %s\n"\ + date "$(date +%F@%R%z)"\ + user "$USER($UID)"\ + pwd "$PWD"\ + cmdline "$CMDLINE" + printf "### BEGIN parssh remote commands ###\n" + printf "%s\n### END parssh remote commands ###\n### ## #\n"\ + "$@" + } + while read host; do while (( $(jobs -pr | wc -l) >= ${_parssh_concurrency:-4} )); do sleep 1 |