From 86bd28fcb4d760cc16b616acc7d1065d7153c852 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Fri, 4 Nov 2016 18:55:32 +0100 Subject: Simplify check for empty variable Someday this is going to bite me in the ass. Right now though, I can't come up with a reason not to do this. Inspiration: test(1) -n STRING the length of STRING is nonzero STRING equivalent to -n STRING --- .bashprompt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.bashprompt') diff --git a/.bashprompt b/.bashprompt index 0ce903f..873746c 100644 --- a/.bashprompt +++ b/.bashprompt @@ -3,7 +3,7 @@ __set-title () local title local path=$(git root 2> /dev/null) - if [ -n "${path}" ] + if [ ${path} ] then title=$(basename ${path}) else -- cgit v1.2.3