IP adresa v shellu (BFU)

Peter Surda shurdeek na panorama.sth.ac.at
Pondělí Únor 25 11:36:16 CET 2002


On Mon, Feb 25, 2002 at 11:12:43AM +0100, Zdenek Mazanec wrote:
> MYIP=`/sbin/ifconfig eth1 | awk '{ if( $1 == "inet" ) print $2 }' | awk -F:
> '{ print $2 }'`
Alternativne:
MYIP=`/sbin/ifconfig eth1|head -2|tail -1|cut -d: -f2|cut -d\  -f1`

Ktovie, co je rychlejsie, 2*awk alebo head+tail+2*cut :-)

Bye,

Peter Surda (Shurdeek) <shurdeek na panorama.sth.ac.at>, ICQ 10236103, +436505122023

--
   If Bill Gates had a dime for every time a Windows box crashed...
                ...Oh, wait a minute, he already does.
------------- další část ---------------
A non-text attachment was scrubbed...
Name: [žádný popis není k dispozici]
Type: application/pgp-signature
Size: 232 bytes
Desc: [žádný popis není k dispozici]
URL: <http://www.linux.cz/pipermail/linux/attachments/20020225/a4cfa32e/attachment.sig>


Další informace o konferenci Linux