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: Eric Anderson
Subject: Re: [shell-script] selecionar substring
Date: Tue, 3 Oct 2006 18:08:35 -0300

c quer o ip à partir de um nome neh?

eu uso:

server_pop_terra=`host pop.sao.terra.com.br | cut -d " " -f4`

sds

Do nada elegante,

Eric
  ----- Original Message ----- 
  From: Humberto Pereira 
  To: address@hidden 
  Sent: Monday, October 02, 2006 6:08 PM
  Subject: Re: [shell-script] selecionar substring


  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/
   

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



reply via email to

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