[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master b25a732 06/18: Resolve all shellcheck "SC2038
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master b25a732 06/18: Resolve all shellcheck "SC2038" warnings |
Date: |
Wed, 29 May 2019 18:49:07 -0400 (EDT) |
branch: master
commit b25a732ed34d985c6803e3bf86bd202692ae24fa
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Resolve all shellcheck "SC2038" warnings
Null separators
find ... -print0 | xargs -0 ...
are supported by both GNU and BSD userlands--i.e., universally--and
seem less confusing than the POSIX alternative
find ... -exec ... {} +
This usage, found in a few files:
grep '!!!!' --count | xargs printf '%d tests succeeded\n'
seems safe enough to leave alone, as does this:
git ls-files --deleted | xargs git checkout --
and in those cases it does seem distasteful to resort to null-separating
options for the commands (other than 'find') on the right-hand side.
---
check_git_setup.sh | 4 ++--
install_msw.sh | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/check_git_setup.sh b/check_git_setup.sh
index 6e033a0..0e35098 100755
--- a/check_git_setup.sh
+++ b/check_git_setup.sh
@@ -43,8 +43,8 @@ case "$lmi_build_type" in
for d in . gwc; do (\
printf '%s...' "$d" \
&& find ./$d -maxdepth 1 -type f \
- -not -name '*.sh' -not -name '*.sed' \
- | xargs chmod -x \
+ -not -name '*.sh' -not -name '*.sed' -print0 \
+ | xargs -0 chmod -x \
)done; \
printf 'all incorrect execute permissions removed\n'
git config core.filemode false
diff --git a/install_msw.sh b/install_msw.sh
index 0c15c89..6c63cc5 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -234,7 +234,7 @@ mkdir --parents /cache_for_lmi/downloads
mount
md5sum "$0"
-find /cache_for_lmi/downloads -type f | xargs md5sum
+find /cache_for_lmi/downloads -type f -print0 | xargs -0 md5sum
make $coefficiency --output-sync=recurse -f install_miscellanea.make clobber
make $coefficiency --output-sync=recurse -f install_miscellanea.make
@@ -270,7 +270,7 @@ do
./install_wx.sh
./install_wxpdfdoc.sh
- find /cache_for_lmi/downloads -type f | xargs md5sum
+ find /cache_for_lmi/downloads -type f -print0 | xargs -0 md5sum
# Source this script only for commands that depend upon it.
. ./set_toolchain.sh
- [lmi-commits] [lmi] master updated (e503910 -> b30b5db), Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master 0d8f53e 02/18: Resolve shellcheck "SC1117" warning, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master 1d9b9a6 04/18: Deduplicate, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master 0e9da3a 01/18: Use Ubuntu 18.04 only for WSL, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master 66fe46b 03/18: Resolve more shellcheck "SC1117" warnings, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master a4ee62f 07/18: Suppress certain shellcheck warnings, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master b25a732 06/18: Resolve all shellcheck "SC2038" warnings,
Greg Chicares <=
- [lmi-commits] [lmi] master d52c37f 09/18: Resolve a shellcheck "SC2034" warning, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master ee293d1 10/18: Update certain URLs, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master 19c0946 13/18: Copy compiler runtime files in one makefile target only, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master 3873eb0 15/18: Fix defect committed 20190521T2101: tested 'md5sums' in wrong directory, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master c40f2f8 14/18: Routinely run shellcheck, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master aebe56b 17/18: Don't copy compiler runtime files to build directory, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master 9b9978f 16/18: Avoid 'ls --classify', Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master f4cb231 08/18: Remove space after '#!', Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master aa29114 12/18: Improve command to copy compiler runtime files, Greg Chicares, 2019/05/29
- [lmi-commits] [lmi] master f760e3d 11/18: Fix defect introduced 20190426T2304Z: wrong variable used, Greg Chicares, 2019/05/29