#!/usr/bin/perl while (<>) { if (/\s*inet (addr:)?([\d\.]+) /) { print "$2\n"; } }