You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Andor Molnar (Jira)" <ji...@apache.org> on 2020/01/06 11:58:00 UTC

[jira] [Comment Edited] (ZOOKEEPER-3646) Executing multiple commands non-interactively with the C client cli

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

Andor Molnar edited comment on ZOOKEEPER-3646 at 1/6/20 11:57 AM:
------------------------------------------------------------------

This would be a very nice feature for the Java client too.


was (Author: andorm):
This would be a very nice for the Java client too.

> Executing multiple commands non-interactively with the C client cli
> -------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-3646
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3646
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: c client
>            Reporter: Mate Szalay-Beko
>            Priority: Major
>
> With the current C CLI client, we can execute a single command, using the {{--cmd}} option.
>  However, when one wants to execute multiple commands in a session from a bash script, he can not really do this now.
> The idea is to allow to execute a command file, where ZooKeeper C client CLI commands are specified in each line. It would be also great to support to read the commands from the standard input, so one is able to use standard unix pipes to channel commands to the zookeeper client. This would allow more dynamic generation of commands from scripts.
> What about the following syntax?
> {code:bash}
> # execute a single command (this is working now)
> cli_mt --host localhost:2181 --cmd 'ls /zookeeper'
> # new: execute a list of commands specified in a file
> cli_mt --host localhost:2181 --cmd ./zk_commands.txt
> # new: read the commands from stdin 
> cat ./zk_commands.txt | cli_mt --host localhost:2181 --cmd
> {code}
> Or if it is easier / nicer, we can add a new parameter and not use {{--cmd}} for the last two cases.
> Please assign the ticket to yourself if you start working on it (or leave a comment).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)