Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with termmsg command

Status
Not open for further replies.

pyutian

IS-IT--Management
Dec 10, 2003
58
0
0
US
I am haveing an issue with the output of termmsg. My goal is to assign logical names to route lists in my switch. The problem I am haveing is the "][" at the begining of each line as seen below.

][DSC 2221
][FLEN 0
][DSP LSC
][Unassigned RAN
][NPA
][NXX
][DSC 2222
][FLEN 0
][DSP LSC
][Unassigned RAN
][NPA
][NXX
][DSC 2223
][FLEN 0
][DSP LSC
][Unassigned RAN
][NPA
][NXX
][DSC 2224
][FLEN 4
][DSP LSC
][Poway
][NPA
][NXX

Here is the code:

proc main
while 1
when target 0 "^M" call lpnum
endwhile
endproc



proc lpnum
string DataVal
set aspect RXDATA ON
while 1
while $RXDATA
rget DataVal
strreplace DataVal "RLI 7" "Unassigned RAN"
strreplace DataVal "RLI 12" "Poway"
strreplace DataVal "RLI 20" "Site 16"
strreplace DataVal "RLI 16" "Site 9"
strreplace DataVal "RLI 22" "Site 23"
strreplace DataVal "RLI 18" "Bldg 90"
strreplace DataVal "RLI 27" "Site 1"
strreplace DataVal "RLI 23" "Bldg 87"
;strreplace DataVal "`n" " "
;strreplace DataVal "^M" " "
strreplace DataVal "][" " "
strreplace DataVal "`f" " "
strreplace DataVal "`t" " "
strreplace DataVal "`v" " "
strreplace DataVal "`b" " "
termmsg "[%s]" DataVal
;endif
endwhile
endwhile
endproc

Any help would be appreciated

Thanks
 
Could you post an example of a string you would be working with? I did not see this problem when I ran a test string through your script, so I'm guessing it is data-dependent.

 
Knob, once I get back to the office.. I'm out for a couple of days
 
Knob, how would I capture the string?
 
The string basically is what I posted above without the ][. I have a feeling that these are some sort of line feed or CR, but I thought I took care of those with my strreplace statements.
 
Knob, I figured it out and feel pretty stupid! I put the ][ in the string myself with this: termmsg "[%s]" DataVal...Took the [ and ] out of the quotes and whammo it works! Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top