sysDescr.0 = STRING: Cisco IOS Software, C3560 Software (C3560-IPBASEK9-M), Version 12.2(25)SEE2, RELEASE SOFTWARE (fc1)
In KSH, to isolate "C3560" and "12.2(25)SEE2"
x=`snmpwalk -c comstring 10.11.12.13 sysDescr.0 |\
awk '{print $7" "$11 | sed 's/\,//g'`
x now = c3560 12.2(25)SEE2
Is there a perl equivalent ?
Heres what Im doing now in perl ... just looks crappy and too many lines ...
@x=`snmpwalk -c comstring 10.11.12.13 sysDescr.0`;
@x = split(/ /, @x);
push(@ver, $x[6]);
push(@ver, $x[10]);
print qq(@ver);
In KSH, to isolate "C3560" and "12.2(25)SEE2"
x=`snmpwalk -c comstring 10.11.12.13 sysDescr.0 |\
awk '{print $7" "$11 | sed 's/\,//g'`
x now = c3560 12.2(25)SEE2
Is there a perl equivalent ?
Heres what Im doing now in perl ... just looks crappy and too many lines ...
@x=`snmpwalk -c comstring 10.11.12.13 sysDescr.0`;
@x = split(/ /, @x);
push(@ver, $x[6]);
push(@ver, $x[10]);
print qq(@ver);