You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jan Høydahl (JIRA)" <ji...@apache.org> on 2017/03/16 09:39:41 UTC

[jira] [Comment Edited] (SOLR-10108) bin/solr script recursive copy broken

    [ https://issues.apache.org/jira/browse/SOLR-10108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15927043#comment-15927043 ] 

Jan Høydahl edited comment on SOLR-10108 at 3/16/17 9:39 AM:
-------------------------------------------------------------

Thanks, putting the {{/}} at the end of the src path (no asterisk) did the trick.

bq. The problem I remember having was that the shell gets in there and expands the '/tmp/*' form and gives me a list of the children of tmp that makes parsing the parameters "interesting".
To avoid the shell parsing the {{\*}}, you can quote just that part, such as {{"/tmp/zoo/\*"}} and it will be passed as-is to the script. But that's when you get the error
{noformat}
ERROR: Path /tmp/zoo/* does not exist
{noformat}
So we have an option to look for a local path ending with {{/*}}, and then simply remote the trailing asterisk - which will mimic the intention of the user. We could of course also try to detect whether there are more than two arguments after {{cp}}, i.e. something else than src and dst, and in such case print a help message that instead of calling out the 3rd unexpected argument as the problem, instead print a help like
{noformat}
ERROR: Too many arguments for command "cp". Note that the src and dst arguments do not support wildcard characters.
{noformat}


was (Author: janhoy):
Thanks, putting the {{/}} at the end of the src path (no asterisk) did the trick.

bq. The problem I remember having was that the shell gets in there and expands the '/tmp/*' form and gives me a list of the children of tmp that makes parsing the parameters "interesting".
To avoid the shell parsing the {{*}}, you can quote just that part, such as {{"/tmp/zoo/*"}} and it will be passed as-is to the script. But that's when you get the error
{noformat}
ERROR: Path /tmp/zoo/* does not exist
{noformat}
So we have an option to look for a local path ending with {{/*}}, and then simply remote the trailing asterisk - which will mimic the intention of the user. We could of course also try to detect whether there are more than two arguments after {{cp}}, i.e. something else than src and dst, and in such case print a help message that instead of calling out the 3rd unexpected argument as the problem, instead print a help like
{noformat}
ERROR: Too many arguments for command "cp". Note that the src and dst arguments do not support wildcard characters.
{noformat}

> bin/solr script recursive copy broken
> -------------------------------------
>
>                 Key: SOLR-10108
>                 URL: https://issues.apache.org/jira/browse/SOLR-10108
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Erick Erickson
>            Assignee: Erick Erickson
>         Attachments: SOLR-10108.patch, SOLR-10108.patch
>
>
> cp /r zk:/ fails with "cannot create //whatever".



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org