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; 4+ 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] 4+ messages in thread
* Re: [9fans] How to use POP3 as Part of upas/fs
@ 2001-08-30 19:16 Russ Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Russ Cox @ 2001-08-30 19:16 UTC (permalink / raw)
  To: 9fans

try upas/fs -f '/pop/mysmtpserver/first last'
(not /pop3/.  it changed to be consistent
with /apop/ not /apop3/.)



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

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

Thread overview: 4+ 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-08-30 19:16 Russ Cox

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