[dev] sed 10q or sed 11q

From: markus schnalke <meillo_AT_marmaro.de>
Date: Sun, 11 Apr 2010 19:10:36 +0200

We don't need head(1) because we have sed(1). But do we get the first
ten lines with
        sed 10q
or with
        sed 11q
?

I am a bit confused, currently.

All sed implementation I had access to printed 10 lines with 10q. It
were from:
- GNU
- Heirloom (sv3, s42, posix, posix2001)
- SunOS (/usr/bin/sed, /usr/ucb/sed, /usr/xpg4/bin/sed)
- 9base

The man page of 9base's sed even says: ``sed 10q file -- Print the
first 10 lines of the file.''

The Unix Programming Environment also writes: ``So it's easy to write
a sed program that will print the first three (say) lines of its
input, then quit: sed 3q.'' (page 110)

Now I actually must assume, Uriel might be wrong. *eek*

See http://harmful.cat-v.org/software/

But is this possible? Or does it Plan9 different and 9base didn't keep
the semantics? Can someone please check Plan9's sed.

meillo
Received on Sun Apr 11 2010 - 17:10:36 UTC

This archive was generated by hypermail 2.2.0 : Sun Apr 11 2010 - 17:12:03 UTC