[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Substituir uma linha por duas
From: |
Gentil de Bortoli Jr |
Subject: |
Re: [shell-script] Substituir uma linha por duas |
Date: |
Thu, 15 Dec 2005 13:55:57 -0200 |
User-agent: |
Thunderbird 1.4.1 (X11/20051006) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Eriberto wrote:
> Pessoal,
>
> Tenho um arquivo com o seguinte conteúdo:
>
> tomate
> cebola
> alho
> laranja
>
> Gostaria de de substituir a linha
>
> cebola
>
> por
>
> cebola
> alface
>
> Existe uma solução com SED para isso?
Eriberto, veja aí:
$ cat Bla.txt
tomate
cebola
alho
laranja
$ sed 's/cebola/cebola\nalface/' Bla.txt
tomate
cebola
alface
alho
laranja
[]s
- --
Gentil de Bortoli Júnior
http://gentil.bortoli.com.br
KeyID: 0x8383E070 - www.keyserver.net
"There Is No Gene For The Human Spirit"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDoZINU6AHyoOD4HARAlL0AJ9gUOVg08hOq9aBejFPdPJQjviI2QCfQfVw
Dar4SfkR7RFtofumq5APh1Q=
=+odw
-----END PGP SIGNATURE-----