diff options
author | Jakob Kaivo <jkk@ung.org> | 2018-10-14 15:00:07 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2018-10-14 15:00:07 -0400 |
commit | dd6d50cd8b85496c5baf7683311d95ba926c2122 (patch) | |
tree | 6d051007809317088ae5748897a06ec97f11d60a | |
parent | 000ce15625da1339f5cbbecb9862e9c20a944c2e (diff) |
use word expansions to handle default values
-rwxr-xr-x | color-ls | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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 |