Which is more portable: stty < or stty >

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Mar 13 13:10:39 AEST 1990


In article <3354 at muffin.cme.nist.gov> libes at cme.nist.gov (Don Libes) writes:
>The native SunOS stty(1)  acts on the device that is the current stdout
>while their System V stty acts on the device that is the current stdin.
>In the interest of portability, which is preferable?

The former is the 7th Ed. UNIX and 4BSD behavior.
System V assumes you may want to redirect the output somewhere other
than the terminal being probed.

Your shell scripts could attempt "stty < /dev/tty > /dev/tty" just to
make sure they see the terminal no matter where stdin and stdout point.
(Don't use "stty <> /dev/tty", since most shells don't support <> properly.)



More information about the Comp.unix.wizards mailing list