#!/usr/bin/perl use strict; use warnings; my @array = (); while () { if ( /Version:\s*(\S+),/ ) { push ( @array, $1 ), next; } if ( /Software version:\s*(\S+)/ ) { push ( @array, $1 ), next; } if ( /SW_REV:\s*(\S+);/ ) { push ( @array, $1 ), next; } } foreach (@array) { $_ =~ s/Copyright//i; print "FW: $_\n"; } __DATA__ Company: Nuera Communications, Inc., ProductFamily: ORCA Series, Product: RDT-8, Version: rdtg7.0.4.7, HardwareRevision: A Motorola Corporation SB4100E Cable Modem: Hardware version: 0; OS: VxW+orks 5.3.1; Software version: 4.1.4p <>OS: VxWorks 5.4 #### [tab@fred dev]$ perl -w pm23-10-03.pl FW: rdtg7.0.4.7 FW: 4.1.4p FW: CG4D_05.3.02