From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15485 invoked by alias); 27 Apr 2016 09:14:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21500 Received: (qmail 9482 invoked from network); 27 Apr 2016 09:14:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VJcJ3XHlLbVC+6kzG63DWZfMeKvZKXF6xS/94Aa7exw=; b=EiiL86GxJHV5i1oIlVkVpeYSXrmM9YT88PJKajbCArKeZLLHP6uNox4nt7zVWdSXdG G2vRKHoqtmDwcjHAar79pmEA6fLYHQ14cUdjLOh6CKiz67euzZ22rOG6Zpeykf/1yD/q lobcg+WMSZolUiVXtxQcwr/IsMZuC6XP8ScIsR5o3LRcdSLfmksYfVxsjUOWXe3WyZ+S 4Tho/XUGHErUVyKynX0XPFuUREC4CEym1HsAeMyealenDUpZm4eOLLGtKoqnHJOyRKct QQQMO+5it/QkN4t9VZ/kipP6xhVbQsLEmDZQ4KSWonH7/N8Lwpz0iHBtBjzz7gjLh1ud a7Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VJcJ3XHlLbVC+6kzG63DWZfMeKvZKXF6xS/94Aa7exw=; b=aN+rDU2IBKkLljR4KPcnAXri89zGljgKYPb/r561qsG2zxBGSI02dBzofAMiuRXynD 69DPVG8feYCea4M0zQzHTbBN+yX6iugWz6PwulLJM8WiZefTmNwh+CtHSgF5icWtDqtb KCKb8J3yZp/HtRcsKHU2APFzWZvOfnwpBPTDA4pcVww4rlxAKgfEeh+NYb6VNB+OiRIE FQXSMK1PXvM05caq7mBF50IdbPBxKI6M6J2p0iv4rrta2/0AWZD+y5d9pBWDMBvDo2Xt f3khBc9bZIDXRwyihcY1INnwzLOyrUOh8pgxCGOBsj7whdgQrT0MnKbiOkMCOf/JdG8l VFZQ== X-Gm-Message-State: AOPr4FWdjr+NW+W7u6Fr1edYOtiJ+2N9JYetSnzN1g6NWM51nBTjZK1shgTx3NwvTLPqmt8JauxBbFOdYWJAhA== X-Received: by 10.112.160.35 with SMTP id xh3mr2986531lbb.86.1461748467108; Wed, 27 Apr 2016 02:14:27 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160426123958.ZM11898@torch.brasslantern.com> References: <160425124932.ZM7571@torch.brasslantern.com> <160426123958.ZM11898@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Wed, 27 Apr 2016 11:14:07 +0200 Message-ID: Subject: Re: Most frequent history words To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 26 April 2016 at 21:39, Bart Schaefer wrote: > On Apr 26, 1:03pm, Sebastian Gniazdowski wrote: > } > } Interesingly, changing ${historywords[@]} to ${history[@]} and > } "${history[@]}" doesn't change script's output, it still outputs most > } frequent words, not history entries. > > I get complete history entries with "${history[@]}" (with or without > the surrounding quotes). Are you sure this isn't being affected by > some other setting such as shwordsplit? True, it does work. I was mislead by the fact that first 10 entries were identical =E2=80=93 commands like "ls", "git", single word stuff. The code is slower than core utils pipeline but I've found a nice way to solve this, wanting to preserve Zsh portability =E2=80=93 a cache regenerated periodically: https://asciinema.org/a/4apqm5hzfz2pgci4u7371ophh This makes the snippet a fine piece of code in general. Best regards, Sebastian Gniazdowski