summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2018-10-14 15:00:07 -0400
committerJakob Kaivo <jkk@ung.org>2018-10-14 15:00:07 -0400
commitdd6d50cd8b85496c5baf7683311d95ba926c2122 (patch)
tree6d051007809317088ae5748897a06ec97f11d60a
parent000ce15625da1339f5cbbecb9862e9c20a944c2e (diff)
use word expansions to handle default values
-rwxr-xr-xcolor-ls5
1 files changed, 1 insertions, 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