From 333e5d0ec73d8243adcb8b081b7f29cbafd7d618 Mon Sep 17 00:00:00 2001 From: panda Date: Mon, 6 Mar 2017 15:23:18 +0100 Subject: [PATCH] added defaults value and inline read --- rasplice2passwd.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rasplice2passwd.sh b/rasplice2passwd.sh index bf37eb6..ae1ed34 100644 --- a/rasplice2passwd.sh +++ b/rasplice2passwd.sh @@ -1,7 +1,11 @@ echo "Rasplice to Password hyperconverged-cloud enabled integration tool" -echo "select minimum word lenght:" -read lenght -echo "select number for words to integrate:" -read words +read -p "select minimum word lenght (press ENTER for default = 11): " lenght +read -p "select number for words to integrate (press ENTER for default = 4): " words + +lenght=${lenght:-11} +#echo $lenght + +words=${words:-4} +#echo $words curl -s http://rasplice.contaminati.net/sproloquio.txt | grep -e "[^\ ]\{$lenght,\}" | shuf -n $words | sed 's/^\(.\)/\U\1/' | paste -sd "" \ No newline at end of file