× 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.



makes sense...thanks Scott...

On 6/19/2012 5:32 PM, Scott Klement wrote:
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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.