Re: [OS-BUILD PATCH 0/20] [redhat] All shell scripts: Fix syntax flagged by shellcheck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 13, 2020 at 09:12:19PM -0000, GitLab Bridge on behalf of bcrocker wrote:
> From: bcrocker on gitlab.com
> 
> Fix syntax flagged by shellcheck in all scripts in the redhat/ subtree.
> 
> A complete 'git log -p' of all commits on this branch can be found at:

Thanks Ben!  It seems to be reasonable. Lots of cookie cutter conversions.

Hopefully the normal workflow will expose any quirks, but after reading this
over 3 times (over the last couple of weeks), I think we should be fine.

Acked-by: Don Zickus <dzickus@xxxxxxxxxx>

> 
> http://pastebin.test.redhat.com/917268
> 
> SC2001: See if you can use ${variable//search/replace} instead.\
> SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..'
> instead.\
> SC2006: Use $(...) notation instead of legacy backticked `...`.\
> SC2007: Use $((..)) instead of deprecated $[..]\
> SC2013: To read lines rather than words, pipe/redirect to a 'while read'
> loop. ???\
> SC2034: <variable> appears unused. Verify use (or export if used
> externally).\
> SC2035: Use ./*glob* or -- *glob* so names with dashes won't become
> options.\
> SC2038: Use -print0/-0 or find -exec + to allow for non-alphanumeric
> filenames.\
> SC2045: Iterating over ls output is fragile. Use globs.\
> SC2046: Quote this (command) to prevent word splitting.\
> SC2068: Double quote array expansions to avoid re-splitting elements.\
> SC2086: Double quote to prevent globbing and word splitting.\
> SC2144: -f doesn't work with globs. Use a for loop.\
> SC2145: Argument mixes string and array. Use * or separate argument.\
> SC2155: Declare and assign separately to avoid masking return values. \
> SC2162: read without -r will mangle backslashes.\
> SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.\
> SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly
> with $?.\
> SC2196: egrep is non-standard and deprecated. Use grep -E instead.\
> SC2231: Quote expansions in this for-loop glob to prevent
> wordsplitting.\
> SC2236: Use -z instead of ! -n.\
> 
> Change to #!/bin/bash explicitly to allow\
> SC2039: bash-isms
> 
> Disable:\
> SC2164: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd
> fails.\
> SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
> 
> Disable checking for one instance of:
> 
> SC2059: Don't use variables in the printf format string. Use printf
> "..%s.." "$foo".
> 
> The pattern in question is a multi-line string; the shellcheck wiki,\
> https://github.com/koalaman/shellcheck/wiki/SC2059, acknowledges that\
> there is no good rewrite for this construct and recommends disabling\
> the warning.
> _______________________________________________
> kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux