9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: markus schnalke <meillo@marmaro.de>
To: 9fans@9fans.net
Subject: [9fans] Duff's rc paper: Why awk?
Date: Fri,  7 Jun 2013 15:02:06 +0200	[thread overview]
Message-ID: <1UkwIw-2xe-00@marmaro.de> (raw)

Hoi,

I've read [0], which is enlightening btw, but there is one thing,
in Section 27, which I don't understand: Why is awk(1) used there?

	fn read{
		$1=`{awk '{print;exit}'}
	}

[0] http://static.tobold.org/rc/rc-duff.html

I rather would have used sed(1), which is less distracting in this
case:

	fn read{
		$1=`{sed q}
	}

This use of awk is unexpected to me, it draws my attention on it,
thus I'm searching for the strange hidden detail that might be
emphasized. (Such as the use of `if not' instead of `else'.) But I
can't find it.

Maybe there is no such hidden detail. Maybe there is no real
reason behind the use of awk here. I'm not really sure ...


meillo



             reply	other threads:[~2013-06-07 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 13:02 markus schnalke [this message]
2013-06-07 13:18 ` erik quanstrom
2013-06-11 12:24   ` Rudolf Sykora
2013-06-11 15:38     ` markus schnalke

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=1UkwIw-2xe-00@marmaro.de \
    --to=meillo@marmaro.de \
    --cc=9fans@9fans.net \
    /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.
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).