From d45f67471124f80f63ab9785da4b9365f0f2ab08 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Mon, 8 Jul 2019 16:09:39 +0200 Subject: [PATCH] Add some debugging functions --- functions/@ | 5 +++++ functions/parent-user | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 functions/@ create mode 100644 functions/parent-user diff --git a/functions/@ b/functions/@ new file mode 100644 index 0000000..182f2e9 --- /dev/null +++ b/functions/@ @@ -0,0 +1,5 @@ +#!/bin/zsh +# for debugging: prefix any command with @ to print it before execution +function @() { + echo "$*"; "$@" +} diff --git a/functions/parent-user b/functions/parent-user new file mode 100644 index 0000000..8973d97 --- /dev/null +++ b/functions/parent-user @@ -0,0 +1,13 @@ +function parent-user() { + pid=${1:-$$} + uid=${2:-$(piduser $pid)} + stat=($(