This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygstart bug: doesn't keep command line arguments intact
- From: John Wiersba <jrw32982 at yahoo dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Sun, 5 Aug 2012 18:58:28 -0700 (PDT)
- Subject: Re: Cygstart bug: doesn't keep command line arguments intact
- References: <1344017509.70947.YahooMailNeo@web161502.mail.bf1.yahoo.com> <1344020282.97348.YahooMailNeo@web161504.mail.bf1.yahoo.com>,<1344021535.36623.YahooMailNeo@web161501.mail.bf1.yahoo.com> <0105D5C1E0353146B1B222348B0411A20A954E0E13@NIHMLBX02.nih.gov> <1344217063.51063.YahooMailNeo@web161502.mail.bf1.yahoo.com> <1344217202.72516.YahooMailNeo@web161503.mail.bf1.yahoo.com>
- Reply-to: John Wiersba <jrw32982 at yahoo dot com>
Thanks for your reply, Barry.? Yes, it seems that way to me, too.? But that seems wrong.? I would think that cygstart should pass arg1 as arg1 to the specified command (winword.exe in my example).? That's certainly the way it works in the unix/linux world and cygstart should be considered as an (emulated) unix command, right?? If cygstart were a Windows command I would expect such behavior, but from an (emulated) unix/linux command, I expect the arguments to be kept intact.?
In any case, it makes it awkward to run the command I mentioned, because I have to parse the arguments myself and perform awkward substitutions on them.
-- John
P.S. I don't know why, but my reply kept getting rejected as spam by cygwin.org's filters, even though I was using yahoo's "plain text" mode:
? Remote host said: 552 spam score exceeded threshold (#5.6.1) [BODY]
>> From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder@niaid.nih.gov>
>>
>>John Wiersba wrote August 03, 2012 3:18 PM
>>>Calling? ? ? ? ? ? ? /c/program\ files/microsoft\ office/office12/winword.exe "a b c.doc" works.
>>>Calling cygstart /c/program\ files/microsoft\ office/office12/winword.exe "a b c.doc" tries to open a.doc, b.doc, and c.doc.
>>
>>In the first, bash strips the quotes and passes <a b c.doc> to winword as arg1.
>>
>>In the second, bash strips the quotes and passes <a b c.doc> to cygstart as arg1.
>>cygstart then passes <a>, <b>, and <c.doc> to winword as arg1, arg2, and arg3.
>>
>>At least that is the way I understand it.
>>Subject to correction by the more knowledgeable.
>>
>>So try protecting your double quotes with single quotes.? E.g. '"a b c.doc"'.
>>I don't know if the double quotes get passed to winword, but there is a lesser
>>chance that single quotes will work if they are on the inside, I doubt MS ever
>>treats
>them as special.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple