aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Pannacciulli <jpannacciulli@mediatemple.net>2016-02-20 15:40:18 (GMT)
committerJim Pannacciulli <jpannacciulli@mediatemple.net>2016-02-20 15:40:18 (GMT)
commit2b5ae4104dc764bf7e254cbb02f397799ddbf957 (patch)
tree64887c6e57dbb8eba870fd8803de1f607269182e
parent4f12f450277ddf7a1186ae640961943e10bab33a (diff)
downloadparssh-2b5ae4104dc764bf7e254cbb02f397799ddbf957.tar.gz
parssh-2b5ae4104dc764bf7e254cbb02f397799ddbf957.tar.bz2
Save full parssh cmdline including redirections / unexpanded remote commands
-rw-r--r--pars.sh5
1 files changed, 4 insertions, 1 deletions
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"\
"$@"