get terminal speed from shell script

Gerry Roderick Singleton gerry at jts.com
Mon Aug 20 12:05:10 AEST 1990


In article <12584 at hydra.gatech.EDU> gt0178a at prism.gatech.EDU (BURNS,JIM) writes:
>in article <1990Aug14.181010.29571 at jts.com>, gerry at jts.com (Gerry Roderick Singleton ) says:
>> #! /bin/sh
>> 
>> speed=`stty speed </dev/tty 2>&1`
>> echo $speed
>
>Nope, on SunOS 4.0, you get:
>
>{richsun12:/usr}
>[196] t=`stty speed </dev/tty 2>&1`
>{richsun12:/usr}
>[197] echo $t
>stty: Operation not supported on socket
>{richsun12:/usr}
>[198]
>-- 

Yup, you sure do but the following works on SunOS3.5, SunOS 4.0.3x, BSD4.3(isi)
and SPARC 4.1:

#! /bin/sh
speed= eval 'stty speed'
echo $speed


Have fun,
ger
-- 
--
G. Roderick Singleton, System and Network Administrator, JTS Computers 
	{uunet | geac | torsqnt}!gerry at jtsv16.jts.com



More information about the Comp.unix.questions mailing list