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

* Re: [9fans] man! play nice.
  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>
  0 siblings, 2 replies; 5+ messages in thread
From: Russ Cox @ 2005-09-17 15:04 UTC (permalink / raw)
  To: erik quanstrom, Fans of the OS Plan 9 from Bell Labs

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

if you're not interested in getting troff output,
you can continue to use the system man by
setting

PAGER=nobs

see cat(1).

russ


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

* Re: [9fans] man! play nice.
  2005-09-17 15:04 ` Russ Cox
@ 2005-09-17 19:37   ` erik quanstrom
       [not found]   ` <20050917162800.6D27E1783D7@dexter-peak.quanstro.net>
  1 sibling, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2005-09-17 19:37 UTC (permalink / raw)
  To: 9fans, rsc

thanks. i didn't think about that.

i have used the postscript output. the script used to correctly
translate for gnu man so the poscript output worked there.

the idea was to get the man page regardless of where it was 
located.

i'd rather man do the  work than type "man <whatever>" 
decide that that's not really what i wanted and then type 
"/usr/bin/man <whatever>".

i don't know how well the script accomplishes this. but that
was the idea, anyway.

erik

Russ Cox <rsc@swtch.com> writes

| 
| > gnu man was leaving bird droppings on my acme win windows;
| > p9p man doesn't do system man pages. so...
| 
| if you're not interested in getting troff output,
| you can continue to use the system man by
| setting
| 
| PAGER=nobs
| 
| see cat(1).
| 
| russ


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

* Re: [9fans] man! play nice.
       [not found]   ` <20050917162800.6D27E1783D7@dexter-peak.quanstro.net>
@ 2005-09-17 20:49     ` Russ Cox
  2005-09-17 23:26       ` erik quanstrom
  0 siblings, 1 reply; 5+ messages in thread
From: Russ Cox @ 2005-09-17 20:49 UTC (permalink / raw)
  To: erik quanstrom; +Cc: 9fans

> i'd rather man do the  work than type "man <whatever>"
> decide that that's not really what i wanted and then type
> "/usr/bin/man <whatever>".

you should put $PLAN9/bin at the end of your path and use 9.
i find it quite reasonable to type "man foo" and get the
unix one and then one i want it i type "9 man foo" to get
the plan 9 one.

russ


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

* Re: [9fans] man! play nice.
  2005-09-17 20:49     ` Russ Cox
@ 2005-09-17 23:26       ` erik quanstrom
  0 siblings, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2005-09-17 23:26 UTC (permalink / raw)
  To: 9fans, rsc; +Cc: 9fans

russ, 

your solution doesn't work if you do "9 man -P man". page will still fail
because it "9 man" will run man with $PLAN9/bin as the first 
element of the path, thus passing on the same to page and then
finding $PLAN9/bin/file before the other one.

erik

Russ Cox <rsc@swtch.com> writes

| 
| > i'd rather man do the  work than type "man <whatever>"
| > decide that that's not really what i wanted and then type
| > "/usr/bin/man <whatever>".
| 
| you should put $PLAN9/bin at the end of your path and use 9.
| i find it quite reasonable to type "man foo" and get the
| unix one and then one i want it i type "9 man foo" to get
| the plan 9 one.
| 
| russ


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