[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] selecionar substring
From: |
Tiago Barcellos Peczenyj |
Subject: |
Re: [shell-script] selecionar substring |
Date: |
Mon, 2 Oct 2006 18:07:35 -0300 |
egrep -o vai mostrar a string que 'casa' com a expressão regular
$ echo 'PING teste.com (69.36.226.134): 56 data bytes' | egrep -o
'[0-9.]{8,18}'
69.36.226.134
coloquei uma expressão simples, qq coisa composta por algo entre 8 e 18
caracteres 0 à 9 e . eu considero como um ip
outra forma é usar 2 cuts
On 10/2/06, Celso Viana <address@hidden> wrote:
>
> All,
>
> 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
>
> OBS.: O endereço IP pode ser variável...
>
> --
> Celso Vianna
> BSD User: 51318
> http://www.bsdcounter.org
>
> 63 8404-8559
> Palmas/TO
>
>
> ---------------------------------------------------------------------
> Esta lista não admite a abordagem de outras liguagens de programação, como
> perl, C etc. Quem insistir em não seguir esta regra será moderado sem prévio
> aviso.
> ---------------------------------------------------------------------
> Sair da lista: address@hidden
> ---------------------------------------------------------------------
> Esta lista é moderada de acordo com o previsto em
> http://www.listas-discussao.cjb.net
> ---------------------------------------------------------------------
> Servidor Newsgroup da lista: news.gmane.org
> Grupo: gmane.org.user-groups.programming.shell.brazil
>
>
> Links do Yahoo! Grupos
>
>
>
>
>
>
>
>
>
--
Tiago B Peczenyj
Linux User #405772
# cd /pub
# more beer
[As partes desta mensagem que não continham texto foram removidas]
- selecionar substring, Celso Viana, 2006/10/02
- Re: [shell-script] selecionar substring,
Tiago Barcellos Peczenyj <=
- Re: [shell-script] selecionar substring, Humberto Pereira, 2006/10/02
- Re: [shell-script] selecionar substring, Celso Viana, 2006/10/02
- Re: [shell-script] selecionar substring, Humberto Pereira, 2006/10/02
- Re: [shell-script] selecionar substring, Alfredo Casanova, 2006/10/02
- Re: [shell-script] selecionar substring, Sergio Nery Simoes, 2006/10/02
- Re: [shell-script] selecionar substring, Julio C. Neves, 2006/10/03
- Re: [shell-script] selecionar substring, Sergio Nery Simoes, 2006/10/04
- Re: [shell-script] selecionar substring, Julio C. Neves, 2006/10/05
- Re: [shell-script] selecionar substring, Sergio Nery Simoes, 2006/10/06
Re: [shell-script] selecionar substring, Eric Anderson, 2006/10/03