]> https://gitweb.dealii.org/ - dealii.git/commitdiff
shell script: fix some shellcheck warnings 9615/head
authorTimo Heister <timo.heister@gmail.com>
Wed, 4 Mar 2020 15:50:54 +0000 (10:50 -0500)
committerTimo Heister <timo.heister@gmail.com>
Wed, 4 Mar 2020 15:51:13 +0000 (10:51 -0500)
contrib/utilities/check_doxygen.sh
contrib/utilities/indent_common.sh

index b6ccfa2710e70b370eca74fe4ccc3a67a43c75a8..b1de396d7e6c81ec437ca9edd7396eac692fea3c 100755 (executable)
@@ -6,4 +6,4 @@ if [ ! -f contrib/utilities/checkdoxygen.py ]; then
 fi
 
 
-find doc examples include \( -name "*.h" -o -name "*.dox" \) -print | xargs -n 1 contrib/utilities/checkdoxygen.py
+find doc examples include \( -name "*.h" -o -name "*.dox" \) -print0 | xargs -0 -n 1 contrib/utilities/checkdoxygen.py
index aeca8a4fe0a3a6c293afd42df977e68f7796f31c..9b9c6422678eb97783f0964ee9fc1638c976c0f4 100644 (file)
@@ -42,7 +42,7 @@ checks() {
   CLANG_FORMAT_PATH="$(cd "$(dirname "$0")" && pwd)/programs/clang-6/bin"
   export PATH="${CLANG_FORMAT_PATH}:${PATH}"
 
-  if ! [ -x "$(command -v ${DEAL_II_CLANG_FORMAT})" ]; then
+  if ! [ -x "$(command -v "${DEAL_II_CLANG_FORMAT}")" ]; then
     echo "***   No clang-format program found."
     echo "***"
     echo "***   You can run the './contrib/utilities/download_clang_format'"
@@ -272,13 +272,14 @@ export -f fix_permissions
 
 process()
 {
+  directories=$1
   case "${OSTYPE}" in
     darwin*)
-      find -E ${1} -regex "${2}" -print0 |
+      find -E ${directories} -regex "${2}" -print0 |
         xargs -0 -n 1 -P 10 -I {} bash -c "${3} {}"
       ;;
     *)
-      find ${1} -regextype egrep -regex "${2}" -print0 |
+      find ${directories} -regextype egrep -regex "${2}" -print0 |
         xargs -0 -n 1 -P 10 -I {} bash -c "${3} {}"
       ;;
   esac
@@ -295,7 +296,7 @@ process()
 process_changed()
 {
   LAST_MERGE_COMMIT="$(git log --format="%H" --merges --max-count=1 master)"
-  COMMON_ANCESTOR_WITH_MASTER="$(git merge-base ${LAST_MERGE_COMMIT} HEAD)"
+  COMMON_ANCESTOR_WITH_MASTER="$(git merge-base "${LAST_MERGE_COMMIT}" HEAD)"
 
   case "${OSTYPE}" in
     darwin*)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.