9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] History
@ 2000-11-09 18:34 rob pike
  2001-01-03 20:57 ` [9fans] Need the CS Troff Font to Print the Sam Tutorial Mark C. Otto
  2001-08-30 14:58 ` [9fans] How to use POP3 as Part of upas/fs Mark Otto
  0 siblings, 2 replies; 5+ messages in thread
From: rob pike @ 2000-11-09 18:34 UTC (permalink / raw)
  To: 9fans

Now that you've recovered your breath from laughing uproariously at my
joke this morning - oh, was that politics you were laughing at?  sorry
- anyway, here's what I do for history.  I've sent them before but I
keep tweaking them and maybe it's time to send them again.  You need
to fix the pattern to match your prompt.  It's an exercise for the
reader to see how they work and how to use them.  Based on an idea
from rsc, I think.  I hardly ever use them when I have a mouse, but if
I'm stuck with a nipple-mouse I use them a lot.

-rob

% cat /bin/"
#!/bin/rc

rfork en

if(test -r /mnt/acme/acme/body)
	bind /mnt/acme/acme/body /dev/text

PROMPT='[^ 	]*%+[ 	]+'

fn cmds {
	grep '^'$PROMPT'[^"]' /dev/text | sed 's/^/	/'
}

switch($#*) {
case 0
	cmds | tail -1
case *
	cmds | grep '^	'$PROMPT^$"* | {echo; cat} |
		pr -t -n | sort -nr | sort -u +1 | sort -n |
		sed 's/^ *[0-9]+	//' | grep .
}

# the silly {echo; cat} gets around pr printing "empty file" when
# presented with no input.
% cat /bin/""
#!/bin/rc

rfork e

PROMPT='[^ 	]*%+[ 	]+'

_x = `{" $* | tail -1}
if(~ $#_x 0) {
	echo no such command found
	exit notfound
}

echo $_x
_x=`{ echo -n 'eval '; echo $_x | sed 's/^'$PROMPT'//'}
rc -c $"_x
% 



^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [9fans] Need the CS Troff Font to Print the Sam Tutorial
@ 2001-01-03 21:00 rob pike
  2001-01-03 21:29 ` Mark C. Otto
  0 siblings, 1 reply; 5+ messages in thread
From: rob pike @ 2001-01-03 21:00 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

Use something distinctive.  I think CS was slanted CW, long lost, intended
to represent input.   Even B would do.

-rob


[-- Attachment #2: Type: message/rfc822, Size: 2112 bytes --]

From: "Mark C. Otto" <Mark_Otto@FWS.Gov>
To: 9fans@cse.psu.edu
Subject: [9fans] Need the CS Troff Font to Print the Sam Tutorial
Date: Wed, 03 Jan 2001 15:57:44 -0500
Message-ID: <3A539248.72027134@FWS.Gov>

I was trying to troff the sam tutorial in /sys/doc/sam but found that it does
not have the CS font in /sys/lib/troff/font/devutf/.  I verified it does not
come with the distribution.  Could someone tell me where I could:  (1) download
the font, (2) find a reasonable substitute for it, or (3) find another tutorial
or set of example beyond the document and manual.  Not surprisingly, sam is so
much easier to do multi-line edits than sed, but there's a lot of potential I am
missing.

Thanks for any help.
Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-08-30 14:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-09 18:34 [9fans] History rob pike
2001-01-03 20:57 ` [9fans] Need the CS Troff Font to Print the Sam Tutorial Mark C. Otto
2001-08-30 14:58 ` [9fans] How to use POP3 as Part of upas/fs Mark Otto
2001-01-03 21:00 [9fans] Need the CS Troff Font to Print the Sam Tutorial rob pike
2001-01-03 21:29 ` Mark C. Otto

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).