I've checked the documentation but can't see anything -- does anyone know if its possible to escape the newlines returned from some OIDs?
I need to parse the output in a script and its causing me headaches.
For example:
$ snmpwalk -v2c -c public -Oq 10.0.0.1 1.3.6.1.2.1.1
SNMPv2-MIB::sysDescr.0 Cisco Internetwork Operating System Software
IOS (tm) Catalyst 4000 L3 Switch Software (cat4000-I5S-M), Version 12.2(18)EW4, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2005 by cisco Systems, Inc.
Com
SNMPv2-MIB::sysObjectID.0 SNMPv2-SMI::enterprises.9.1.502
DISMAN-EVENT-MIB::sysUpTimeInstance 122:19:10:46.16
SNMPv2-MIB::sysContact.0 012345
SNMPv2-MIB::sysName.0 name
SNMPv2-MIB::sysLocation.0 London,uk,emea
In my code I can parse each line of the output and split it on the first space which works until I get a multiline response like the sysDescr OID above. It would be great if there was some way to actually print \n in the response instead of a real new line.