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

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

Re: teste condicional em awk


From: merthobu
Subject: Re: teste condicional em awk
Date: Tue, 15 Jan 2008 21:06:46 -0000
User-agent: eGroups-EW/0.82

... E resolveu!!!  =8))
D+, valeu.

> Se eu entendi direito, este script resolve.
> 
> #!/usr/bin/awk -f
> 
> BEGIN {flag=0;}
> {
>          if ($5 == "E") {
>                  flag=1;
>                  next;
>          }
>          else if ($5 == "A1") {
>                  flag=0;
>                  next;
>          }
> 
>          if (flag==0) {
>                  print;
>          }
>          else {
>                  print $1,$2,$3,$4,$6,$5,$7;
>          }
> }
> 
> 
> -- 
> Fabiano Caixeta Duarte
> Especialista em Redes de Computadores
> Linux User #195299
> Ribeirão Preto - SP
>




reply via email to

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