summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xe6
-rwxr-xr-xedit6
2 files changed, 8 insertions, 4 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
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