rexec

This connectivity command runs commands on remote hosts running the rexecd service. Rexec authenticates the user name on the remote host by using a password, before executing the specified command.

Syntax

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

Parameters

host

Specifies the remote host on which to run command.

-l username

Specifies the user name on the remote host.

-n

Redirects the input of rexec to NUL.

command

Specifies the command to run.

Notes

Rexec prompts the user for a password and authenticates the password on the remote host. If the authentication succeeds, the command is executed.

Rexec copies standard input to the remote command, standard output to its standard output, and standard error to its standard error. Interrupt, quit, and terminate signals are propagated to the remote command. Rexec normally terminates when the remote command does.

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:



rexec otherhost cat remotefile >> localfile

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



rexec otherhost cat remotefile ">>" otherremotefile

Using Interactive Commands

You cannot run most interactive commands. For example, vi or emacs cannot be run using rexec. Use telnet to run interactive commands.