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 88D98A0583; Thu, 19 Mar 2020 16:17:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F0B481AFF; Thu, 19 Mar 2020 16:17:46 +0100 (CET) Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by dpdk.org (Postfix) with ESMTP id CC3CEF90 for ; Thu, 19 Mar 2020 16:17:44 +0100 (CET) Received: by mail-pj1-f65.google.com with SMTP id dw20so2409172pjb.0 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=DtGpFFg319tnIlXLRlaZevl/5VucglcrDgsMwmmw1Puqwyu/HQlEGu0sSTtumil7jD 0jwr+EwXs+XkW3xDEHmxmbqi97oMbfq8tYPanx+7SjF3QIjK6ce/abL8UR4aihcUVmSA qC2NqMbm+8AQcNu6P4aDNJxjnTxFrWsmcjwEwZyFH0QHAE/XAalVQcY3Ar8c5l4gAq85 FUhd8zzrQkifkvy0WlkEjFUiWiqwe+zcfBKKeYAw86aWiTVzS6hbBG0YjaAlRX5PTcbZ ZDkt1wm49BMFqBqwdUE6CSzecgu37pxvLH+/MSeDwZBXR/+UtwLSKvBG1nguYLC6rs2X p6Qw== X-Gm-Message-State: ANhLgQ3mHQ2h/RGxOiJYqBdGZ8X1bNo3tkGPc3aUHAwrkCApeM1z5ldn NmiL5tPryM4vXDXCbpNomDEN+WGF+zI= 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-dev] [PATCH] usertools/dpdk-setup.sh: fix dpdk-setup's behaviour on non-alphanumeric inputs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.