SUMMARY: stty:TCGETS error when trying to rcp

From: Ricardo Gonzalez (ricardo@divi.com)
Date: Fri Mar 17 1995 - 05:03:48 CST


        Thanks everyone who responded to my request for help. I got quite a large number of responses all with the same solution. My original question was :

> I have a couple of Sun workstations running SunOS 4.1.4. I'm experiencing a problem when I try to remote copy a file from machine A to machine B. The following command returns the specified error message, and the file never gets copied:

> rcp A:/var/yp/aliases .
> stty: TCGETS: Operation not supported on socket

        After removing the "stty erase " from the .cshrc file the problem went away, and I was able to rcp files again. This are some of the responses:

:---------------------------------------------------------------------------
Get that 'stty' command out of the '.cshrc' file. It belongs in '.login'.
From: Neil Rickert <rickert@cs.niu.edu>

:---------------------------------------------------------------------------
Check your .cshrc on the remote machine. If you have an stty command yo have
that problem. Take out the stty command or check for login access.
Look at /usr/lib/Cshrc

# commands for all csh
if (! $?prompt ) exit
#commands for interactive shells

This is because csh read .cshrc for all csh execution. And when you
execute rcp,it uses csh.

Good luck.
Roberto Wagner.
:---------------------------------------------------------------------------
Basically the rcp command perform a BATCH login to the account on the remote
host in order to copy the file. Your startup file are getting launched and
should not contain lines which runs ONLY in interactive more (stty, ioctl etc).

You should do you global setup in the beginning of those files (~/.login, ~/.cshrc)
e.g. SETENV, set path, etc and the put the line:

# skip remaining setup if not an interactive shell

if ($?USER == 0 || $?prompt == 0) exit

If you want to debug this problem you can enter echo lines

(echo "I ah here") in your ~/.login and ~/.cshrc (or ~/.tcshrc) files and try to
rcp, this will give you a way to find where is your problem.

Regards,
Bamby.
:---------------------------------------------------------------------------
Usually this means that you have some stty command in your .cshrc
or equivalent that is not protected to run on an interactive shell.
rcp doesn not create and interactive shell so if you try to run
an stty command on it...it gets upset.

Try wrapping the command in something like:

if ( $?prompt ) then
        stty command
endif

Mikey



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:18 CDT