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

Edward Ribeiro commented on ZOOKEEPER-1535:
-------------------------------------------

I didn't provide any tests because it requires the use of zkCli.sh and I didn't 
find any test using it. I simulated and checked my fix iteratively. How do I 
justify this? Remember, I am the n00b here. :) 

The steps I followed to simulate and fix the bug were:
1. start zkCli.sh
2. Type one or more commands (ls, history, etc) and then press CTRL+D. It 
should reexecute the last command I issued;
3. After applying the patch, I re-execute steps 1-2, but it closes the 
connection and leaves the CLI without executing the latest command a second 
time. 

Besides, the two patches I've uploaded are different fixes of the same problem. 
I think the first version is the better, but I would like to hear what you 
think about it.

Thanks,
Ed
                
> 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
>            Assignee: Edward Ribeiro
>              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

Reply via email to