Open System Services Management and Operations Guide (G06.30+, H06.08+, J06.03+)

Executing Remote Shell Commands
The rsh command executes a specified shell command remotely. It executes commands at the
host system where the commands are to be run. The rsh command sends standard input from the
local host to the remote command and receives standard output and standard error file data from
the remote command.
NOTE: If the remote host is a NonStop server, you must specify the -l flag and provide your
password in clear text form. Using clear text for passwords is not a good practice, so the rsh
command should be avoided if possible.
You can do the following tasks by using the rsh command:
Turn on debugging of the TCP sockets used for communication with the remote host
Choose to log into the remote host using a specified user name rather than the local user name
Specify an argument to the command you are performing remotely
The remote host allows access only if at least one of the following conditions is satisfied:
The local user ID is not the super ID, and the name of the local host is listed as an equivalent
host in the remote /etc/hosts.equiv file.
The remote user’s home directory contains a $HOME/.rhosts file that lists the local host and
user name.
For security reasons, any $HOME/.rhosts file must be owned by either the remote user or the
super ID, and only the owner should have write access.
For more information about the rsh command, see the rsh(1) reference page either online or
in the Open System Services Shell and Utilities Reference Manual.
Parsing Command Options With the getopts Command
The getopts command is used only in shell scripts, not at the shell prompt. It parses command
options and checks a specified command for legal options. Each time it is invoked, getopts
places the next option letter it finds into a variable name that you specify. You can also specify
letters that the getopts command is to recognize as valid option values and an option argument
to parse.
The getopts command differs from regular OSS shell commands in that it does not open a new
shell process when it executes.
For more information about the getopts command, see the getopts(1) reference page either
online or in the Open System Services Shell and Utilities Reference Manual.
OSS Core Utilities User Commands
The OSS Utilities product (OSSUTIL – T8626) provides the essential OSS user commands and
utilities. Beginning with the J06.14 and H06.25 RVUs, the OSS Core Utilities product (T1202)
provides additional Open Source utilities.
The OSS Core Utilities (T1202) provide industry-standard alternatives (not replacements or updates)
to the original OSS Utilities (T8626). Some of these utilities have the same names as those present
in the original OSS Utilities. These utilities are not in all cases upwardly-compatible replacements
for the original OSS Utilities, and the original OSS Utilities continue to exist.
Executing Remote Shell Commands 243