[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Validar data
From: |
Victor Leonardo |
Subject: |
Re: [shell-script] Validar data |
Date: |
Fri, 26 Nov 2004 08:11:26 -0200 |
Boa! Valeu Fábio! Grande Abraço!!!
Em Qui, 2004-11-25 às 17:56, Fábio Batista escreveu:
> [fabio@elefante testes]$ cat data.sh
> #!/bin/sh
> DT=$1
>
> if [ `date -d $DT +%Y%m%d` == $DT ]; then
> echo "data ok"
> else
> echo "data incorreta"
> fi
>
> [fabio@elefante testes]$ sh data.sh 20040231
> data incorreta
>
> [fabio@elefante testes]$ sh data.sh 20040229
> data ok