# Perl version while (<>){ # Loop over the input file/stream my @line = split; # Split each line into "fields" next unless $line[1] =~ /^[AP]M$/ && $line[2] =~ /^(eth|bon)/; # Note: the 'eth0' and the 'IFACE' line aren't in here because they don't # contribute anything to the validation routine as originally written. [ ... ]