aboutsummaryrefslogtreecommitdiffstats
path: root/doc/bashref.info
diff options
context:
space:
mode:
Diffstat (limited to 'doc/bashref.info')
-rw-r--r--doc/bashref.info1272
1 files changed, 694 insertions, 578 deletions
diff --git a/doc/bashref.info b/doc/bashref.info
index 3b2b6da..f4ee48a 100644
--- a/doc/bashref.info
+++ b/doc/bashref.info
@@ -1,5 +1,5 @@
-This is Info file bashref.info, produced by Makeinfo version 1.68 from
-the input file /usr/homes/chet/src/bash/src/doc/bashref.texi.
+This is bashref.info, produced by makeinfo version 4.0 from
+/usr/homes/chet/src/bash/src/doc/bashref.texi.
INFO-DIR-SECTION Utilities
START-INFO-DIR-ENTRY
@@ -9,9 +9,9 @@ END-INFO-DIR-ENTRY
This text is a brief description of the features that are present in
the Bash shell.
-This is Edition 2.4, last updated 14 March 2000,
+This is Edition 2.5, last updated 28 Mar 2001,
of `The GNU Bash Reference Manual',
-for `Bash', Version 2.04.
+for `Bash', Version 2.05.
Copyright (C) 1991-1999 Free Software Foundation, Inc.
@@ -38,8 +38,8 @@ Bash Features
This text is a brief description of the features that are present in
the Bash shell.
- This is Edition 2.4, last updated 14 March 2000, of `The GNU Bash
-Reference Manual', for `Bash', Version 2.04.
+ This is Edition 2.5, last updated 28 Mar 2001, of `The GNU Bash
+Reference Manual', for `Bash', Version 2.05.
Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
@@ -332,30 +332,30 @@ Shell Operation
The following is a brief description of the shell's operation when it
reads and executes a command. Basically, the shell does the following:
- 1. Reads its input from a file (*note Shell Scripts::.), from a string
+ 1. Reads its input from a file (*note Shell Scripts::), from a string
supplied as an argument to the `-c' invocation option (*note
- Invoking Bash::.), or from the user's terminal.
+ Invoking Bash::), or from the user's terminal.
2. Breaks the input into words and operators, obeying the quoting
rules described in *Note Quoting::. These tokens are separated by
`metacharacters'. Alias expansion is performed by this step
- (*note Aliases::.).
+ (*note Aliases::).
3. Parses the tokens into simple and compound commands (*note Shell
- Commands::.).
+ Commands::).
- 4. Performs the various shell expansions (*note Shell Expansions::.),
+ 4. Performs the various shell expansions (*note Shell Expansions::),
breaking the expanded tokens into lists of filenames (*note
- Filename Expansion::.) and commands and arguments.
+ Filename Expansion::) and commands and arguments.
- 5. Performs any necessary redirections (*note Redirections::.) and
+ 5. Performs any necessary redirections (*note Redirections::) and
removes the redirection operators and their operands from the
argument list.
- 6. Executes the command (*note Executing Commands::.).
+ 6. Executes the command (*note Executing Commands::).
7. Optionally waits for the command to complete and collects its exit
- status (*note Exit Status::.).
+ status (*note Exit Status::).

@@ -381,11 +381,11 @@ or words to the shell. Quoting can be used to disable special
treatment for special characters, to prevent reserved words from being
recognized as such, and to prevent parameter expansion.
- Each of the shell metacharacters (*note Definitions::.) has special
+ Each of the shell metacharacters (*note Definitions::) has special
meaning to the shell and must be quoted if it is to represent itself.
When the command history expansion facilities are being used, the
HISTORY EXPANSION character, usually `!', must be quoted to prevent
-history expansion. *Note Bash History Facilities:: for more details
+history expansion. *Note Bash History Facilities::, for more details
concerning history expansion. There are three quoting mechanisms: the
ESCAPE CHARACTER, single quotes, and double quotes.
@@ -421,8 +421,8 @@ Double Quotes
Enclosing characters in double quotes (`"') preserves the literal
value of all characters within the quotes, with the exception of `$',
``', and `\'. The characters `$' and ``' retain their special meaning
-within double quotes (*note Shell Expansions::.). The backslash
-retains its special meaning only when followed by one of the following
+within double quotes (*note Shell Expansions::). The backslash retains
+its special meaning only when followed by one of the following
characters: `$', ``', `"', `\', or `newline'. Within double quotes,
backslashes that are followed by one of these characters are removed.
Backslashes preceding characters without a special meaning are left
@@ -430,7 +430,7 @@ unmodified. A double quote may be quoted within double quotes by
preceding it with a backslash.
The special parameters `*' and `@' have special meaning when in
-double quotes (*note Shell Parameter Expansion::.).
+double quotes (*note Shell Parameter Expansion::).

File: bashref.info, Node: ANSI-C Quoting, Next: Locale Translation, Prev: Double Quotes, Up: Quoting
@@ -440,7 +440,7 @@ ANSI-C Quoting
Words of the form `$'STRING'' are treated specially. The word
expands to STRING, with backslash-escaped characters replaced as
-specifed by the ANSI C standard. Backslash escape sequences, if
+specified by the ANSI C standard. Backslash escape sequences, if
present, are decoded as follows:
`\a'
@@ -495,6 +495,12 @@ the string to be translated according to the current locale. If the
current locale is `C' or `POSIX', the dollar sign is ignored. If the
string is translated and replaced, the replacement is double-quoted.
+ Some systems use the message catalog selected by the `LC_MESSAGES'
+shell variable. Others create the name of the message catalog from the
+value of the `TEXTDOMAIN' shell variable, possibly adding a suffix of
+`.mo'. If you use the `TEXTDOMAIN' variable, you may need to set the
+`TEXTDOMAINDIR' variable to the location of the message catalog files.
+

File: bashref.info, Node: Comments, Prev: Quoting, Up: Shell Syntax
@@ -503,7 +509,7 @@ Comments
In a non-interactive shell, or an interactive shell in which the
`interactive_comments' option to the `shopt' builtin is enabled (*note
-Bash Builtins::.), a word beginning with `#' causes that word and all
+Bash Builtins::), a word beginning with `#' causes that word and all
remaining characters on that line to be ignored. An interactive shell
without the `interactive_comments' option enabled does not allow
comments. The `interactive_comments' option is on by default in
@@ -542,11 +548,11 @@ Simple Commands
A simple command is the kind of command encountered most often.
It's just a sequence of words separated by `blank's, terminated by one
-of the shell's control operators (*note Definitions::.). The first
-word generally specifies a command to be executed, with the rest of the
+of the shell's control operators (*note Definitions::). The first word
+generally specifies a command to be executed, with the rest of the
words being that command's arguments.
- The return status (*note Exit Status::.) of a simple command is its
+ The return status (*note Exit Status::) of a simple command is its
exit status as provided by the POSIX 1003.1 `waitpid' function, or
128+N if the command was terminated by signal N.
@@ -576,14 +582,14 @@ The use of `time' as a reserved word permits the timing of shell
builtins, shell functions, and pipelines. An external `time' command
cannot time these easily.
- If the pipeline is not executed asynchronously (*note Lists::.), the
+ If the pipeline is not executed asynchronously (*note Lists::), the
shell waits for all commands in the pipeline to complete.
Each command in a pipeline is executed in its own subshell (*note
-Command Execution Environment::.). The exit status of a pipeline is
-the exit status of the last command in the pipeline. If the reserved
-word `!' precedes the pipeline, the exit status is the logical negation
-of the exit status of the last command.
+Command Execution Environment::). The exit status of a pipeline is the
+exit status of the last command in the pipeline. If the reserved word
+`!' precedes the pipeline, the exit status is the logical negation of
+the exit status of the last command.

File: bashref.info, Node: Lists, Next: Looping Constructs, Prev: Pipelines, Up: Shell Commands
@@ -602,7 +608,7 @@ followed by `;' and `&', which have equal precedence.
executes the command asynchronously in a subshell. This is known as
executing the command in the BACKGROUND. The shell does not wait for
the command to finish, and the return status is 0 (true). When job
-control is not active (*note Job Control::.), the standard input for
+control is not active (*note Job Control::), the standard input for
asynchronous commands, in the absence of any explicit redirections, is
redirected from `/dev/null'.
@@ -662,7 +668,7 @@ syntax, it may be replaced with one or more newlines.
resultant list, with NAME bound to the current member. If `in
WORDS' is not present, the `for' command executes the COMMANDS
once for each positional parameter that is set, as if `in "$@"'
- had been specified (*note Special Parameters::.). The return
+ had been specified (*note Special Parameters::). The return
status is the exit status of the last command that executes. If
there are no items in the expansion of WORDS, no commands are
executed, and the return status is zero.
@@ -671,7 +677,7 @@ syntax, it may be replaced with one or more newlines.
for (( EXPR1 ; EXPR2 ; EXPR3 )) ; do COMMANDS ; done
First, the arithmetic expression EXPR1 is evaluated according to
- the rules described below (*note Shell Arithmetic::.). The
+ the rules described below (*note Shell Arithmetic::). The
arithmetic expression EXPR2 is then evaluated repeatedly until it
evaluates to zero. Each time EXPR2 evaluates to a non-zero value,
COMMANDS are executed and the arithmetic expression EXPR3 is
@@ -680,7 +686,7 @@ syntax, it may be replaced with one or more newlines.
command in LIST that is executed, or false if any of the
expressions is invalid.
- The `break' and `continue' builtins (*note Bourne Shell Builtins::.)
+ The `break' and `continue' builtins (*note Bourne Shell Builtins::)
may be used to control loop execution.

@@ -782,7 +788,7 @@ Conditional Constructs
(( EXPRESSION ))
The arithmetic EXPRESSION is evaluated according to the rules
- described below (*note Shell Arithmetic::.). If the value of the
+ described below (*note Shell Arithmetic::). If the value of the
expression is non-zero, the return status is 0; otherwise the
return status is 1. This is exactly equivalent to
let "EXPRESSION"
@@ -895,7 +901,7 @@ COMMAND-LIST must be terminated with a semicolon or a newline.
When a function is executed, the arguments to the function become
the positional parameters during its execution (*note Positional
-Parameters::.). The special parameter `#' that expands to the number of
+Parameters::). The special parameter `#' that expands to the number of
positional parameters is updated to reflect the change. Positional
parameter `0' is unchanged. The `FUNCNAME' variable is set to the name
of the function while the function is executing.
@@ -944,7 +950,7 @@ command substitution, arithmetic expansion, and quote removal (detailed
below). If the variable has its `integer' attribute set (see the
description of the `declare' builtin in *Note Bash Builtins::), then
VALUE is subject to arithmetic expansion even if the `$((...))'
-expansion is not used (*note Arithmetic Expansion::.). Word splitting
+expansion is not used (*note Arithmetic Expansion::). Word splitting
is not performed, with the exception of `"$@"' as explained below.
Filename expansion is not performed.
@@ -961,8 +967,8 @@ using the `set' builtin command. Positional parameter `N' may be
referenced as `${N}', or as `$N' when `N' consists of a single digit.
Positional parameters may not be assigned to with assignment statements.
The `set' and `shift' builtins are used to set and unset them (*note
-Shell Builtin Commands::.). The positional parameters are temporarily
-replaced when a shell function is executed (*note Shell Functions::.).
+Shell Builtin Commands::). The positional parameters are temporarily
+replaced when a shell function is executed (*note Shell Functions::).
When a positional parameter consisting of more than a single digit
is expanded, it must be enclosed in braces.
@@ -1016,11 +1022,11 @@ only be referenced; assignment to them is not allowed.
`0'
Expands to the name of the shell or shell script. This is set at
shell initialization. If Bash is invoked with a file of commands
- (*note Shell Scripts::.), `$0' is set to the name of that file.
- If Bash is started with the `-c' option (*note Invoking Bash::.),
- then `$0' is set to the first argument after the string to be
- executed, if one is present. Otherwise, it is set to the filename
- used to invoke Bash, as given by argument zero.
+ (*note Shell Scripts::), `$0' is set to the name of that file. If
+ Bash is started with the `-c' option (*note Invoking Bash::), then
+ `$0' is set to the first argument after the string to be executed,
+ if one is present. Otherwise, it is set to the filename used to
+ invoke Bash, as given by argument zero.
`_'
(An underscore.) At shell startup, set to the absolute filename
@@ -1080,10 +1086,10 @@ parameter, variable, and arithmetic expansion and command substitution.
Only brace expansion, word splitting, and filename expansion can
change the number of words of the expansion; other expansions expand a
single word to a single word. The only exceptions to this are the
-expansions of `"$@"' (*note Special Parameters::.) and `"${NAME[@]}"'
-(*note Arrays::.).
+expansions of `"$@"' (*note Special Parameters::) and `"${NAME[@]}"'
+(*note Arrays::).
- After all expansions, `quote removal' (*note Quote Removal::.) is
+ After all expansions, `quote removal' (*note Quote Removal::) is
performed.

