From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Most frequent history words
Date: Wed, 27 Apr 2016 11:14:07 +0200 [thread overview]
Message-ID: <CAKc7PVBr7HWR7kcGm-16uzEsdPtBdQAOQTP4kBeO0XCjbut1ew@mail.gmail.com> (raw)
In-Reply-To: <160426123958.ZM11898@torch.brasslantern.com>
On 26 April 2016 at 21:39, Bart Schaefer <schaefer@brasslantern.com> 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 – 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 – a cache
regenerated periodically:
https://asciinema.org/a/4apqm5hzfz2pgci4u7371ophh
This makes the snippet a fine piece of code in general.
Best regards,
Sebastian Gniazdowski
next prev parent reply other threads:[~2016-04-27 9:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 10:36 Sebastian Gniazdowski
2016-04-25 19:49 ` Bart Schaefer
2016-04-26 11:03 ` Sebastian Gniazdowski
2016-04-26 19:39 ` Bart Schaefer
2016-04-27 9:14 ` Sebastian Gniazdowski [this message]
2016-04-27 15:59 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKc7PVBr7HWR7kcGm-16uzEsdPtBdQAOQTP4kBeO0XCjbut1ew@mail.gmail.com \
--to=sgniazdowski@gmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).