From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 177C7A0583 for ; Thu, 19 Mar 2020 16:17:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C6F3B3B5; Thu, 19 Mar 2020 16:17:46 +0100 (CET) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id C792ECF3 for ; Thu, 19 Mar 2020 16:17:44 +0100 (CET) Received: by mail-pl1-f194.google.com with SMTP id m1so1193687pll.6 for ; Thu, 19 Mar 2020 08:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FeD1gPa9SCfOD+ZKCZbbLxnMgBXpQhXewMaWW0o/vnE=; b=X7QQwmcwp5r+u9wnAxgPDSU6sFrIh1CeJWdVQyTXPSLtyhjbCdw+XJHxlvB31SCrAn afjLAXJxERC/2i1KEMLy3C1KotnelDM/T6EROgpTV77JPqtkUh5+zF/5DJ5DzSryy0Jp 495PhQgdD45SLYCJFMTehBA+QHnXVWn2Czq46rEXSAIg6rb3iODP9QuAkgGL/Fjde24A QvACeV/C0Ct3hmtz8ZhbnvaoTBDnWU/R5GtB5Fv2CI2r+YBRfFkizqYrlCpwhQBZxCS7 Sn2faJtUDQLEwS2k4togSartdFhLwCIkmX+1gl7B3tx6KsCBcjIQnyyXxMew7il8eEbq X8uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FeD1gPa9SCfOD+ZKCZbbLxnMgBXpQhXewMaWW0o/vnE=; b=DS9MSmLTSejKMpNsyV4KAaKzBdcQmdaix3EbKv/xMIUcM38bId5vx8KYO12oK5GpMS 9I+2EyqGcOCaV88J77WVt/FdAY+4zMMosrewpytEj8ho/SFCNb5+vrsx3DM2Ao9i48VN 2rBm7OPbcMbeORtpPv8TcB8CN4gpXpwEREl54cds/Tixfv5/uHsa77dSudlwLMEfxbhS 9Swf2vXXwEpF/wFU+FRCdUMUd1xgPf66QmRShnQSMbnGiR1o6aSXyqU4AxKzdiLPUyzs sPWdrs+b0yZadmwLgOeo9P4KOS3YxsCTFmmkxq+AjL2CIkhYwDRwSncT0nKHe4hNWVm+ J6mA== X-Gm-Message-State: ANhLgQ009mBk1OVju+xU6XIjuuyEkVLz05Wx7pL3w4AYbLDTl8P1FtXP tQJKO34bY3bzECaLoi1hu9+Q4Q== X-Google-Smtp-Source: ADFU+vs6k2Q20Cfm7aTbFQLlXBiGJtZQtKiUrafJC86dNByN7et+2jEsg9cC42iljCHHd2vAKj3MHw== X-Received: by 2002:a17:902:c389:: with SMTP id g9mr3810652plg.19.1584631063857; Thu, 19 Mar 2020 08:17:43 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id y7sm2864002pfq.159.2020.03.19.08.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 08:17:41 -0700 (PDT) Date: Thu, 19 Mar 2020 08:17:33 -0700 From: Stephen Hemminger To: Sarosh Arif Cc: dev@dpdk.org, stable@dpdk.org Message-ID: <20200319081733.7c9a6a56@hermes.lan> In-Reply-To: <20200319133147.24180-1-sarosh.arif@emumba.com> References: <20200319133147.24180-1-sarosh.arif@emumba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] usertools/dpdk-setup.sh: fix dpdk-setup's behaviour on non-alphanumeric inputs X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Thu, 19 Mar 2020 18:31:47 +0500 Sarosh Arif wrote: > - ${OPTIONS[our_entry]} ${our_entry} > > + re='^[0-9]+$' > + if [[ $our_entry =~ $re ]] ; then > + ${OPTIONS[our_entry]} ${our_entry} > + fi > + Some comments: 1. Use same indentation style as the rest of the script This follows the mantra that all repairs should like the original code. 2. If user gives bad data, an error should be printed and not silently ignored. 3.The variable "re" doesn't need to be a temporary variable. 4. The [[ construct is a bash only thing, and not used elsewhere in the script.