Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while [[ (! $fecha =~ ([0-9]{2}/){2}[0-9]{2} || $DD -gt 31 || $MM -gt 12) ]]; do
- tput sc
- read -ep " Fecha (DD/MM/AA): " fecha
- tput rc
- tput ed
- DD=$( echo $fecha | cut -d '/' -f 1 )
- MM=$( echo $fecha | cut -d '/' -f 2 )
- done
- # Donde
- # ([0-9]{2}/){2}[0-9]{2} → 2 conjuntos de 2 numeros, seguidos de /, seguido de 2 numeros
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement