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 6E0DFA058A; Fri, 17 Apr 2020 14:50:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE4B11E567; Fri, 17 Apr 2020 14:50:35 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id A81601E551 for ; Fri, 17 Apr 2020 14:50:34 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id o127so2181915iof.0 for ; Fri, 17 Apr 2020 05:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KE/UuKkl5YqFAAHfHIQV5efCfA9GpJiIAm8T1FdLDIs=; b=eIjrXLRnyqvf1H883opGC/a51cSaRcScugy/M7/0ASmP76RaL0QqBmH/+IwImM2HlH MXMNtU4F+DX2GnoJdPITWAXN25HfFnyyw9JVwt6R8575l4WKscN7k8WNXB1z1WpySUYC R9bRGuAvtqhIbJxesUN2ucTEIhyvZ4uf9FzS46HFSo+H/AVqpJud4B1mYAH7NFHm7Xiv pHng6qjcK5OUGPrRpmoJr+rnVuZ6+jLjAf828L9EgoDgeZYo/mgShKnopJhYv9JRx2u3 1RKwWSz5dBIMczTZScHDPfou4EDpudyfJgMDyGzZKcOJnF5u1zMrAzwwI1zSpdd6V4wB LrEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KE/UuKkl5YqFAAHfHIQV5efCfA9GpJiIAm8T1FdLDIs=; b=r9M5yZAgnhdryzU3PiiU7H6C4xV636qHs9JdyG+DjvxhhABs4LjwbNxrD/I3NwboQe FC5nXUopU+pNRyy+iU+FC1ufGglE8OitGgajiTMSDJ8G13u/y+8DVF6k0vnH8iJoxA3G yxUd+xLUkxGdauRFzxwrIaPQZTDcshTE6/7/1ot1MdfWs/cQcAIw36tkBP5ZUOgbg2Tr sgqO1OPoLp0j7t7lh5Lc+N4+Pi0lWRdB+j3YFOZveefm7b+4yWsCzWXu7pNxFEIBpi68 tCt5sqWidOLtHI6/YXXCPhRPfzX9vhpZSpR41Q1jMnaHdrvjVUC09UWPSam7WKBinNRZ Kclw== X-Gm-Message-State: AGi0PuZGhHEmBBDcZeGBNwgtBKLrZlQ+q2nQDsN5GPqvma+tg256k/4e 1VoidUIiSqKhagzTlHuVB2ECQiZD1jRUAQGU3jnFDduo X-Google-Smtp-Source: APiQypIaMouCnXH8dbFOkS2bYWXo1mysXrXrDA6r11QDL9eMruen9S04tLx9NsAID5R2zV79V13rX2Wskp9VWJWW6Hg= X-Received: by 2002:a02:2a4a:: with SMTP id w71mr3121820jaw.75.1587127833851; Fri, 17 Apr 2020 05:50:33 -0700 (PDT) MIME-Version: 1.0 References: <20200320065002.5410-1-sarosh.arif@emumba.com> In-Reply-To: <20200320065002.5410-1-sarosh.arif@emumba.com> From: Sarosh Arif Date: Fri, 17 Apr 2020 17:50:22 +0500 Message-ID: To: dev@dpdk.org Cc: stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2] 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" Hello, If there is no objection on this patch then it can perhaps be applied. On Fri, Mar 20, 2020 at 11:50 AM Sarosh Arif wrote: > Bugzilla ID: 419 > Cc: stable@dpdk.org > Signed-off-by: Sarosh Arif > --- > usertools/dpdk-setup.sh | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/usertools/dpdk-setup.sh b/usertools/dpdk-setup.sh > index e5bbe9fee..c27f89c5f 100755 > --- a/usertools/dpdk-setup.sh > +++ b/usertools/dpdk-setup.sh > @@ -592,11 +592,17 @@ while [ "$QUIT" == "0" ]; do > echo "[$OPTION_NUM] Exit Script" > OPTIONS[$OPTION_NUM]="quit" > echo "" > - echo -n "Option: " > - read our_entry > + read -p "Option: " our_entry > + [ $? -eq 0 ] || exit 0 > + > echo "" > - ${OPTIONS[our_entry]} ${our_entry} > - > + numeric="^[[:digit:]]+$" > + if [[ "$our_entry" =~ $numeric ]]; then > + ${OPTIONS[our_entry]} ${our_entry} > + else > + echo "Please enter a numeric value" > + fi > + > if [ "$QUIT" == "0" ] ; then > echo > echo -n "Press enter to continue ..."; read > -- > 2.17.1 > >