in reply to Re^3: two vars from one string.
in thread two vars from one string.
__DATA__ 10000000C95C0379 10000000C9551477 10000000C95A58AEuse strict; use warnings; use Data::Dumper; my @hbas; open (LSDEV, "/usr/sbin/lsdev |") or die $!; while (<LSDEV>) { if ( /^(fcs\d+)/ ) { push (@hbas, +(split)[0]); } } my %hoa; my $hba; for $hba (@hbas) { $hoa{$hba} = qx(/usr/bin/fcstat $hba|/usr/bin/grep -i "world wide port name"|/us +r/bin/cut -f2 -d:|sed s/0x//); } while (my ($key, $val) = each %hoa) { my ($str,$str1) = split / /, $hoa{$key}; print $str1,"\n"; foreach (<DATA>) { if ( /$str1/g ) { print "YES\n",qx(hostname),"\n",$key,$val,"\n"; print qx(/usr/bin/fcstat $key|head -n 7); print qx(/usr/sbin/lsmcode -cd $key); } } }
10000000C95CE93F 10000000C94056CD 10000000C9540D92 10000000C9502723 10000000C94FE5D7 10000000C948ACA7 10000000C959C9F9 10000000C956BD68 10000000C9619092 10000000C9639A5D "hba_FW.ksh" 146 lines, 2629 characters root@dxxxxxx:/export/resources/SOX/scripts> perl hba_FW.plx 10000000C95A58AE YES dunmpr01 fcs1 10000000C95A58AE FIBRE CHANNEL STATISTICS REPORT: fcs1 Device Type: FC Adapter (df1000fa) Serial Number: 1D63508268 Option ROM Version: 02881955 Firmware Version: T1D1.91A5 The current microcode level for fcs1 is 191105. 10000000C95C0379
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: two vars from one string.
by ikegami (Patriarch) on Mar 03, 2010 at 21:37 UTC |