diff --git a/Recursiveness.md b/Recursiveness.md index 030110c..7dee90c 100644 --- a/Recursiveness.md +++ b/Recursiveness.md @@ -23,11 +23,8 @@ shopt -s nullglob dotglob shellcheck /path/to/scripts/**.{sh,bash,ksh,bashrc,bash_profile,bash_login,bash_logout} # POSIX -find /path/to/scripts -type f \( -name "*.sh" -o -name "*.bash" -o -name "*.ksh" -o -name "*.bashrc" -o -name "*.bash_profile" -o -name "*.bash_login" -o -name "*.bash_logout" \) -print | - while IFS="" read -r file - do - shellcheck "$file" - done +find /path/to/scripts -type f \( -name '*.sh' -o -name '*.bash' -o -name '*.ksh' -o -name '*.bashrc' -o -name '*.bash_profile' -o -name '*.bash_login' -o -name '*.bash_logout' \) \ + | xargs shellcheck ``` ## By shebang @@ -36,9 +33,5 @@ To check files whose shebang indicate that they are sh/bash/ksh scripts: ``` # POSIX -find /path/to/scripts -type f -exec grep -Eq '^#!(.*/|.*env +)(sh|bash|ksh)' {} \; -print | - while IFS="" read -r file - do - shellcheck "$file" - done +find /path/to/scripts -type f -exec grep -Eq '^#!(.*/|.*env +)(sh|bash|ksh)' {} \; | xargs shellcheck ``` \ No newline at end of file