zsh-users
 help / color / mirror / code / Atom feed
From: Eike von Seggern <eikevons@yahoo.de>
To: zsh-users@zsh.org
Subject: Re: Having random output from a file
Date: Tue, 3 Apr 2012 12:23:05 +0200	[thread overview]
Message-ID: <20120403102304.GA12996@matzbach> (raw)
In-Reply-To: <20120402191933.5608a936@internecto.net>

On Mon, Apr 02, 2012 at 19:19 +0200, Mark van Dijk 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.

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.

Best
    eike


  parent reply	other threads:[~2012-04-03 11:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 17:19 Mark van Dijk
2012-04-02 17:25 ` Mikael Magnusson
2012-04-02 20:10   ` Mark van Dijk
2012-04-03 10:23 ` Eike von Seggern [this message]
     [not found] ` <20120403102304.GA12996__48421.5200799101$1333452094$gmane$org@matzbach>
2012-04-03 18:08   ` Christian Neukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120403102304.GA12996@matzbach \
    --to=eikevons@yahoo.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).