@@ -1094,7 +1100,7 @@ Brace Expansion
Brace expansion is a mechanism by which arbitrary strings may be
generated. This mechanism is similar to FILENAME EXPANSION (*note
-Filename Expansion::.), but the file names generated need not exist.
+Filename Expansion::), but the file names generated need not exist.
Patterns to be brace expanded take the form of an optional PREAMBLE,
followed by a series of comma-separated strings between a pair of
braces, followed by an optional POSTSCRIPT. The preamble is prefixed
@@ -1149,7 +1155,7 @@ a number N, optionally prefixed by a `+' or a `-', the tilde-prefix is
replaced with the corresponding element from the directory stack, as it
would be displayed by the `dirs' builtin invoked with the characters
following tilde in the tilde-prefix as an argument (*note The Directory
-Stack::.). If the tilde-prefix, sans the tilde, consists of a number
+Stack::). If the tilde-prefix, sans the tilde, consists of a number
without a leading `+' or `-', `+' is assumed.
If the login name is invalid, or the tilde expansion fails, the word
@@ -1253,7 +1259,7 @@ if the colon is omitted, the operator tests only for existence.
character specified by OFFSET. If LENGTH is omitted, expands to
the substring of PARAMETER starting at the character specified by
OFFSET. LENGTH and OFFSET are arithmetic expressions (*note Shell
- Arithmetic::.). This is referred to as Substring Expansion.
+ Arithmetic::). This is referred to as Substring Expansion.
LENGTH must evaluate to a number greater than or equal to zero.
If OFFSET evaluates to a number less than zero, the value is used
@@ -1279,7 +1285,7 @@ if the colon is omitted, the operator tests only for existence.
`${PARAMETER#WORD}'
`${PARAMETER##WORD}'
The WORD is expanded to produce a pattern just as in filename
- expansion (*note Filename Expansion::.). If the pattern matches
+ expansion (*note Filename Expansion::). If the pattern matches
the beginning of the expanded value of PARAMETER, then the result
of the expansion is the expanded value of PARAMETER with the
shortest matching pattern (the `#' case) or the longest matching
@@ -1373,7 +1379,7 @@ substitution, and quote removal. Arithmetic substitutions may be
nested.
The evaluation is performed according to the rules listed below
-(*note Shell Arithmetic::.). If the expression is invalid, Bash prints
+(*note Shell Arithmetic::). If the expression is invalid, Bash prints
a message indicating failure to the standard error and no substitution
occurs.
@@ -1445,7 +1451,7 @@ Filename Expansion
* Pattern Matching:: How the shell matches patterns.
After word splitting, unless the `-f' option has been set (*note The
-Set Builtin::.), Bash scans each word for the characters `*', `?', and
+Set Builtin::), Bash scans each word for the characters `*', `?', and
`['. If one of these characters appears, then the word is regarded as
a PATTERN, and replaced with an alphabetically sorted list of file
names matching the pattern. If no matching file names are found, and
@@ -1454,8 +1460,8 @@ If the `nullglob' option is set, and no matches are found, the word is
removed. If the shell option `nocaseglob' is enabled, the match is
performed without regard to the case of alphabetic characters.
- When a pattern is used for filename generation, the character `.'
-at the start of a filename or immediately following a slash must be
+ When a pattern is used for filename generation, the character `.' at
+the start of a filename or immediately following a slash must be
matched explicitly, unless the shell option `dotglob' is set. When
matching a file name, the slash character must always be matched
explicitly. In other cases, the `.' character is not treated specially.
@@ -1466,7 +1472,7 @@ description of the `nocaseglob', `nullglob', and `dotglob' options.
The `GLOBIGNORE' shell variable may be used to restrict the set of
filenames matching a pattern. If `GLOBIGNORE' is set, each matching
filename that also matches one of the patterns in `GLOBIGNORE' is
-removed from the list of matches. The filenames `.' and `..' are
+removed from the list of matches. The filenames `.' and `..' are
always ignored, even when `GLOBIGNORE' is set. However, setting
`GLOBIGNORE' has the effect of enabling the `dotglob' shell option, so
all other filenames beginning with a `.' will match. To get the old
@@ -1494,12 +1500,25 @@ quoted if they are to be matched literally.
`[...]'
Matches any one of the enclosed characters. A pair of characters
- separated by a minus sign denotes a RANGE; any character lexically
- between those two characters, inclusive, is matched. If the first
- character following the `[' is a `!' or a `^' then any character
- not enclosed is matched. A `-' may be matched by including it as
- the first or last character in the set. A `]' may be matched by
- including it as the first character in the set.
+ separated by a hyphen denotes a RANGE EXPRESSION; any character
+ that sorts between those two characters, inclusive, using the
+ current locale's collating sequence and character set, is matched.
+ If the first character following the `[' is a `!' or a `^' then
+ any character not enclosed is matched. A `-' may be matched by
+ including it as the first or last character in the set. A `]' may
+ be matched by including it as the first character in the set. The
+ sorting order of characters in range expressions is determined by
+ the current locale and the value of the `LC_COLLATE' shell
+ variable, if set.
+
+ For example, in the default C locale, `[a-dx-z]' is equivalent to
+ `[abcdxyz]'. Many locales sort characters in dictionary order,
+ and in these locales `[a-dx-z]' is typically not equivalent to
+ `[abcdxyz]'; it might be equivalent to `[aBbCcDdxXyYz]', for
+ example. To obtain the traditional interpretation of ranges in
+ bracket expressions, you can force the use of the C locale by
+ setting the `LC_COLLATE' or `LC_ALL' environment variable to the
+ value `C'.
Within `[' and `]', CHARACTER CLASSES can be specified using the
syntax `[:'CLASS`:]', where CLASS is one of the following classes
@@ -1514,7 +1533,7 @@ quoted if they are to be matched literally.
collation weight (as defined by the current locale) as the
character C.
- Within `[' and `]', the syntax `[.'SYMBOL`.]' matches the
+ Within `[' and `]', the syntax `[.'SYMBOL`.]' matches the
collating symbol SYMBOL.
If the `extglob' shell option is enabled using the `shopt' builtin,
@@ -1769,12 +1788,12 @@ expansions, assignments, and redirections, from left to right.
processing.
2. The words that are not variable assignments or redirections are
- expanded (*note Shell Expansions::.). If any words remain after
+ expanded (*note Shell Expansions::). If any words remain after
expansion, the first word is taken to be the name of the command
and the remaining words are the arguments.
3. Redirections are performed as described above (*note
- Redirections::.).
+ Redirections::).
4. The text after the `=' in each variable assignment undergoes tilde
expansion, parameter expansion, command substitution, arithmetic
@@ -1872,10 +1891,11 @@ following:
* options enabled by `shopt'
- * shell aliases defined with `alias' (*note Aliases::.)
+ * shell aliases defined with `alias' (*note Aliases::)
* various process IDs, including those of background jobs (*note
- Lists::.), the value of `$$', and the value of `$PPID'
+ Lists::), the value of `$$', and the value of `$PPID'
+
When a simple command other than a builtin or shell function is to
be executed, it is invoked in a separate execution environment that
@@ -1890,11 +1910,12 @@ inherited from the shell.
* the file creation mode mask
* shell variables marked for export, along with variables exported
- for the command, passed in the environment (*note Environment::.)
+ for the command, passed in the environment (*note Environment::)
* traps caught by the shell are reset to the values inherited from
the shell's parent, and traps ignored by the shell are ignored
+
A command invoked in this separate environment cannot affect the
shell's execution environment.
@@ -1934,7 +1955,7 @@ temporarily by prefixing it with parameter assignments, as described in
*Note Shell Parameters::. These assignment statements affect only the
environment seen by that command.
- If the `-k' option is set (*note The Set Builtin::.), then all
+ If the `-k' option is set (*note The Set Builtin::), then all
parameter assignments are placed in the environment for a command, not
just those that precede the command name.
@@ -1963,8 +1984,8 @@ the return status is 126.
redirection, the exit status is greater than zero.
The exit status is used by the Bash conditional commands (*note
-Conditional Constructs::.) and some of the list constructs (*note
-Lists::.).
+Conditional Constructs::) and some of the list constructs (*note
+Lists::).
All of the Bash builtins return an exit status of zero if they
succeed and a non-zero status on failure, so they may be used by the
@@ -1982,7 +2003,7 @@ Signals
`SIGINT' is caught and handled (so that the `wait' builtin is
interruptible). When Bash receives a `SIGINT', it breaks out of any
executing loops. In all cases, Bash ignores `SIGQUIT'. If job control
-is in effect (*note Job Control::.), Bash ignores `SIGTTIN', `SIGTTOU',
+is in effect (*note Job Control::), Bash ignores `SIGTTIN', `SIGTTOU',
and `SIGTSTP'.
Commands started by Bash have signal handlers set to the values
@@ -1997,12 +2018,12 @@ exiting, it resends the `SIGHUP' to all jobs, running or stopped.
Stopped jobs are sent `SIGCONT' to ensure that they receive the
`SIGHUP'. To prevent the shell from sending the `SIGHUP' signal to a
particular job, it should be removed from the jobs table with the
-`disown' builtin (*note Job Control Builtins::.) or marked to not
+`disown' builtin (*note Job Control Builtins::) or marked to not
receive `SIGHUP' using `disown -h'.
If the `huponexit' shell option has been set with `shopt' (*note
-Bash Builtins::.), Bash sends a `SIGHUP' to all jobs when an
-interactive login shell exits.
+Bash Builtins::), Bash sends a `SIGHUP' to all jobs when an interactive
+login shell exits.
When Bash receives a signal for which a trap has been set while
waiting for a command to complete, the trap will not be executed until
@@ -2020,7 +2041,7 @@ Shell Scripts
A shell script is a text file containing shell commands. When such
a file is used as the first non-option argument when invoking Bash, and
-neither the `-c' nor `-s' option is supplied (*note Invoking Bash::.),
+neither the `-c' nor `-s' option is supplied (*note Invoking Bash::),
Bash reads and executes commands from the file, then exits. This mode
of operation creates a non-interactive shell. When Bash runs a shell
script, it sets the special parameter `0' to the name of the file,
@@ -2079,7 +2100,7 @@ Shell Builtin Commands
Builtin commands are contained within the shell itself. When the
name of a builtin command is used as the first word of a simple command
-(*note Simple Commands::.), the shell executes the command directly,
+(*note Simple Commands::), the shell executes the command directly,
without invoking another program. Builtin commands are necessary to
implement functionality impossible or inconvenient to obtain with
separate utilities.
@@ -2090,10 +2111,10 @@ have been extended in Bash.
Several builtin commands are described in other chapters: builtin
commands which provide the Bash interface to the job control facilities
-(*note Job Control Builtins::.), the directory stack (*note Directory
-Stack Builtins::.), the command history (*note Bash History
-Builtins::.), and the programmable completion facilities (*note
-Programmable Completion Builtins::.).
+(*note Job Control Builtins::), the directory stack (*note Directory
+Stack Builtins::), the command history (*note Bash History Builtins::),
+and the programmable completion facilities (*note Programmable
+Completion Builtins::).
Many of the builtins have been extended by POSIX or Bash.
@@ -2116,14 +2137,14 @@ standard.
. FILENAME [ARGUMENTS]
Read and execute commands from the FILENAME argument in the
current shell context. If FILENAME does not contain a slash, the
- `PATH' variable is used to find FILENAME. The current directory
- is searched if FILENAME is not found in `$PATH'. If any ARGUMENTS
- are supplied, they become the positional parameters when FILENAME
- is executed. Otherwise the positional parameters are unchanged.
- The return status is the exit status of the last command executed,
- or zero if no commands are executed. If FILENAME is not found, or
- cannot be read, the return status is non-zero. This builtin is
- equivalent to `source'.
+ `PATH' variable is used to find FILENAME. When Bash is not in
+ POSIX mode, the current directory is searched if FILENAME is not
+ found in `$PATH'. If any ARGUMENTS are supplied, they become the
+ positional parameters when FILENAME is executed. Otherwise the
+ positional parameters are unchanged. The return status is the
+ exit status of the last command executed, or zero if no commands
+ are executed. If FILENAME is not found, or cannot be read, the
+ return status is non-zero. This builtin is equivalent to `source'.
`break'
break [N]
@@ -2327,13 +2348,13 @@ standard.
If the first argument is `!', the expression is true if and
only if the second argument is null. If the first argument
is one of the unary conditional operators (*note Bash
- Conditional Expressions::.), the expression is true if the
+ Conditional Expressions::), the expression is true if the
unary test is true. If the first argument is not a valid
unary operator, the expression is false.
3 arguments
If the second argument is one of the binary conditional
- operators (*note Bash Conditional Expressions::.), the result
+ operators (*note Bash Conditional Expressions::), the result
of the expression is the result of the binary test using the
first and third arguments as operands. If the first argument
is `!', the value is the negation of the two-argument test
@@ -2437,10 +2458,10 @@ POSIX 1003.2 standard.
bind [-m KEYMAP] -x KEYSEQ:SHELL-COMMAND
bind [-m KEYMAP] KEYSEQ:FUNCTION-NAME
- Display current Readline (*note Command Line Editing::.) key and
+ Display current Readline (*note Command Line Editing::) key and
function bindings, or bind a key sequence to a Readline function
or macro. The binding syntax accepted is identical to that of a
- Readline initialization file (*note Readline Init File::.), but
+ Readline initialization file (*note Readline Init File::), but
each binding must be passed as a separate argument: e.g.,
`"\C-x\C-r":re-read-init-file'. Options, if supplied, have the
following meanings:
@@ -2448,7 +2469,7 @@ POSIX 1003.2 standard.
`-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',
+ `emacs-standard', `emacs-meta', `emacs-ctlx', `vi', `vi-move',
`vi-command', and `vi-insert'. `vi' is equivalent to
`vi-command'; `emacs' is equivalent to `emacs-standard'.
@@ -2514,7 +2535,7 @@ POSIX 1003.2 standard.
named `ls', running `command ls' within the function will execute
the external command `ls' instead of calling the function
recursively. The `-p' option means to use a default value for
- `$PATH' that is guaranteed to find all of the standard utilities.
+ `PATH' that is guaranteed to find all of the standard utilities.
The return status in this case is 127 if COMMAND cannot be found
or an error occurred, and the exit status of COMMAND otherwise.
@@ -2539,14 +2560,14 @@ POSIX 1003.2 standard.
the specified attributes or to give variables attributes:
`-a'
- Each NAME is an array variable (*note Arrays::.).
+ Each NAME is an array variable (*note Arrays::).
`-f'
Use function names only.
`-i'
The variable is to be treated as an integer; arithmetic
- evaluation (*note Shell Arithmetic::.) is performed when the
+ evaluation (*note Shell Arithmetic::) is performed when the
variable is assigned a value.
`-r'
@@ -2565,7 +2586,7 @@ POSIX 1003.2 standard.
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 (*note Arrays::.), one of the
+ using the compound assignment syntax (*note Arrays::), 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
@@ -2643,7 +2664,7 @@ POSIX 1003.2 standard.
If there are no options, a list of the shell builtins is displayed.
The `-s' option restricts `enable' to the POSIX special builtins.
If `-s' is used with `-f', the new builtin becomes a special
- builtin (*note Special Builtins::.).
+ builtin (*note Special Builtins::).
The return status is zero unless a NAME is not a shell builtin or
there is an error loading a new builtin from a shared object.
@@ -2724,8 +2745,8 @@ POSIX 1003.2 standard.
line, rather than newline.
`-e'
- Readline (*note Command Line Editing::.) is used to obtain
- the line.
+ Readline (*note Command Line Editing::) is used to obtain the
+ line.
`-n NCHARS'
`read' returns after reading NCHARS characters rather than
@@ -2774,7 +2795,7 @@ POSIX 1003.2 standard.
`-o'
Restricts the values of OPTNAME to be those defined for the
- `-o' option to the `set' builtin (*note The Set Builtin::.).
+ `-o' option to the `set' builtin (*note The Set Builtin::).
If either `-s' or `-u' is used with no OPTNAME arguments, the
display is limited to those options which are set or unset,
@@ -2833,7 +2854,7 @@ POSIX 1003.2 standard.
`extglob'
If set, the extended pattern matching features described above
- (*note Pattern Matching::.) are enabled.
+ (*note Pattern Matching::) are enabled.
`histappend'
If set, the history list is appended to the file named by the
@@ -2853,12 +2874,12 @@ POSIX 1003.2 standard.
`hostcomplete'
If set, and Readline is being used, Bash will attempt to
perform hostname completion when a word containing a `@' is
- being completed (*note Commands For Completion::.). This
+ being completed (*note Commands For Completion::). This
option is enabled by default.
`huponexit'
If set, Bash will send `SIGHUP' to all jobs when an
- interactive login shell exits (*note Signals::.).
+ interactive login shell exits (*note Signals::).
`interactive_comments'
Allow a word beginning with `#' to cause that word and all
@@ -2890,20 +2911,20 @@ POSIX 1003.2 standard.
`progcomp'
If set, the programmable completion facilities (*note
- Programmable Completion::.) are enabled. This option is
+ Programmable Completion::) are enabled. This option is
enabled by default.
`promptvars'
If set, prompt strings undergo variable and parameter
- expansion after being expanded (*note Printing a Prompt::.).
+ expansion after being expanded (*note Printing a Prompt::).
This option is enabled by default.
`restricted_shell'
The shell sets this option if it is started in restricted mode
- (*note The Restricted Shell::.). The value may not be
- changed. This is not reset when the startup files are
- executed, allowing the startup files to discover whether or
- not a shell is restricted.
+ (*note The Restricted Shell::). The value may not be changed.
+ This is not reset when the startup files are executed,
+ allowing the startup files to discover whether or not a shell
+ is restricted.
`shift_verbose'
If this is set, the `shift' builtin prints an error message
@@ -2926,7 +2947,7 @@ POSIX 1003.2 standard.
`source'
source FILENAME
- A synonym for `.' (*note Bourne Shell Builtins::.).
+ A synonym for `.' (*note Bourne Shell Builtins::).
`type'
type [-atp] [NAME ...]
@@ -3041,7 +3062,8 @@ The Set Builtin
Options, if specified, have the following meanings:
`-a'
- Mark variables which are modified or created for export.
+ Mark variables and function which are modified or created for
+ export to the environment of subsequent commands.
`-b'
Cause the status of terminated background jobs to be reported
@@ -3050,7 +3072,7 @@ The Set Builtin
`-e'
Exit immediately if a simple command (*note Simple
- Commands::.) exits with a non-zero status, unless the command
+ Commands::) exits with a non-zero status, unless the command
that fails is part of an `until' or `while' loop, part of an
`if' statement, part of a `&&' or `||' list, or if the
command's return status is being inverted using `!'.
@@ -3068,7 +3090,7 @@ The Set Builtin
the command name.
`-m'
- Job control is enabled (*note Job Control::.).
+ Job control is enabled (*note Job Control::).
`-n'
Read commands but do not execute them; this may be used to
@@ -3086,7 +3108,7 @@ The Set Builtin
`emacs'
Use an `emacs'-style line editing interface (*note
- Command Line Editing::.).
+ Command Line Editing::).
`errexit'
Same as `-e'.
@@ -3135,9 +3157,8 @@ The Set Builtin
`posix'
Change the behavior of Bash where the default operation
differs from the POSIX 1003.2 standard to match the
- standard (*note Bash POSIX Mode::.). This is intended
- to make Bash behave as a strict superset of that
- standard.
+ standard (*note Bash POSIX Mode::). This is intended to
+ make Bash behave as a strict superset of that standard.
`privileged'
Same as `-p'.
@@ -3181,7 +3202,7 @@ The Set Builtin
`-B'
The shell will perform brace expansion (*note Brace
- Expansion::.). This option is on by default.
+ Expansion::). This option is on by default.
`-C'
Prevent output redirection using `>', `>&', and `<>' from
@@ -3189,8 +3210,8 @@ The Set Builtin
`-H'
Enable `!' style history substitution (*note History
- Interaction::.). This option is on by default for
- interactive shells.
+ Interaction::). This option is on by default for interactive
+ shells.
`-P'
If set, do not follow symbolic links when performing commands
@@ -3242,7 +3263,7 @@ Special Builtins
================
For historical reasons, the POSIX 1003.2 standard has classified
-several builtin commands as *special*. When Bash is executing in POSIX
+several builtin commands as _special_. When Bash is executing in POSIX
mode, the special builtins differ from other builtin commands in three
respects:
@@ -3294,7 +3315,7 @@ shell. In some cases, Bash assigns a default value to the variable.
`HOME'
The current user's home directory; the default for the `cd' builtin
command. The value of this variable is also used by tilde
- expansion (*note Tilde Expansion::.).
+ expansion (*note Tilde Expansion::).
`IFS'
A list of characters that separate fields; used when the shell
@@ -3343,7 +3364,7 @@ normally treat them specially.
A few variables used by Bash are described in different chapters:
variables for controlling the job control facilities (*note Job Control
-Variables::.).
+Variables::).
`BASH'
The full pathname used to execute the current instance of Bash.
@@ -3358,7 +3379,7 @@ Variables::.).
The version number of the current instance of Bash.
`BASH_VERSINFO'
- A readonly array variable (*note Arrays::.) whose members hold
+ A readonly array variable (*note Arrays::) whose members hold
version information for this instance of Bash. The values
assigned to the array members are as follows:
@@ -3384,18 +3405,18 @@ Variables::.).
An array variable consisting of the individual words in the
current command line. This variable is available only in shell
functions invoked by the programmable completion facilities (*note
- Programmable Completion::.).
+ Programmable Completion::).
`COMP_CWORD'
An index into `${COMP_WORDS}' of the word containing the current
cursor position. This variable is available only in shell
functions invoked by the programmable completion facilities (*note
- Programmable Completion::.).
+ Programmable Completion::).
`COMP_LINE'
The current command line. This variable is available only in
shell functions and external commands invoked by the programmable
- completion facilities (*note Programmable Completion::.).
+ completion facilities (*note Programmable Completion::).
`COMP_POINT'
The index of the current cursor position relative to the beginning
@@ -3403,12 +3424,12 @@ Variables::.).
end of the current command, the value of this variable is equal to
`${#COMP_LINE}'. This variable is available only in shell
functions and external commands invoked by the programmable
- completion facilities (*note Programmable Completion::.).
+ completion facilities (*note Programmable Completion::).
`COMPREPLY'
An array variable from which Bash reads the possible completions
generated by a shell function invoked by the programmable
- completion facility (*note Programmable Completion::.).
+ completion facility (*note Programmable Completion::).
`DIRSTACK'
An array variable containing the current contents of the directory
@@ -3443,14 +3464,14 @@ Variables::.).
`GROUPS'
An array variable containing the list of groups of which the
current user is a member. Assignments to `GROUPS' have no effect
- and are silently discarded. If `GROUPS' is unset, it loses its
+ and return an error status. If `GROUPS' is unset, it loses its
special properties, even if it is subsequently reset.
`histchars'
Up to three characters which control history expansion, quick
- substitution, and tokenization (*note History Interaction::.).
- The first character is the HISTORY EXPANSION character, that is,
- the character which signifies the start of a history expansion,
+ substitution, and tokenization (*note History Interaction::). The
+ first character is the HISTORY EXPANSION character, that is, the
+ character which signifies the start of a history expansion,
normally `!'. The second character is the character which
signifies `quick substitution' when seen as the first character on
a line, normally `^'. The optional third character is the
@@ -3469,7 +3490,7 @@ Variables::.).
`FUNCNAME'
The name of any currently-executing shell function. This variable
exists only when a shell function is executing. Assignments to
- `FUNCNAME' have no effect and are silently discarded. If
+ `FUNCNAME' have no effect and return an error status. If
`FUNCNAME' is unset, it loses its special properties, even if it
is subsequently reset.
@@ -3561,21 +3582,31 @@ Variables::.).
results of filename expansion, and determines the behavior of
range expressions, equivalence classes, and collating sequences
within filename expansion and pattern matching (*note Filename
- Expansion::.).
+ Expansion::).
`LC_CTYPE'
This variable determines the interpretation of characters and the
behavior of character classes within filename expansion and pattern
- matching (*note Filename Expansion::.).
+ matching (*note Filename Expansion::).
`LC_MESSAGES'
This variable determines the locale used to translate double-quoted
- strings preceded by a `$' (*note Locale Translation::.).
+ strings preceded by a `$' (*note Locale Translation::).
`LC_NUMERIC'
This variable determines the locale category used for number
formatting.
+`LINES'
+ Used by the `select' builtin command to determine the column length
+ for printing selection lists. Automatically set upon receipt of a
+ `SIGWINCH'.
+
+`COLUMNS'
+ Used by the `select' builtin command to determine the terminal
+ width when printing selection lists. Automatically set upon
+ receipt of a `SIGWINCH'.
+
`LINENO'
The line number in the script or shell function currently
executing.
@@ -3586,7 +3617,11 @@ Variables::.).
`MAILCHECK'
How often (in seconds) that the shell should check for mail in the
- files specified in the `MAILPATH' or `MAIL' variables.
+ files specified in the `MAILPATH' or `MAIL' variables. The
+ default is 60 seconds. When it is time to check for mail, the
+ shell does so before displaying the primary prompt. If this
+ variable is unset, or set to a value that is not a number greater
+ than or equal to zero, the shell disables mail checking.
`OLDPWD'
The previous working directory as set by the `cd' builtin.
@@ -3599,7 +3634,7 @@ Variables::.).
A string describing the operating system Bash is running on.
`PIPESTATUS'
- An array variable (*note Arrays::.) containing a list of exit
+ An array variable (*note Arrays::) containing a list of exit
status values from the processes in the most-recently-executed
foreground pipeline (which may contain only a single command).
@@ -3618,7 +3653,7 @@ Variables::.).
`PS4'
The value is the prompt printed before the command line is echoed
- when the `-x' option is set (*note The Set Builtin::.). The first
+ when the `-x' option is set (*note The Set Builtin::). The first
character of `PS4' is replicated multiple times, as necessary, to
indicate multiple levels of indirection. The default is `+ '.
@@ -3642,7 +3677,7 @@ Variables::.).
`SHELLOPTS'
A colon-separated list of enabled shell options. Each word in the
list is a valid argument for the `-o' option to the `set' builtin
- command (*note The Set Builtin::.). The options appearing in
+ command (*note The Set Builtin::). The options appearing in
`SHELLOPTS' are those reported as `on' by `set -o'. If this
variable is in the environment when Bash starts up, each shell
option in the list will be enabled before reading any startup
@@ -3737,7 +3772,7 @@ Invoking Bash
bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [ARGUMENT ...]
In addition to the single-character shell command-line options
-(*note The Set Builtin::.), there are several multi-character options
+(*note The Set Builtin::), there are several multi-character options
that you can use. These options must appear on the command line before
the single-character options in order for them to be recognized.
@@ -3752,16 +3787,22 @@ the single-character options in order for them to be recognized.
`--help'
Display a usage message on standard output and exit sucessfully.
+`--init-file FILENAME'
+`--rcfile FILENAME'
+ Execute commands from FILENAME (instead of `~/.bashrc') in an
+ interactive shell.
+
`--login'
- Make this shell act as if it were directly invoked by login. This
- is equivalent to `exec -l bash' but can be issued from another
- shell, such as `csh'. `exec bash --login' will replace the
- current shell with a Bash login shell. *Note Bash Startup
- Files::, for a description of the special behavior of a login
- shell.
+ Make this shell act as if it had been directly invoked by login.
+ When the shell is interactive, this is equivalent to starting a
+ login shell with `exec -l bash'. When the shell is not
+ interactive, the login shell startup files will be executed.
+ `exec bash --login' will replace the current shell with a Bash
+ login shell. *Note Bash Startup Files::, for a description of the
+ special behavior of a login shell.
`--noediting'
- Do not use the GNU Readline library (*note Command Line Editing::.)
+ Do not use the GNU Readline library (*note Command Line Editing::)
to read command lines when the shell is interactive.
`--noprofile'
@@ -3781,12 +3822,8 @@ the single-character options in order for them to be recognized.
standard. *Note Bash POSIX Mode::, for a description of the Bash
POSIX mode.
-`--rcfile FILENAME'
- Execute commands from FILENAME (instead of `~/.bashrc') in an
- interactive shell.
-
`--restricted'
- Make the shell a restricted shell (*note The Restricted Shell::.).
+ Make the shell a restricted shell (*note The Restricted Shell::).
`--verbose'
Equivalent to `-v'. Print shell input lines as they're read.
@@ -3808,7 +3845,7 @@ invocation which are not available with the `set' builtin.
described in *Note Interactive Shells::.
`-r'
- Make the shell a restricted shell (*note The Restricted Shell::.).
+ Make the shell a restricted shell (*note The Restricted Shell::).
`-s'
If this option is present, or if no arguments remain after option
@@ -3820,7 +3857,7 @@ invocation which are not available with the `set' builtin.
A list of all double-quoted strings preceded by `$' is printed on
the standard ouput. These are the strings that are subject to
language translation when the current locale is not `C' or `POSIX'
- (*note Locale Translation::.). This implies the `-n' option; no
+ (*note Locale Translation::). This implies the `-n' option; no
commands will be executed.
`--'
@@ -3828,21 +3865,20 @@ invocation which are not available with the `set' builtin.
processing. Any arguments after the `--' are treated as filenames
and arguments.
- An *interactive* shell is one started without non-option arguments,
+ An _interactive_ shell is one started without non-option arguments,
unless `-s' is specified, without specifying the `-c' option, and whose
input and output are both connected to terminals (as determined by
`isatty(3)'), or one started with the `-i' option. *Note Interactive
-Shells:: for more information.
+Shells::, for more information.
If arguments remain after option processing, and neither the `-c'
nor the `-s' option has been supplied, the first argument is assumed to
-be the name of a file containing shell commands (*note Shell
-Scripts::.). When Bash is invoked in this fashion, `$0' is set to the
-name of the file, and the positional parameters are set to the
-remaining arguments. Bash reads and executes commands from this file,
-then exits. Bash's exit status is the exit status of the last command
-executed in the script. If no commands are executed, the exit status
-is 0.
+be the name of a file containing shell commands (*note Shell Scripts::).
+When Bash is invoked in this fashion, `$0' is set to the name of the
+file, and the positional parameters are set to the remaining arguments.
+Bash reads and executes commands from this file, then exits. Bash's
+exit status is the exit status of the last command executed in the
+script. If no commands are executed, the exit status is 0.

File: bashref.info, Node: Bash Startup Files, Next: Interactive Shells, Prev: Invoking Bash, Up: Bash Features
@@ -3853,7 +3889,7 @@ Bash Startup Files
This section describs how Bash executes its startup files. If any
of the files exist but cannot be read, Bash reports an error. Tildes
are expanded in file names as described above under Tilde Expansion
-(*note Tilde Expansion::.).
+(*note Tilde Expansion::).
Interactive shells are described in *Note Interactive Shells::.
@@ -3899,6 +3935,10 @@ following command were executed:
but the value of the `PATH' variable is not used to search for the file
name.
+ As noted above, if a non-interactive shell is invoked with the
+`--login' option, Bash attempts to read and execute commands from the
+login shell startup files.
+
Invoked with name `sh'
......................
@@ -3997,9 +4037,8 @@ contains `i' when the shell is interactive. For example:
*) echo This shell is not interactive ;;
esac
- Alternatively, startup scripts may examine the variable `$PS1'; it
-is unset in non-interactive shells, and set in interactive shells.
-Thus:
+ Alternatively, startup scripts may examine the variable `PS1'; it is
+unset in non-interactive shells, and set in interactive shells. Thus:
if [ -z "$PS1" ]; then
echo This shell is not interactive
@@ -4019,64 +4058,64 @@ several ways.
1. Startup files are read and executed as described in *Note Bash
Startup Files::.
- 2. Job Control (*note Job Control::.) is enabled by default. When job
+ 2. Job Control (*note Job Control::) is enabled by default. When job
control is in effect, Bash ignores the keyboard-generated job
control signals `SIGTTIN', `SIGTTOU', and `SIGTSTP'.
- 3. Bash expands and displays `$PS1' before reading the first line of
- a command, and expands and displays `$PS2' before reading the
- second and subsequent lines of a multi-line command.
+ 3. Bash expands and displays `PS1' before reading the first line of a
+ command, and expands and displays `PS2' before reading the second
+ and subsequent lines of a multi-line command.
4. Bash executes the value of the `PROMPT_COMMAND' variable as a
command before printing the primary prompt, `$PS1' (*note Bash
- Variables::.).
+ Variables::).
- 5. Readline (*note Command Line Editing::.) is used to read commands
+ 5. Readline (*note Command Line Editing::) is used to read commands
from the user's terminal.
6. Bash inspects the value of the `ignoreeof' option to `set -o'
instead of exiting immediately when it receives an `EOF' on its
- standard input when reading a command (*note The Set Builtin::.).
+ standard input when reading a command (*note The Set Builtin::).
- 7. Command history (*note Bash History Facilities::.) and history
- expansion (*note History Interaction::.) are enabled by default.
+ 7. Command history (*note Bash History Facilities::) and history
+ expansion (*note History Interaction::) are enabled by default.
Bash will save the command history to the file named by `$HISTFILE'
when an interactive shell exits.
- 8. Alias expansion (*note Aliases::.) is performed by default.
+ 8. Alias expansion (*note Aliases::) is performed by default.
9. In the absence of any traps, Bash ignores `SIGTERM' (*note
- Signals::.).
+ Signals::).
10. In the absence of any traps, `SIGINT' is caught and handled
- ((*note Signals::.). `SIGINT' will interrupt some shell builtins.
+ ((*note Signals::). `SIGINT' will interrupt some shell builtins.
11. An interactive login shell sends a `SIGHUP' to all jobs on exit if
- the `hupoxexit' shell option has been enabled (*note Signals::.).
+ the `hupoxexit' shell option has been enabled (*note Signals::).
12. The `-n' invocation option is ignored, and `set -n' has no effect
- (*note The Set Builtin::.).
+ (*note The Set Builtin::).
13. Bash will check for mail periodically, depending on the values of
the `MAIL', `MAILPATH', and `MAILCHECK' shell variables (*note
- Bash Variables::.).
+ Bash Variables::).
14. Expansion errors due to references to unbound shell variables after
`set -u' has been enabled will not cause the shell to exit (*note
- The Set Builtin::.).
+ The Set Builtin::).
15. The shell will not exit on expansion errors caused by VAR being
unset or null in `${VAR:?WORD}' expansions (*note Shell Parameter
- Expansion::.).
+ Expansion::).
16. Redirection errors encountered by shell builtins will not cause the
shell to exit.
17. When running in POSIX mode, a special builtin returning an error
- status will not cause the shell to exit (*note Bash POSIX Mode::.).
+ status will not cause the shell to exit (*note Bash POSIX Mode::).
18. A failed `exec' will not cause the shell to exit (*note Bourne
- Shell Builtins::.).
+ Shell Builtins::).
19. Parser syntax errors will not cause the shell to exit.
@@ -4086,7 +4125,7 @@ several ways.
21. The shell will check the value of the `TMOUT' variable and exit if
a command is not read within the specified number of seconds after
- printing `$PS1' (*note Bash Variables::.).
+ printing `$PS1' (*note Bash Variables::).

