neulab/tldr huggingface dataset:
History expansion is performed immediately after a complete line is read, before the shell breaks it into words, and is performed on each line individually without taking quoting on previous lines into account.  It takes place in two parts.  The first is to determine which line from the history list to use during substitution.  The second is to select portions of that line for inclusion into the current one.  The line selected from the history is the event, and the portions of that line that are acted upon are words.  Various modifiers are available to manipulate the selected words.  The line is broken into words in the same fashion as when reading input, so that several metacharacter-separated words surrounded by quotes are considered one word.  History expansions are introduced by the appearance of the history expansion character, which is ! by default.  Only backslash (\) and single quotes can quote the history expansion character, but the history expansion character is also treated as quoted if it immediately precedes the closing double quote in a double-quoted string.
Several characters inhibit history expansion if found immediately following the history expansion character, even if it is unquoted: space, tab, newline, carriage return, and =.  If the extglob shell option is enabled, ( will also inhibit expansion.
Several shell options settable with the shopt builtin may be used to tailor the behavior of history expansion.  If the histverify shell option is enabled (see the description of the shopt builtin below), and readline is being used, history substitutions are not immediately passed to the shell parser.  Instead, the expanded line is reloaded into the readline editing buffer for further modification.  If readline is being used, and the histreedit shell option is enabled, a failed history substitution will be reloaded into the readline editing buffer for correction.  The -p option to the history builtin command may be used to see what a history expansion will do before using it.  The -s option to the history builtin may be used to add commands to the end of the history list without actually executing them, so that they are available for subsequent recall.
The shell allows control of the various characters used by the history expansion mechanism (see the description of histchars above under Shell Variables).  The shell uses the history comment character to mark history timestamps when writing the history file.
Event Designators An event designator is a reference to a command line entry in the history list.  Unless the reference is absolute, events are relative to the current position in the history list.
!      Start a history substitution, except when followed by a blank, newline, carriage return, = or ( (when the extglob shell option is enabled using the shopt builtin). !n     Refer to command line n. !-n    Refer to the current command minus n. !!     Refer to the previous command.  This is a synonym for `!-1'. !string Refer to the most recent command preceding the current position in the history list starting with string. !?string[?] Refer to the most recent command preceding the current position in the history list containing string.  The trailing ? may be omitted if string is followed immediately by a newline.  If string is missing, the string from the most recent search is used; it is an error if there is no previous search string. ^string1^string2^ Quick substitution.  Repeat the previous command, replacing string1 with string2.  Equivalent to ``!!:s^string1^string2^'' (see Modifiers below). !#     The entire command line typed so far.
Word Designators Word designators are used to select desired words from the event.  A : separates the event specification from the word designator.  It may be omitted if the word designator begins with a ^, $, *, -, or %.  Words are numbered from the beginning of the line, with the first word being denoted by 0 (zero).  Words are inserted into the current line separated by single spaces.
0 (zero) The zeroth word.  For the shell, this is the command word. n      The nth word. ^      The first argument.  That is, word 1. $      The last word.  This is usually the last argument, but will expand to the zeroth word if there is only one word in the line. %      The first word matched by the most recent `?string?' search, if the search string begins with a character that is part of a word. x-y    A range of words; `-y' abbreviates `0-y'. *      All of the words but the zeroth.  This is a synonym for `1-$'.  It is not an error to use * if there is just one word in the event; the empty string is returned in that case. x*     Abbreviates x-$. x-     Abbreviates x-$ like x*, but omits the last word.  If x is missing, it defaults to 0.
If a word designator is supplied without an event specification, the previous command is used as the event.
Modifiers After the optional word designator, there may appear a sequence of one or more of the following modifiers, each preceded by a `:'.  These modify, or edit, the word or words selected from the history event.
h      Remove a trailing filename component, leaving only the head. t      Remove all leading filename components, leaving the tail. r      Remove a trailing suffix of the form .xxx, leaving the basename. e      Remove all but the trailing suffix. p      Print the new command but do not execute it. q      Quote the substituted words, escaping further substitutions. x      Quote the substituted words as with q, but break into words at blanks and newlines.  The q and x modifiers are mutually exclusive; the last one supplied is used. s/old/new/ Substitute new for the first occurrence of old in the event line. Any character may be used as the delimiter in place of /.  The final delimiter is optional if it is the last character of the event line.  The delimiter may be quoted in old and new with a single backslash.  If & appears in new, it is replaced by old.  A single backslash will quote the &.  If old is null, it is set to the last old substituted, or, if no previous history substitutions took place, the last string in a !?string[?]  search.  If new is null, each matching old is deleted. &      Repeat the previous substitution. g      Cause changes to be applied over the entire event line.  This is used in conjunction with `:s' (e.g., `:gs/old/new/') or `:&'.  If used with `:s', any delimiter can be used in place of /, and the final delimiter is optional if it is the last character of the event line.  An a may be used as a synonym for g. G      Apply the following `s' or `&' modifier once to each word in the event line.
Unless otherwise noted, each builtin command documented in this section as accepting options preceded by - accepts -- to signify the end of the options.  The :, true, false, and test/[ builtins do not accept options and do not treat -- specially.  The exit, logout, return, break, continue, let, and shift builtins accept and process arguments beginning with - without requiring --.  Other builtins that accept arguments but are not specified as accepting options interpret arguments beginning with - as invalid options and require -- to prevent this interpretation. : [arguments] No effect; the command does nothing beyond expanding arguments and performing any specified redirections.  The return status is zero.
.  filename [arguments] source filename [arguments] Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename.  If filename does not contain a slash, filenames in PATH are used to find the directory containing filename.  The file searched for in PATH need not be executable. When bash is not in posix mode, the current directory is searched if no file is found in PATH.  If the sourcepath option to the shopt builtin command is turned off, the PATH is not searched.  If any arguments are supplied, they become the positional parameters when filename is executed.  Otherwise the positional parameters are unchanged.  If the -T option is enabled, source inherits any trap on DEBUG; if it is not, any DEBUG trap string is saved and restored around the call to source, and source unsets the DEBUG trap while it executes.  If -T is not set, and the sourced file changes the DEBUG trap, the new value is retained when source completes.  The return status is the status of the last command exited within the script (0 if no commands are executed), and false if filename is not found or cannot be read.
alias [-p] [name[=value] ...] Alias with no arguments or with the -p option prints the list of aliases in the form alias name=value on standard output.  When arguments are supplied, an alias is defined for each name whose value is given.  A trailing space in value causes the next word to be checked for alias substitution when the alias is expanded.  For each name in the argument list for which no value is supplied, the name and value of the alias is printed.  Alias returns true unless a name is given for which no alias has been defined.
bg [jobspec ...] Resume each suspended job jobspec in the background, as if it had been started with &.  If jobspec is not present, the shell's notion of the current job is used.  bg jobspec returns 0 unless run when job control is disabled or, when run with job control enabled, any specified jobspec was not found or was started without job control.
bind [-m keymap] [-lpsvPSVX] bind [-m keymap] [-q function] [-u function] [-r keyseq] bind [-m keymap] -f filename bind [-m keymap] -x keyseq:shell-command bind [-m keymap] keyseq:function-name bind [-m keymap] keyseq:readline-command Display current readline key and function bindings, bind a key sequence to a readline function or macro, or set a readline variable.  Each non-option argument is a command as it would appear in .inputrc, but each binding or command must be passed as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'. Options, if supplied, have the following meanings: -m keymap Use keymap as the keymap to be affected by the subsequent bindings.  Acceptable keymap names are emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command, and vi-insert.  vi is equivalent to vi-command (vi-move is also a synonym); emacs is equivalent to emacs-standard. -l     List the names of all readline functions. -p     Display readline function names and bindings in such a way that they can be re-read. -P     List current readline function names and bindings. -s     Display readline key sequences bound to macros and the strings they output in such a way that they can be re-read. -S     Display readline key sequences bound to macros and the strings they output. -v     Display readline variable names and values in such a way that they can be re-read. -V     List current readline variable names and values. -f filename Read key bindings from filename. -q function Query about which keys invoke the named function. -u function Unbind all keys bound to the named function. -r keyseq Remove any current binding for keyseq. -x keyseq:shell-command Cause shell-command to be executed whenever keyseq is entered.  When shell-command is executed, the shell sets the READLINE_LINE variable to the contents of the readline line buffer and the READLINE_POINT and READLINE_MARK variables to the current location of the insertion point and the saved insertion point (the mark), respectively.  If the executed command changes the value of any of READLINE_LINE, READLINE_POINT, or READLINE_MARK, those new values will be reflected in the editing state. -X     List all key sequences bound to shell commands and the associated commands in a format that can be reused as input.
The return value is 0 unless an unrecognized option is given or an error occurred.
break [n] Exit from within a for, while, until, or select loop.  If n is specified, break n levels.  n must be ≥ 1.  If n is greater than the number of enclosing loops, all enclosing loops are exited. The return value is 0 unless n is not greater than or equal to 1.
builtin shell-builtin [arguments] Execute the specified shell builtin, passing it arguments, and return its exit status.  This is useful when defining a function whose name is the same as a shell builtin, retaining the functionality of the builtin within the function.  The cd builtin is commonly redefined this way.  The return status is false if shell-builtin is not a shell builtin command.
caller [expr] Returns the context of any active subroutine call (a shell function or a script executed with the . or source builtins). Without expr, caller displays the line number and source filename of the current subroutine call.  If a non-negative integer is supplied as expr, caller displays the line number, subroutine name, and source file corresponding to that position in the current execution call stack.  This extra information may be used, for example, to print a stack trace.  The current frame is frame 0.  The return value is 0 unless the shell is not executing a subroutine call or expr does not correspond to a valid position in the call stack.
cd [-L|[-P [-e]] [-@]] [dir] Change the current directory to dir.  if dir is not supplied, the value of the HOME shell variable is the default.  Any additional arguments following dir are ignored.  The variable CDPATH defines the search path for the directory containing dir: each directory name in CDPATH is searched for dir.  Alternative directory names in CDPATH are separated by a colon (:).  A null directory name in CDPATH is the same as the current directory, i.e., ``.''.  If dir begins with a slash (/), then CDPATH is not used.  The -P option causes cd to use the physical directory structure by resolving symbolic links while traversing dir and before processing instances of .. in dir (see also the -P option to the set builtin command); the -L option forces symbolic links to be followed by resolving the link after processing instances of .. in dir.  If .. appears in dir, it is processed by removing the immediately previous pathname component from dir, back to a slash or the beginning of dir.  If the -e option is supplied with -P, and the current working directory cannot be successfully determined after a successful directory change, cd will return an unsuccessful status.  On systems that support it, the -@ option presents the extended attributes associated with a file as a directory.  An argument of - is converted to $OLDPWD before the directory change is attempted.  If a non-empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output.  The return value is true if the directory was successfully changed; false otherwise.
command [-pVv] command [arg ...] Run command with args suppressing the normal shell function lookup.  Only builtin commands or commands found in the PATH are executed.  If the -p option is given, the search for command is performed using a default value for PATH that is guaranteed to find all of the standard utilities.  If either the -V or -v option is supplied, a description of command is printed.  The -v option causes a single word indicating the command or filename used to invoke command to be displayed; the -V option produces a more verbose description.  If the -V or -v option is supplied, the exit status is 0 if command was found, and 1 if not.  If neither option is supplied and an error occurred or command cannot be found, the exit status is 127.  Otherwise, the exit status of the command builtin is the exit status of command.
compgen [option] [word] Generate possible completion matches for word according to the options, which may be any option accepted by the complete builtin with the exception of -p and -r, and write the matches to the standard output.  When using the -F or -C options, the various shell variables set by the programmable completion facilities, while available, will not have useful values.
The matches will be generated in the same way as if the programmable completion code had generated them directly from a completion specification with the same flags.  If word is specified, only those completions matching word will be displayed.
The return value is true unless an invalid option is supplied, or no matches were generated.
complete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] name [name ...] complete -pr [-DEI] [name ...] Specify how arguments to each name should be completed.  If the -p option is supplied, or if no options are supplied, existing completion specifications are printed in a way that allows them to be reused as input.  The -r option removes a completion specification for each name, or, if no names are supplied, all completion specifications.  The -D option indicates that other supplied options and actions should apply to the ``default'' command completion; that is, completion attempted on a command for which no completion has previously been defined.  The -E option indicates that other supplied options and actions should apply to ``empty'' command completion; that is, completion attempted on a blank line.  The -I option indicates that other supplied options and actions should apply to completion on the initial non- assignment word on the line, or after a command delimiter such as ; or |, which is usually command name completion.  If multiple options are supplied, the -D option takes precedence over -E, and both take precedence over -I.  If any of -D, -E, or -I are supplied, any other name arguments are ignored; these completions only apply to the case specified by the option.
The process of applying these completion specifications when word completion is attempted is described above under Programmable Completion.
The return value is true unless an invalid option is supplied, an option other than -p or -r is supplied without a name argument, an attempt is made to remove a completion specification for a name for which no specification exists, or an error occurs adding a completion specification.
compopt [-o option] [-DEI] [+o option] [name] Modify completion options for each name according to the options, or for the currently-executing completion if no names are supplied.  If no options are given, display the completion options for each name or the current completion.  The possible values of option are those valid for the complete builtin described above. The -D option indicates that other supplied options should apply to the ``default'' command completion; that is, completion attempted on a command for which no completion has previously been defined.  The -E option indicates that other supplied options should apply to ``empty'' command completion; that is, completion attempted on a blank line.  The -I option indicates that other supplied options should apply to completion on the initial non- assignment word on the line, or after a command delimiter such as ; or |, which is usually command name completion.
The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a name for which no completion specification exists, or an output error occurs.
continue [n] Resume the next iteration of the enclosing for, while, until, or select loop.  If n is specified, resume at the nth enclosing loop. n must be ≥ 1.  If n is greater than the number of enclosing loops, the last enclosing loop (the ``top-level'' loop) is resumed.  The return value is 0 unless n is not greater than or equal to 1.
declare [-aAfFgiIlnrtux] [-p] [name[=value] ...] typeset [-aAfFgiIlnrtux] [-p] [name[=value] ...] Declare variables and/or give them attributes.  If no names are given then display the values of variables.  The -p option will display the attributes and values of each name.  When -p is used with name arguments, additional options, other than -f and -F, are ignored.  When -p is supplied without name arguments, it will display the attributes and values of all variables having the attributes specified by the additional options.  If no other options are supplied with -p, declare will display the attributes and values of all shell variables.  The -f option will restrict the display to shell functions.  The -F option inhibits the display of function definitions; only the function name and attributes are printed.  If the extdebug shell option is enabled using shopt, the source file name and line number where each name is defined are displayed as well.  The -F option implies -f.  The -g option forces variables to be created or modified at the global scope, even when declare is executed in a shell function.  It is ignored in all other cases.  The -I option causes local variables to inherit the attributes (except the nameref attribute) and value of any existing variable with the same name at a surrounding scope.  If there is no existing variable, the local variable is initially unset.  The following options can be used to restrict output to variables with the specified attribute or to give variables attributes: -a     Each name is an indexed array variable (see Arrays above). -A     Each name is an associative array variable (see Arrays above). -f     Use function names only. -i     The variable is treated as an integer; arithmetic evaluation (see ARITHMETIC EVALUATION above) is performed when the variable is assigned a value. -l     When the variable is assigned a value, all upper-case characters are converted to lower-case.  The upper-case attribute is disabled. -n     Give each name the nameref attribute, making it a name reference to another variable.  That other variable is defined by the value of name.  All references, assignments, and attribute modifications to name, except those using or changing the -n attribute itself, are performed on the variable referenced by name's value.  The nameref attribute cannot be applied to array variables. -r     Make names readonly.  These names cannot then be assigned values by subsequent assignment statements or unset. -t     Give each name the trace attribute.  Traced functions inherit the DEBUG and RETURN traps from the calling shell. The trace attribute has no special meaning for variables. -u     When the variable is assigned a value, all lower-case characters are converted to upper-case.  The lower-case attribute is disabled. -x     Mark names for export to subsequent commands via the environment.
Using `+' instead of `-' turns off the attribute instead, with the exceptions that +a and +A may not be used to destroy array variables and +r will not remove the readonly attribute.  When used in a function, declare and typeset make each name local, as with the local command, unless the -g option is supplied.  If a variable name is followed by =value, the value of the variable is set to value.  When using -a or -A and the compound assignment syntax to create array variables, additional attributes do not take effect until subsequent assignments.  The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using ``-f foo=bar'', an attempt is made to assign a value to a readonly variable, an attempt is made to assign a value to an array variable without using the compound assignment syntax (see Arrays above), one of the names is not a valid shell variable name, an attempt is made to turn off readonly status for a readonly variable, an attempt is made to turn off array status for an array variable, or an attempt is made to display a non-existent function with -f.
dirs [-clpv] [+n] [-n] Without options, displays the list of currently remembered directories.  The default display is on a single line with directory names separated by spaces.  Directories are added to the list with the pushd command; the popd command removes entries from the list.  The current directory is always the first directory in the stack. -c     Clears the directory stack by deleting all of the entries. -l     Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory. -p     Print the directory stack with one entry per line. -v     Print the directory stack with one entry per line, prefixing each entry with its index in the stack. +n     Displays the nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero. -n     Displays the nth entry counting from the right of the list shown by dirs when invoked without options, starting with zero.
The return value is 0 unless an invalid option is supplied or n indexes beyond the end of the directory stack.
disown [-ar] [-h] [jobspec ... | pid ... ] Without options, remove each jobspec from the table of active jobs.  If jobspec is not present, and neither the -a nor the -r option is supplied, the current job is used.  If the -h option is given, each jobspec is not removed from the table, but is marked so that SIGHUP is not sent to the job if the shell receives a SIGHUP.  If no jobspec is supplied, the -a option means to remove or mark all jobs; the -r option without a jobspec argument restricts operation to running jobs.  The return value is 0 unless a jobspec does not specify a valid job.
echo [-neE] [arg ...] Output the args, separated by spaces, followed by a newline.  The return status is 0 unless a write error occurs.  If -n is specified, the trailing newline is suppressed.  If the -e option is given, interpretation of the following backslash-escaped characters is enabled.  The -E option disables the interpretation of these escape characters, even on systems where they are interpreted by default.  The xpg_echo shell option may be used to dynamically determine whether or not echo expands these escape characters by default.  echo does not interpret -- to mean the end of options.  echo interprets the following escape sequences: \a     alert (bell) \b     backspace \c     suppress further output \e \E     an escape character \f     form feed \n     new line \r     carriage return \t     horizontal tab \v     vertical tab \\     backslash \0nnn  the eight-bit character whose value is the octal value nnn (zero to three octal digits) \xHH   the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) \uHHHH the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits) \UHHHHHHHH the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits)
enable [-a] [-dnps] [-f filename] [name ...] Enable and disable builtin shell commands.  Disabling a builtin allows a disk command which has the same name as a shell builtin to be executed without specifying a full pathname, even though the shell normally searches for builtins before disk commands.  If -n is used, each name is disabled; otherwise, names are enabled.  For example, to use the test binary found via the PATH instead of the shell builtin version, run ``enable -n test''.  The -f option means to load the new builtin command name from shared object filename, on systems that support dynamic loading.  The -d option will delete a builtin previously loaded with -f.  If no name arguments are given, or if the -p option is supplied, a list of shell builtins is printed.  With no other option arguments, the list consists of all enabled shell builtins.  If -n is supplied, only disabled builtins are printed.  If -a is supplied, the list printed includes all builtins, with an indication of whether or not each is enabled.  If -s is supplied, the output is restricted to the POSIX special builtins.  The return value is 0 unless a name is not a shell builtin or there is an error loading a new builtin from a shared object.
eval [arg ...] The args are read and concatenated together into a single command. This command is then read and executed by the shell, and its exit status is returned as the value of eval.  If there are no args, or only null arguments, eval returns 0.
exec [-cl] [-a name] [command [arguments]] If command is specified, it replaces the shell.  No new process is created.  The arguments become the arguments to command.  If the -l option is supplied, the shell places a dash at the beginning of the zeroth argument passed to command.  This is what login(1) does.  The -c option causes command to be executed with an empty environment.  If -a is supplied, the shell passes name as the zeroth argument to the executed command.  If command cannot be executed for some reason, a non-interactive shell exits, unless the execfail shell option is enabled.  In that case, it returns failure.  An interactive shell returns failure if the file cannot be executed.  A subshell exits unconditionally if exec fails.  If command is not specified, any redirections take effect in the current shell, and the return status is 0.  If there is a redirection error, the return status is 1.
exit [n] Cause the shell to exit with a status of n.  If n is omitted, the exit status is that of the last command executed.  A trap on EXIT is executed before the shell terminates.
export [-fn] [name[=word]] ... export -p The supplied names are marked for automatic export to the environment of subsequently executed commands.  If the -f option is given, the names refer to functions.  If no names are given, or if the -p option is supplied, a list of names of all exported variables is printed.  The -n option causes the export property to be removed from each name.  If a variable name is followed by =word, the value of the variable is set to word.  export returns an exit status of 0 unless an invalid option is encountered, one of the names is not a valid shell variable name, or -f is supplied with a name that is not a function.
fc [-e ename] [-lnr] [first] [last] fc -s [pat=rep] [cmd] The first form selects a range of commands from first to last from the history list and displays or edits and re-executes them. First and last may be specified as a string (to locate the last command beginning with that string) or as a number (an index into the history list, where a negative number is used as an offset from the current command number).  When listing, a first or last of 0 is equivalent to -1 and -0 is equivalent to the current command (usually the fc command); otherwise 0 is equivalent to -1 and -0 is invalid.  If last is not specified, it is set to the current command for listing (so that ``fc -l -10'' prints the last 10 commands) and to first otherwise.  If first is not specified, it is set to the previous command for editing and -16 for listing.
The -n option suppresses the command numbers when listing.  The -r option reverses the order of the commands.  If the -l option is given, the commands are listed on standard output.  Otherwise, the editor given by ename is invoked on a file containing those commands.  If ename is not given, the value of the FCEDIT variable is used, and the value of EDITOR if FCEDIT is not set.  If neither variable is set, vi is used.  When editing is complete, the edited commands are echoed and executed.
In the second form, command is re-executed after each instance of pat is replaced by rep.  Command is interpreted the same as first above.  A useful alias to use with this is ``r="fc -s"'', so that typing ``r cc'' runs the last command beginning with ``cc'' and typing ``r'' re-executes the last command.
If the first form is used, the return value is 0 unless an invalid option is encountered or first or last specify history lines out of range.  If the -e option is supplied, the return value is the value of the last command executed or failure if an error occurs with the temporary file of commands.  If the second form is used, the return status is that of the command re-executed, unless cmd does not specify a valid history line, in which case fc returns failure.
fg [jobspec] Resume jobspec in the foreground, and make it the current job.  If jobspec is not present, the shell's notion of the current job is used.  The return value is that of the command placed into the foreground, or failure if run when job control is disabled or, when run with job control enabled, if jobspec does not specify a valid job or jobspec specifies a job that was started without job control.
getopts optstring name [arg ...] getopts is used by shell procedures to parse positional parameters.  optstring contains the option characters to be recognized; if a character is followed by a colon, the option is expected to have an argument, which should be separated from it by white space.  The colon and question mark characters may not be used as option characters.  Each time it is invoked, getopts places the next option in the shell variable name, initializing name if it does not exist, and the index of the next argument to be processed into the variable OPTIND.  OPTIND is initialized to 1 each time the shell or a shell script is invoked.  When an option requires an argument, getopts places that argument into the variable OPTARG.  The shell does not reset OPTIND automatically; it must be manually reset between multiple calls to getopts within the same shell invocation if a new set of parameters is to be used.
When the end of options is encountered, getopts exits with a return value greater than zero.  OPTIND is set to the index of the first non-option argument, and name is set to ?.
getopts normally parses the positional parameters, but if more arguments are supplied as arg values, getopts parses those instead.
getopts can report errors in two ways.  If the first character of optstring is a colon, silent error reporting is used.  In normal operation, diagnostic messages are printed when invalid options or missing option arguments are encountered.  If the variable OPTERR is set to 0, no error messages will be displayed, even if the first character of optstring is not a colon.
If an invalid option is seen, getopts places ? into name and, if not silent, prints an error message and unsets OPTARG.  If getopts is silent, the option character found is placed in OPTARG and no diagnostic message is printed.
If a required argument is not found, and getopts is not silent, a question mark (?) is placed in name, OPTARG is unset, and a diagnostic message is printed.  If getopts is silent, then a colon (:) is placed in name and OPTARG is set to the option character found.
getopts returns true if an option, specified or unspecified, is found.  It returns false if the end of options is encountered or an error occurs.
hash [-lr] [-p filename] [-dt] [name] Each time hash is invoked, the full pathname of the command name is determined by searching the directories in $PATH and remembered.  Any previously-remembered pathname is discarded.  If the -p option is supplied, no path search is performed, and filename is used as the full filename of the command.  The -r option causes the shell to forget all remembered locations.  The -d option causes the shell to forget the remembered location of each name.  If the -t option is supplied, the full pathname to which each name corresponds is printed.  If multiple name arguments are supplied with -t, the name is printed before the hashed full pathname.  The -l option causes output to be displayed in a format that may be reused as input.  If no arguments are given, or if only -l is supplied, information about remembered commands is printed.  The return status is true unless a name is not found or an invalid option is supplied.
help [-dms] [pattern] Display helpful information about builtin commands.  If pattern is specified, help gives detailed help on all commands matching pattern; otherwise help for all the builtins and shell control structures is printed. -d     Display a short description of each pattern -m     Display the description of each pattern in a manpage-like format -s     Display only a short usage synopsis for each pattern
The return status is 0 unless no command matches pattern.
history [n] history -c history -d offset history -d start-end history -anrw [filename] history -p arg [arg ...] history -s arg [arg ...] With no options, display the command history list with line numbers.  Lines listed with a * have been modified.  An argument of n lists only the last n lines.  If the shell variable HISTTIMEFORMAT is set and not null, it is used as a format string for strftime(3) to display the time stamp associated with each displayed history entry.  No intervening blank is printed between the formatted time stamp and the history line.  If filename is supplied, it is used as the name of the history file; if not, the value of HISTFILE is used.  Options, if supplied, have the following meanings: -c     Clear the history list by deleting all the entries. -d offset Delete the history entry at position offset.  If offset is negative, it is interpreted as relative to one greater than the last history position, so negative indices count back from the end of the history, and an index of -1 refers to the current history -d command. -d start-end Delete the history entries between positions start and end, inclusive.  Positive and negative values for start and end are interpreted as described above. -a     Append the ``new'' history lines to the history file. These are history lines entered since the beginning of the current bash session, but not already appended to the history file. -n     Read the history lines not already read from the history file into the current history list.  These are lines appended to the history file since the beginning of the current bash session. -r     Read the contents of the history file and append them to the current history list. -w     Write the current history list to the history file, overwriting the history file's contents. -p     Perform history substitution on the following args and display the result on the standard output.  Does not store the results in the history list.  Each arg must be quoted to disable normal history expansion. -s     Store the args in the history list as a single entry.  The last command in the history list is removed before the args are added.
If the HISTTIMEFORMAT variable is set, the time stamp information associated with each history entry is written to the history file, marked with the history comment character.  When the history file is read, lines beginning with the history comment character followed immediately by a digit are interpreted as timestamps for the following history entry.  The return value is 0 unless an invalid option is encountered, an error occurs while reading or writing the history file, an invalid offset is supplied as an argument to -d, or the history expansion supplied as an argument to -p fails.
jobs [-lnprs] [ jobspec ... ] jobs -x command [ args ... ] The first form lists the active jobs.  The options have the following meanings: -l     List process IDs in addition to the normal information. -n     Display information only about jobs that have changed status since the user was last notified of their status. -p     List only the process ID of the job's process group leader. -r     Display only running jobs. -s     Display only stopped jobs.
If jobspec is given, output is restricted to information about that job.  The return status is 0 unless an invalid option is encountered or an invalid jobspec is supplied.
If the -x option is supplied, jobs replaces any jobspec found in command or args with the corresponding process group ID, and executes command passing it args, returning its exit status.
kill [-s sigspec | -n signum | -sigspec] [pid | jobspec] ... kill -l|-L [sigspec | exit_status] Send the signal named by sigspec or signum to the processes named by pid or jobspec.  sigspec is either a case-insensitive signal name such as SIGKILL (with or without the SIG prefix) or a signal number; signum is a signal number.  If sigspec is not present, then SIGTERM is assumed.  An argument of -l lists the signal names.  If any arguments are supplied when -l is given, the names of the signals corresponding to the arguments are listed, and the return status is 0.  The exit_status argument to -l is a number specifying either a signal number or the exit status of a process terminated by a signal.  The -L option is equivalent to -l.  kill returns true if at least one signal was successfully sent, or false if an error occurs or an invalid option is encountered.
let arg [arg ...] Each arg is an arithmetic expression to be evaluated (see ARITHMETIC EVALUATION above).  If the last arg evaluates to 0, let returns 1; 0 is returned otherwise.
local [option] [name[=value] ... | - ] For each argument, a local variable named name is created, and assigned value.  The option can be any of the options accepted by declare.  When local is used within a function, it causes the variable name to have a visible scope restricted to that function and its children.  If name is -, the set of shell options is made local to the function in which local is invoked: shell options changed using the set builtin inside the function are restored to their original values when the function returns.  The restore is effected as if a series of set commands were executed to restore the values that were in place before the function.  With no operands, local writes a list of local variables to the standard output.  It is an error to use local when not within a function. The return status is 0 unless local is used outside a function, an invalid name is supplied, or name is a readonly variable.
logout Exit a login shell.
mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array] readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array] Read lines from the standard input into the indexed array variable array, or from file descriptor fd if the -u option is supplied. The variable MAPFILE is the default array.  Options, if supplied, have the following meanings: -d     The first character of delim is used to terminate each input line, rather than newline.  If delim is the empty string, mapfile will terminate a line when it reads a NUL character. -n     Copy at most count lines.  If count is 0, all lines are copied. -O     Begin assigning to array at index origin.  The default index is 0. -s     Discard the first count lines read. -t     Remove a trailing delim (default newline) from each line read. -u     Read lines from file descriptor fd instead of the standard input. -C     Evaluate callback each time quantum lines are read.  The -c option specifies quantum. -c     Specify the number of lines read between each call to callback.
If -C is specified without -c, the default quantum is 5000.  When callback is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that element as additional arguments.  callback is evaluated after the line is read but before the array element is assigned.
If not supplied with an explicit origin, mapfile will clear array before assigning to it.
mapfile returns successfully unless an invalid option or option argument is supplied, array is invalid or unassignable, or if array is not an indexed array.
popd [-n] [+n] [-n] Removes entries from the directory stack.  With no arguments, removes the top directory from the stack, and performs a cd to the new top directory.  Arguments, if supplied, have the following meanings: -n     Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. +n     Removes the nth entry counting from the left of the list shown by dirs, starting with zero.  For example: ``popd +0'' removes the first directory, ``popd +1'' the second. -n     Removes the nth entry counting from the right of the list shown by dirs, starting with zero.  For example: ``popd -0'' removes the last directory, ``popd -1'' the next to last.
If the popd command is successful, a dirs is performed as well, and the return status is 0.  popd returns false if an invalid option is encountered, the directory stack is empty, a non- existent directory stack entry is specified, or the directory change fails.
printf [-v var] format [arguments] Write the formatted arguments to the standard output under the control of the format.  The -v option causes the output to be assigned to the variable var rather than being printed to the standard output.
The format is a character string which contains three types of objects: plain characters, which are simply copied to standard output, character escape sequences, which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive argument.  In addition to the standard printf(1) format specifications, printf interprets the following extensions: %b     causes printf to expand backslash escape sequences in the corresponding argument in the same way as echo -e. %q     causes printf to output the corresponding argument in a format that can be reused as shell input. %(datefmt)T causes printf to output the date-time string resulting from using datefmt as a format string for strftime(3).  The corresponding argument is an integer representing the number of seconds since the epoch.  Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked.  If no argument is specified, conversion behaves as if -1 had been given. This is an exception to the usual printf behavior.
The %b, %q, and %T directives all use the field width and precision arguments from the format specification and write that many bytes from (or use that wide a field for) the expanded argument, which usually contains more characters than the original.
Arguments to non-string format specifiers are treated as C constants, except that a leading plus or minus sign is allowed, and if the leading character is a single or double quote, the value is the ASCII value of the following character.
The format is reused as necessary to consume all of the arguments. If the format requires more arguments than are supplied, the extra format specifications behave as if a zero value or null string, as appropriate, had been supplied.  The return value is zero on success, non-zero on failure.
pushd [-n] [+n] [-n] pushd [-n] [dir] Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working directory.  With no arguments, pushd exchanges the top two directories and returns 0, unless the directory stack is empty. Arguments, if supplied, have the following meanings: -n     Suppresses the normal change of directory when rotating or adding directories to the stack, so that only the stack is manipulated. +n     Rotates the stack so that the nth directory (counting from the left of the list shown by dirs, starting with zero) is at the top. -n     Rotates the stack so that the nth directory (counting from the right of the list shown by dirs, starting with zero) is at the top. dir    Adds dir to the directory stack at the top, making it the new current working directory as if it had been supplied as the argument to the cd builtin.
If the pushd command is successful, a dirs is performed as well. If the first form is used, pushd returns 0 unless the cd to dir fails.  With the second form, pushd returns 0 unless the directory stack is empty, a non-existent directory stack element is specified, or the directory change to the specified new current directory fails.
pwd [-LP] Print the absolute pathname of the current working directory.  The pathname printed contains no symbolic links if the -P option is supplied or the -o physical option to the set builtin command is enabled.  If the -L option is used, the pathname printed may contain symbolic links.  The return status is 0 unless an error occurs while reading the name of the current directory or an invalid option is supplied.
If no names are supplied, the line read, without the ending delimiter but otherwise unmodified, is assigned to the variable REPLY.  The exit status is zero, unless end-of-file is encountered, read times out (in which case the status is greater than 128), a variable assignment error (such as assigning to a readonly variable) occurs, or an invalid file descriptor is supplied as the argument to -u.