Pull random line from a file

Archaic archaic at comcast.net
Thu Sep 5 20:53:03 PDT 2002


On Thu, Sep 05, 2002 at 10:31:17PM -0500, Kevan Shea wrote:
> On Thu, 5 Sep 2002 20:57:58 -0600, Rob Park <rbpark at ualberta.ca> wrote:
> > 
> > This ought to do it:
> > 
> > rand($.) < 1 && ($line = $_) while <>;
> > 
> > ... OH, you wanted BASH? heh, oops ;)
> > 
> 
> Thanks Larry ;)

HAHAHAHA. That's funny! :D

-- 
Archaic

-- 
The spirit of resistance to government is so valuable on certain
occasions, that I wish it always to be kept alive.  It will often be
exercised when wrong, but better so than not to be exercised at all. I
like a little rebellion now and then.

- Thomas Jefferson, letter to Abigail Adams, 1787


-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message



More information about the lfs-chat mailing list