@@ -4181,7 +4220,7 @@ checked. If the FILE argument to one of the primaries is one of
`-o OPTNAME'
True if shell option OPTNAME is enabled. The list of options
appears in the description of the `-o' option to the `set' builtin
- (*note The Set Builtin::.).
+ (*note The Set Builtin::).
`-z STRING'
True if the length of STRING is zero.
@@ -4330,11 +4369,11 @@ with the `unalias' command.
There is no mechanism for using arguments in the replacement text,
as in `csh'. If arguments are needed, a shell function should be used
-(*note Shell Functions::.).
+(*note Shell Functions::).
Aliases are not expanded when the shell is not interactive, unless
the `expand_aliases' shell option is set using `shopt' (*note Bash
-Builtins::.).
+Builtins::).
The rules concerning the definition and use of aliases are somewhat
confusing. Bash always reads at least one complete line of input
@@ -4616,12 +4655,12 @@ which can appear in the prompt variables:
The command number and the history number are usually different: the
history number of a command is its position in the history list, which
may include commands restored from the history file (*note Bash History
-Facilities::.), while the command number is the position in the
-sequence of commands executed during the current shell session.
+Facilities::), while the command number is the position in the sequence
+of commands executed during the current shell session.
After the string is decoded, it is expanded via parameter expansion,
command substitution, arithmetic expansion, and quote removal, subject
-to the value of the `promptvars' shell option (*note Bash Builtins::.).
+to the value of the `promptvars' shell option (*note Bash Builtins::).

