[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ler lista e adicionar no script
From: |
rafaeliga |
Subject: |
Re: Ler lista e adicionar no script |
Date: |
Fri, 13 May 2005 16:39:49 -0000 |
User-agent: |
eGroups-EW/0.82 |
certissimo Emerson !!
brigado ! =)
--- Em address@hidden, "Emerson Domingues Souto"
<emerson.souto@i...> escreveu
>
> Muito simples, segue resposta abaixo:
>
> > ----- Original Message -----
> > From: "Rafael Fernandes Iga" <rafaeliga@y...>
> > To: <address@hidden>
> > Sent: Friday, May 13, 2005 8:10 AM
> > Subject: [shell-script] Re: Ler lista e adicionar no script
> >
>
> > segue:
> >
> > teste.sh
> >
> > #!/bin/sh
> >
> > for v_tel in $(cat telefones.txt) ; do
> > ./tel.sh $v_tel
> > done
> >
> > ####
> > #Onde:
> > #telefones.txt - é o nome do arquivo que contem a lsita de
telefones ( 1
> por linha)
> > #v_tel - e a varial que pegara cada linha de telefones.txt
> >
> > tel.sh
> >
> > #!/bin/sh
> >
>
> MUDE ESTA LINHA
> /*
> > sendfax -d $tel telefone.ps
> */
>
> PARA:
> sendfax -d $1 telefone.ps
>
>
> EXPLICACAO:
> a variavel $1 pega o primeiro argumento enviado à funcao,
> no caso o argumento é o conteudo da variável v_tel
> observe que é o conteúdo e não a variável que vai como argumento
>
>
> >
> >
> >
> > telefones.txt
> >
> > 66665555
> > 22223333
> > 55554444
> >
> >
> > eu tentei por no tel.sh a varial $v_tel em vez da $
> > tel,tbm nao deu certo.