D. Allen [CGL]" <idallen@watcgl.waterloo.edu> (01/30/91)
Another Ultrix bug I thought would have been fixed years ago. % set x=`stty speed` stty: : Not a typewriter This happens because stty normally does its ioctl's on stdout and prints on stderr. The other Unix systems I use are smart enough to fiddle with the units so that you can use `stty speed` to actually find out the baud rate of your tty in a shell script. You'll find that no combination of i/o redirection (even using units in /bin/sh) will work on Ultrix. This has been broken since at least Ultrix 2.1. I made the obvious fix when we had Ultrix 3.1 source. I guess I'll make the same fix on Ultrix 4.1. Never get Unix without source! -- -IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu [129.97.128.64] Computer Graphics Lab/University of Waterloo/Ontario/Canada
christos@batcomputer.tn.cornell.edu (Christos S. Zoulas) (01/31/91)
Doesn't that work? set speed=`sh -c "stty everything 2>&1 > /dev/tty" | \\ fgrep 'baud' | sed -e 's/ baud.*//' -e 's/.* //'` christos -- +------------------------------------------------------------------------+ | Christos Zoulas | 389 Theory Center, Electrical Engineering, | | christos@ee.cornell.edu | Cornell University, Ithaca NY 14853. | | christos@crnlee.bitnet | Phone: (607) 255 0302 | Fax: (607) 254 4565 |
christos@theory.tn.cornell.edu (Christos S. Zoulas) (02/28/91)
In article <1991Jan30.073059.19868@watcgl.waterloo.edu> idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL]) writes: >Another Ultrix bug I thought would have been fixed years ago. > > % set x=`stty speed` > stty: : Not a typewriter > >This happens because stty normally does its ioctl's on stdout and prints >on stderr. The other Unix systems I use are smart enough to fiddle with >the units so that you can use `stty speed` to actually find out the baud >rate of your tty in a shell script. You'll find that no combination of >i/o redirection (even using units in /bin/sh) will work on Ultrix. This is not true... % set x=`sh -c "stty everything 2>&1 > /dev/tty" | awk '{ if ( $1 == "speed" ) print( $2 ); }'` christos -- +------------------------------------------------------------------------+ | Christos Zoulas | 389 Theory Center, Electrical Engineering, | | christos@ee.cornell.edu | Cornell University, Ithaca NY 14853. | | christos@crnlee.bitnet | Phone: (607) 255 0302 | Fax: (607) 254 4565 |