summaryrefslogtreecommitdiffstats
path: root/e
diff options
context:
space:
mode:
Diffstat (limited to 'e')
-rwxr-xr-xe6
1 files changed, 4 insertions, 2 deletions
diff --git a/e b/e
index c214982..d3efac5 100755
--- a/e
+++ b/e
@@ -1,7 +1,9 @@
#!/bin/sh
+FILE=$(readlink -f "$1")
+
if [ $(id -u) -eq 0 ]; then
- exec sudo -u neoraider emacsclient -n /sudo::$(readlink -f $1)
+ exec sudo -u "$SUDO_USER" emacsclient -n "/sudo::$FILE"
else
- exec emacsclient -n $(readlink -f $1)
+ exec emacsclient -n "$FILE"
fi