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

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

Re: [shell-script] Pegar range especifico de ip


From: Julio C. Neves
Subject: Re: [shell-script] Pegar range especifico de ip
Date: Thu, 5 Mar 2009 09:56:55 -0300

grep -E '^192.168.[0-9]{3}.2([1-4][0-9]|50)$'

-- 
Abração,
Julio
*Cursos de Shell e Zenity nos finais de semana:
- Em SP ligue (11) 2125-4747;
- Em DF ligue (61) 3223-3000;
- No RJ brevemente;
- Turmas fechadas em outras cidades ligue (21) 8112-9988*

2009/3/5 Marcelo <address@hidden>

>   Srs,
>
> Usando fgrep/grep/egrep como consigo "pegar" um range especifico de ip?
> por exemplo, tenho um arquivo com o conteudo:
>
> 192.168.0.20
> 192.168.0.200
> 192.168.0.233
> 192.168.0.250
> 192.168.0.252
> 192.168.200.22
> 192.168.200.211
> 1922.168.200.212
> 192.1688.200.213
>
> Preciso pegar o range de 192.168.xxx.210 ate 192.168.xxx.250
>
> Estou usando o txt2regex mas o mais proximo que cheguei foi:
>
> egrep ^[0-9]{3}\.[0-9]{3}\.[0-9]+\.[0-9]{3} arquivo
>
> resultado:
>
> 192.168.0.200
> 192.168.0.233
> 192.168.0.250
> 192.168.0.252
> 192.168.200.211
>
> Preciso somente de:
>
> 192.168.0.233
> 192.168.0.250
> 192.168.200.211
>
> É isso...
>
> Abraços e Obrigado,
>
> Marcelo
>
> ----------------------------------------------------------
> Esta mensagem pode conter informacao confidencial.
> Se voce nao for o destinatario ou a pessoa autorizada a receber
> esta mensagem, nao podera usar, copiar ou divulgar as informacoes nela
> contidas ou tomar qualquer acao baseada nessas informacoes. Se
> voce recebeu esta mensagem por engano, favor avisar imediatamente o
> remetente, respondendo o e-mail e, em seguida, apague-o.
> Agradecemos sua cooperacao.
>
> This message may contain confidential information.
> If you are not the addressee or authorized person to receive it for the
> addressee, you must not use, copy, disclose or take any action based on
> this message or any information herein. If you have received this message
> in error, please advise the sender immediately by replying this e-mail
> message and delete it.
> Thanks in advance for your cooperation.
> ----------------------------------------------------------
> Faculdade de Medicina USP
> ----------------------------------------------------------
>
>  
>


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



reply via email to

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