minor perf idiom improvement
authorIan Kelling <ian@iankelling.org>
Wed, 18 Jun 2014 01:53:51 +0000 (18:53 -0700)
committerIan Kelling <ian@iankelling.org>
Wed, 18 Jun 2014 01:53:51 +0000 (18:53 -0700)
appendu
appendu-function

diff --git a/appendu b/appendu
index c7455dccdbe43be08e1b5f858f8ef2db7f8f0fcc..1d9388e8840b580327d6ae4bc8ff41ef1344602f 100755 (executable)
--- a/appendu
+++ b/appendu
@@ -56,7 +56,7 @@ Appended lines are output to the terminal.
         readsudo=
         writesudo=
     fi
-    if [[ $@ ]]; then
+    if (( $# )); then
         for x in "$@"; do
             [[ -e "$file" ]] && $readsudo grep -q "^$x$" "$file" || $writesudo tee -a "$file"<<<"$x"
         done
index 40a4edfa4d6ef92c33530c77cd643461ffb06ed6..a169bd7cf680a860116d46928b442b9583baaadb 100644 (file)
@@ -56,7 +56,7 @@ Appended lines are output to the terminal.
         readsudo=
         writesudo=
     fi
-    if [[ $@ ]]; then
+    if (( $# )); then
         for x in "$@"; do
             [[ -e "$file" ]] && $readsudo grep -q "^$x$" "$file" || $writesudo tee -a "$file"<<<"$x"
         done