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

Re: Having random output from a file



On Mon, 2 Apr 2012 19:25:32 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:

> On 2 April 2012 19:19, Mark van Dijk <lists+zsh@xxxxxxxxxxxxxx> wrote:
> > Hello,
> >
> > I have a file that contains quotes that are separated by a blank
> > line. Can zsh help me to randomly output a quote from that file or
> > should I use awk, or grep or so? Should the first quote be prefaced
> > by a blank line?
> >
> > Thanks for helping me,
> > -Mark.
> 
> Are you trying to reinvent fortunes? Just separate the quotes by a
> line that has a % on it and you can use fortunes directly. :)
> 

Oh yes, good plan indeed. When I was reading Voltaire on wikiquotes I
couldn't resist sharing his wisdom. In (t)his regard it is remarkable
both how little has changed through the years and how ironic each quote
appears to be under this email. :-)

-- 
It is difficult to free fools from the chains they revere.
  -- Voltaire, 'Le dîner du comte de Boulainvilliers' (1767)



Messages sorted by: Reverse Date, Date, Thread, Author