quoting and escaping in java @argfiles

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue Aug 8 19:34:08 UTC 2017


The "escape in quotes" rule is meant to simplify the use of file paths 
on Windows, like
     C:\Users\jjg\Desktop
such that you can use \ in a path without having to quote it.

-- Jon

On 08/08/2017 12:24 PM, Roman Shevchenko wrote:
> I see. It didn’t occur to me that the escaping only works inside the 
> quotes.
>
> Back-ticks were meant to enclose the example, Markdown-style.
>
> Thanks!
>
>> On 8. Aug 2017, at 20:36, Jonathan Gibbons 
>> <jonathan.gibbons at oracle.com <mailto:jonathan.gibbons at oracle.com>> wrote:
>>
>> Yes, @-files should support this.
>>
>> Escape sequences are only allowed in quoted strings, and strings can 
>> be quoted with either
>> single or double quotes (' or ").
>>
>> It is not clear from the example in your message whether the 
>> back-ticks (`) were meant to enclose
>> the example or as part of the example.
>>
>> -- Jon
>>
>> On 08/08/2017 11:20 AM, Roman Shevchenko wrote:
>>> Hello,
>>>
>>> is it possible to use @argfiles to pass main class parameters which may
>>> contain any sort of special cases described in [1] (double quotes, 
>>> leading
>>> hash signs, etc.)? A backslash doesn't seem to work as a general escape
>>> symbol - e.g. the line `\#not-a-comment` is still ignored by the 
>>> launcher.
>>>
>>> [1]
>>> https://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-4856361B-8BFD-4964-AE84-121F5F6CF111
>>>
>>
>



More information about the jdk9-dev mailing list