diff options
author | Adeel Mujahid <3840695+am11@users.noreply.github.com> | 2020-12-23 03:52:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 03:52:26 +0300 |
commit | 8f463670ed885a3a70e1ac87809b8eda2926fc4d (patch) | |
tree | 44bd6d4f034dc0826f1d65aade2c34bf76f752d8 /src/coreclr/run-cppcheck.sh | |
parent | 7a02953aefe74050837164d9c0ec141aed2cbf8d (diff) |
Replace AWK with Bash scripts (#46313)
* Replace AWK with Bash scripts
* Replace awk usage with Bash or POSIX tr
* Simplify genmoduleindex.sh
Diffstat (limited to 'src/coreclr/run-cppcheck.sh')
-rwxr-xr-x | src/coreclr/run-cppcheck.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/coreclr/run-cppcheck.sh b/src/coreclr/run-cppcheck.sh index 46e51e1e747..454ab344301 100755 --- a/src/coreclr/run-cppcheck.sh +++ b/src/coreclr/run-cppcheck.sh @@ -36,16 +36,18 @@ Files="$ProjectRoot/src/**" FilesFromArgs="" CppCheckOutput="cppcheck.xml" SloccountOutput="sloccount.sc" + # Get the number of processors available to the scheduler # Other techniques such as `nproc` only get the number of # processors available to a single process. platform="$(uname)" if [ "$platform" = "FreeBSD" ]; then -NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }') + output=("$(sysctl hw.ncpu)") + NumProc="$((output[1] + 1))" elif [ "$platform" = "NetBSD" || "$platform" = "SunOS" ]; then -NumProc=$(($(getconf NPROCESSORS_ONLN)+1)) + NumProc=$(($(getconf NPROCESSORS_ONLN)+1)) else -NumProc=$(($(getconf _NPROCESSORS_ONLN)+1)) + NumProc=$(($(getconf _NPROCESSORS_ONLN)+1)) fi while [[ $# > 0 ]] |