22 Mar
2004
22 Mar
'04
19:40
Hallo, Am Mon, 22 Mar 2004, Daniel Lord schrieb:
ifconfig ppp0 | awk '/((I|i)net)|INET)/ {print $2}' | cut -d ":" -f 2
Erm David,Jan & Co fällt euch noch was zu dem unschönen cut ein :)
Jo, mit awk geht's auch: LANG=C /sbin/ifconfig ppp0 | awk -F: '/P-t-P/{print gensub(" .*","",0,$3);}' Oder auch LANG=C /sbin/ifconfig ppp0 | awk '/P-t-P/{print gensub("^[^:]*:","",0,$3);}' und u.U. LANG=C /sbin/ifconfig ppp0 | awk '/P-t-P/{print gensub(".*:","",0,$3);}' Die Variante mit sed steht nebenan. -dnh -- If you haven't got time to RTFM, you haven't got time to whine on this mailing list.