You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Candid Dauth (Jira)" <ji...@apache.org> on 2021/01/05 19:52:01 UTC
[jira] [Issue Comment Deleted] (EXEC-36) CommandLine does not work
with double quote or single quote correctly
[ https://issues.apache.org/jira/browse/EXEC-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Candid Dauth updated EXEC-36:
-----------------------------
Comment: was deleted
(was: What's the status of this? When I'm running DefaultExecutor.execute() on Linux, any quotes in my environment variables are getting lost.
This causes frontend-maven-plugin to crash when run inside VS Code, which I have described [here|https://github.com/eirslett/frontend-maven-plugin/issues/951].)
> CommandLine does not work with double quote or single quote correctly
> ---------------------------------------------------------------------
>
> Key: EXEC-36
> URL: https://issues.apache.org/jira/browse/EXEC-36
> Project: Commons Exec
> Issue Type: Bug
> Affects Versions: 1.0
> Environment: Ubuntu 704, JDK1.6
> Reporter: Kai Hu
> Assignee: Siegfried Goeschl
> Priority: Critical
> Attachments: ExecParseUtils.java, ExecParseUtilsTest.java, StringUtils.java
>
>
> Please review and run the following junit test, either apache ant or apache exec does not handle the qoute in the arguments correctly.
> @Test
> public void shouldHandleTheDoubelQuote() throws Exception {
> String commandline = "./script/jrake cruise:publish_installers "
> + "INSTALLER_VERSION=unstable_2_1 "
> + "INSTALLER_PATH=\"/var/lib/ cruise-agent/installers\" "
> + "INSTALLER_DOWNLOAD_SERVER='something'"
> + "WITHOUT_HELP_DOC=true";
> CommandLine line = CommandLine.parse(commandline);
> String[] args = line.getArguments();
> assertThat(args[0], is("cruise:publish_installers"));
> assertThat(args[1], is("INSTALLER_VERSION=unstable_2_1"));
> assertThat(args[2], is("INSTALLER_PATH=\"/var/lib/ cruise-agent/installers\""));
> assertThat(args[3], is("INSTALLER_DOWNLOAD_SERVER='something'"));
> assertThat(args[4], is("WITHOUT_HELP_DOC=true"));
> }
--
This message was sent by Atlassian Jira
(v8.3.4#803005)