Problem
When I use the rcp(TC) or rcmd(TC) commands to interface with a remote machine, and the remote login is running a csh, the command fails and the following message is displayed:
On 3.2v4.2 or ODT3.0: stty: Invalid argument
Mon Aug 12 17:41:31 GMT 1996On OpenServer 5.0.X: stty: tcgetattr failed: Bad address (error 14)
Mon Aug 12 17:41:31 GMT 1996 Cause
The destination user to which the command is addressed is running
the C-shell (csh(C)). The .cshrc file of this user contains
stty settings. Solution
The problem is due to the .cshrc file of the remote user. Setting
terminal modes with the stty command should only be done when using
an interactive shell. rcp(TC) and rcmd(TC) invoke a non-interactive
shell and should not set terminal modes. This can be solved by
separating the definitions for interactive and non-interactive
shells with an `if' construct in the .cshrc file as in the following
example:if $?prompt then
do stuff that should only be done in an interactive shell
(eg. stty erase ^H)
else
do stuff that should only be done in a non-interactive shell
endif