Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Most frequent history words
- X-seq: zsh-users 21500
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Most frequent history words
- Date: Wed, 27 Apr 2016 11:14:07 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <160426123958.ZM11898@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCmE-pnDQNCJWS91id7=L+x4M8+q5oLd076AcVgOYHf7A@mail.gmail.com> <160425124932.ZM7571@torch.brasslantern.com> <CAKc7PVDo3gGK5LMpvKneF+biqizrqVuXOu9mPAkXOr1K_pEfHg@mail.gmail.com> <160426123958.ZM11898@torch.brasslantern.com>
On 26 April 2016 at 21:39, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author