summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-10-30 17:33:21 +0100
committerHugues Hiegel <hugues@hiegel.fr>2008-10-30 17:33:21 +0100
commitdb01d97db5efcb06e3999cb60afd98fcb552a6b1 (patch)
treea7421a83501c4308803420f3956d48aa353c4148
parentef2fd43bb34f6690a34237828b40eb3b5b1cce59 (diff)
Best management of ~ folder for sudo logins
-rw-r--r--zshrc8
1 files changed, 4 insertions, 4 deletions
diff --git a/zshrc b/zshrc
index ec461f3..e39d09d 100644
--- a/zshrc
+++ b/zshrc
@@ -71,9 +71,9 @@ if [ -d $ZDOTDIR ]; then
fi
# For sudo shells
-#if [ "$USER" = "root" ]
-#then
- [ "`pwd`" = ~ ] && cd ~$USER
+if [ "$USER" = "root" -a "$SUDO_USER" != "$USER" ]
+then
export HOME=~$USER
-#fi
+ [ "`pwd`" = ~$SUDO_USER ] && cd
+fi