[comp.sys.sun] `stty speed` problem under 4.0 ??

eho@bogey.princeton.edu (Eric Y.W. Ho) (06/28/89)

Does anyone has this problem under 4.0.1 (on Sun-3's & Sun-4's) ?

	cognito-root(3)-[/]: set xyz = `stty speed`
	stty: Operation not supported on socket

It doesn't seem matter if you're doing this on a CRT terminal (I'm using a
Wyse-50) or you're doing this in suntools.

I'm using csh and has this in my .login file :-

	stty dec
	set crt=24
	set noglob
	eval `tset -sQ -m su:avt -m wy50:wy50 -m sun:sun -m :?weirdo`
	unset noglob
	set notify filec

However, if you just do 'stty speed' (i.e. without the back-quote) then it
is fine.  Strange .... ?  Did I do something wrong ?

--

regards.

-eric-

maart@uunet.uu.net (Maarten Litmaath) (07/11/89)

eho@bogey.princeton.edu (Eric Y.W. Ho) writes:
\Does anyone has this problem under 4.0.1 (on Sun-3's & Sun-4's) ?
\
\	cognito-root(3)-[/]: set xyz = `stty speed`
\	stty: Operation not supported on socket [...]

The output of the `backquote sub-shell' is connected with the parent
through a pipe (read: a socket).  The `stty' command is performing calls
to ioctl(2) on stdout, which isn't a terminal in this case. The output of
stty itself is sent to STDERR.  So, to achieve what you want, you need to
redirect that very stderr into the pipe, i.e. to stdout, and redirect
stdout to your terminal:

	set xyz = "`(stty speed > /dev/tty) |& cat`"
In sh:
	xyz="`stty speed 2>&1 > /dev/tty`"
 
   "... a lap-top Cray-2 with builtin    |Maarten Litmaath @ VU Amsterdam:
cold fusion power supply"  (Colin Dente) |maart@cs.vu.nl, mcvax!botter!maart

dupuy@cs.columbia.edu (07/12/89)

   From: eho@bogey.princeton.edu (Eric Y.W. Ho)
   Newsgroups: comp.sys.sun
   Date: 28 Jun 89 04:54:40 GMT

	   cognito-root(3)-[/]: set xyz = `stty speed`
	   stty: Operation not supported on socket

   However, if you just do 'stty speed' (i.e. without the back-quote) then it
   is fine.  Strange .... ?  Did I do something wrong ?

Try "set xyz = `/usr/5bin/stty speed`.  Works for me.

@alex