-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nelson Ramos wrote:
>cd /home/nelson/scripts/relatorios
>rm -f teste
>cont="1"
>result="1"
>while [ "$cont" -gt "0" ]
>do
>        if [ "$result" -ne " " ]
>        then
>                result=`cat cadastro | head -$cont | tail -n +$cont |
> cut -d"|" -f1` echo $result >> teste
>                cat cadastro | head -$cont | tail -n +$cont | cut -d"|"
> -f2 >> teste cat cadastro | head -$cont | tail -n +$cont | cut -d"|"
> -f3 >> teste cat cadastro | head -$cont | tail -n +$cont | cut -d"|"
> -f4 >> teste cat cadastro | head -$cont | tail -n +$cont | cut -d"|"
> -f5 >> teste cat cadastro | head -$cont | tail -n +$cont | cut -d"|"
> -f6 >> teste echo " " >> teste
>                echo " " >> teste
>                cont=`expr $cont + 1`
>        else
>        cont="0"
>        fi
>done

Reescrevendo o script:
cd /home/nelson/scripts/relatorios
awk -F '|' \
'{print $1; print $2; print $3; print $4; print $5; print $6; print "";}' 
\
< cadastro > teste

- -- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGKPD+M/XwBW70U1gRAi0iAJ96/zbbC/09EfA0QrDZ0D3dFALbtACfUz+/
LR6EOnhVZUay4w6H479oYT4=
=8HAV
-----END PGP SIGNATURE-----

---------------------------------------------------------------------------
Esta lista é patrocinada pela Conectiva S.A. Visite http://www.conectiva.com.br

Arquivo: http://bazar2.conectiva.com.br/mailman/listinfo/linux-br
Regras de utilização da lista: http://linux-br.conectiva.com.br
FAQ: http://www.zago.eti.br/menu.html

Responder a