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