From ccf1c051d96bc84349da873c7bf70a0de9338953 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 26 Jul 2010 20:59:42 +0200 Subject: Improved whitespace handling -.- --- edit | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'edit') 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 -- cgit v1.2.3