Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Shell Experts PLEASE

15 views
Skip to first unread message

John

unread,
Sep 13, 2005, 5:35:41 PM9/13/05
to
Hi guys

I have a program and does stdout a mix of characters.

When I created a simple program to test the types of characters I noticed
that the windows shell didn’t handle well the output

The sample program is the one below

echo off

REM the var variable is an example of what the program stdouts

set var=Status: Interface Down 100%: IF-TESTSQL01/65539 [Intel 21140-Based
PCI Fast Ethernet Adapter (Generic)] [10.255.255.152]


REM here I capture the STDOUT to another variable called Out
REM if the for /f line doesn’t run then program bop_cmd program will not
complete

for /f "Tokens=*" %%a in ('bop_cmd -f c:\gencr.frg "gencr("""%var%""",
"""%CIID%""","""""","""""", """""", """""","""""", """""", """""","""""",
"""""", """%SM_OBJ_Severity%""", """INCIDENT""")"') do set Out=%%a


REM here I just try to echo out the information and this is the stdout I get

echo %var%


C:\>testvar.bat REM name of simple batch to test

C:\>echo off
] was unexpected at this time.
C:\>

Any help on how I can escape characters or wrap them in such a way that it
will not stop the script from running the next line

samee...@gmail.com

unread,
Mar 2, 2013, 3:46:20 PM3/2/13
to
I know its a very long time that you had posted this.
Have you done any scripting to open tickets using cmd line into ca service desk ?

-Sameer
samee...@gmail.com
0 new messages