diff options
author | James Pannacciulli <jpnc@jpnc.info> | 2021-11-18 00:26:29 -0500 |
---|---|---|
committer | James Pannacciulli <jpnc@jpnc.info> | 2021-11-18 00:26:29 -0500 |
commit | aeccba1564bf09991fba1f4e3bc4f82a70f83879 (patch) | |
tree | 0926313508f27f55a7bad6169cdeff8ff5a66cb7 | |
parent | 040e164a3dab6ebcb532226e67e03d9402f22d65 (diff) | |
download | parssh-aeccba1564bf09991fba1f4e3bc4f82a70f83879.tar.gz parssh-aeccba1564bf09991fba1f4e3bc4f82a70f83879.tar.bz2 |
fix bug affecting savecmd output
-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 |