tool to protocol shell invocations from other tools
authormirabilos <m@mirbsd.org>
Wed, 3 Oct 2018 19:10:45 +0000 (19:10 +0000)
committermirabilos <m@mirbsd.org>
Wed, 3 Oct 2018 19:10:45 +0000 (19:10 +0000)
bash-ksh/protoshell [new file with mode: 0644]

diff --git a/bash-ksh/protoshell b/bash-ksh/protoshell
new file mode 100644 (file)
index 0000000..89bd303
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/mpkg/bin/bash
+function dumpargv {
+       local i=0 j
+       for j in "$@"; do
+               printf '%s' " $((i++))<$j>"
+       done
+}
+function dumpinfo {
+       echo === BEGIN $(date)
+       echo ENVIRONMENT:
+       typeset -p
+       echo -n ARGV:
+       dumpargv "$@"
+       echo
+       echo === RUNNING
+}
+dumpinfo >>/tmp/protoshell.log
+/bin/mksh "$@"
+rv=$?
+echo === $rv END $(date) >>/tmp/protoshell.log
+exit $rv