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

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

Re: [shell-script] Mascara + Rede


From: Flavio Junior
Subject: Re: [shell-script] Mascara + Rede
Date: Mon, 10 Dec 2007 14:16:29 -0200

Pega os 4 campos do IP e faz:

$ echo "obase=2;$CAMPO" | bc -l

sem mto tempo..

--

Flavio do Carmo Junior

On Dec 10, 2007 2:09 PM, Fábio Gomes <address@hidden> wrote:
>
>
>
>
>
>
> Boa tarde lista,
>
>  Alguem sabe alguma função que me retorne a rede em binario, eu
>  informando ip e a mascara?
>
>  Eu estou usando...
>
>  IP_IF2=$(/sbin/ifconfig ${IF_LINK2} | awk '/inet addr:/ {print $2}' |
>  cut -d: -f2)
>  MASK_IF2=$(/sbin/ifconfig ${IF_LINK2} | awk '/inet addr:/ {print $4}' |
>  cut -d: -f2)
>  REDE2=$(ipmask $MASK_IF2 $IP_IF2 | cut -f2 -d" ")
>
>  Mas preciso que seja em binario, preciso saber se eh /24, /18, etc...
>
>  Obrigado
>
>  Fábio Gomes dos Santos
>  


reply via email to

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