Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Having random output from a file



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