File: bashref.info, Node: The Restricted Shell, Next: Bash POSIX Mode, Prev: Printing a Prompt, Up: Bash Features
@@ -4682,10 +4721,12 @@ that specified by POSIX in areas where the Bash default differs.
re-search `$PATH' to find the new location. This is also
available with `shopt -s checkhash'.
- 2. The `>&' redirection does not redirect stdout and stderr.
+ 2. The message printed by the job control code and builtins when a job
+ exits with a non-zero status is `Done(status)'.
3. The message printed by the job control code and builtins when a job
- exits with a non-zero status is `Done(status)'.
+ is stopped is `Stopped(SIGNAME)', where SIGNAME is, for example,
+ `SIGTSTP'.
4. Reserved words may not be aliased.
@@ -4739,7 +4780,7 @@ that specified by POSIX in areas where the Bash default differs.
`$CDPATH', the value it assigns to the `PWD' variable does not
contain any symbolic links, as if `cd -P' had been executed.
- 19. If `$CDPATH' is set, the `cd' builtin will not implicitly append
+ 19. If `CDPATH' is set, the `cd' builtin will not implicitly append
the current directory to it. This means that `cd' will fail if no
valid directory name can be constructed from any of the entries in
`$CDPATH', even if the a directory with the same name as the name
@@ -4759,9 +4800,27 @@ that specified by POSIX in areas where the Bash default differs.
23. Assignment statements preceding POSIX 1003.2 special builtins
persist in the shell environment after the builtin completes.
- 24. The `export' and `readonly' builtin commands display their output
+ 24. Assignment statements preceding shell function calls persist in the
+ shell environment after the function returns, as if a POSIX
+ special builtin command had been executed.
+
+ 25. The `export' and `readonly' builtin commands display their output
in the format required by POSIX 1003.2.
+ 26. The `trap' builtin displays signal names without the leading `SIG'.
+
+ 27. The `.' and `source' builtins do not search the current directory
+ for the filename argument if it is not found by searching `PATH'.
+
+ 28. Subshells spawned to execute command substitutions inherit the
+ value of the `-e' option from the parent shell. When not in POSIX
+ mode, Bash clears the `-e' option in such subshells.
+
+ 29. Alias expansion is always enabled, even in non-interactive shells.
+
+ 30. When the `set' builtin is invoked without options, it does not
+ display shell function names and definitions.
+
There is other POSIX 1003.2 behavior that Bash does not implement.
Specifically:
@@ -4769,6 +4828,16 @@ Specifically:
1. Assignment statements affect the execution environment of all
builtins, not just special ones.
+ 2. When a subshell is created to execute a shell script with execute
+ permission, but without a leading `#!', Bash sets `$0' to the full
+ pathname of the script as found by searching `$PATH', rather than
+ the command as typed by the user.
+
+ 3. When using `.' to source a shell script found in `$PATH', bash
+ checks execute permission bits rather than read permission bits,
+ just as if it were searching for a command.
+
+

