changeset 586:f7c6b4b90147

Fix: stat: cannot stat ‘...’: No such file or directory e: 32: [: !=: unexpected operator
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 25 Mar 2015 18:41:49 +0200
parents 51304cfa14f6
children af3762ec58ba
files emacs/e
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/emacs/e	Sat Jan 17 19:49:24 2015 +0200
+++ b/emacs/e	Wed Mar 25 18:41:49 2015 +0200
@@ -29,7 +29,7 @@
 fi
 
 f=`readlink -f "$1"`
-if [ -e "$f" -a `stat -c %U "$f"` != $USER ] || [ -e "${f%/*}" -a `stat -c %U "${f%/*}"` != $USER ]; then
+if [ -e "$f" ] && [ `stat -c %U "$f"` != $USER ] || [ -e "${f%/*}" -a `stat -c %U "${f%/*}"` != $USER ]; then
     shift
     exec emacsclient $ERAGS -- "/sudo::$f" "$@"
 fi