From 56027bfa615a8a1f0bf1604c90d618caf785cf87 Mon Sep 17 00:00:00 2001 From: rupa Date: Fri, 27 Jun 2014 12:42:47 -0400 Subject: [PATCH] suppress error from tab completion when datafile not exists h/t @juanpabloaj. Closes #136 --- z.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/z.sh b/z.sh index b254c5e..9517f05 100644 --- a/z.sh +++ b/z.sh @@ -82,7 +82,7 @@ _z() { fi # tab completion - elif [ "$1" = "--complete" ]; then + elif [ "$1" = "--complete" -a -s "$datafile" ]; then while read line; do [ -d "${line%%\|*}" ] && echo $line done < "$datafile" | awk -v q="$2" -F"|" '