BAEL-3370: First draft of menu

This commit is contained in:
Sorin Zamfir 2019-12-17 23:30:12 +02:00
parent 9818939e40
commit 18b9e796ef
1 changed files with 23 additions and 1 deletions

View File

@ -58,6 +58,7 @@ timeout_input_read(){
read -p "$prompt" -s -r -t 5 input
if [ -z "$input" ]; then
echo -e "\ntimeout occured!"
echo "empty -?> [$input]"
else
echo -e "\ninput word [$input]"
fi
@ -68,4 +69,25 @@ exactly_n_read(){
read -p "$prompt" -N 11 -t 5 input1 input2
echo -e "\ninput word1 [$input1]"
echo "input word2 [$input2]"
}
}
echo "Read command samples"
options=("default_read" "custom_ifs_no_array" "prompt_read_password" "quit")
select option in "${options[@]}"
do
case $option in
"default_read")
echo "Default read"
default_read
;;
"custom_ifs_no_array")
echo "Custom IFS no array"
custom_ifs_no_array
;;
"quit")
break
;;
*) echo "Invalid option";;
esac
done