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

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

Re: [shell-script] Simulando grep -A1


From: Eri Ramos Bastos
Subject: Re: [shell-script] Simulando grep -A1
Date: Thu, 28 Aug 2008 18:41:45 -0300

Valeu, Jimmy, mas infelizmente não funcionou.
O sed do Solaris também é um pentelho. Pelo jeito o ed também... :(

A solução foi em awk:

$ awk '/regex/ { getline ; print }' arquivo.txt

[]'s
Eri

2008/8/28 jimmy <address@hidden>

>
> _______________________________________________________________________________
>
> não conheço solaris ...
>
> mas se tiver sed use:
>
> sed '/regex/,+1!d' arquivo
>
> ou se tiver o editor ed:
>
> echo -e "g/regex/\n+1p" | ed -s arquivo
>
>
>


[As partes desta mensagem que não continham texto foram removidas]



reply via email to

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