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

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

Re: [shell-script] selecionar substring


From: Humberto Pereira
Subject: Re: [shell-script] selecionar substring
Date: Mon, 02 Oct 2006 18:08:07 -0300
User-agent: Opera Mail/9.02 (Linux)

On Mon, 02 Oct 2006 17:57:49 -0300, Celso Viana <address@hidden> wrote:
Na linha abaixo, como é que pega somente o que está dentro dos
parenteses (endereço IP)?

PING teste.com (69.36.226.134): 56 data bytes
Opa,

[begnini@coke analise]$ echo "PING teste.com (69.36.226.134): 56 data bytes" | sed -r 's/^.*\((([0-9]{1,3}\.){3}[0-9]{1,3}).*$/\1/'
69.36.226.134
[begnini@coke analise]$

[]s
Humberto Pereira
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


reply via email to

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