[comp.unix.wizards] What \"isatty\"?

rbj@dsys.icst.nbs.gov (Root Boy Jim) (05/25/89)

? From: Chris Torek <chris@mimsy.uucp>

? In article <2421@Portia.Stanford.EDU> joe@hanauma (Joe Dellinger) writes:
? >	I have a graphics driver program which has 2 basic behaviours.
? >If you do
? >	pspen < plot.data > file
? >it writes postscript code to "file". If you do
? >	pspen < plot.data
? >it spools the postscript for you.

? Yuck.

? Programs that produce output should produce the output to stdout.

I agree completely, Chris. Now get cracking on `cc', so that
`cc prog.c' writes to stdout instead of `a.out' :-)

? In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
? Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

	Root Boy Jim is what I am
	Are you what you are or what?

jiii@visdc.UUCP (John E Van Deusen III) (05/27/89)

In article <19756@adm.BRL.MIL> rbj@dsys.icst.nbs.gov (Root Boy Jim) writes:
>
> I agree completely, Chris. Now get cracking on `cc', so that
> `cc prog.c' writes to stdout instead of `a.out' :-)

	$ cat xxx > xxx
	cat: input xxx is output

Oh thank you for saving me from my stupid error Mr. cat(1)!  I guess
I am under too much pressure to finish this work before the deadline.

	$ cat xxx
	$

Mere humans can not be trusted to I/O redirection.  It is simply a
matter of time until even the best and brightest of us screw up.  To
efficiently use Unix, the standard output has to be redirected, but if
at all possible, the place to redirect the output is within the
executable:

	...
	test $STATUS = $COPACETIC && exec 1>precious.dat
	...
--
John E Van Deusen III, PO Box 9283, Boise, ID  83707, (208) 343-1865

uunet!visdc!jiii