File: bashref.info, Node: Job Control, Next: Using History Interactively, Prev: Bash Features, Up: Top
@@ -4860,7 +4929,7 @@ equivalent to `bg %1'
Normally, Bash waits until it is about to print a prompt before
reporting changes in a job's status so as to not interrupt any other
output. If the the `-b' option to the `set' builtin is enabled, Bash
-reports such changes immediately (*note The Set Builtin::.).
+reports such changes immediately (*note The Set Builtin::).
If an attempt to exit Bash is while jobs are stopped, the shell
prints a message warning that there are stopped jobs. The `jobs'
@@ -4989,8 +5058,8 @@ Job Control Variables
`substring', the string supplied needs to match a substring of the
name of a stopped job. The `substring' value provides
functionality analogous to the `%?' job ID (*note Job Control
- Basics::.). If set to any other value, the supplied string must
- be a prefix of a stopped job's name; this provides functionality
+ Basics::). If set to any other value, the supplied string must be
+ a prefix of a stopped job's name; this provides functionality
analogous to the `%' job ID.

@@ -5027,10 +5096,10 @@ Introduction to Line Editing
The following paragraphs describe the notation used to represent
keystrokes.
- The text <C-k> is read as `Control-K' and describes the character
+ The text `C-k' is read as `Control-K' and describes the character
produced when the <k> key is pressed while the Control key is depressed.
- The text <M-k> is read as `Meta-K' and describes the character
+ The text `M-k' is read as `Meta-K' and describes the character
produced when the Meta key (if you have one) is depressed, and the <k>
key is pressed. The Meta key is labeled <ALT> on many keyboards. On
keyboards with two keys labeled <ALT> (usually to either side of the
@@ -5041,18 +5110,18 @@ Compose key for typing accented characters.
If you do not have a Meta or <ALT> key, or another key working as a
Meta key, the identical keystroke can be generated by typing <ESC>
-first, and then typing <k>. Either process is known as "metafying" the
-<k> key.
+_first_, and then typing <k>. Either process is known as "metafying"
+the <k> key.
- The text <M-C-k> is read as `Meta-Control-k' and describes the
-character produced by "metafying" <C-k>.
+ The text `M-C-k' is read as `Meta-Control-k' and describes the
+character produced by "metafying" `C-k'.
In addition, several keys have their own names. Specifically,
<DEL>, <ESC>, <LFD>, <SPC>, <RET>, and <TAB> all stand for themselves
-when seen in this text, or in an init file (*note Readline Init
-File::.). If your keyboard lacks a <LFD> key, typing <C-j> will
-produce the desired character. The <RET> key may be labeled <Return>
-or <Enter> on some keyboards.
+when seen in this text, or in an init file (*note Readline Init File::).
+If your keyboard lacks a <LFD> key, typing <C-j> will produce the
+desired character. The <RET> key may be labeled <Return> or <Enter> on
+some keyboards.

File: bashref.info, Node: Readline Interaction, Next: Readline Init File, Prev: Introduction and Notation, Up: Command Line Editing
@@ -5067,9 +5136,9 @@ as you type it in, allowing you to just fix your typo, and not forcing
you to retype the majority of the line. Using these editing commands,
you move the cursor to the place that needs correction, and delete or
insert the text of the corrections. Then, when you are satisfied with
-the line, you simply press <RETURN>. You do not have to be at the end
-of the line to press <RETURN>; the entire line is accepted regardless
-of the location of the cursor within the line.
+the line, you simply press <RET>. You do not have to be at the end of
+the line to press <RET>; the entire line is accepted regardless of the
+location of the cursor within the line.
* Menu:
@@ -5092,8 +5161,8 @@ erase character to back up and delete the mistyped character.
Sometimes you may mistype a character, and not notice the error
until you have typed several other characters. In that case, you can
-type <C-b> to move the cursor to the left, and then correct your
-mistake. Afterwards, you can move the cursor to the right with <C-f>.
+type `C-b' to move the cursor to the left, and then correct your
+mistake. Afterwards, you can move the cursor to the right with `C-f'.
When you add text in the middle of a line, you will notice that
characters to the right of the cursor are `pushed over' to make room
@@ -5103,28 +5172,28 @@ back' to fill in the blank space created by the removal of the text. A
list of the bare essentials for editing the text of an input line
follows.
-<C-b>
+`C-b'
Move back one character.
-<C-f>
+`C-f'
Move forward one character.
<DEL> or <Backspace>
Delete the character to the left of the cursor.
-<C-d>
+`C-d'
Delete the character underneath the cursor.
Printing characters
Insert the character into the line at the cursor.
-<C-_> or <C-x C-u>
+`C-_' or `C-x C-u'
Undo the last editing command. You can undo all the way back to an
empty line.
(Depending on your configuration, the <Backspace> key be set to delete
the character to the left of the cursor and the <DEL> key set to delete
-the character underneath the cursor, like <C-d>, rather than the
+the character underneath the cursor, like `C-d', rather than the
character to the left of the cursor.)

@@ -5135,26 +5204,26 @@ Readline Movement Commands
The above table describes the most basic keystrokes that you need in
order to do editing of the input line. For your convenience, many
-other commands have been added in addition to <C-b>, <C-f>, <C-d>, and
+other commands have been added in addition to `C-b', `C-f', `C-d', and
<DEL>. Here are some commands for moving more rapidly about the line.
-<C-a>
+`C-a'
Move to the start of the line.
-<C-e>
+`C-e'
Move to the end of the line.
-<M-f>
+`M-f'
Move forward a word, where a word is composed of letters and
digits.
-<M-b>
+`M-b'
Move backward a word.
-<C-l>
+`C-l'
Clear the screen, reprinting the current line at the top.
- Notice how <C-f> moves forward a character, while <M-f> moves
+ Notice how `C-f' moves forward a character, while `M-f' moves
forward a word. It is a loose convention that control keystrokes
operate on characters while meta keystrokes operate on words.
@@ -5181,34 +5250,34 @@ available to be yanked back later, when you are typing another line.
Here is the list of commands for killing text.
-<C-k>
+`C-k'
Kill the text from the current cursor position to the end of the
line.
-<M-d>
+`M-d'
Kill from the cursor to the end of the current word, or, if between
words, to the end of the next word. Word boundaries are the same
- as those used by <M-f>.
+ as those used by `M-f'.
-<M-DEL>
+`M-<DEL>'
Kill from the cursor the start of the previous word, or, if between
words, to the start of the previous word. Word boundaries are the
- same as those used by <M-b>.
+ same as those used by `M-b'.
-<C-w>
+`C-w'
Kill from the cursor to the previous whitespace. This is
- different than <M-DEL> because the word boundaries differ.
+ different than `M-<DEL>' because the word boundaries differ.
Here is how to "yank" the text back into the line. Yanking means to
copy the most-recently-killed text from the kill buffer.
-<C-y>
+`C-y'
Yank the most recently killed text back into the buffer at the
cursor.
-<M-y>
+`M-y'
Rotate the kill-ring, and yank the new top. You can only do this
- if the prior command is <C-y> or <M-y>.
+ if the prior command is `C-y' or `M-y'.

File: bashref.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline Interaction
@@ -5228,7 +5297,8 @@ meta digits before the command. If the first `digit' typed is a minus
sign (`-'), then the sign of the argument will be negative. Once you
have typed one meta digit to get the argument started, you can type the
remainder of the digits, and then the command. For example, to give
-the <C-d> command an argument of 10, you could type `M-1 0 C-d'.
+the `C-d' command an argument of 10, you could type `M-1 0 C-d', which
+will delete the next ten characters on the input line.

File: bashref.info, Node: Searching, Prev: Readline Arguments, Up: Readline Interaction
@@ -5237,30 +5307,32 @@ Searching for Commands in the History
-------------------------------------
Readline provides commands for searching through the command history
-(*note Bash History Facilities::.) for lines containing a specified
-string. There are two search modes: INCREMENTAL and NON-INCREMENTAL.
+(*note Bash History Facilities::) for lines containing a specified
+string. There are two search modes: "incremental" and
+"non-incremental".
Incremental searches begin before the user has finished typing the
search string. As each character of the search string is typed,
Readline displays the next entry from the history matching the string
typed so far. An incremental search requires only as many characters
as needed to find the desired history entry. To search backward in the
-history for a particular string, type <C-r>. Typing <C-s> searches
+history for a particular string, type `C-r'. Typing `C-s' searches
forward through the history. The characters present in the value of
the `isearch-terminators' variable are used to terminate an incremental
search. If that variable has not been assigned a value, the <ESC> and
-<C-J> characters will terminate an incremental search. <C-g> will
+`C-J' characters will terminate an incremental search. `C-g' will
abort an incremental search and restore the original line. When the
search is terminated, the history entry containing the search string
becomes the current line.
- To find other matching entries in the history list, type <C-r> or
-<C-s> as appropriate. This will search backward or forward in the
+ To find other matching entries in the history list, type `C-r' or
+`C-s' as appropriate. This will search backward or forward in the
history for the next entry matching the search string typed so far.
Any other key sequence bound to a Readline command will terminate the
search and execute that command. For instance, a <RET> will terminate
the search and accept the line, thereby executing the command from the
-history list.
+history list. A movement command will terminate the search, make the
+last line found the current line, and begin editing.
Non-incremental searches read the entire search string before
starting to search for matching history lines. The search string may be
@@ -5303,17 +5375,24 @@ Readline Init File Syntax
There are only a few basic constructs allowed in the Readline init
file. Blank lines are ignored. Lines beginning with a `#' are
comments. Lines beginning with a `$' indicate conditional constructs
-(*note Conditional Init Constructs::.). Other lines denote variable
+(*note Conditional Init Constructs::). Other lines denote variable
settings and key bindings.
Variable Settings
You can modify the run-time behavior of Readline by altering the
values of variables in Readline using the `set' command within the
- init file. Here is how to change from the default Emacs-like key
- binding to use `vi' line editing commands:
+ init file. The syntax is simple:
+
+ set VARIABLE VALUE
+
+ Here, for example, is how to change from the default Emacs-like
+ key binding to use `vi' line editing commands:
set editing-mode vi
+ Variable names and values, where appropriate, are recognized
+ without regard to case.
+
The `bind -V' command lists the current Readline variable names
and values. *Note Bash Builtins::.
@@ -5343,7 +5422,8 @@ Variable Settings
possibilities. If the number of possible completions is
greater than this value, Readline will ask the user whether
or not he wishes to view them; otherwise, they are simply
- listed. The default limit is `100'.
+ listed. This variable must be set to an integer value
+ greater than or equal to 0. The default limit is `100'.
`convert-meta'
If set to `on', Readline will convert characters with the
@@ -5380,7 +5460,7 @@ Variable Settings
`input-meta'
If set to `on', Readline will enable eight-bit input (it will
- not strip the eighth bit from the characters it reads),
+ not clear the eighth bit in the characters it reads),
regardless of what the terminal claims it can support. The
default value is `off'. The name `meta-flag' is a synonym
for this variable.
@@ -5388,14 +5468,14 @@ Variable Settings
`isearch-terminators'
The string of characters that should terminate an incremental
search without subsequently executing the character as a
- command (*note Searching::.). If this variable has not been
- given a value, the characters <ESC> and <C-J> will terminate
+ command (*note Searching::). If this variable has not been
+ given a value, the characters <ESC> and `C-J' will terminate
an incremental search.
`keymap'
Sets Readline's idea of the current keymap for key binding
commands. Acceptable `keymap' names are `emacs',
- `emacs-standard', `emacs-meta', `emacs-ctlx', `vi',
+ `emacs-standard', `emacs-meta', `emacs-ctlx', `vi', `vi-move',
`vi-command', and `vi-insert'. `vi' is equivalent to
`vi-command'; `emacs' is equivalent to `emacs-standard'. The
default value is `emacs'. The value of the `editing-mode'
@@ -5438,11 +5518,14 @@ Key Bindings
command name, the default keybinding, if any, and a short
description of what the command does.
- Once you know the name of the command, simply place the name of
- the key you wish to bind the command to, a colon, and then the
- name of the command on a line in the init file. The name of the
- key can be expressed in different ways, depending on which is most
- comfortable for you.
+ Once you know the name of the command, simply place on a line in
+ the init file the name of the key you wish to bind the command to,
+ a colon, and then the name of the command. The name of the key
+ can be expressed in different ways, depending on what you find most
+ comfortable.
+
+ In addition to command names, readline allows keys to be bound to
+ a string that is inserted when the key is pressed (a MACRO).
The `bind -p' command displays Readline function names and
bindings in a format that can put directly into an initialization
@@ -5455,11 +5538,16 @@ Key Bindings
Meta-Rubout: backward-kill-word
Control-o: "> output"
- In the above example, <C-u> is bound to the function
- `universal-argument', and <C-o> is bound to run the macro
+ In the above example, `C-u' is bound to the function
+ `universal-argument', `M-DEL' is bound to the function
+ `backward-kill-word', and `C-o' is bound to run the macro
expressed on the right hand side (that is, to insert the text
`> output' into the line).
+ A number of symbolic character names are recognized while
+ processing this key binding syntax: DEL, ESC, ESCAPE, LFD,
+ NEWLINE, RET, RETURN, RUBOUT, SPACE, SPC, and TAB.
+
"KEYSEQ": FUNCTION-NAME or MACRO
KEYSEQ differs from KEYNAME above in that strings denoting an
entire key sequence can be specified, by placing the key
@@ -5471,11 +5559,11 @@ Key Bindings
"\C-x\C-r": re-read-init-file
"\e[11~": "Function Key 1"
- In the above example, <C-u> is bound to the function
+ In the above example, `C-u' is again bound to the function
`universal-argument' (just as it was in the first example),
- `<C-x> <C-r>' is bound to the function `re-read-init-file',
- and `<ESC> <[> <1> <1> <~>' is bound to insert the text
- `Function Key 1'.
+ `C-x C-r' is bound to the function `re-read-init-file', and
+ `<ESC> <[> <1> <1> <~>' is bound to insert the text `Function
+ Key 1'.
The following GNU Emacs style escape sequences are available when
specifying key sequences:
@@ -5526,11 +5614,11 @@ Key Bindings
vertical tab
`\NNN'
- the character whose `ASCII' code is the octal value NNN (one
- to three digits)
+ the character whose ASCII code is the octal value NNN (one to
+ three digits)
`\xNNN'
- the character whose `ASCII' code is the hexadecimal value NNN
+ the character whose ASCII code is the hexadecimal value NNN
(one to three digits)
When entering the text of a macro, single or double quotes must be
@@ -5579,10 +5667,10 @@ are four parser directives used.
The APPLICATION construct is used to include
application-specific settings. Each program using the
Readline library sets the APPLICATION NAME, and you can test
- for it. This could be used to bind key sequences to
- functions useful for a specific program. For instance, the
- following command adds a key sequence that quotes the current
- or previous word in Bash:
+ for a particular value. This could be used to bind key
+ sequences to functions useful for a specific program. For
+ instance, the following command adds a key sequence that
+ quotes the current or previous word in Bash:
$if Bash
# Quote the current or previous word
"\C-xq": "\eb\"\ef\""
@@ -5598,7 +5686,8 @@ are four parser directives used.
`$include'
This directive takes a single filename as an argument and reads
- commands and bindings from that file.
+ commands and bindings from that file. For example, the following
+ directive reads from `/etc/inputrc':
$include /etc/inputrc

@@ -5607,7 +5696,7 @@ File: bashref.info, Node: Sample Init File, Prev: Conditional Init Constructs,
Sample Init File
----------------
- Here is an example of an inputrc file. This illustrates key
+ Here is an example of an INPUTRC file. This illustrates key
binding, variable assignment, and conditional syntax.
@@ -5729,13 +5818,13 @@ Bindable Readline Commands
This section describes Readline commands that may be bound to key
sequences. You can list your key bindings by executing `bind -P' or,
for a more terse format, suitable for an INPUTRC file, `bind -p'.
-(*Note Bash Builtins::.)
+(*Note Bash Builtins::.) Command names without an accompanying key
+sequence are unbound by default.
- Command names without an accompanying key sequence are unbound by
-default. In the following descriptions, POINT refers to the current
-cursor position, and MARK refers to a cursor position saved by the
+ In the following descriptions, "point" refers to the current cursor
+position, and "mark" refers to a cursor position saved by the
`set-mark' command. The text between the point and mark is referred to
-as the REGION.
+as the "region".

File: bashref.info, Node: Commands For Moving, Next: Commands For History, Up: Bindable Readline Commands
@@ -5776,17 +5865,19 @@ File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev
Commands For Manipulating The History
-------------------------------------
-`accept-line (Newline, Return)'
+`accept-line (Newline or Return)'
Accept the line regardless of where the cursor is. If this line is
non-empty, add it to the history list according to the setting of
- the `HISTCONTROL' and `HISTIGNORE' variables. If this line was a
- history line, then restore the history line to its original state.
+ the `HISTCONTROL' and `HISTIGNORE' variables. If this line is a
+ modified history line, then restore the history line to its
+ original state.
`previous-history (C-p)'
- Move `up' through the history list.
+ Move `back' through the history list, fetching the previous
+ command.
`next-history (C-n)'
- Move `down' through the history list.
+ Move `forward' through the history list, fetching the next command.
`beginning-of-history (M-<)'
Move to the first line in the history.
@@ -5826,12 +5917,12 @@ Commands For Manipulating The History
`yank-nth-arg (M-C-y)'
Insert the first argument to the previous command (usually the
- second word on the previous line). With an argument N, insert the
- Nth word from the previous command (the words in the previous
- command begin with word 0). A negative argument inserts the Nth
- word from the end of the previous command.
+ second word on the previous line) at point. With an argument N,
+ insert the Nth word from the previous command (the words in the
+ previous command begin with word 0). A negative argument inserts
+ the Nth word from the end of the previous command.
-`yank-last-arg (M-., M-_)'
+`yank-last-arg (M-. or M-_)'
Insert last argument to the previous command (the last word of the
previous history entry). With an argument, behave exactly like
`yank-nth-arg'. Successive calls to `yank-last-arg' move back
@@ -5845,10 +5936,9 @@ Commands For Changing Text
--------------------------
`delete-char (C-d)'
- Delete the character under the cursor. If the cursor is at the
- beginning of the line, there are no characters in the line, and
- the last character typed was not bound to `delete-char', then
- return `EOF'.
+ Delete the character at point. If point is at the beginning of
+ the line, there are no characters in the line, and the last
+ character typed was not bound to `delete-char', then return EOF.
`backward-delete-char (Rubout)'
Delete the character behind the cursor. A numeric argument means
@@ -5859,9 +5949,9 @@ Commands For Changing Text
end of the line, in which case the character behind the cursor is
deleted. By default, this is not bound to a key.
-`quoted-insert (C-q, C-v)'
+`quoted-insert (C-q or C-v)'
Add the next character typed to the line verbatim. This is how to
- insert key sequences like <C-q>, for example.
+ insert key sequences like `C-q', for example.
`self-insert (a, b, A, 1, !, ...)'
Insert yourself.
@@ -5904,15 +5994,15 @@ Killing And Yanking
Kill backward from the cursor to the beginning of the current line.
`kill-whole-line ()'
- Kill all characters on the current line, no matter point is. By
- default, this is unbound.
+ Kill all characters on the current line, no matter where point is.
+ By default, this is unbound.
`kill-word (M-d)'
Kill from point to the end of the current word, or if between
words, to the end of the next word. Word boundaries are the same
as `forward-word'.
-`backward-kill-word (M-DEL)'
+`backward-kill-word (M-<DEL>)'
Kill the word behind point. Word boundaries are the same as
`backward-word'.
@@ -5943,12 +6033,11 @@ Killing And Yanking
command is unbound.
`yank (C-y)'
- Yank the top of the kill ring into the buffer at the current
- cursor position.
+ Yank the top of the kill ring into the buffer at point.
`yank-pop (M-y)'
Rotate the kill-ring, and yank the new top. You can only do this
- if the prior command is yank or yank-pop.
+ if the prior command is `yank' or `yank-pop'.

File: bashref.info, Node: Numeric Arguments, Next: Commands For Completion, Prev: Commands For Killing, Up: Bindable Readline Commands
@@ -5958,7 +6047,7 @@ Specifying Numeric Arguments
`digit-argument (M-0, M-1, ... M--)'
Add this digit to the argument already accumulating, or start a new
- argument. <M-> starts a negative argument.
+ argument. `M--' starts a negative argument.
`universal-argument ()'
This is another way to specify an argument. If this command is
@@ -5979,21 +6068,17 @@ File: bashref.info, Node: Commands For Completion, Next: Keyboard Macros, Pre
Letting Readline Type For You
-----------------------------
-`complete (TAB)'
- Attempt to do completion on the text before the cursor. This is
- application-specific. Generally, if you are typing a filename
- argument, you can do filename completion; if you are typing a
- command, you can do command completion; if you are typing in a
- symbol to GDB, you can do symbol name completion; if you are
- typing in a variable to Bash, you can do variable name completion,
- and so on. Bash attempts completion treating the text as a
- variable (if the text begins with `$'), username (if the text
- begins with `~'), hostname (if the text begins with `@'), or
- command (including aliases and functions) in turn. If none of
- these produces a match, filename completion is attempted.
+`complete (<TAB>)'
+ Attempt to perform completion on the text before point. The
+ actual completion performed is application-specific. Bash
+ attempts completion treating the text as a variable (if the text
+ begins with `$'), username (if the text begins with `~'), hostname
+ (if the text begins with `@'), or command (including aliases and
+ functions) in turn. If none of these produces a match, filename
+ completion is attempted.
`possible-completions (M-?)'
- List the possible completions of the text before the cursor.
+ List the possible completions of the text before point.
`insert-completions (M-*)'
Insert all completions of the text before point that would have
@@ -6004,10 +6089,11 @@ Letting Readline Type For You
a single match from the list of possible completions. Repeated
execution of `menu-complete' steps through the list of possible
completions, inserting each match in turn. At the end of the list
- of completions, the bell is rung and the original text is restored.
- An argument of N moves N positions forward in the list of matches;
- a negative argument may be used to move backward through the list.
- This command is intended to be bound to `TAB', but is unbound by
+ of completions, the bell is rung (subject to the setting of
+ `bell-style') and the original text is restored. An argument of N
+ moves N positions forward in the list of matches; a negative
+ argument may be used to move backward through the list. This
+ command is intended to be bound to <TAB>, but is unbound by
default.
`delete-char-or-list ()'
@@ -6057,7 +6143,7 @@ Letting Readline Type For You
List the possible completions of the text before point, treating
it as a command name.
-`dynamic-complete-history (M-TAB)'
+`dynamic-complete-history (M-<TAB>)'
Attempt completion on the text before point, comparing the text
against lines from the history list for possible completion
matches.
@@ -6065,7 +6151,7 @@ Letting Readline Type For You
`complete-into-braces (M-{)'
Perform filename completion and insert the list of possible
completions enclosed within braces so the list is available to the
- shell (*note Brace Expansion::.).
+ shell (*note Brace Expansion::).

File: bashref.info, Node: Keyboard Macros, Next: Miscellaneous Commands, Prev: Commands For Completion, Up: Bindable Readline Commands
@@ -6102,11 +6188,11 @@ Some Miscellaneous Commands
If the metafied character X is lowercase, run the command that is
bound to the corresponding uppercase character.
-`prefix-meta (ESC)'
- Make the next character typed be metafied. This is for keyboards
- without a meta key. Typing `ESC f' is equivalent to typing `M-f'.
+`prefix-meta (<ESC>)'
+ Metafy the next character typed. This is for keyboards without a
+ meta key. Typing `<ESC> f' is equivalent to typing `M-f'.
-`undo (C-_, C-x C-u)'
+`undo (C-_ or C-x C-u)'
Incremental undo, separately remembered for each line.
`revert-line (M-r)'
@@ -6117,8 +6203,8 @@ Some Miscellaneous Commands
Perform tilde expansion on the current word.
`set-mark (C-@)'
- Set the mark to the current point. If a numeric argument is
- supplied, the mark is set to that position.
+ Set the mark to the point. If a numeric argument is supplied, the
+ mark is set to that position.
`exchange-point-and-mark (C-x C-x)'
Swap the point with the mark. The current cursor position is set
@@ -6155,9 +6241,9 @@ Some Miscellaneous Commands
`dump-macros ()'
Print all of the Readline key sequences bound to macros and the
- strings they ouput. If a numeric argument is supplied, the output
- is formatted in such a way that it can be made part of an INPUTRC
- file. This command is unbound by default.
+ strings they output. If a numeric argument is supplied, the
+ output is formatted in such a way that it can be made part of an
+ INPUTRC file. This command is unbound by default.
`glob-expand-word (C-x *)'
The word before point is treated as a pattern for pathname
@@ -6174,22 +6260,22 @@ Some Miscellaneous Commands
`shell-expand-line (M-C-e)'
Expand the line as the shell does. This performs alias and
history expansion as well as all of the shell word expansions
- (*note Shell Expansions::.).
+ (*note Shell Expansions::).
`history-expand-line (M-^)'
Perform history expansion on the current line.
`magic-space ()'
Perform history expansion on the current line and insert a space
- (*note History Interaction::.).
+ (*note History Interaction::).
`alias-expand-line ()'
- Perform alias expansion on the current line (*note Aliases::.).
+ Perform alias expansion on the current line (*note Aliases::).
`history-and-alias-expand-line ()'
Perform history and alias expansion on the current line.
-`insert-last-argument (M-., M-_)'
+`insert-last-argument (M-. or M-_)'
A synonym for `yank-last-arg'.
`operate-and-get-next (C-o)'
@@ -6214,7 +6300,7 @@ standard.
In order to switch interactively between `emacs' and `vi' editing
modes, use the `set -o emacs' and `set -o vi' commands (*note The Set
-Builtin::.). The Readline default is `emacs' mode.
+Builtin::). The Readline default is `emacs' mode.
When you enter a line in `vi' mode, you are already placed in
`insertion' mode, as if you had typed an `i'. Pressing <ESC> switches
@@ -6230,7 +6316,7 @@ Programmable Completion
When word completion is attempted for an argument to a command for
which a completion specification (a COMPSPEC) has been defined using
-the `complete' builtin (*note Programmable Completion Builtins::.), the
+the `complete' builtin (*note Programmable Completion Builtins::), the
programmable completion facilities are invoked.
First, the command name is identified. If a compspec has been
@@ -6242,7 +6328,7 @@ a compspec for the portion following the final slash.
Once a compspec has been found, it is used to generate the list of
matching words. If a compspec is not found, the default Bash completion
-described above (*note Commands For Completion::.) is performed.
+described above (*note Commands For Completion::) is performed.
First, the actions specified by the compspec are used. Only matches
which are prefixed by the word being completed are returned. When the
@@ -6261,9 +6347,9 @@ considered. The string is first split using the characters in the `IFS'
special variable as delimiters. Shell quoting is honored. Each word
is then expanded using brace expansion, tilde expansion, parameter and
variable expansion, command substitution, arithmetic expansion, and
-pathname expansion, as described above (*note Shell Expansions::.).
-The results are split using the rules described above (*note Word
-Splitting::.). The results of the expansion are prefix-matched against
+pathname expansion, as described above (*note Shell Expansions::). The
+results are split using the rules described above (*note Word
+Splitting::). The results of the expansion are prefix-matched against
the word being completed, and the matching words become the possible
completions.
@@ -6271,7 +6357,7 @@ completions.
command specified with the `-F' and `-C' options is invoked. When the
command or function is invoked, the `COMP_LINE' and `COMP_POINT'
variables are assigned values as described above (*note Bash
-Variables::.). If a shell function is being invoked, the `COMP_WORDS'
+Variables::). If a shell function is being invoked, the `COMP_WORDS'
and `COMP_CWORD' variables are also set. When the function or command
is invoked, the first argument is the name of the command whose
arguments are being completed, the second argument is the word being
@@ -6282,9 +6368,9 @@ or command has complete freedom in generating the matches.
Any function specified with `-F' is invoked first. The function may
use any of the shell facilities, including the `compgen' builtin
-described below (*note Programmable Completion Builtins::.), to
-generate the matches. It must put the possible completions in the
-`COMPREPLY' array variable.
+described below (*note Programmable Completion Builtins::), to generate
+the matches. It must put the possible completions in the `COMPREPLY'
+array variable.
Next, any command specified with the `-C' option is invoked in an
environment equivalent to command substitution. It should print a list
@@ -6305,10 +6391,17 @@ options are added to each member of the completion list, and the result
is returned to the Readline completion code as the list of possible
completions.
- If a compspec is found, whatever it generates is returned to the
-completion code as the full set of possible completions. The default
-Bash completions are not attempted, and the Readline default of
-filename completion is disabled.
+ If the previously-applied actions do not generate any matches, and
+the `-o dirnames' option was supplied to `complete' when the compspec
+was defined, directory name completion is attempted.
+
+ By default, if a compspec is found, whatever it generates is
+returned to the completion code as the full set of possible completions.
+The default Bash completions are not attempted, and the Readline default
+of filename completion is disabled. If the `-o default' option was
+supplied to `complete' when the compspec was defined, Readline's
+default completion will be performed if the compspec generates no
+matches.

File: bashref.info, Node: Programmable Completion Builtins, Prev: Programmable Completion, Up: Command Line Editing
@@ -6338,7 +6431,7 @@ completion facilities.
no matches were generated.
`complete'
- `complete [-abcdefjkvu] [-A ACTION] [-G GLOBPAT] [-W WORDLIST]
+ `complete [-abcdefjkvu] [-o COMP-OPTION] [-A ACTION] [-G GLOBPAT] [-W WORDLIST]
[-P PREFIX] [-S SUFFIX] [-X FILTERPAT] [-F FUNCTION]
[-C COMMAND] NAME [NAME ...]'
`complete -pr [NAME ...]'
@@ -6352,13 +6445,33 @@ completion facilities.
The process of applying these completion specifications when word
completion is attempted is described above (*note Programmable
- Completion::.).
+ Completion::).
Other options, if specified, have the following meanings. The
arguments to the `-G', `-W', and `-X' options (and, if necessary,
the `-P' and `-S' options) should be quoted to protect them from
expansion before the `complete' builtin is invoked.
+ `-o COMP-OPTION'
+ The COMP-OPTION controls several aspects of the compspec's
+ behavior beyond the simple generation of completions.
+ COMP-OPTION may be one of:
+
+ `default'
+ Use readline's default completion if the compspec
+ generates no matches.
+
+ `dirnames'
+ Perform directory name completion if the compspec
+ generates no matches.
+
+ `filenames'
+ Tell Readline that the compspec generates filenames, so
+ it can perform any filename\-specific processing (like
+ adding a slash to directory names or suppressing
+ trailing spaces). This option is intended to be used
+ with shell functions specified with `-F'.
+
`-A ACTION'
The ACTION may be one of the following to generate a list of
possible completions:
@@ -6371,7 +6484,7 @@ completion facilities.
`binding'
Readline key binding names (*note Bindable Readline
- Commands::.).
+ Commands::).
`builtin'
Names of shell builtin commands. May also be specified
@@ -6401,11 +6514,11 @@ completion facilities.
`helptopic'
Help topics as accepted by the `help' builtin (*note
- Bash Builtins::.).
+ Bash Builtins::).
`hostname'
Hostnames, as taken from the file specified by the
- `HOSTFILE' shell variable (*note Bash Variables::.).
+ `HOSTFILE' shell variable (*note Bash Variables::).
`job'
Job names, if job control is active. May also be
@@ -6419,11 +6532,11 @@ completion facilities.
`setopt'
Valid arguments for the `-o' option to the `set' builtin
- (*note The Set Builtin::.).
+ (*note The Set Builtin::).
`shopt'
Shell option names as accepted by the `shopt' builtin
- (*note Bash Builtins::.).
+ (*note Bash Builtins::).
`signal'
Signal names.
@@ -6505,7 +6618,7 @@ Bash History Facilities
=======================
When the `-o history' option to the `set' builtin is enabled (*note
-The Set Builtin::.), the shell provides access to the COMMAND HISTORY,
+The Set Builtin::), the shell provides access to the "command history",
the list of commands previously typed. The value of the `HISTSIZE'
shell variable is used as the number of commands to save in a history
list. The text of the last `$HISTSIZE' commands (default 500) is saved.
@@ -6521,7 +6634,7 @@ no more than the number of lines specified by the value of the
`HISTFILESIZE' variable. When an interactive shell exits, the last
`$HISTSIZE' lines are copied from the history list to the file named by
`$HISTFILE'. If the `histappend' shell option is set (*note Bash
-Builtins::.), the lines are appended to the history file, otherwise the
+Builtins::), the lines are appended to the history file, otherwise the
history file is overwritten. If `HISTFILE' is unset, or if the history
file is unwritable, the history is not saved. After saving the
history, the history file is truncated to contain no more than
@@ -6533,7 +6646,7 @@ a portion of the history list. The `history' builtin may be used to
display or modify the history list and manipulate the history file.
When using command-line editing, search commands are available in each
editing mode that provide access to the history list (*note Commands
-For History::.).
+For History::).
The shell allows control over which commands are saved on the history
list. The `HISTCONTROL' and `HISTIGNORE' variables may be set to cause
@@ -6581,7 +6694,7 @@ and history file.
A useful alias to use with the `fc' command is `r='fc -s'', so
that typing `r cc' runs the last command beginning with `cc' and
- typing `r' re-executes the last command (*note Aliases::.).
+ typing `r' re-executes the last command (*note Aliases::).
`history'
history [N]
@@ -6591,8 +6704,8 @@ and history file.
history -ps ARG
With no options, display the history list with line numbers.
- Lines prefixed with with a `*' have been modified. An argument of
- N lists only the last N lines. Options, if supplied, have the
+ Lines prefixed with a `*' have been modified. An argument of N
+ lists only the last N lines. Options, if supplied, have the
following meanings:
`-c'
@@ -6661,7 +6774,7 @@ appearance of the history expansion character, which is `!' by default.
Only `\' and `'' may be used to escape the history expansion character.
Several shell options settable with the `shopt' builtin (*note Bash
-Builtins::.) may be used to tailor the behavior of history expansion.
+Builtins::) may be used to tailor the behavior of history expansion.
If the `histverify' shell option is enabled, and Readline is being
used, history substitutions are not immediately passed to the shell
parser. Instead, the expanded line is reloaded into the Readline
@@ -7148,20 +7261,20 @@ does not provide the necessary support.
`--enable-alias'
Allow alias expansion and include the `alias' and `unalias'
- builtins (*note Aliases::.).
+ builtins (*note Aliases::).
`--enable-arith-for-command'
Include support for the alternate form of the `for' command that
behaves like the C language `for' statement (*note Looping
- Constructs::.).
+ Constructs::).
`--enable-array-variables'
Include support for one-dimensional array shell variables (*note
- Arrays::.).
+ Arrays::).
`--enable-bang-history'
Include support for `csh'-like history substitution (*note History
- Interaction::.).
+ Interaction::).
`--enable-brace-expansion'
Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
@@ -7170,16 +7283,16 @@ does not provide the necessary support.
`--enable-command-timing'
Include support for recognizing `time' as a reserved word and for
displaying timing statistics for the pipeline following `time'
- (*note Pipelines::.). This allows pipelines as well as shell
+ (*note Pipelines::). This allows pipelines as well as shell
builtins and functions to be timed.
`--enable-cond-command'
Include support for the `[[' conditional command (*note
- Conditional Constructs::.).
+ Conditional Constructs::).
`--enable-directory-stack'
Include support for a `csh'-like directory stack and the `pushd',
- `popd', and `dirs' builtins (*note The Directory Stack::.).
+ `popd', and `dirs' builtins (*note The Directory Stack::).
`--enable-disabled-builtins'
Allow builtin commands to be invoked via `builtin xxx' even after
@@ -7189,7 +7302,7 @@ does not provide the necessary support.
`--enable-dparen-arithmetic'
Include support for the `((...))' command (*note Conditional
- Constructs::.).
+ Constructs::).
`--enable-extended-glob'
Include support for the extended pattern matching features
@@ -7197,24 +7310,24 @@ does not provide the necessary support.
`--enable-help-builtin'
Include the `help' builtin, which displays help on shell builtins
- and variables (*note Bash Builtins::.).
+ and variables (*note Bash Builtins::).
`--enable-history'
Include command history and the `fc' and `history' builtin
- commands (*note Bash History Facilities::.).
+ commands (*note Bash History Facilities::).
`--enable-job-control'
- This enables the job control features (*note Job Control::.), if
+ This enables the job control features (*note Job Control::), if
the operating system supports them.
`--enable-net-redirections'
This enables the special handling of filenames of the form
`/dev/tcp/HOST/PORT' and `/dev/udp/HOST/PORT' when used in
- redirections (*note Redirections::.).
+ redirections (*note Redirections::).
`--enable-process-substitution'
- This enables process substitution (*note Process Substitution::.)
- if the operating system provides the necessary support.
+ This enables process substitution (*note Process Substitution::) if
+ the operating system provides the necessary support.
`--enable-prompt-string-decoding'
Turn on the interpretation of a number of backslash-escaped
@@ -7224,12 +7337,12 @@ does not provide the necessary support.
`--enable-progcomp'
Enable the programmable completion facilities (*note Programmable
- Completion::.). If Readline is not enabled, this option has no
+ Completion::). If Readline is not enabled, this option has no
effect.
`--enable-readline'
Include support for command-line editing and history with the Bash
- version of the Readline library (*note Command Line Editing::.).
+ version of the Readline library (*note Command Line Editing::).
`--enable-restricted'
Include support for a "restricted shell". If this is enabled,
@@ -7238,7 +7351,7 @@ does not provide the necessary support.
`--enable-select'
Include the `select' builtin, which allows the generation of simple
- menus (*note Conditional Constructs::.).
+ menus (*note Conditional Constructs::).
`--enable-usg-echo-default'
A synonym for `--enable-xpg-echo-default'.
@@ -7303,70 +7416,69 @@ be implemented. There are some differences between the traditional
Bourne shell and Bash; this section quickly details the differences of
significance. A number of these differences are explained in greater
depth in previous sections. This section uses the version of `sh'
-included SVR4.2 as the baseline reference.
+included in SVR4.2 as the baseline reference.
* Bash is POSIX-conformant, even where the POSIX specification
- differs from traditional `sh' behavior.
+ differs from traditional `sh' behavior (*note Bash POSIX Mode::).
* Bash has multi-character invocation options (*note Invoking
- Bash::.).
+ Bash::).
- * Bash has command-line editing (*note Command Line Editing::.) and
+ * Bash has command-line editing (*note Command Line Editing::) and
the `bind' builtin.
* Bash provides a programmable word completion mechanism (*note
- Programmable Completion::.), and two builtin commands, `complete'
+ Programmable Completion::), and two builtin commands, `complete'
and `compgen', to manipulate it.
- * Bash has command history (*note Bash History Facilities::.) and the
+ * Bash has command history (*note Bash History Facilities::) and the
`history' and `fc' builtins to manipulate it.
* Bash implements `csh'-like history expansion (*note History
- Interaction::.).
+ Interaction::).
- * Bash has one-dimensional array variables (*note Arrays::.), and the
+ * Bash has one-dimensional array variables (*note Arrays::), and the
appropriate variable expansions and assignment syntax to use them.
Several of the Bash builtins take options to act on arrays. Bash
provides a number of built-in array variables.
* The `$'...'' quoting syntax, which expands ANSI-C
backslash-escaped characters in the text between the single quotes,
- is supported (*note ANSI-C Quoting::.).
+ is supported (*note ANSI-C Quoting::).
* Bash supports the `$"..."' quoting syntax to do locale-specific
translation of the characters between the double quotes. The
`-D', `--dump-strings', and `--dump-po-strings' invocation options
list the translatable strings found in a script (*note Locale
- Translation::.).
+ Translation::).
* Bash implements the `!' keyword to negate the return value of a
- pipeline (*note Pipelines::.). Very useful when an `if' statement
+ pipeline (*note Pipelines::). Very useful when an `if' statement
needs to act only if a test fails.
* Bash has the `time' reserved word and command timing (*note
- Pipelines::.). The display of the timing statistics may be
+ Pipelines::). The display of the timing statistics may be
controlled with the `TIMEFORMAT' variable.
* Bash implements the `for (( EXPR1 ; EXPR2 ; EXPR3 ))' arithmetic
for command, similar to the C language (*note Looping
- Constructs::.).
+ Constructs::).
* Bash includes the `select' compound command, which allows the
- generation of simple menus (*note Conditional Constructs::.).
+ generation of simple menus (*note Conditional Constructs::).
* Bash includes the `[[' compound command, which makes conditional
- testing part of the shell grammar (*note Conditional
- Constructs::.).
+ testing part of the shell grammar (*note Conditional Constructs::).
- * Bash includes brace expansion (*note Brace Expansion::.) and tilde
- expansion (*note Tilde Expansion::.).
+ * Bash includes brace expansion (*note Brace Expansion::) and tilde
+ expansion (*note Tilde Expansion::).
* Bash implements command aliases and the `alias' and `unalias'
- builtins (*note Aliases::.).
+ builtins (*note Aliases::).
* Bash provides shell arithmetic, the `((' compound command (*note
- Conditional Constructs::.), and arithmetic expansion (*note Shell
- Arithmetic::.).
+ Conditional Constructs::), and arithmetic expansion (*note Shell
+ Arithmetic::).
* Variables present in the shell's initial environment are
automatically exported to child processes. The Bourne shell does
@@ -7375,33 +7487,33 @@ included SVR4.2 as the baseline reference.
* Bash includes the POSIX pattern removal `%', `#', `%%' and `##'
expansions to remove leading or trailing substrings from variable
- values (*note Shell Parameter Expansion::.).
+ values (*note Shell Parameter Expansion::).
* The expansion `${#xx}', which returns the length of `${xx}', is
- supported (*note Shell Parameter Expansion::.).
+ supported (*note Shell Parameter Expansion::).
* The expansion `${var:'OFFSET`[:'LENGTH`]}', which expands to the
substring of `var''s value of length LENGTH, beginning at OFFSET,
- is present (*note Shell Parameter Expansion::.).
+ is present (*note Shell Parameter Expansion::).
* The expansion `${var/[/]'PATTERN`[/'REPLACEMENT`]}', which matches
PATTERN and replaces it with REPLACEMENT in the value of `var', is
- available (*note Shell Parameter Expansion::.).
+ available (*note Shell Parameter Expansion::).
* The expansion `${!PREFIX}*' expansion, which expands to the names
of all shell variables whose names begin with PREFIX, is available
- (*note Shell Parameter Expansion::.).
+ (*note Shell Parameter Expansion::).
* Bash has INDIRECT variable expansion using `${!word}' (*note Shell
- Parameter Expansion::.).
+ Parameter Expansion::).
* Bash can expand positional parameters beyond `$9' using `${NUM}'.
* The POSIX `$()' form of command substitution is implemented (*note
- Command Substitution::.), and preferred to the Bourne shell's ```'
+ Command Substitution::), and preferred to the Bourne shell's ```'
(which is also implemented for backwards compatibility).
- * Bash has process substitution (*note Process Substitution::.).
+ * Bash has process substitution (*note Process Substitution::).
* Bash automatically assigns variables that provide information
about the current user (`UID', `EUID', and `GROUPS'), the current
@@ -7410,68 +7522,68 @@ included SVR4.2 as the baseline reference.
`BASH_VERSINFO'). *Note Bash Variables::, for details.
* The `IFS' variable is used to split only the results of expansion,
- not all words (*note Word Splitting::.). This closes a
+ not all words (*note Word Splitting::). This closes a
longstanding shell security hole.
* Bash implements the full set of POSIX 1003.2 filename expansion
operators, including CHARACTER CLASSES, EQUIVALENCE CLASSES, and
- COLLATING SYMBOLS (*note Filename Expansion::.).
+ COLLATING SYMBOLS (*note Filename Expansion::).
* Bash implements extended pattern matching features when the
- `extglob' shell option is enabled (*note Pattern Matching::.).
+ `extglob' shell option is enabled (*note Pattern Matching::).
* It is possible to have a variable and a function with the same
name; `sh' does not separate the two name spaces.
* Bash functions are permitted to have local variables using the
`local' builtin, and thus useful recursive functions may be written
- (*note Bash Builtins::.).
+ (*note Bash Builtins::).
* Variable assignments preceding commands affect only that command,
- even builtins and functions (*note Environment::.). In `sh', all
+ even builtins and functions (*note Environment::). In `sh', all
variable assignments preceding commands are global unless the
command is executed from the file system.
* Bash performs filename expansion on filenames specified as operands
- to input and output redirection operators (*note Redirections::.).
+ to input and output redirection operators (*note Redirections::).
* Bash contains the `<>' redirection operator, allowing a file to be
opened for both reading and writing, and the `&>' redirection
operator, for directing standard output and standard error to the
- same file (*note Redirections::.).
+ same file (*note Redirections::).
* Bash treats a number of filenames specially when they are used in
- redirection operators (*note Redirections::.).
+ redirection operators (*note Redirections::).
* Bash can open network connections to arbitrary machines and
- services with the redirection operators (*note Redirections::.).
+ services with the redirection operators (*note Redirections::).
* The `noclobber' option is available to avoid overwriting existing
- files with output redirection (*note The Set Builtin::.). The
- `>|' redirection operator may be used to override `noclobber'.
+ files with output redirection (*note The Set Builtin::). The `>|'
+ redirection operator may be used to override `noclobber'.
- * The Bash `cd' and `pwd' builtins (*note Bourne Shell Builtins::.)
- each take `-L' and `-P' builtins to switch between logical and
+ * The Bash `cd' and `pwd' builtins (*note Bourne Shell Builtins::)
+ each take `-L' and `-P' options to switch between logical and
physical modes.
* Bash allows a function to override a builtin with the same name,
and provides access to that builtin's functionality within the
function via the `builtin' and `command' builtins (*note Bash
- Builtins::.).
+ Builtins::).
* The `command' builtin allows selective disabling of functions when
- command lookup is performed (*note Bash Builtins::.).
+ command lookup is performed (*note Bash Builtins::).
* Individual builtins may be enabled or disabled using the `enable'
- builtin (*note Bash Builtins::.).
+ builtin (*note Bash Builtins::).
* The Bash `exec' builtin takes additional options that allow users
to control the contents of the environment passed to the executed
command, and what the zeroth argument to the command is to be
- (*note Bourne Shell Builtins::.).
+ (*note Bourne Shell Builtins::).
* Shell functions may be exported to children via the environment
- using `export -f' (*note Shell Functions::.).
+ using `export -f' (*note Shell Functions::).
* The Bash `export', `readonly', and `declare' builtins can take a
`-f' option to act on shell functions, a `-p' option to display
@@ -7483,15 +7595,15 @@ included SVR4.2 as the baseline reference.
* The Bash `hash' builtin allows a name to be associated with an
arbitrary filename, even when that filename cannot be found by
searching the `$PATH', using `hash -p' (*note Bourne Shell
- Builtins::.).
+ Builtins::).
* Bash includes a `help' builtin for quick reference to shell
- facilities (*note Bash Builtins::.).
+ facilities (*note Bash Builtins::).
* The `printf' builtin is available to display formatted output
- (*note Bash Builtins::.).
+ (*note Bash Builtins::).
- * The Bash `read' builtin (*note Bash Builtins::.) will read a line
+ * The Bash `read' builtin (*note Bash Builtins::) will read a line
ending in `\' with the `-r' option, and will use the `REPLY'
variable as a default if no non-option arguments are supplied.
The Bash `read' builtin also accepts a prompt string with the `-p'
@@ -7506,43 +7618,43 @@ included SVR4.2 as the baseline reference.
* The `return' builtin may be used to abort execution of scripts
executed with the `.' or `source' builtins (*note Bourne Shell
- Builtins::.).
+ Builtins::).
* Bash includes the `shopt' builtin, for finer control of shell
- optional capabilities (*note Bash Builtins::.).
+ optional capabilities (*note Bash Builtins::).
* Bash has much more optional behavior controllable with the `set'
- builtin (*note The Set Builtin::.).
+ builtin (*note The Set Builtin::).
- * The `test' builtin (*note Bourne Shell Builtins::.) is slightly
+ * The `test' builtin (*note Bourne Shell Builtins::) is slightly
different, as it implements the POSIX algorithm, which specifies
the behavior based on the number of arguments.
- * The `trap' builtin (*note Bourne Shell Builtins::.) allows a
+ * The `trap' builtin (*note Bourne Shell Builtins::) allows a
`DEBUG' pseudo-signal specification, similar to `EXIT'. Commands
specified with a `DEBUG' trap are executed after every simple
command. The `DEBUG' trap is not inherited by shell functions.
* The Bash `type' builtin is more extensive and gives more
- information about the names it finds (*note Bash Builtins::.).
+ information about the names it finds (*note Bash Builtins::).
* The Bash `umask' builtin permits a `-p' option to cause the output
to be displayed in the form of a `umask' command that may be
- reused as input (*note Bourne Shell Builtins::.).
+ reused as input (*note Bourne Shell Builtins::).
* Bash implements a `csh'-like directory stack, and provides the
`pushd', `popd', and `dirs' builtins to manipulate it (*note The
- Directory Stack::.). Bash also makes the directory stack visible
+ Directory Stack::). Bash also makes the directory stack visible
as the value of the `DIRSTACK' shell variable.
* Bash interprets special backslash-escaped characters in the prompt
- strings when interactive (*note Printing a Prompt::.).
+ strings when interactive (*note Printing a Prompt::).
* The Bash restricted mode is more useful (*note The Restricted
- Shell::.); the SVR4.2 shell restricted mode is too limited.
+ Shell::); the SVR4.2 shell restricted mode is too limited.
* The `disown' builtin can remove a job from the internal shell job
- table (*note Job Control Builtins::.) or suppress the sending of
+ table (*note Job Control Builtins::) or suppress the sending of
`SIGHUP' to a job when the shell exits as the result of a `SIGHUP'.
* The SVR4.2 shell has two privilege-related builtins (`mldmode' and
@@ -7555,6 +7667,7 @@ included SVR4.2 as the baseline reference.
* The SVR4.2 `sh' uses a `TIMEOUT' variable like Bash uses `TMOUT'.
+
More features unique to Bash may be found in *Note Bash Features::.
Implementation Differences From The SVR4.2 Shell
@@ -7719,6 +7832,7 @@ Parameter and Variable Index
* BASH_VERSION: Bash Variables.
* bell-style: Readline Init File Syntax.
* CDPATH: Bourne Shell Variables.
+* COLUMNS: Bash Variables.
* comment-begin: Readline Init File Syntax.
* COMP_CWORD: Bash Variables.
* COMP_LINE: Bash Variables.
@@ -7763,6 +7877,7 @@ Parameter and Variable Index
* LC_MESSAGES: Bash Variables.
* LC_NUMERIC: Bash Variables.
* LINENO: Bash Variables.
+* LINES: Bash Variables.
* MACHTYPE: Bash Variables.
* MAIL: Bourne Shell Variables.
* MAILCHECK: Bash Variables.
@@ -7804,11 +7919,11 @@ Function Index
* Menu:
* abort (C-g): Miscellaneous Commands.
-* accept-line (Newline, Return): Commands For History.
+* accept-line (Newline or Return): Commands For History.
* backward-char (C-b): Commands For Moving.
* backward-delete-char (Rubout): Commands For Text.
* backward-kill-line (C-x Rubout): Commands For Killing.
-* backward-kill-word (M-DEL): Commands For Killing.
+* backward-kill-word (M-<DEL>): Commands For Killing.
* backward-word (M-b): Commands For Moving.
* beginning-of-history (M-<): Commands For History.
* beginning-of-line (C-a): Commands For Moving.
@@ -7817,7 +7932,7 @@ Function Index
* character-search (C-]): Miscellaneous Commands.
* character-search-backward (M-C-]): Miscellaneous Commands.
* clear-screen (C-l): Commands For Moving.
-* complete (TAB): Commands For Completion.
+* complete (<TAB>): Commands For Completion.
* copy-backward-word (): Commands For Killing.
* copy-forward-word (): Commands For Killing.
* copy-region-as-kill (): Commands For Killing.
@@ -7851,9 +7966,9 @@ Function Index
* non-incremental-forward-search-history (M-n): Commands For History.
* non-incremental-reverse-search-history (M-p): Commands For History.
* possible-completions (M-?): Commands For Completion.
-* prefix-meta (ESC): Miscellaneous Commands.
+* prefix-meta (<ESC>): Miscellaneous Commands.
* previous-history (C-p): Commands For History.
-* quoted-insert (C-q, C-v): Commands For Text.
+* quoted-insert (C-q or C-v): Commands For Text.
* re-read-init-file (C-x C-r): Miscellaneous Commands.
* redraw-current-line (): Commands For Moving.
* reverse-search-history (C-r): Commands For History.
@@ -7863,13 +7978,13 @@ Function Index
* start-kbd-macro (C-x (): Keyboard Macros.
* transpose-chars (C-t): Commands For Text.
* transpose-words (M-t): Commands For Text.
-* undo (C-_, C-x C-u): Miscellaneous Commands.
+* undo (C-_ or C-x C-u): Miscellaneous Commands.
* universal-argument (): Numeric Arguments.
* unix-line-discard (C-u): Commands For Killing.
* unix-word-rubout (C-w): Commands For Killing.
* upcase-word (M-u): Commands For Text.
* yank (C-y): Commands For Killing.
-* yank-last-arg (M-., M-_): Commands For History.
+* yank-last-arg (M-. or M-_): Commands For History.
* yank-nth-arg (M-C-y): Commands For History.
* yank-pop (M-y): Commands For Killing.
@@ -7916,8 +8031,8 @@ Concept Index
* evaluation, arithmetic: Shell Arithmetic.
* event designators: Event Designators.
* execution environment: Command Execution Environment.
-* exit status <1>: Exit Status.
-* exit status: Definitions.
+* exit status <1>: Definitions.
+* exit status: Exit Status.
* expansion: Shell Expansions.
* expansion, arithmetic: Arithmetic Expansion.
* expansion, brace: Brace Expansion.
@@ -7944,8 +8059,8 @@ Concept Index
* interactive shell <1>: Interactive Shells.
* interactive shell: Invoking Bash.
* job: Definitions.
-* job control <1>: Job Control Basics.
-* job control: Definitions.
+* job control <1>: Definitions.
+* job control: Job Control Basics.
* kill ring: Readline Killing Commands.
* killing text: Readline Killing Commands.
* localization: Locale Translation.
@@ -7982,13 +8097,14 @@ Concept Index
* shell, interactive: Interactive Shells.
* signal: Definitions.
* signal handling: Signals.
-* special builtin <1>: Special Builtins.
-* special builtin: Definitions.
+* special builtin <1>: Definitions.
+* special builtin: Special Builtins.
* startup files: Bash Startup Files.
* suspending jobs: Job Control Basics.
* tilde expansion: Tilde Expansion.
* token: Definitions.
* variable, shell: Shell Parameters.
+* variables, readline: Readline Init File Syntax.
* word: Definitions.
* word splitting: Word Splitting.
* yanking text: Readline Killing Commands.
@@ -7996,126 +8112,126 @@ Concept Index

Tag Table:
-Node: Top1185
-Node: Introduction3316
-Node: What is Bash?3541
-Node: What is a shell?4642
-Node: Definitions6876
-Node: Basic Shell Features9542
-Node: Shell Syntax10766
-Node: Shell Operation11790
-Node: Quoting13085
-Node: Escape Character14345
-Node: Single Quotes14817
-Node: Double Quotes15152
-Node: ANSI-C Quoting16055
-Node: Locale Translation16957
-Node: Comments17378
-Node: Shell Commands17984
-Node: Simple Commands18865
-Node: Pipelines19488
-Node: Lists21015
-Node: Looping Constructs22529
-Node: Conditional Constructs24976
-Node: Command Grouping30918
-Node: Shell Functions32295
-Node: Shell Parameters34833
-Node: Positional Parameters36159
-Node: Special Parameters37052
-Node: Shell Expansions39711
-Node: Brace Expansion41635
-Node: Tilde Expansion43305
-Node: Shell Parameter Expansion45637
-Node: Command Substitution52439
-Node: Arithmetic Expansion53761
-Node: Process Substitution54606
-Node: Word Splitting55643
-Node: Filename Expansion57095
-Node: Pattern Matching59055
-Node: Quote Removal61450
-Node: Redirections61736
-Node: Executing Commands68607
-Node: Simple Command Expansion69274
-Node: Command Search and Execution71197
-Node: Command Execution Environment73194
-Node: Environment75648
-Node: Exit Status77300
-Node: Signals78497
-Node: Shell Scripts80392
-Node: Shell Builtin Commands82776
-Node: Bourne Shell Builtins84211
-Node: Bash Builtins99107
-Node: The Set Builtin123146
-Node: Special Builtins129959
-Node: Shell Variables130931
-Node: Bourne Shell Variables131367
-Node: Bash Variables133147
-Node: Bash Features147888
-Node: Invoking Bash148770
-Node: Bash Startup Files153441
-Node: Interactive Shells158148
-Node: What is an Interactive Shell?158550
-Node: Is this Shell Interactive?159185
-Node: Interactive Shell Behavior159991
-Node: Bash Conditional Expressions163279
-Node: Shell Arithmetic166574
-Node: Aliases169005
-Node: Arrays171510
-Node: The Directory Stack174530
-Node: Directory Stack Builtins175236
-Node: Printing a Prompt178114
-Node: The Restricted Shell180486
-Node: Bash POSIX Mode181964
-Node: Job Control186258
-Node: Job Control Basics186724
-Node: Job Control Builtins190939
-Node: Job Control Variables195234
-Node: Command Line Editing196384
-Node: Introduction and Notation197382
-Node: Readline Interaction198999
-Node: Readline Bare Essentials200191
-Node: Readline Movement Commands201971
-Node: Readline Killing Commands202927
-Node: Readline Arguments204832
-Node: Searching205806
-Node: Readline Init File207685
-Node: Readline Init File Syntax208739
-Node: Conditional Init Constructs218285
-Node: Sample Init File220723
-Node: Bindable Readline Commands223892
-Node: Commands For Moving225085
-Node: Commands For History225933
-Node: Commands For Text228727
-Node: Commands For Killing230678
-Node: Numeric Arguments232644
-Node: Commands For Completion233770
-Node: Keyboard Macros237602
-Node: Miscellaneous Commands238160
-Node: Readline vi Mode242534
-Node: Programmable Completion243444
-Node: Programmable Completion Builtins248120
-Node: Using History Interactively254226
-Node: Bash History Facilities254905
-Node: Bash History Builtins257466
-Node: History Interaction261038
-Node: Event Designators263590
-Node: Word Designators264517
-Node: Modifiers266146
-Node: Installing Bash267463
-Node: Basic Installation268605
-Node: Compilers and Options271723
-Node: Compiling For Multiple Architectures272457
-Node: Installation Names274114
-Node: Specifying the System Type274837
-Node: Sharing Defaults275544
-Node: Operation Controls276209
-Node: Optional Features277160
-Node: Reporting Bugs284581
-Node: Major Differences From The Bourne Shell285678
-Node: Builtin Index299726
-Node: Reserved Word Index303317
-Node: Variable Index304793
-Node: Function Index310465
-Node: Concept Index314955
+Node: Top1157
+Node: Introduction3286
+Node: What is Bash?3511
+Node: What is a shell?4612
+Node: Definitions6846
+Node: Basic Shell Features9512
+Node: Shell Syntax10736
+Node: Shell Operation11760
+Node: Quoting13045
+Node: Escape Character14304
+Node: Single Quotes14776
+Node: Double Quotes15111
+Node: ANSI-C Quoting16012
+Node: Locale Translation16915
+Node: Comments17690
+Node: Shell Commands18295
+Node: Simple Commands19176
+Node: Pipelines19797
+Node: Lists21322
+Node: Looping Constructs22835
+Node: Conditional Constructs25279
+Node: Command Grouping31220
+Node: Shell Functions32597
+Node: Shell Parameters35134
+Node: Positional Parameters36459
+Node: Special Parameters37350
+Node: Shell Expansions40008
+Node: Brace Expansion41928
+Node: Tilde Expansion43597
+Node: Shell Parameter Expansion45928
+Node: Command Substitution52728
+Node: Arithmetic Expansion54050
+Node: Process Substitution54894
+Node: Word Splitting55931
+Node: Filename Expansion57383
+Node: Pattern Matching59341
+Node: Quote Removal62472
+Node: Redirections62758
+Node: Executing Commands69629
+Node: Simple Command Expansion70296
+Node: Command Search and Execution72217
+Node: Command Execution Environment74214
+Node: Environment76667
+Node: Exit Status78318
+Node: Signals79513
+Node: Shell Scripts81405
+Node: Shell Builtin Commands83788
+Node: Bourne Shell Builtins85218
+Node: Bash Builtins100145
+Node: The Set Builtin124177
+Node: Special Builtins131034
+Node: Shell Variables132006
+Node: Bourne Shell Variables132442
+Node: Bash Variables134221
+Node: Bash Features149565
+Node: Invoking Bash150447
+Node: Bash Startup Files155232
+Node: Interactive Shells160102
+Node: What is an Interactive Shell?160504
+Node: Is this Shell Interactive?161139
+Node: Interactive Shell Behavior161945
+Node: Bash Conditional Expressions165212
+Node: Shell Arithmetic168506
+Node: Aliases170937
+Node: Arrays173440
+Node: The Directory Stack176460
+Node: Directory Stack Builtins177166
+Node: Printing a Prompt180044
+Node: The Restricted Shell182414
+Node: Bash POSIX Mode183892
+Node: Job Control189520
+Node: Job Control Basics189986
+Node: Job Control Builtins194200
+Node: Job Control Variables198495
+Node: Command Line Editing199644
+Node: Introduction and Notation200642
+Node: Readline Interaction202259
+Node: Readline Bare Essentials203445
+Node: Readline Movement Commands205225
+Node: Readline Killing Commands206181
+Node: Readline Arguments208090
+Node: Searching209125
+Node: Readline Init File211115
+Node: Readline Init File Syntax212169
+Node: Conditional Init Constructs222372
+Node: Sample Init File224896
+Node: Bindable Readline Commands228065
+Node: Commands For Moving229264
+Node: Commands For History230112
+Node: Commands For Text233000
+Node: Commands For Killing234933
+Node: Numeric Arguments236883
+Node: Commands For Completion238010
+Node: Keyboard Macros241590
+Node: Miscellaneous Commands242148
+Node: Readline vi Mode246510
+Node: Programmable Completion247419
+Node: Programmable Completion Builtins252467
+Node: Using History Interactively259374
+Node: Bash History Facilities260053
+Node: Bash History Builtins262613
+Node: History Interaction266179
+Node: Event Designators268730
+Node: Word Designators269657
+Node: Modifiers271286
+Node: Installing Bash272603
+Node: Basic Installation273745
+Node: Compilers and Options276863
+Node: Compiling For Multiple Architectures277597
+Node: Installation Names279254
+Node: Specifying the System Type279977
+Node: Sharing Defaults280684
+Node: Operation Controls281349
+Node: Optional Features282300
+Node: Reporting Bugs289705
+Node: Major Differences From The Bourne Shell290802
+Node: Builtin Index304814
+Node: Reserved Word Index308405
+Node: Variable Index309881
+Node: Function Index315667
+Node: Concept Index320157

End Tag Table