get terminal speed from shell script

Bob McGowen x4312 dept208 bob at wyse.wyse.com
Tue Aug 14 11:21:24 AEST 1990


In article <90Aug12.135618edt.18763 at me.utoronto.ca> sun at hammer.me.UUCP (Andy Sun Anu-guest) writes:
  >Hi Net,
  >
  >The question I have is:
  >
  >Is there a way to get the terminal speed from a (sh or csh) script?
  >
  >I used to be able to do the following in a Bourne shell script:
  >
  >			speed=`stty speed`
  >
  >and got the terminal speed assigned to variable speed. As various OS
  >gets updated (e.g. Ultrix 3.1 and SUN OS 4.0.3), this won't work anymore
  >because all stty outputs are being sent to stderr, not stdout, thus no
  >piping or redirection is possible. Is there any similar commands that can 
You CAN still cause redirection to occur.
  >get terminal speed inside a shell script?

I just tried the following:

   date>date.data
   echo 'echo date.data >&2 # sends file name to standard error' > errout
   chmod +x errout
   cat `errout` # date.data appeared on screen, cat read terminal
   		# this is the expected result
   cat `errout 2>&1` # the date stored in the file was cat'ed to the screen

Of course, this is the Bourne shell, not csh.  I cannot vouch for how or if
this is possible with csh.

Bob McGowan  (standard disclaimer, these are my own ...)
Product Support, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob at wyse.com



More information about the Comp.unix.wizards mailing list