Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while [[ ! $hora =~ ^[0-9]{2}:[0-9]{2}$ || $HH -gt 23 || $MM -gt 59 ]]; do
- tput sc
- read -ep " Hora (HH:MM, en 24h): " hora
- tput rc
- tput ed
- HH=${hora:0:2}
- MM=${hora:3:2}
- done
- # Donde
- # ^[0-9]{2}:[0-9]{2}$ → 2 num seguidos de ':', seguido de 2 num
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement