9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] missing ed's line numbering in sam -d
Date: Thu, 23 Apr 2009 11:17:20 -0400	[thread overview]
Message-ID: <197a3463cec5dc91af55851cbcb841d0@quanstro.net> (raw)
In-Reply-To: <a560a5d00904230803r1260687cr6cf70d941c25a954@mail.gmail.com>

you can do this in sam with an external program

; cat /bin/nl
#!/bin/rc

if(~ $#* 0)
	awk '{printf("%4d %s\n", ++lineno, $0);}'
if not for(i)
	awk '{printf("%4d %s\n", ++lineno, $0);}' < $i
; sam -d /lib/volcanoes
1,10>nl
   1 This nice little file came from the Smithsonian.
   2 Doug McIlroy
   3
   4                           SMITHSONIAN INSTITUTION
   5                          GLOBAL VOLCANISM PROGRAM
   6                      NHB MRC 119, Washington, DC 20560
   7
   8                        VOLCANOES OF THE WORLD - 1992
   9
  10
!

- erik



  reply	other threads:[~2009-04-23 15:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 15:03 Rudolf Sykora
2009-04-23 15:17 ` erik quanstrom [this message]
2009-04-23 15:34   ` roger peppe
2009-04-23 15:42     ` erik quanstrom
2009-04-23 16:04       ` roger peppe
2009-04-23 16:12         ` erik quanstrom
2009-04-23 16:34           ` John Stalker
2009-04-28 22:37 ` Russ Cox

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=197a3463cec5dc91af55851cbcb841d0@quanstro.net \
    --to=quanstro@quanstro.net \
    --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).