You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Chris Nauroth (JIRA)" <ji...@apache.org> on 2013/11/07 07:55:20 UTC

[jira] [Updated] (HADOOP-9660) [WINDOWS] Powershell / cmd parses -Dkey=value from command line as [-Dkey, value] which breaks GenericsOptionParser

     [ https://issues.apache.org/jira/browse/HADOOP-9660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Nauroth updated HADOOP-9660:
----------------------------------

    Fix Version/s:     (was: 2.3.0)
                   2.2.1

I merged to branch-2.2 for inclusion in the 2.2.1 release.  Thanks again for this patch, Enis.

> [WINDOWS] Powershell / cmd parses -Dkey=value from command line as [-Dkey, value] which breaks GenericsOptionParser
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-9660
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9660
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: scripts, util
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>             Fix For: 3.0.0, 1-win, 2.2.1
>
>         Attachments: hadoop-9660-branch1_v1.patch, hadoop-9660-branch1_v2.patch, hadoop-9660-branch1_v3-addendum.patch, hadoop-9660-branch1_v3.patch, hadoop-9660-branch2_v1.patch, hadoop-9660-branch2_v2.patch, hadoop-9660-branch2_v3.patch
>
>
> When parsing parameters to a class implementing Tool, and using ToolRunner, we can pass 
> {code}
> bin/hadoop <tool_class> -Dkey=value 
> {code}
> However, powershell parses the '=' sign itself, and sends it to  java as ["-Dkey", "value"] which breaks GenericOptionsParser. 
> Using "-Dkey=value" or '-Dkey=value' does not fix the problem. The only workaround seems to trick PS by using: 
> '"-Dkey=value"' (single + double quote)
> In cmd, "-Dkey=value" works, but not '"-Dkey=value"'. 
> http://stackoverflow.com/questions/4940375/how-do-i-pass-an-equal-sign-when-calling-a-batch-script-in-powershell



--
This message was sent by Atlassian JIRA
(v6.1#6144)