DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] usertools/dpdk-setup.sh: fix dpdk-setup's behaviour on non-alphanumeric inputs
@ 2020-03-19 13:31 Sarosh Arif
  2020-03-19 15:17 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Sarosh Arif @ 2020-03-19 13:31 UTC (permalink / raw)
  To: dev; +Cc: Sarosh Arif, stable

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-19 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 13:31 [dpdk-dev] [PATCH] usertools/dpdk-setup.sh: fix dpdk-setup's behaviour on non-alphanumeric inputs Sarosh Arif
2020-03-19 15:17 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).