[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] 1º Nome e Nome Completo
From: |
Ulysses Almeida |
Subject: |
Re: [shell-script] 1º Nome e Nome Completo |
Date: |
Thu, 6 May 2004 16:54:52 -0400 |
User-agent: |
Mutt/1.5.3i |
On Thu, May 06, 2004 at 05:41:25PM -0300, Viktor Mota wrote:
>
> Preciso criar uma correspondencia que fique ± assim:
> "Prezado BENICIO,
>
> Parabéns... bla bla bla bla bla bla
>
> Vc foi cadastrado como: BENICIO DA SILVA JUAR
>
> Atenciosamente
> A Direcao"
>
> Consegui fazer a leitura do arquivo.txt com o comando:
>
> cat arquivo.txt |
> while read NOME
> do
> echo "Prezado $NOME, blablabla vc foi cadastrado como $NOME" >>
> correspondencia.txt
> done
>
É bem por ae...
tente da seguinte maneira.
cat arquivo.txt |while read NOME_COMPLETO
do
NOME=$(echo $NOME_COMPLETO |sed 's/ .*//')
echo "Prezado $NOME, blablabla vc foi cadastrado como $NOME_COMPLETO >>
correspondencia.txt
done
[]s
--
.~. Ulysses Almeida
/ V \ address@hidden
/ ( ) \ Seja livre, use GNU/Linux!
^^-^^