
668
|
Chapter 6: The Bash Shell and Korn Shell
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
-. End processing of options by specifying -- on the command line.
string contains the option letters to be recognized by getopts when
running the shell script. Valid options are processed in turn and
stored in the shell variable name. If an option is followed by a
colon, the option must be followed by one or more arguments.
(Multiple arguments must be given to the command as one shell
word. This is done by quoting the arguments or separating them
with commas. The application must be written to expect multiple
arguments in this format.) getopts uses the shell variables
OPTARG and OPTIND. The Bash version also uses OPTERR.
Option
-a Use name in error messages about invalid options. ksh93 only.
hash
hash [-dlrt] [-p file] [commands]
Bash version. As the shell finds commands along the search path
($PATH), it remembers the found location in an internal hash
table. The next time you enter a command, the shell uses the value
stored in its hash table.
With no arguments, hash lists the current hashed commands. The
display shows hits (the number of times the command is called by
the shell) and the command name.
With commands, the shell adds those commands to the hash table.
Options
-d Remove (delete) just the specified commands from the hash
table.
-l Produce ...