Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
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?
# 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
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).