shell script implementation of man

Matthew Hiles matthew.hiles at gmail.com
Wed Nov 19 19:03:12 UTC 2008


On Wed, Nov 19, 2008 at 1:11 PM, Cathey, Jim <jcathey at ciena.com> wrote:
> One more optimization it needs, it should check
> to see that stdout is a tty and only run the
> pager if it is, else cat.  ("man foo >foofile")
> -- Jim

hm.. well the easiest way to code this in is to add a line after the
line that checks to see if PAGER is set. I.E.

[ -z $PAGER ] && PAGER=less
tty -s <&1 || PAGER=cat
#okay, found the page, try decompressing and displaying


Admittedly it's not the efficient way, but it was the first thing that
popped into my head.
~Matthew Hiles



More information about the busybox mailing list