Vylistovani podrizenych interface

Ivo Hazmuk ivo at vutbr.cz
Fri Nov 23 10:54:57 CET 2012


Ahoj,

Dan Lukes napsal(a):
> for i in $( ifconfig -l ) ; do
>   pi=$( ifconfig "$i" |  grep 'parent interface' | cut -d: -f3 );
>   [ -z "$pi" ] || echo "$i -> $pi" ;
> done

to je moc pekne. Ja bych to napsal ponekud sloziteji.

A=`ifconfig -l`
for i in $A
do
    PI=`ifconfig $i|grep 'parent interface'|cut -f3 -d:`
    if [ -n "$PI" ]
    then
        echo "$i -> $PI"
    fi
done

	I.


More information about the Users-l mailing list