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

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

Re: [shell-script] Apagar último caracter concatenando a linha.


From: Aurelio Marinho Jargas
Subject: Re: [shell-script] Apagar último caracter concatenando a linha.
Date: Tue, 23 Nov 2004 17:13:13 -0300 (ART)

oi salviano,

 --- Salviano Leÿffffe3o <address@hidden> escreveu: 
> texto0 texto0 texto0
> texto1 texto1 texto1%
> texto2 texto2 texto2
> texto3 texto3 texto3
> 
> deveria ficar assim,
> 
> texto0 texto0 texto0
> texto1 texto1 texto1 texto2 texto2 texto2
> texto3 texto3 texto3


  $ cat lixo | sed '/%$/{N;s/%\n/ /;}'
  texto0 texto0 texto0
  texto1 texto1 texto1 texto2 texto2 texto2
  texto3 texto3 texto3
  $


destrinchando:

/%$/               nas linhas que terminarem em %
    {
     N             junte a proxima
     s/%\n/ /      troque o % e a quebra de linha
                   por um espaço em branco
    }

falou!

=====
-- 
Aurelio Marinho Jargas, Curitiba, Conectiva
Funcoes ZZ v4.1111 http://aurelio.net/zz
txt2tags v2.1 http://txt2tags.sf.net/pt


        
        
                
_______________________________________________________ 
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! 
http://br.acesso.yahoo.com/


reply via email to

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