aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pars.sh29
1 files changed, 14 insertions, 15 deletions
diff --git a/pars.sh b/pars.sh
index fa7a7ce..379372f 100644
--- a/pars.sh
+++ b/pars.sh
@@ -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