need your help in coding, I can do this using if / else and while but I like to see if there is a way to do it in one or less commands as possible (I like use less lines as possible and more complex commands :D just to learn new things)
I have this command that works to read input having only letters, numbers and _
while [[ "$inp" =~ [^a-zA-Z0-9] || -z "$inp" ]]; do
read -r -p "Please enter name and hit ENTER:" inp;
done
is there a way to add to same command to also check if variable is more than 5 and less than 20 characters?
and going even more if possible, we need to know that starts only with following patterns: p_ d_ s_
thanks :)