You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Edward Ribeiro (JIRA)" <ji...@apache.org> on 2012/12/29 18:42:12 UTC
[jira] [Updated] (ZOOKEEPER-1535) ZK Shell/Cli re-executes last
command on exit
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Edward Ribeiro updated ZOOKEEPER-1535:
--------------------------------------
Attachment: ZOOKEEPER-1535-2.patch
ZOOKEEPER-1535-1.patch
I am submitting two mutually exclusive patches for your consideration:
1. The first one just removes the snippet of code I cited previously, but I would be really glad if you could analyse it and see if it's safe to remove or not. I didn't see any counterexample for not getting rid of it.
2. The second one is a 'hack' that populates the 'dirty' cl object by a "quit" command when leaving the loop, so that it can at least close the connection on ctrl+d. My favorite is the first one, but I left it up to you to decide if any of them is worth committing.
> ZK Shell/Cli re-executes last command on exit
> ---------------------------------------------
>
> Key: ZOOKEEPER-1535
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1535
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Environment: zookeeper-3.4.3 release
> Reporter: Stu Hood
> Labels: cli, shell, zkcli, zkcli.sh
> Attachments: ZOOKEEPER-1535-1.patch, ZOOKEEPER-1535-2.patch
>
>
> In the ZK 3.4.3 release's version of zkCli.sh, the last command that was executed is *re*-executed when you {{ctrl+d}} out of the shell. In the snippet below, {{ls}} is executed, and then {{ctrl+d}} is triggered (inserted below to illustrate), the output from {{ls}} appears again, due to the command being re-run.
> {noformat}
> [zk: zookeeper.example.com:2181(CONNECTED) 0] ls /blah
> [foo]
> [zk: zookeeper.example.com:2181(CONNECTED) 1] <ctrl+d> [foo]
> $
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira