added defaults value and inline read

This commit is contained in:
panda 2017-03-06 15:23:18 +01:00
parent 2c602aaf17
commit 333e5d0ec7

View file

@ -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 ""