[net.bugs.usg] ps problem

guy@rlgvax.UUCP (Guy Harris) (01/31/85)

> Why does:
> 
> 	nohup ps
> 
> fail to produce significant output in nohup.out under AT&T UNIX* 5.2?
> Only the ps header line is output.

Because the command "ps" lists only the processes attached to the "current
terminal", where the "current terminal" is the one which file descriptor
2 refers to.  Since file descriptor 2 is redirected to "nohup.out" by
"nohup", "ps" can't determine what the current terminal is, and so finds
no processes attached to that terminal.  Unfortunately, file descriptor
0 is redirected to /dev/null for background processes in the Bourne
shell, so that won't work (FD1 is also redirected to "nohup.out").

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy