rsh

This connectivity command runs commands on remote hosts running the RSH service. For information about the .rhosts file, see the Rcp command.

Syntax

rsh host [-l username] [-n] command

Parameters

host

Specifies the remote host on which to run command.

-l username

Specifies the user name to use on the remote host. If omitted, the logged on user name is used.

-n

Redirects the input of rsh to NUL.

command

Specifies the command to run.

Notes

Rsh copies standard input to the remote command, standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Rsh normally terminates when the remote command does.

Using Redirection Symbols

Use quotation marks around redirection symbols to redirect onto the remote host. If quotation marks are not used, redirection occurs on the local computer. For example, the following command appends the remote file remotefile to the local file localfile:



rsh otherhost cat remotefile >> localfile

The following command appends the remote file remotefile to the remote file otherremotefile:



rsh otherhost cat remotefile ">>" otherremotefile

Using Rsh on a Windows NT Server Domain

If the user is logged on to a Windows NT Server domain, the domain controller must be available to resolve the currently logged on name, because the logged on name is not cached on the local computer. Because the username is required as part of the rsh protocol, the command fails if the username cannot be obtained.