shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Mostrar arquivo maior que certa data.


From: Wilson Freitas
Subject: Re: [shell-script] Mostrar arquivo maior que certa data.
Date: Fri, 11 Jun 2004 21:52:01 -0300
User-agent: Mozilla Thunderbird 0.5 (X11/20040512)

IGOR wrote:
Pessoal,
Fala ae

tenho um arquivo e dentro dele tenho o seguinte formato:


ARO.LR.1#20040203#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040204#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040205#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040206#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040207#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040208#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040209#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040210#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040211#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040212#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK

Gostaria de mostrar, somente as linhas que tiverem a data maior que 
20040301(ano,mês,dia).
As linhas dentro do arquivo, são separadas por "#", então a data é a segunda 
coluna.
Tenta isso aqui, é meio nas coxas mas se for pra uma rapidinha resolve;)


$ cat arquivo_log | awk -F"#" '{ if ($2 > 20040209) print $0 }'
ARO.LR.1#20040210#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040211#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK
ARO.LR.1#20040212#bmpa#ARO01#Rec80.020504.gz  020504 - 23:00  OK



Obrigado
De nada, valeu!!

Wilson Freitas


reply via email to

[Prev in Thread] Current Thread [Next in Thread]