From 22b68c7e9605a367d1b8289cd93c7a385337f695 Mon Sep 17 00:00:00 2001 From: rupa Date: Wed, 27 Apr 2011 14:30:30 -0400 Subject: [PATCH] use 'test' to check for file ownership. closes #25. thanks sjmadsen. --- z.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/z.sh b/z.sh index 7b3d045..a03b8df 100755 --- a/z.sh +++ b/z.sh @@ -25,7 +25,7 @@ z() { local datafile="$HOME/.z" # bail out if we don't own ~/.z (we're another user but our ENV is still set) - [ -f "$datafile" -a "$(stat -c %U "$datafile")" != "$USER" ] && return + [ -f "$datafile" -a ! -O "$datafile" ] && return # add entries if [ "$1" = "--add" ]; then