Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Having random output from a file
- X-seq: zsh-users 16977
- From: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Having random output from a file
- Date: Tue, 03 Apr 2012 20:08:39 +0200
- 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: <20120402191933.5608a936@internecto.net> <20120403102304.GA12996__48421.5200799101$1333452094$gmane$org@matzbach>
- Sender: chris@juno
Eike von Seggern <eikevons@xxxxxxxx> writes:
> I use this alias to get a random line from a file (so it would only work
> in your case if each quote is on a single line)
>
> alias rndline='sort -R | head -1'
>
> But it's not using any zsh magic.
If you depend on GNU coreutils anyway, you can just do "shuf -n1".
--
Christian Neukirchen <chneukirchen@xxxxxxxxx> http://chneukirchen.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author