[Pkg-xen-devel] Bug#437127: xen-utils-common: vif-common fails to identify ip address of ethernet device

Marc A. Donges kosh at hadiko.de
Mon Aug 25 23:51:44 UTC 2008

I must apologize, those semantics of match() are a peculiarity of
GNU awk. The following should work portably, I tested it with an old mawk:

ip -4 -o addr show primary dev eth0 | awk '$3 == "inet" {split($4,i,"/"); print i[1]; exit}'


  _ _    Marc A. Donges                      +49 721 6904-2130
  'v'    Klosterweg 28 / E110
 /   \   76131 Karlsruhe
  W W                              http://www.hadiko.de/~marc/

More information about the Pkg-xen-devel mailing list