Open System Services Management and Operations Guide (G06.29+, H06.07+)
Managing With the Shell
Open System Services Management and Operations Guide—527191-005
9-11
Parsing Command Options With the getopts
Command
•
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.