patches for DPDK stable branches
 help / color / Atom feed
From: Sarosh Arif <sarosh.arif@emumba.com>
To: dev@dpdk.org
Cc: Sarosh Arif <sarosh.arif@emumba.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH] usertools/dpdk-setup.sh: fix dpdk-setup's behaviour on non-alphanumeric inputs
Date: Thu, 19 Mar 2020 18:31:47 +0500
Message-ID: <20200319133147.24180-1-sarosh.arif@emumba.com> (raw)

Used regular expression to see if the input is numeric, otherwise prompts the user to re-enter.

Bugzilla ID: 419
Cc: stable@dpdk.org

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
---
 usertools/dpdk-setup.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
 mode change 100755 => 100644 usertools/dpdk-setup.sh

diff --git a/usertools/dpdk-setup.sh b/usertools/dpdk-setup.sh
old mode 100755
new mode 100644
index e5bbe9fee..a29fdc677
--- a/usertools/dpdk-setup.sh
+++ b/usertools/dpdk-setup.sh
@@ -595,8 +595,12 @@ while [ "$QUIT" == "0" ]; do
 	echo -n "Option: "
 	read our_entry
 	echo ""
-	${OPTIONS[our_entry]} ${our_entry}
 
+	re='^[0-9]+$'
+	if  [[ $our_entry =~ $re ]] ; then
+	${OPTIONS[our_entry]} ${our_entry}
+	fi
+
 	if [ "$QUIT" == "0" ] ; then
 		echo
 		echo -n "Press enter to continue ..."; read
-- 
2.17.1


             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 13:31 Sarosh Arif [this message]
2020-03-19 15:17 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200319133147.24180-1-sarosh.arif@emumba.com \
    --to=sarosh.arif@emumba.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox