From 84e4e67a503eefd311f0585337cc4a14b2b029d0 Mon Sep 17 00:00:00 2001 From: xyz Date: Wed, 15 Dec 2021 21:40:56 -0800 Subject: `[ -n "$a" ]` and `[ "$a" ]` seems the same, I decided to use the latter --- home/xyz/.local/bin/dirnameall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'home/xyz/.local/bin/dirnameall') diff --git a/home/xyz/.local/bin/dirnameall b/home/xyz/.local/bin/dirnameall index d2d78a5b..befd3478 100755 --- a/home/xyz/.local/bin/dirnameall +++ b/home/xyz/.local/bin/dirnameall @@ -1,7 +1,7 @@ #!/bin/sh while read -r line; do - if [ -n "$paths" ]; then + if [ "$paths" ]; then paths="$paths $line" else @@ -11,7 +11,7 @@ done dirs="$paths" while [ "$dirs" != '.' ]; do - [ -n "$dirs" ] && paths="$paths + [ "$dirs" ] && paths="$paths $dirs" dirs="$(echo "$dirs" | tr '\n' '\0' | xargs -0 dirname | awk '!a[$0]++')" done -- cgit v1.2.3-70-g09d2