From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D718C433E7 for ; Mon, 12 Oct 2020 08:38:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D30A62076E for ; Mon, 12 Oct 2020 08:38:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726921AbgJLIib (ORCPT ); Mon, 12 Oct 2020 04:38:31 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:5449 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgJLIib (ORCPT ); Mon, 12 Oct 2020 04:38:31 -0400 X-IronPort-AV: E=Sophos;i="5.77,366,1596492000"; d="scan'208";a="472083358" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 10:38:29 +0200 Date: Mon, 12 Oct 2020 10:38:29 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Sumera Priyadarsini cc: Julia.Lawall@lip6.fr, michal.lkml@markovi.net, linux-doc@vger.kernel.org, Gilles.Muller@lip6.fr, corbet@lwn.net, nicolas.palix@imag.fr, linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr Subject: Re: [Cocci] [PATCH v4 1/3] scripts: coccicheck: Add quotes to improve portability In-Reply-To: <76ca49efc2ec4b8279e70c4bc4052fb7b543bc86.1602410019.git.sylphrenadin@gmail.com> Message-ID: References: <76ca49efc2ec4b8279e70c4bc4052fb7b543bc86.1602410019.git.sylphrenadin@gmail.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sun, 11 Oct 2020, Sumera Priyadarsini wrote: > 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 Applied, thanks. > --- > scripts/coccicheck | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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 > -- > 2.25.1 > > _______________________________________________ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci >