Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!munnari.oz.au!comp.vuw.ac.nz!massey!ARaman From: ARaman@massey.ac.nz (A.V. Raman) Newsgroups: comp.unix.questions Subject: How does man know? Keywords: thanks Message-ID: <350@massey.ac.nz> Date: 2 Oct 89 00:34:06 GMT Reply-To: ARaman@massey.ac.nz (A.V. Raman) Organization: Massey University, Palmerston North, New Zealand Lines: 49 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@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@massey.ac.nz Ph: +64-63-69099 x7943 NZ = GMT + 12