aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/sudo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/sudo.sh')
-rw-r--r--sh/shrc.d/sudo.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/sh/shrc.d/sudo.sh b/sh/shrc.d/sudo.sh
new file mode 100644
index 00000000..a5883168
--- /dev/null
+++ b/sh/shrc.d/sudo.sh
@@ -0,0 +1,5 @@
+# Add the -H parameter to sudo(8) calls, always use the target user's $HOME
+sudo() {
+ [ "$1" != -v ] && set -- -H "$@"
+ command sudo "$@"
+}