×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Hi Tim,
On both Unix and DOS, parameters are separated by a space. If you want
to include spaces in your parameter, you need to put them in quotes...
the problem is, the quotes are removed, so when you pass a parameter
to one program (rexec) that in turn will pass it to another program
(Windows command prompt) it's going to go through this quoting process
twice.
In your example, you're doing (pathname and other options removed for
brevity):
rexec host test.bat "a bcdefghiz.com"
What will QShell pass to the "rexec" program? It'll pass 3 parameters:
program = rexec
parm 1 = host
parm 2 = test.bat
parm 3 = a bcdefghiz.com
That works as you expected... the "a bcdefghiz.com" got passed as a
single parameter because you put quotes around them. But, the quotes
were removed once the data was grouped into a single parameter.
Now rexec passes the command string to Windows. On Windows it looks
like this:
test.bat a bcdefghiz.com
Windows then takes this command string and breaks it up based on the
spaces, so you now have this:
program = test.bat
parm1 = a
parm2 = bcdefghiz.com
When test.bat is asked to print it's first parameter (that's what %1
means) the first parameter is just "a".
One workaround in QShell is to put the double quotes inside single
quotes like this:
rexec host test.bat '"a bcdefghiz.com"'
Now when QShell calls rexec, it looks like this:
program = rexec
parm1 = host
parm2 = test.bat
parm3 = "a bcdefghiz.com"
Qshell removed the outer quotes, but left the inner quotes (the single
quotes) intact. Now when rexec passes this string to Windows it looks
like this:
program = test.bat
parm1 = host
parm2 = a bcdefghiz.com
Make sense?
On 6/19/2012 3:55 PM, tim.dclinc@xxxxxxxxx wrote:
im issuing the following command via qsh
rexec -u usertim -p timpass 10.0.0.76
C:\\PROGRA~1\\TRENDM~1\\CLIENT~1\\test.bat "a bcdefghiz.com"
in the bat pgm i echo %1 and get the following:
a
It seems to be cutting off after the "a" rather then taking the entire
string i enclosed in double quotes.
Any idea why this is doing this?
As an Amazon Associate we earn from qualifying purchases.