From dd6d50cd8b85496c5baf7683311d95ba926c2122 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 14 Oct 2018 15:00:07 -0400 Subject: use word expansions to handle default values --- color-ls | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/color-ls b/color-ls index 28c1036..3132590 100755 --- a/color-ls +++ b/color-ls @@ -23,10 +23,7 @@ # SOFTWARE. # TODO: handle recursive stuff -output=C -trim=1 options= -one=1 while getopts ACFHLRSacdfgiklmnopqrstux1 option; do case ${option} in @@ -40,4 +37,4 @@ done shift $(($OPTIND - 1)) -exec ls -${options}F${one} -- ${1+$*} | awk -vtrim=${trim} -voutput=${output} -f $(dirname $0)/color-ls.awk +exec ls -${options}F${one:-1} -- ${1+$*} | awk -vtrim=${trim:-1} -voutput=${output:-C} -f $(dirname $0)/color-ls.awk -- cgit v1.2.1