show tech-support details -------------------- show switchname ------------------ CCC217_ANG_GREEN ****************************************************************** -------------------- show interface brief ------------------ ------------------------------------------------------------------------------- mgmt0 up 10.33.81.54/20 100 Mbps 1500 ------------------------------------------------------------------------------- Interface Vsan Admin Status Oper Oper IP Trunk Mode Speed Address Mode (Gbps) ------------------------------------------------------------------------------- port-channel 1 1050 on trunking TE 4 -- port-channel 3 1 on trunking TE 2 -- ****************************************************************** #### #! c:/perl/bin/perl.exe use strict; #undef $/; #local $/; my $eof_tmp = $/; #$/=""; open (FILE,"$ARGV[0]") || die "\n$!: $ARGV[0]\n"; my $Rec = {}; while (my $Info = ) { undef $/; $Rec->{Switchname} = $1 if ($Info =~ /-+ show switchname -+\n(\w+)/sm); $/ = $eof_tmp; $Rec->{PortChannel_Num} = $1 if ($Info =~ /^(port-channel \d+)$/); } print "Switch Name: \t$Rec->{Switchname}\n"; print "Port Channel Number: \t$Rec->{PortChannel_Num}\n";