[net.unix] Csh and stty

dave@utcsrgv.UUCP (Dave Sherman) (08/10/84)

In article <895@trwrb.UUCP> simpson@trwrb.UUCP (Scott Simpson) writes:
~| 
~| 	Here is an interesting anamoly of the C shell and the way it
~| forks off processes.  When you type "stty everything", you get what
~| you expect: the state of your terminal using the new tty driver.
~| When you type "stty everything | more", you get the (confused) old
~| terminal driver.

Sorry, that has nothing whatsoever to do with the way csh forks off
processes. You'll get the same reponse with sh. "stty" sends its
information to stderr, and by default looks on stdout to determine
what the settings are. When you type "stty | more", stty looks down
a pipe, finds no terminal there (and does its best) and puts the
information on the diagnostic output.

Incidentally, it's because stty looks on stdout and writes on stderr
that the way to find out the speed or other parameters of a user on
"ttyx" is the rather curious
	stty > /dev/ttyx


Dave Sherman
Toronto
-- 
 {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave

barmar@mit-eddie.UUCP (Barry Margolin) (08/13/84)

I use Uniplus+ System III, and here "stty" looks at stdin, NOT stdout.
It prints its output on stdout.  This seems like a much more reasonable
arrangement.  There is an option (-g) which makes it output an octal
string that can be used as input for another stty.  Since it outputs on
stdout, this can be used as
	OLDMODES=`stty -g`
	stty ...
	....
	stty $OLDMODES
-- 
    Barry Margolin
    ARPA: barmar@MIT-Multics
    UUCP: ..!genrad!mit-eddie!barmar

gwyn@BRL-VLD.ARPA (08/19/84)

From:      Doug Gwyn (VLD/VMB) <gwyn@BRL-VLD.ARPA>

For collectors of UNIX differences:

UNIX System III/V "stty" reports on the modes of the terminal on
its standard INPUT, with the report written on the standard OUTPUT,
whereas 7th Edition/BSD "stty" reports on the modes of the terminal
on its standard OUTPUT, with the report written on the standard ERROR.

No comment on the relative worth of the designs, just a warning that
they do differ.