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

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

Re: [shell-script] imcremento ao final de um txt


From: AWK
Subject: Re: [shell-script] imcremento ao final de um txt
Date: Mon, 15 Dec 2003 14:14:44 -0200

On Sat, 13 Dec 2003 01:56:26 -0300 (ART)
fost kidi <address@hidden> wrote:

> 
> Eu fiz um simples script para poder adcionar
> um testo ao final de todos os arquivos
> emcontrados com *.txt, eu queria saber como
> posso fazer isso em linha de comando. Eu tentei
> fazer com o find mais não tive nenhum resultado
> satisfatorio.
> 
> -----------------------------
> #!/bin/bash
> 
> if [  -z $1 ]; then
> find  /tmp -name "*\.txt" -type f -exec $0 {} \;
>   else 
>     echo "Mensagem" >> $1
> fi
> -----------------------------
> 

fost,

        É simples.  Utilize o 'sed'.  Vamos supor que o texto que vc quer
inserir esteja no arquivo 'fotenote.txt', então fariamos o seguinte:

        $ sed '$r fotenote.txt' *.txt

[ ]'s
---- 
            ////
          ( O O )
=======oOO==(_)==OOo============
  
 Márcio Alexandre S. Mendonça
 address@hidden
 Linux User #298595
  
 $~ make linux | more > friendly
 
      .oooO   Oooo.
======(   )===(   )=============
       \ (     ) /
        \_)   (_/


reply via email to

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