Parsing a trap message

buskus@kickapoo.sownmc.state.wi.us
Mon, 30 Dec 1996 12:01:12 -0600 (CST)

Hi,

I have a newbie question. I'm relatively new to tcl and I'm trying to figure
out how to parse a trap message. The trap message has a format:
MIBOID="MIB VALUE" MIBOID="MIB VALUE". I thought that this pattern would have
a llength of 2. However, tcl ignores the quotes and uses the embedded spaces
between the quotes as a delimiter. Hence the llength of the above pattern is
4 with a list that looks like {MIBOID="MIB}{VALUE"}{MIBOID="MIB}{VALUE"}.
Basically I'm trying to get a list that looks like
{MIBOID="VALUE"} {MIBOID="VALUE"}.

I tried reformatting the trap message with a [join [split $val =]], but
then I have a llength of 4 with a list of {MIBOID} {VALUE} {MIBOID} {VALUE}.
I know I can process this list by using a foreach and use a counter to
track if it the list value is odd or even. But I keep thinking there might
be a better way.

Thanks
--------------------------------------------------------------------------
Stan Buskus Telephone: 608 258-2124
State of Wisconsin NMC Email: buskus@kickapoo.sownmc.state.wi.us
316 W. Washington Room 509 "It's hard to let go all that we know."
Madison, WI 53703 N. Finn
--------------------------------------------------------------------------