satisfy shellcheck
[log-quiet] / logq-function
index 2ae5dae47fb8ff3e14890e34760473b220837b47..3744d101ffeab7e34cff643396d8377ded56175c 100644 (file)
@@ -1,5 +1,12 @@
 #!/bin/bash
-# Copyright (C) 2014-2016 Ian Kelling
+# I, Ian Kelling, follow the GNU license recommendations at
+# https://www.gnu.org/licenses/license-recommendations.en.html. They
+# recommend that small programs, < 300 lines, be licensed under the
+# Apache License 2.0. This file contains or is part of one or more small
+# programs. If a small program grows beyond 300 lines, I plan to switch
+# its license to GPL.
+
+# Copyright 2024 Ian Kelling
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -12,6 +19,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 logq () {
   local help="Usage: logq [-h|--help] COMMAND [ARG...]
 
@@ -45,11 +53,12 @@ $help"
   printf "%s\n%s\n\n" "Log of $prettycommand" "$(date)" >"$file"
 
   if [[ $- != *x* ]]; then
-    echo "log $file = $@"
+    echo "log $file = $*"
   fi
 
   # we will propagate any errors
-  local logq_ret=$(
+  local logq_ret
+  logq_ret=$(
     set +e
     trap ERR
     "$@" &>> "$file"