9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] man! play nice.
@ 2005-09-17  2:42 erik quanstrom
  2005-09-17 15:04 ` Russ Cox
  0 siblings, 1 reply; 5+ messages in thread
From: erik quanstrom @ 2005-09-17  2:42 UTC (permalink / raw)
  To: 9fans

gnu man was leaving bird droppings on my acme win windows;
p9p man doesn't do system man pages. so...

(the sed has ^h after the _ and before the ., in case mail
mangles the script.)

bugs; this script should have -[u9] switches to force one
or the other.

#!/usr/local/bin/rc
u_man=/usr/bin/man
9_man=$PLAN9 ^ /bin/man

fn do_u_man {
	args=()

	for (i in $*){
		if (~ $i -P){
			args=($args -t)
		} else {
			args=($args $i)
		}
	}

	if (~ -t $args) {
		$u_man $args | psv -
	} else {
		$u_man $args | sed 's///gi
s.//g'
	}
}
	
if (~ $PLAN9 ()){
	do_u_man $*
} else {
	$9_man $* >[2] /dev/null || do_u_man $* |cat
}


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

end of thread, other threads:[~2005-09-17 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-17  2:42 [9fans] man! play nice erik quanstrom
2005-09-17 15:04 ` Russ Cox
2005-09-17 19:37   ` erik quanstrom
     [not found]   ` <20050917162800.6D27E1783D7@dexter-peak.quanstro.net>
2005-09-17 20:49     ` Russ Cox
2005-09-17 23:26       ` erik quanstrom

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