Technical article 107614

rcp(TC) and rcmd(TC) fail with stty related error messages when using the csh.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

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 1996
On 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

From the Xinuos technical article database, record 107614. Reproduced with permission. The original is at www.sco.com/ta/107614, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.