RSH, REMSH(1c,C) AIX TCP/IP User's Guide RSH, REMSH(1c,C)
-------------------------------------------------------------------------------
rsh, remsh
PURPOSE
Connects to the specified host and executes the specified command.
SYNTAX
+-----------------+ +-----------+
rsh, remsh --- host ---| +-------------+ |---| |---|
+-| -n |-+ +- command -+
| -l username |
+-------------+
DESCRIPTION
The rsh command connects to the specified host, and executes the specified
command. This command copies its standard input to the remote command, the
standard output of the remote command to its standard output, and the standard
error of the remote command to its standard error. Interrupt, quit and
terminate signals are propagated to the remote command. The rsh command
normally terminates when the remote command terminates.
The remote username used is the same as your local username, unless you specify
a different remote name with the -l options. This remote name must be
equivalent (in the sense of rlogin, see "rlogin,") to the originating account.
No provision is made for specifying a password with a command.
If you omit command, then instead of executing a single command, you log in on
the remote host using the rlogin command.
Shell metacharacters which are not quoted are interpreted on the local machine,
while quoted metacharacters are interpreted on the remote machine. Thus the
command
rsh otherhost cat remotefile >> localfile
appends the remote file remotefile to the local file localfile, while
rsh otherhost cat remotefile ">>" otherremotefile
appends remotefile to otherremotefile.
Host names are given in the file /etc/hosts. Each host has one standard name
(the first name given in the file), which is rather long and clearly defined.
Optionally, the host has one or more nicknames.
Processed October 29, 1990 RSH, REMSH(1c,C) 1
RSH, REMSH(1c,C) AIX TCP/IP User's Guide RSH, REMSH(1c,C)
If you are using the C shell and put a rsh command in the background without
redirecting its input away from the terminal, it blocks even if no reads are
posted by the remote command. If no input is desired, you should redirect the
input of rsh to /dev/null using the -n option.
FLAGS
-n Redirects the input of rsh to /dev/null if you desire no input.
-l Specifies a different remote name. If -l is not used, the remote
username used is the same as your local username.
EXAMPLES
To compile a file on a remote host:
$ rsh host2 "cc -o hello hello.c"
$ _
To read a remote file:
$ rsh host2 "cat /tmp/log"
This is the output from the file /tmp/log on
host2
.
.
.
$ _
FILES
/etc/hosts
RELATED INFORMATION
In this book:
"rlogin"
"hosts.equiv"
".rhosts"
Processed October 29, 1990 RSH, REMSH(1c,C) 2