How does man know?

A.V. Raman ARaman at massey.ac.nz
Mon Oct 2 10:34:06 AEST 1989


Thanks for the overwhelming response for my question -
How does man know?

Thanks goes to the following persons and also to those whose mail
I haven't yet received.

Tim Olson, Advanced Micro Devices
Barry Margolin, Thinking Machines Corp
bill davidsen, GE
Jeff Beadles, Utek Engineering, Tektronix Inc.
Eduardo Krell, AT&T Bell Laboratories, Murray Hill, NJ
Frank W. Peters, Mississippi State University
Michael A. Thompson, Iotek Inc
bob, Omni
David Goodenough,             +---+
keenan royle, Indiana University, Bloomington
guy at auspex.com
bill, FPS Computing Inc.

The answer is that man uses the isatty (fd) call to find out
whether output is going to a tty or not.

Special thanks goes to Barry Margolin of Thinking Machines Corp. who points
out also, that the Unix philosophy is not so much transparency as simplicity
and convenience, and programs should rather be easier to use than 'chaste'.

I'm taking the liberty of quoting him:
> Personally, I like it when programs
> "do the right thing" without requiring everyone to write aliases and
> shell scripts.  Would you ever NOT want to page the output of "man"
> when you're reading it on your terminal?  If everyone would have to
> write an alias that looked like "man !* | more", it makes good sense
> for "man" to do it automatically.
-- 

I guess this is the opinion of BWK himself (The Unix programming
environment, ch3.2:
  > A digression on echo:
  ...
  > Since a program should by default execute its most comonly used
  > function, the real echo appends the final newline automatically.)

                                          - anand, Massey Univ., NZ.


-- 
/*----------------------------------------------------------------------*/
Anand Venkataraman - Systems group, Computer Center, Massey University,
Palmerston North, New Zealand
INTERNET: A.Raman at massey.ac.nz  Ph: +64-63-69099 x7943  NZ = GMT + 12



More information about the Comp.unix.questions mailing list