Olá!
Outra forma:
# ifconfig eth0 | egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
| head -n1
192.168.0.128
[]'s
Cléoson.
2008/8/29 Cléoson Barreto <[EMAIL PROTECTED]>
> Olá,
>
> Vê se ajuda:
> # ifconfig eth0 | awk '/inet end.:/ { print $3 }'
> 192.168.0.128
>
> #ifconfig eth0 | grep inet | tr -s " " | cut -f4 -d" "
> 182.168.0.128
>
>
> []'s
> Cléoson.
>
>
> 2008/8/29 Douglas Milanez <[EMAIL PROTECTED]>
>
> Olá galera, tudo bom?
>>
>> Segunte: como fazer uma expressão regular que pegue a saida do comando
>> "ifconfig eth0" e retorne apenas o IP da máquina, ex.:
>>
>> # ifconfig | <regexp>
>> # 192.168.0.1
>>
>> --
>> []'s,
>> Douglas Milanez.
>>
>>
>
>
[As partes desta mensagem que não continham texto foram removidas]