From 2b5ae4104dc764bf7e254cbb02f397799ddbf957 Mon Sep 17 00:00:00 2001 From: Jim Pannacciulli Date: Sat, 20 Feb 2016 07:40:18 -0800 Subject: Save full parssh cmdline including redirections / unexpanded remote commands --- pars.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pars.sh b/pars.sh index a749335..91b1022 100644 --- a/pars.sh +++ b/pars.sh @@ -104,11 +104,14 @@ parssh () { { [[ "$_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" + pwd "$PWD"\ + cmdline "$CMDLINE" printf "### BEGIN parssh remote commands ###\n" printf "%s\n### END parssh remote commands ###\n### ###\n"\ "$@" -- cgit v1.2.3