diff options
author | Sumera Priyadarsini <sylphrenadin@gmail.com> | 2020-10-11 13:28:43 +0300 |
---|---|---|
committer | Julia Lawall <Julia.Lawall@lip6.fr> | 2020-10-12 11:32:40 +0300 |
commit | 2f324dd8ab2e3d8b097f3eac6d380d1adbdbe6e6 (patch) | |
tree | cec5ca72de6c23517c1449ac144f0a5c9b0c428b | |
parent | 28c185a88607bc361ec7f071b907285e2e75de1b (diff) | |
download | linux-2f324dd8ab2e3d8b097f3eac6d380d1adbdbe6e6.tar.xz |
scripts: coccicheck: Add quotes to improve portability
While fetching the number of threads per core with lscpu,
the [:digit:] set is used for translation of digits from 0-9.
However, using [:digit:] instead of "[:digit:]" does not seem
to work uniformly for some shell types and configurations
(such as zsh).
Therefore, modify coccicheck to use double quotes around the
[:digit:] set for uniformity and better portability.
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
-rwxr-xr-x | scripts/coccicheck | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck index 6789751607f5..d67907b8a38b 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -76,7 +76,7 @@ else fi # Use only one thread per core by default if hyperthreading is enabled - THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd [:digit:]) + THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]") if [ -z "$J" ]; then NPROC=$(getconf _NPROCESSORS_ONLN) if [ $THREADS_PER_CORE -gt 1 -a $NPROC -gt 2 ] ; then |