diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-11 14:49:26 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-11 15:19:40 -0700 |
commit | 011c1d1c0766c65517ebd495465c99e86edb63ec (patch) | |
tree | 30d8f6a13235af90897c3223554871ef52225462 /doc | |
parent | 40cfaccf7b178b6239b5cd0013ef80b7ff8e503e (diff) | |
download | vyatta-bash-011c1d1c0766c65517ebd495465c99e86edb63ec.tar.gz vyatta-bash-011c1d1c0766c65517ebd495465c99e86edb63ec.zip |
Update to bash-4.1
Diffstat (limited to 'doc')
-rw-r--r-- | doc/._fdl.texi | bin | 0 -> 4096 bytes | |||
-rw-r--r-- | doc/._fdl.txt | bin | 0 -> 4096 bytes | |||
-rw-r--r-- | doc/FAQ | 0 | ||||
-rw-r--r-- | doc/Makefile.in | 45 | ||||
-rw-r--r-- | doc/article.ms | 1114 | ||||
-rw-r--r-- | doc/bash.0 | 5358 | ||||
-rw-r--r-- | doc/bash.1 | 1421 | ||||
-rw-r--r-- | doc/bash.html | 12571 | ||||
-rw-r--r-- | doc/bash.pdf | bin | 0 -> 288296 bytes | |||
-rw-r--r-- | doc/bash.ps | 8202 | ||||
-rw-r--r-- | doc/bashbug.0 | 50 | ||||
-rw-r--r-- | doc/bashbug.1 | 29 | ||||
-rw-r--r-- | doc/bashbug.ps | 284 | ||||
-rw-r--r-- | doc/builtins.0 | 1579 | ||||
-rw-r--r-- | doc/builtins.1 | 14 | ||||
-rw-r--r-- | doc/builtins.ps | 2651 | ||||
-rw-r--r-- | doc/fdl.texi | 96 | ||||
-rw-r--r-- | doc/fdl.txt | 130 | ||||
-rw-r--r-- | doc/rbash.0 | 59 | ||||
-rw-r--r-- | doc/rbash.1 | 2 | ||||
-rw-r--r-- | doc/rbash.ps | 280 | ||||
-rw-r--r-- | doc/texinfo.tex | 8692 | ||||
-rw-r--r-- | doc/version.texi | 12 |
23 files changed, 38006 insertions, 4583 deletions
diff --git a/doc/._fdl.texi b/doc/._fdl.texi Binary files differnew file mode 100644 index 0000000..3d0bb98 --- /dev/null +++ b/doc/._fdl.texi diff --git a/doc/._fdl.txt b/doc/._fdl.txt Binary files differnew file mode 100644 index 0000000..cf58b16 --- /dev/null +++ b/doc/._fdl.txt diff --git a/doc/FAQ b/doc/FAQ deleted file mode 100644 index e69de29..0000000 --- a/doc/FAQ +++ /dev/null diff --git a/doc/Makefile.in b/doc/Makefile.in index 270ddfd..3e0e68b 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,20 +1,19 @@ # This Makefile is for the Bash/documentation directory -*- text -*-. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ @@ -35,6 +34,8 @@ VPATH = .:@srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ + infodir = @infodir@ # set this to a directory name to have the HTML files installed @@ -93,7 +94,7 @@ GROFF = groff HSUSER = $(RL_LIBDIR)/doc/hsuser.texi RLUSER = $(RL_LIBDIR)/doc/rluser.texi -BASHREF_FILES = $(srcdir)/bashref.texi $(srcdir)/version.texi +BASHREF_FILES = $(srcdir)/bashref.texi $(srcdir)/fdl.texi $(srcdir)/version.texi .SUFFIXES: .0 .1 .3 .ms .ps .txt .dvi .html .pdf @@ -143,6 +144,7 @@ BASHREF_FILES = $(srcdir)/bashref.texi $(srcdir)/version.texi all: ps info dvi text html nodvi: ps info text html +everything: all pdf PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps DVIFILES = bashref.dvi bashref.ps @@ -223,9 +225,12 @@ installdirs: install: info installdirs bash.info -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext} -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext} -# uncomment the next line to install the builtins man page -# -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} - -$(INSTALL_DATA) $(srcdir)/bash.info $(DESTDIR)$(infodir)/bash.info +# uncomment the next lines to install the builtins man page +# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 +# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} +# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 + -if test -f bash.info; then d=.; else d=$(srcdir); fi; \ + $(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info # run install-info if it is present to update the info directory if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \ @@ -236,8 +241,16 @@ install: info installdirs bash.info $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \ fi +install_builtins: installdirs + sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 + -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} + -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 + +install_everything: install install_builtins + uninstall: -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext} + -$(RM) $(DESTDIR)$(man1dir)/bash_builtins${man1ext} $(RM) $(DESTDIR)$(infodir)/bash.info -if test -n "$(htmldir)" ; then \ $(RM) $(DESTDIR)$(htmldir)/bash.html ; \ diff --git a/doc/article.ms b/doc/article.ms deleted file mode 100644 index 517155a..0000000 --- a/doc/article.ms +++ /dev/null @@ -1,1114 +0,0 @@ -.de SE \" start example -.sp .5 -.RS -.ft CR -.nf -.. -.de EE \" end example -.fi -.sp .5 -.RE -.ft R -.. -.TL -Bash \- The GNU shell* -.AU -Chet Ramey -Case Western Reserve University -chet@po.cwru.edu -.FS -*An earlier version of this article appeared in The Linux Journal. -.FE -.NH 1 -Introduction -.PP -.B Bash -is the shell, or command language interpreter, -that will appear in the GNU operating system. -The name is an acronym for -the \*QBourne-Again SHell\*U, a pun on Steve Bourne, the author -of the direct ancestor of the current -.UX -shell \fI/bin/sh\fP, -which appeared in the Seventh Edition Bell Labs Research version -of \s-1UNIX\s+1. -.PP -Bash is an \fBsh\fP\-compatible shell that incorporates useful -features from the Korn shell (\fBksh\fP) and the C shell (\fBcsh\fP), -described later in this article. It is ultimately intended to be a -conformant implementation of the IEEE POSIX Shell and Utilities -specification (IEEE Working Group 1003.2). It offers functional -improvements over sh for both interactive and programming use. -.PP -While the GNU operating system will most likely include a version -of the Berkeley shell csh, Bash will be the default shell. -Like other GNU software, Bash is quite portable. It currently runs -on nearly every version of -.UX -and a few other operating systems \- an independently-supported -port exists for OS/2, and there are rumors of ports to DOS and -Windows NT. Ports to \s-1UNIX\s+1-like systems such as QNX and Minix -are part of the distribution. -.PP -The original author of Bash -was Brian Fox, an employee of the Free Software Foundation. The -current developer and maintainer is Chet Ramey, a volunteer who -works at Case Western Reserve University. -.NH 1 -What's POSIX, anyway? -.PP -.I POSIX -is a name originally coined by Richard Stallman for a family of open -system standards based on \s-1UNIX\s+1. There are a number of aspects of \s-1UNIX\s+1 -under consideration for standardization, from the basic system services -at the system call and C library level to applications and tools to system -administration and management. Each area of standardization is -assigned to a working group in the 1003 series. -.PP -The POSIX Shell and Utilities standard has been developed by IEEE Working -Group 1003.2 (POSIX.2).\(dd -.FS -\(ddIEEE, \fIIEEE Standard for Information Technology -- Portable -Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, -1992. -.FE -It concentrates on the command interpreter -interface and utility programs -commonly executed from the command line or by other programs. -An initial version of the standard has been -approved and published by the IEEE, and work is currently underway to -update it. -There are four primary areas of work in the 1003.2 standard: -.IP \(bu -Aspects of the shell's syntax and command language. -A number of special builtins such as -.B cd -and -.B exec -are being specified as part of the shell, since their -functionality usually cannot be implemented by a separate executable; -.IP \(bu -A set of utilities to be called by shell scripts and applications. -Examples are programs like -.I sed, -.I tr, -and -.I awk. -Utilities commonly implemented as shell builtins -are described in this section, such as -.B test -and -.B kill . -An expansion of this section's scope, termed the User Portability -Extension, or UPE, has standardized interactive programs such as -.I vi -and -.I mailx; -.IP \(bu -A group of functional interfaces to services provided by the -shell, such as the traditional \f(CRsystem()\fP -C library function. There are functions to perform shell word -expansions, perform filename expansion (\fIglobbing\fP), obtain values -of POSIX.2 system configuration variables, retrieve values of -environment variables (\f(CRgetenv()\fP\^), and other services; -.IP \(bu -A suite of \*Qdevelopment\*U utilities such as -.I c89 -(the POSIX.2 version of \fIcc\fP), -and -.I yacc. -.PP -Bash is concerned with the aspects of the shell's behavior -defined by POSIX.2. The shell command language has of -course been standardized, including the basic flow control -and program execution constructs, I/O redirection and -pipelining, argument handling, variable expansion, and quoting. -The -.I special -builtins, which must be implemented as part of the shell to -provide the desired functionality, are specified as being -part of the shell; examples of these are -.B eval -and -.B export . -Other utilities appear in the sections of POSIX.2 not -devoted to the shell which are commonly (and in some -cases must be) implemented as builtin commands, such as -.B read -and -.B test . -POSIX.2 also specifies aspects of the shell's -interactive behavior as part of -the UPE, including job control and command line editing. -Interestingly enough, only \fIvi\fP-style line editing commands -have been standardized; \fIemacs\fP editing commands were left -out due to objections. -.PP -While POSIX.2 includes much of what the shell has traditionally -provided, some important things have been omitted as being -\*Qbeyond its scope.\*U There is, for instance, no mention of -a difference between a -.I login -shell and any other interactive shell (since POSIX.2 does not -specify a login program). No fixed startup files are defined, -either \- the standard does not mention -.I .profile . -.NH 1 -Basic Bash features -.PP -Since the Bourne shell -provides Bash with most of its philosophical underpinnings, -Bash inherits most of its features and functionality from sh. -Bash implements all of the traditional sh flow -control constructs (\fIfor\fP, \fIif\fP, \fIwhile\fP, etc.). -All of the Bourne shell builtins, including those not specified in -the POSIX.2 standard, appear in Bash. Shell \fIfunctions\fP, -introduced in the SVR2 version of the Bourne shell, -are similar to shell scripts, but are defined using a special -syntax and are executed in the same process as the calling shell. -Bash has shell functions -which behave in a fashion upward-compatible with sh functions. -There are certain shell -variables that Bash interprets in the same way as sh, such as -.B PS1 , -.B IFS , -and -.B PATH . -Bash implements essentially the same grammar, parameter and -variable expansion semantics, redirection, and quoting as the -Bourne shell. Where differences appear between the POSIX.2 -standard and traditional sh behavior, Bash follows POSIX. -.PP -The Korn Shell (\fBksh\fP) is a descendent of the Bourne shell written -at AT&T Bell Laboratories by David Korn\(dg. It provides a number of -useful features that POSIX and Bash have adopted. Many of the -interactive facilities in POSIX.2 have their roots in the ksh: -for example, the POSIX and ksh job control facilities are nearly -identical. Bash includes features from the Korn Shell for both -interactive use and shell programming. For programming, Bash provides -variables such as -.B RANDOM -and -.B REPLY , -the -.B typeset -builtin, -the ability to remove substrings from variables based on patterns, -and shell arithmetic. -.FS -\(dgMorris Bolsky and David Korn, \fIThe KornShell Command and -Programming Language\fP, Prentice Hall, 1989. -.FE -.B RANDOM -expands to a random number each time it is referenced; assigning a -value to -.B RANDOM -seeds the random number generator. -.B REPLY -is the default variable used by the -.B read -builtin when no variable names are supplied as arguments. -The -.B typeset -builtin is used to define variables and give them attributes -such as \fBreadonly\fP. -Bash arithmetic allows the evaluation of an expression and the -substitution of the result. Shell variables may be used as operands, -and the result of an expression may be assigned to a variable. -Nearly all of the operators from the C language are available, -with the same precedence rules: -.SE -$ echo $((3 + 5 * 32)) -163 -.EE -.LP -For interactive use, Bash implements ksh-style aliases and builtins -such as -.B fc -(discussed below) and -.B jobs . -Bash aliases allow a string to be substituted for a command name. -They can be used to create a mnemonic for a \s-1UNIX\s+1 command -name (\f(CRalias del=rm\fP), to expand a single word to a complex command -(\f(CRalias news='xterm -g 80x45 -title trn -e trn -e -S1 -N &'\fP), or to -ensure that a command is invoked with a basic set of options -(\f(CRalias ls="/bin/ls -F"\fP). -.PP -The C shell (\fBcsh\fP)\(dg, originally written by Bill Joy while at -Berkeley, is widely used and quite popular for its interactive -facilities. Bash includes a csh-compatible history expansion -mechanism (\*Q! history\*U), brace expansion, access to a stack -of directories via the -.B pushd , -.B popd , -and -.B dirs -builtins, and tilde expansion, to generate users' home directories. -Tilde expansion has also been adopted by both the Korn Shell and -POSIX.2. -.FS -\(dgBill Joy, An Introduction to the C Shell, \fIUNIX User's Supplementary -Documents\fP, University of California at Berkeley, 1986. -.FE -.PP -There were certain areas in which POSIX.2 felt standardization -was necessary, but no existing implementation provided the proper -behavior. The working group invented and standardized functionality -in these areas, which Bash implements. The -.B command -builtin was invented so that shell functions could be written to -replace builtins; it makes the capabilities of the builtin -available to the function. The reserved word \*Q!\*U was added -to negate the return value of a command or pipeline; it was nearly -impossible to express \*Qif not x\*U cleanly using the sh language. -There exist multiple incompatible implementations of the -.B test -builtin, which tests files for type and other attributes and performs -arithmetic and string comparisons. -POSIX considered none of these correct, so the standard -behavior was specified in terms of the number of arguments to the -command. POSIX.2 dictates exactly what will happen when four or -fewer arguments are given to -.B test , -and leaves the behavior undefined when more arguments are supplied. -Bash uses the POSIX.2 algorithm, which was conceived by David Korn. -.NH 2 -Features not in the Bourne Shell -.PP -There are a number of minor differences between Bash and the -version of sh present on most other versions of \s-1UNIX\s+1. The majority -of these are due to the POSIX standard, but some are the result of -Bash adopting features from other shells. For instance, Bash -includes the new \*Q!\*U reserved word, the -.B command -builtin, the ability of the -.B read -builtin to correctly return a line ending with a backslash, symbolic -arguments to the -.B umask -builtin, variable substring removal, a way to get the length of a variable, -and the new algorithm for the -.B test -builtin from the POSIX.2 standard, none of which appear in sh. -.PP -Bash also implements the \*Q$(...)\*U command substitution syntax, -which supersedes the sh `...` construct. -The \*Q$(...)\*U construct expands to the output of the command -contained within the -parentheses, with trailing newlines removed. The sh syntax is -accepted for backwards compatibility, but the \*Q$(...)\*U form -is preferred because its quoting rules are much simpler and it -is easier to nest. -.PP -The Bourne shell does not provide such features as brace expansion, -the ability -to define a variable and a function with the same name, local variables -in shell functions, the ability to enable and disable individual -builtins or write a function to replace a builtin, or a means to -export a shell function to a child process. -.PP -Bash has closed -a long-standing shell security hole by not using the -.B $IFS -variable to split each word read by the shell, but splitting only -the results of expansion (ksh and the 4.4 BSD sh have fixed this -as well). Useful behavior such as a means to abort -execution of a script read with the \*Q.\*U command using the -\fBreturn\fP builtin or automatically -exporting variables in the shell's environment to children is also -not present in the Bourne shell. Bash provides a much more powerful -environment for both interactive use and programming. -.NH 1 -Bash-specific Features -.PP -This section details a few of the features which make Bash unique. -Most of them provide improved interactive use, but a few programming -improvements are present as well. Full descriptions of these -features can be found in the Bash documentation. -.NH 2 -Startup Files -.PP -Bash executes startup files differently than other shells. The Bash -behavior is a compromise between the csh principle of startup files -with fixed names executed for each shell and the sh -\*Qminimalist\*U behavior. An interactive instance of Bash started -as a login shell reads and executes -.I ~/.bash_profile -(the file .bash_profile in the user's home directory), if it exists. -An interactive non-login shell reads and executes -.I ~/.bashrc . -A non-interactive shell (one begun to execute a shell script, for -example) reads no fixed startup file, but uses the value of the variable -.B $ENV , -if set, as the name of a startup file. The ksh practice of reading -.B $ENV -for every shell, with the accompanying difficulty of defining the -proper variables and functions for interactive and non-interactive -shells or having the file read only for interactive shells, was -considered too complex. Ease of use won out here. Interestingly, -the next release of ksh will change to reading -.B $ENV -only for interactive shells. -.NH 2 -New Builtin Commands -.PP -There are a few builtins which are new or have been extended in Bash. -The -.B enable -builtin allows builtin commands to be turned on and off arbitrarily. -To use the version of -.I echo -found in a user's search path rather than the Bash builtin, -\f(CRenable -n echo\fP suffices. The -.B help -builtin provides -quick synopses of the shell facilities without requiring -access to a manual page. -.B Builtin -is similar to -.B command -in that it bypasses shell functions and directly executes builtin -commands. Access to a csh-style stack of directories is provided -via the -.B pushd , -.B popd , -and -.B dirs -builtins. -.B Pushd -and -.B popd -insert and remove directories from the stack, respectively, and -.B dirs -lists the stack contents. On systems that allow fine-grained control -of resources, the -.B ulimit -builtin can be used to tune these settings. -.B Ulimit -allows a user to control, -among other things, whether core dumps are to be generated, -how much memory the shell or a child process is allowed to allocate, -and how large a file created by a child process can grow. The -.B suspend -command will stop the shell process when job control is active; most -other shells do not allow themselves to be stopped like that. -.B Type, -the Bash answer to -.B which -and -.B whence, -shows what will happen when a word is typed as a command: -.SE -$ type export -export is a shell builtin -$ type -t export -builtin -$ type bash -bash is /bin/bash -$ type cd -cd is a function -cd () -{ - builtin cd ${1+"$@"} && xtitle $HOST: $PWD -} -.EE -.LP -Various -modes tell what a command word is (reserved word, alias, function, builtin, -or file) or which version of a command will be executed based on -a user's search path. Some of this functionality has been adopted -by POSIX.2 and folded into the -.B command -utility. -.NH 2 -Editing and Completion -.PP -One area in which Bash shines is command line editing. Bash uses the -.I readline -library to read and edit lines when interactive. Readline is a -powerful and flexible input facility that a user can configure to -individual tastes. It allows lines to be edited using either emacs -or vi commands, where those commands are appropriate. The full -capability of emacs is not present \- there is no way to execute -a named command with M-x, for instance \- but the existing commands -are more than adequate. The vi mode is compliant with -the command line editing standardized by POSIX.2. -.PP -Readline is fully customizable. In addition to the basic commands -and key bindings, the library allows users to define additional -key bindings using a startup file. The -.I inputrc -file, which defaults to the file -.I ~/.inputrc , -is read each time readline initializes, permitting users to -maintain a consistent interface across a set of programs. Readline -includes an extensible interface, so each program using the -library can add its own bindable commands and program-specific -key bindings. Bash uses this facility to add bindings -that perform history expansion or shell word expansions on the current -input line. -.PP -Readline interprets a number of -variables which further tune its behavior. Variables -exist to control whether or not eight-bit characters are directly -read as input or converted to meta-prefixed key sequences (a -meta-prefixed key sequence consists of the character with the -eighth bit zeroed, preceded by the -.I meta-prefix -character, usually escape, which selects an alternate keymap), to -decide whether to output characters with the eighth bit set -directly or as a meta-prefixed key sequence, whether or not to -wrap to a new screen line when a line being edited is longer than -the screen width, the keymap to which subsequent key bindings should -apply, or even what happens when readline wants to -ring the terminal's bell. All of these variables can be set in -the inputrc file. -.PP -The startup file understands a set of C -preprocessor-like conditional constructs which allow variables or -key bindings to be assigned based on the application using readline, -the terminal currently being used, or the editing mode. Users can -add program-specific bindings to make their lives easier: I have -bindings that let me edit the value of -.B $PATH -and double-quote the current or previous word: -.SE -# Macros that are convenient for shell interaction -$if Bash -# edit the path -"\eC-xp": "PATH=${PATH}\ee\eC-e\eC-a\eef\eC-f" -# prepare to type a quoted word -- insert open and close double -# quotes and move to just after the open quote -"\eC-x\e"": "\e"\e"\eC-b" -# Quote the current or previous word -"\eC-xq": "\eeb\e"\eef\e"" -$endif -.EE -.LP -There is a readline -command to re-read the file, so users can edit the file, change -some bindings, and begin to use them almost immediately. -.PP -Bash implements the -.B bind -builtin for more dyamic control of readline than the startup file -permits. -.B Bind -is used in several ways. In -.I list -mode, it can display the current key bindings, list all the -readline editing directives available for binding, list which keys -invoke a given directive, or output the current set of key -bindings in a format that can be incorporated directly into an inputrc -file. In -.I batch -mode, it reads a series of key bindings directly from a file and -passes them to readline. In its most common usage, -.B bind -takes a single string and passes it directly to readline, which -interprets the line as if it had just been read from the inputrc file. -Both key bindings and variable assignments may appear in the -string given to -.B bind . -.PP -The readline library also provides an interface for \fIword completion\fP. -When the -.I completion -character (usually TAB) is typed, readline looks at the word currently -being entered and computes the set of filenames of which the current -word is a valid prefix. -If there is only one possible completion, the -rest of the characters are inserted directly, otherwise the -common prefix of the set of filenames is added to the current word. -A second TAB character entered immediately after a non-unique -completion causes readline to list the possible completions; there is -an option to have the list displayed immediately. -Readline provides hooks so that applications can provide specific types -of completion before the default filename completion is attempted. -This is quite flexible, though it is not completely user-programmable. -Bash, for example, can complete filenames, command names (including aliases, -builtins, shell reserved words, shell functions, and executables found -in the file system), shell variables, usernames, and hostnames. It -uses a set of heuristics that, while not perfect, is generally quite -good at determining what type of completion to attempt. -.NH 2 -History -.PP -Access to the list of commands previously entered (the \fIcommand history\fP) -is provided jointly by Bash and the readline library. Bash provides -variables (\fB$HISTFILE\fP, \fB$HISTSIZE\fP, and \fB$HISTCONTROL\fP) -and the -.B history -and -.B fc -builtins to manipulate the history list. -The value of -.B $HISTFILE -specifes the file where Bash writes the command history on exit and -reads it on startup. -.B $HISTSIZE -is used to limit the number of commands saved in the history. -.B $HISTCONTROL -provides a crude form of control over which commands are saved on -the history list: a value of -.I ignorespace -means to not save commands which begin with a space; a value of -.I ignoredups -means to not save commands identical to the last command saved. -\fB$HISTCONTROL\fP was named \fB$history_control\fP in earlier -versions of Bash; the old name is still accepted for backwards -compatibility. The -.B history -command can read or write files containing the history list -and display the current list contents. The -.B fc -builtin, adopted from POSIX.2 and the Korn Shell, allows display -and re-execution, with optional editing, -of commands from the history list. The readline -library offers a set of commands to search the history list for -a portion of the current input line or a string typed by the user. -Finally, the -.I history -library, generally incorporated directly into the readline library, -implements a facility for history recall, expansion, and re-execution -of previous commands very similar to csh -(\*Qbang history\*U, so called because the exclamation point -introduces a history substitution): -.SE -$ echo a b c d e -a b c d e -$ !! f g h i -echo a b c d e f g h i -a b c d e f g h i -$ !-2 -echo a b c d e -a b c d e -$ echo !-2:1-4 -echo a b c d -a b c d -.EE -.LP -The command history is only -saved when the shell is interactive, so it is not available for use -by shell scripts. -.NH 2 -New Shell Variables -.PP -There are a number of convenience variables that Bash interprets -to make life easier. These include -.B FIGNORE , -which is a set of filename suffixes identifying files to exclude when -completing filenames; -.B HOSTTYPE , -which is automatically set to a string describing the type of -hardware on which Bash is currently executing; -.B command_oriented_history , -which directs Bash to save all lines of a multiple-line -command such as a \fIwhile\fP or \fIfor\fP loop in a single -history entry, allowing easy re-editing; and -.B IGNOREEOF , -whose value indicates the number of consecutive EOF characters that -an interactive shell will read before exiting \- an easy way to keep -yourself from being logged out accidentally. The -.B auto_resume -variable alters the way the shell treats simple command names: -if job control is active, and this variable is set, single-word -simple commands without redirections cause the shell to first -look for and restart a suspended job with that name before -starting a new process. -.NH 2 -Brace Expansion -.PP -Since sh offers no convenient way to generate arbitrary strings that -share a common prefix or suffix (filename expansion requires that -the filenames exist), Bash implements \fIbrace expansion\fP, a -capability picked up from csh. -Brace expansion is similar to filename expansion, but the strings -generated need not correspond to existing files. A brace expression -consists of an optional -.I preamble , -followed by a pair of braces enclosing a series of comma-separated -strings, and an optional -.I postamble . -The preamble is prepended to each string within the braces, and the -postamble is then appended to each resulting string: -.SE -$ echo a{d,c,b}e -ade ace abe -.EE -.LP -As this example demonstrates, the results of brace expansion are not -sorted, as they are by filename expansion. -.NH 2 -Process Substitution -.PP -On systems that can support it, Bash provides a facility known as -\fIprocess substitution\fP. Process substitution is similar to command -substitution in that its specification includes a command to execute, -but the shell does not collect the command's output and insert it into -the command line. Rather, Bash opens a pipe to the command, which -is run in the background. The shell uses named pipes (FIFOs) or the -.I /dev/fd -method of naming open files to expand the process -substitution to a filename which connects to the pipe when opened. -This filename becomes the result of the expansion. Process substitution -can be used to compare the outputs of two different versions of an -application as part of a regression test: -.SE -$ cmp <(old_prog) <(new_prog) -.EE -.NH 2 -Prompt Customization -.PP -One of the more popular interactive features that Bash provides is -the ability to customize the prompt. Both -.B $PS1 -and -.B $PS2, -the primary and secondary prompts, are expanded before being -displayed. Parameter and variable expansion is performed when -the prompt string is expanded, so any shell variable can be -put into the prompt (e.g., -.B $SHLVL , -which indicates how deeply the current shell is nested). -Bash specially interprets characters in the prompt string -preceded by a backslash. Some of these backslash escapes are -replaced with -the current time, the date, the current working directory, -the username, and the command number or history number of the command -being entered. There is even a backslash escape to cause the shell -to change its prompt when running as root after an \fIsu\fP. -Before printing each primary prompt, Bash expands the variable -.B $PROMPT_COMMAND -and, if it has a value, executes the expanded value as a command, -allowing additional prompt customization. For example, this assignment -causes the current user, the current host, the time, the last -component of the current working directory, the level of shell -nesting, and the history number of the current command to be embedded -into the primary prompt: -.SE -$ PS1='\eu@\eh [\et] \eW($SHLVL:\e!)\e$ ' -chet@odin [21:03:44] documentation(2:636)$ cd .. -chet@odin [21:03:54] src(2:637)$ -.EE -.LP -The string being assigned is surrounded by single quotes so that if -it is exported, the value of -.B $SHLVL -will be updated by a child shell: -.SE -chet@odin [21:17:35] src(2:638)$ export PS1 -chet@odin [21:17:40] src(2:639)$ bash -chet@odin [21:17:46] src(3:696)$ -.EE -.LP -The \fP\e$\fP escape is displayed -as \*Q\fB$\fP\*U when running as a normal user, but as \*Q\fB#\fP\*U when -running as root. -.NH 2 -File System Views -.PP -Since Berkeley introduced symbolic links in 4.2 BSD, one of their most -annoying properties has been the \*Qwarping\*U to a completely -different area of the file system when using -.B cd , -and the resultant non-intuitive behavior of \*Q\fBcd ..\fP\*U. -The \s-1UNIX\s+1 kernel treats symbolic links -.I physically . -When the kernel is translating a pathname -in which one component is a symbolic link, it replaces all or part -of the pathname while processing the link. If the contents of the symbolic -link begin with a slash, the kernel replaces the -pathname entirely; if not, the link contents replace -the current component. In either case, the symbolic link -is visible. If the link value is an absolute pathname, -the user finds himself in a completely different part of the file -system. -.PP -Bash provides a -.I logical -view of the file system. In this default mode, command and filename -completion and builtin commands such as -.B cd -and -.B pushd -which change the current working directory transparently follow -symbolic links as if they were directories. -The -.B $PWD -variable, which holds the shell's idea of the current working directory, -depends on the path used to reach the directory rather than its -physical location in the local file system hierarchy. For example: -.SE -$ cd /usr/local/bin -$ echo $PWD -/usr/local/bin -$ pwd -/usr/local/bin -$ /bin/pwd -/net/share/sun4/local/bin -$ cd .. -$ pwd -/usr/local -$ /bin/pwd -/net/share/sun4/local -$ cd .. -$ pwd -/usr -$ /bin/pwd -/usr -.EE -.LP -One problem with this, of -course, arises when programs that do not understand the shell's logical -notion of the file system interpret \*Q..\*U differently. This generally -happens when Bash completes filenames containing \*Q..\*U according to a -logical hierarchy which does not correspond to their physical location. -For users who find this troublesome, a corresponding -.I physical -view of the file system is available: -.SE -$ cd /usr/local/bin -$ pwd -/usr/local/bin -$ set -o physical -$ pwd -/net/share/sun4/local/bin -.EE -.NH 2 -Internationalization -.PP -One of the most significant improvements in version 1.13 of Bash was the -change to \*Qeight-bit cleanliness\*U. Previous versions used the -eighth bit of characters to mark whether or not they were -quoted when performing word expansions. While this did not affect -the majority of users, most of whom used only seven-bit ASCII characters, -some found it confining. Beginning with version 1.13, Bash -implemented a different quoting mechanism that did not alter the -eighth bit of characters. This allowed Bash -to manipulate files with \*Qodd\*U characters in their names, but -did nothing to help users enter those names, so -version 1.13 introduced changes to readline that -made it eight-bit clean as well. Options exist that force readline to -attach no special significance to characters with the eighth bit set -(the default behavior is to convert these characters to meta-prefixed -key sequences) and to output these characters without conversion to -meta-prefixed sequences. These changes, along with the expansion of -keymaps to a full eight bits, enable readline to work with most of the -ISO-8859 family of character sets, used by many European countries. -.NH 2 -POSIX Mode -.PP -Although Bash is intended to be POSIX.2 conformant, there are areas in -which the default behavior is not compatible with the standard. For -users who wish to operate in a strict POSIX.2 environment, Bash -implements a \fIPOSIX mode\fP. When this mode is active, Bash modifies -its default operation where it differs from POSIX.2 to match the -standard. POSIX mode is entered when Bash is started with the -.B -posix -option. This feature is also available as an option to the -\fBset\fP builtin, \fBset -o posix\fP. -For compatibility with other GNU software that attempts to be POSIX.2 -compliant, Bash also enters POSIX mode if the variable -.B $POSIXLY_CORRECT -is set when Bash is started or assigned a value during execution. -.B $POSIX_PEDANTIC -is accepted as well, to be compatible with some older GNU utilities. -When Bash is started in POSIX mode, for example, it sources the -file named by the value of -.B $ENV -rather than the \*Qnormal\*U startup files, and does not allow -reserved words to be aliased. -.NH 1 -New Features and Future Plans -.PP -There are several features introduced in the current -version of Bash, version 1.14, and a number under consideration -for future releases. This section will briefly detail the new -features in version 1.14 and describe several features -that may appear in later versions. -.NH 2 -New Features in Bash-1.14 -.PP -The new features available in Bash-1.14 answer several of -the most common requests for enhancements. Most notably, there -is a mechanism -for including non-visible character sequences in prompts, such as -those which cause a terminal to print characters in different -colors or in standout mode. There was nothing preventing the use -of these sequences in earlier -versions, but the readline redisplay algorithm assumed each -character occupied physical screen space and would wrap lines -prematurely. -.PP -Readline has a few new -variables, several new bindable commands, and some additional -emacs mode default key bindings. A new history search -mode has been implemented: in this mode, readline searches the -history for lines beginning with the characters between the -beginning of the current line and the cursor. The existing readline -incremental search commands no longer match identical lines more -than once. -Filename completion now expands variables in directory names. -The history expansion facilities are now nearly -completely csh-compatible: missing modifiers have been added and -history substitution has been extended. -.PP -Several of the features described earlier, such as -.B "set -o posix" -and -.B $POSIX_PEDANTIC , -are new in version 1.14. -There is a new shell variable, -.B OSTYPE , -to which Bash assigns a value that identifies the -version of \s-1UNIX\s+1 it's -running on (great for putting architecture-specific binary directories -into the \fB$PATH\fP). -Two variables have been renamed: -.B $HISTCONTROL -replaces -.B $history_control , -and -.B $HOSTFILE -replaces -.B $hostname_completion_file . -In both cases, the old names are accepted for backwards -compatibility. The ksh -.I select -construct, which allows the generation of simple menus, -has been implemented. New capabilities have been added -to existing variables: -.B $auto_resume -can now take values of -.I exact -or -.I substring , -and -.B $HISTCONTROL -understands the value -.I ignoreboth , -which combines the two previously acceptable values. The -.B dirs -builtin has acquired options to print out specific members of the -directory stack. The -.B $nolinks -variable, which forces a physical view of the file system, -has been superseded by the -.B \-P -option to the -.B set -builtin (equivalent to \fBset -o physical\fP); the variable is retained -for backwards compatibility. The version string contained in -.B $BASH_VERSION -now includes an indication of the patch level as well as the -\*Qbuild version\*U. -Some little-used features have -been removed: the -.B bye -synonym for -.B exit -and the -.B $NO_PROMPT_VARS -variable are gone. There is now an organized test suite that can be -run as a regression test when building a new version of Bash. -.PP -The documentation has been thoroughly overhauled: -there is a new manual page on the readline library and the \fIinfo\fP -file has been updated to reflect the current version. -As always, as many bugs as possible have been fixed, although some -surely remain. -.NH 2 -Other Features -.PP -There are a few features that I hope to include in later Bash releases. -Some are based on work already done in other shells. -.PP -In addition to simple variables, a future release of Bash will include -one-dimensional arrays, using the ksh -implementation of arrays as a model. Additions to the ksh syntax, -such as \fIvarname\fP=( ... ) to assign a list of words directly to -an array and a mechanism to allow -the -.B read -builtin to read a list of values directly into an array, would be -desirable. Given those extensions, the ksh -.B "set \-A" -syntax may not be worth supporting (the -.B \-A -option assigns a list of values to an array, but is a rather -peculiar special case). -.PP -Some shells include a means of \fIprogrammable\fP word -completion, where the user specifies on a per-command basis how the -arguments of the command are to be treated when completion is attempted: -as filenames, hostnames, executable files, and so on. The other -aspects of the current Bash implementation could remain as-is; the -existing heuristics would still be valid. Only when completing the -arguments to a simple command would the programmable completion be -in effect. -.PP -It would also be nice to give the user finer-grained -control over which commands are saved onto the history list. One -proposal is for a variable, tentatively named -.B HISTIGNORE , -which would contain a colon-separated list of commands. Lines beginning -with these commands, after the restrictions of -.B $HISTCONTROL -have been applied, would not be placed onto the history list. The -shell pattern-matching capabilities could also be available when -specifying the contents of -.B $HISTIGNORE . -.PP -One thing that newer shells such as -.B wksh -(also known as -.B dtksh ) -provide is a command to dynamically load code -implementing additional builtin commands into a running shell. -This new builtin would take an object file or shared library -implementing the \*Qbody\*U of the -builtin (\fIxxx_builtin()\fP for those familiar with Bash internals) -and a structure containing the name of the new command, the function -to call when the new builtin is invoked (presumably defined in the -shared object specified as an argument), and the documentation to be -printed by the -.B help -command (possibly present in the shared object as well). It would -manage the details of extending the internal table of builtins. -.PP -A few other builtins would also be desirable: two are the POSIX.2 -.B getconf -command, which prints the values of system configuration variables -defined by POSIX.2, and a -.B disown -builtin, which causes a shell running -with job control active to \*Qforget about\*U one or more -background jobs in its internal jobs table. Using -.B getconf , -for example, a user could retrieve a value for -.B $PATH -guaranteed to find all of the POSIX standard utilities, or -find out how long filenames may be in the file system containing -a specified directory. -.PP -There are no implementation timetables for any of these features, nor -are there concrete plans to include them. If anyone has comments on -these proposals, feel free to send me electronic mail. -.NH 1 -Reflections and Lessons Learned -.PP -The lesson that has been repeated most often during Bash -development is that there are dark corners in the Bourne shell, -and people use all of them. In the original description of the -Bourne shell, quoting and the shell grammar are both poorly -specified and incomplete; subsequent descriptions have not helped -much. The grammar presented in Bourne's paper describing -the shell distributed with the Seventh Edition of \s-1UNIX\s+1\(dg -is so far off that it does not allow the command \f(CWwho|wc\fP. -In fact, as Tom Duff states: -.QP -Nobody really knows what the -Bourne shell's grammar is. Even examination of the source code is -little help.\(dd -.FS -\(dgS. R. Bourne, \*QUNIX Time-Sharing System: The UNIX Shell\*U, -\fIBell System Technical Journal\fP, 57(6), July-August, 1978, pp. 1971-1990. -.FE -.FS -\(ddTom Duff, \*QRc \- A Shell for Plan 9 and \s-1UNIX\s+1 systems\*U, -\fIProc. of the Summer 1990 EUUG Conference\fP, London, July, 1990, -pp. 21-33. -.FE -.LP -The POSIX.2 standard includes a \fIyacc\fP grammar that comes close -to capturing the Bourne shell's behavior, but it disallows some -constructs which sh accepts without complaint \- and there are -scripts out there that use them. It took a few versions and -several bug reports before Bash implemented sh-compatible quoting, -and there are still some \*Qlegal\*U sh constructs which Bash flags as -syntax errors. Complete sh compatibility is a tough nut. -.PP -The shell is bigger and slower than I would like, though the current -version is substantially faster than previously. The readline library -could stand a substantial rewrite. A hand-written parser to replace -the current \fIyacc\fP-generated one would probably result in a speedup, -and would solve one glaring problem: the shell could parse -commands in \*Q$(...)\*U constructs -as they are entered, rather than reporting errors when the construct -is expanded. -.PP -As always, there is some chaff to go with the wheat. -Areas of duplicated functionality need to be cleaned -up. There are several cases where Bash treats a variable specially to -enable functionality available another way (\fB$notify\fP vs. -\fBset -o notify\fP and \fB$nolinks\fP vs. \fBset -o physical\fP, for -instance); the special treatment of the variable name should probably -be removed. A few more things could stand removal; the -.B $allow_null_glob_expansion -and -.B $glob_dot_filenames -variables are of particularly questionable value. -The \fB$[...]\fP arithmetic evaluation syntax is redundant now that -the POSIX-mandated \fB$((...))\fP construct has been implemented, -and could be deleted. -It would be nice if the text output by the -.B help -builtin were external to the shell rather than compiled into it. -The behavior enabled by -.B $command_oriented_history , -which causes the shell to attempt to save all lines of a multi-line -command in a single history entry, should be made the default and -the variable removed. -.NH 1 -Availability -.PP -As with all other -GNU software, Bash is available for anonymous FTP from -.I prep.ai.mit.edu:/pub/gnu -and from other GNU software mirror sites. The current version is in -.I bash-1.14.1.tar.gz -in that directory. Use -.I archie -to find the nearest archive site. The -latest version is always available for FTP from -.I bash.CWRU.Edu:/pub/dist. -Bash documentation is available for FTP from -.I bash.CWRU.Edu:/pub/bash. -.PP -The Free Software Foundation sells tapes and CD-ROMs -containing Bash; send electronic mail to -\f(CRgnu@prep.ai.mit.edu\fP or call \f(CR+1-617-876-3296\fP -for more information. -.PP -Bash is also distributed with several versions of \s-1UNIX\s+1-compatible -systems. It is included as /bin/sh and /bin/bash on several Linux -distributions (more about the difference in a moment), and as contributed -software in BSDI's BSD/386* and FreeBSD. -.FS -*BSD/386 is a trademark of Berkeley Software Design, Inc. -.FE -.PP -The Linux distribution deserves special mention. There are two -configurations included in the standard Bash distribution: a -\*Qnormal\*U configuration, in which all of the standard features -are included, and a \*Qminimal\*U configuration, which omits job -control, aliases, history and command line editing, the directory -stack and -.B pushd/popd/dirs, -process substitution, prompt string special character decoding, and the -.I select -construct. This minimal version is designed to be a drop-in replacement -for the traditional \s-1UNIX\s+1 /bin/sh, and is included as the Linux -/bin/sh in several packagings. -.NH 1 -Conclusion -.PP -Bash is a worthy successor to sh. -It is sufficiently portable -to run on nearly every version of \s-1UNIX\s+1 from -4.3 BSD to SVR4.2, and several \s-1UNIX\s+1 workalikes. -It is robust enough to replace sh on most of those systems, -and provides more functionality. It has several thousand regular users, -and their feedback has helped to make it as good as it is today \- a -testament to the benefits of free software. diff --git a/doc/bash.0 b/doc/bash.0 new file mode 100644 index 0000000..675cd2f --- /dev/null +++ b/doc/bash.0 @@ -0,0 +1,5358 @@ +BASH(1) BASH(1) + + + +NNAAMMEE + bash - GNU Bourne-Again SHell + +SSYYNNOOPPSSIISS + bbaasshh [options] [file] + +CCOOPPYYRRIIGGHHTT + Bash is Copyright (C) 1989-2009 by the Free Software Foundation, Inc. + +DDEESSCCRRIIPPTTIIOONN + BBaasshh is an sshh-compatible command language interpreter that executes + commands read from the standard input or from a file. BBaasshh also incor- + porates useful features from the _K_o_r_n and _C shells (kksshh and ccsshh). + + BBaasshh is intended to be a conformant implementation of the Shell and + Utilities portion of the IEEE POSIX specification (IEEE Standard + 1003.1). BBaasshh can be configured to be POSIX-conformant by default. + +OOPPTTIIOONNSS + In addition to the single-character shell options documented in the + description of the sseett builtin command, bbaasshh interprets the following + options when it is invoked: + + --cc _s_t_r_i_n_g If the --cc option is present, then commands are read from + _s_t_r_i_n_g. If there are arguments after the _s_t_r_i_n_g, they are + assigned to the positional parameters, starting with $$00. + --ii If the --ii option is present, the shell is _i_n_t_e_r_a_c_t_i_v_e. + --ll Make bbaasshh act as if it had been invoked as a login shell (see + IINNVVOOCCAATTIIOONN below). + --rr If the --rr option is present, the shell becomes _r_e_s_t_r_i_c_t_e_d + (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). + --ss If the --ss option is present, or if no arguments remain after + option processing, then commands are read from the standard + input. This option allows the positional parameters to be + set when invoking an interactive shell. + --DD A list of all double-quoted strings preceded by $$ is printed + on the standard output. These are the strings that are sub- + ject to language translation when the current locale is not CC + or PPOOSSIIXX. This implies the --nn option; no commands will be + executed. + [[--++]]OO [[_s_h_o_p_t___o_p_t_i_o_n]] + _s_h_o_p_t___o_p_t_i_o_n is one of the shell options accepted by the + sshhoopptt builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). If + _s_h_o_p_t___o_p_t_i_o_n is present, --OO sets the value of that option; ++OO + unsets it. If _s_h_o_p_t___o_p_t_i_o_n is not supplied, the names and + values of the shell options accepted by sshhoopptt are printed on + the standard output. If the invocation option is ++OO, the + output is displayed in a format that may be reused as input. + ---- A ---- signals the end of options and disables further option + processing. Any arguments after the ---- are treated as file- + names and arguments. An argument of -- is equivalent to ----. + + BBaasshh also interprets a number of multi-character options. These + options must appear on the command line before the single-character + options to be recognized. + + ----ddeebbuuggggeerr + Arrange for the debugger profile to be executed before the shell + starts. Turns on extended debugging mode (see the description + of the eexxttddeebbuugg option to the sshhoopptt builtin below) and shell + function tracing (see the description of the --oo ffuunnccttrraaccee option + to the sseett builtin below). + ----dduummpp--ppoo--ssttrriinnggss + Equivalent to --DD, but the output is in the GNU _g_e_t_t_e_x_t ppoo (por- + table object) file format. + ----dduummpp--ssttrriinnggss + Equivalent to --DD. + ----hheellpp Display a usage message on standard output and exit success- + fully. + ----iinniitt--ffiillee _f_i_l_e + ----rrccffiillee _f_i_l_e + Execute commands from _f_i_l_e instead of the standard personal ini- + tialization file _~_/_._b_a_s_h_r_c if the shell is interactive (see + IINNVVOOCCAATTIIOONN below). + + ----llooggiinn + Equivalent to --ll. + + ----nnooeeddiittiinngg + Do not use the GNU rreeaaddlliinnee library to read command lines when + the shell is interactive. + + ----nnoopprrooffiillee + Do not read either the system-wide startup file _/_e_t_c_/_p_r_o_f_i_l_e or + any of the personal initialization files _~_/_._b_a_s_h___p_r_o_f_i_l_e, + _~_/_._b_a_s_h___l_o_g_i_n, or _~_/_._p_r_o_f_i_l_e. By default, bbaasshh reads these + files when it is invoked as a login shell (see IINNVVOOCCAATTIIOONN + below). + + ----nnoorrcc Do not read and execute the personal initialization file + _~_/_._b_a_s_h_r_c if the shell is interactive. This option is on by + default if the shell is invoked as sshh. + + ----ppoossiixx + Change the behavior of bbaasshh where the default operation differs + from the POSIX standard to match the standard (_p_o_s_i_x _m_o_d_e). + + ----rreessttrriicctteedd + The shell becomes restricted (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). + + ----vveerrbboossee + Equivalent to --vv. + + ----vveerrssiioonn + Show version information for this instance of bbaasshh on the stan- + dard output and exit successfully. + +AARRGGUUMMEENNTTSS + If arguments remain after option processing, and neither the --cc nor the + --ss option has been supplied, the first argument is assumed to be the + name of a file containing shell commands. If bbaasshh is invoked in this + fashion, $$00 is set to the name of the file, and the positional parame- + ters are set to the remaining arguments. BBaasshh reads and executes com- + mands from this file, then exits. BBaasshh's exit status is the exit sta- + tus of the last command executed in the script. If no commands are + executed, the exit status is 0. An attempt is first made to open the + file in the current directory, and, if no file is found, then the shell + searches the directories in PPAATTHH for the script. + +IINNVVOOCCAATTIIOONN + A _l_o_g_i_n _s_h_e_l_l is one whose first character of argument zero is a --, or + one started with the ----llooggiinn option. + + An _i_n_t_e_r_a_c_t_i_v_e shell is one started without non-option arguments and + without the --cc option whose standard input and error are both connected + to terminals (as determined by _i_s_a_t_t_y(3)), or one started with the --ii + option. PPSS11 is set and $$-- includes ii if bbaasshh is interactive, allowing + a shell script or a startup file to test this state. + + The following paragraphs describe how bbaasshh executes its startup files. + If any of the files exist but cannot be read, bbaasshh reports an error. + Tildes are expanded in file names as described below under TTiillddee EExxppaann-- + ssiioonn in the EEXXPPAANNSSIIOONN section. + + When bbaasshh is invoked as an interactive login shell, or as a non-inter- + active shell with the ----llooggiinn option, it first reads and executes com- + mands from the file _/_e_t_c_/_p_r_o_f_i_l_e, if that file exists. After reading + that file, it looks for _~_/_._b_a_s_h___p_r_o_f_i_l_e, _~_/_._b_a_s_h___l_o_g_i_n, and _~_/_._p_r_o_f_i_l_e, + in that order, and reads and executes commands from the first one that + exists and is readable. The ----nnoopprrooffiillee option may be used when the + shell is started to inhibit this behavior. + + When a login shell exits, bbaasshh reads and executes commands from the + file _~_/_._b_a_s_h___l_o_g_o_u_t, if it exists. + + When an interactive shell that is not a login shell is started, bbaasshh + reads and executes commands from _~_/_._b_a_s_h_r_c, if that file exists. This + may be inhibited by using the ----nnoorrcc option. The ----rrccffiillee _f_i_l_e option + will force bbaasshh to read and execute commands from _f_i_l_e instead of + _~_/_._b_a_s_h_r_c. + + When bbaasshh is started non-interactively, to run a shell script, for + example, it looks for the variable BBAASSHH__EENNVV in the environment, expands + its value if it appears there, and uses the expanded value as the name + of a file to read and execute. BBaasshh behaves as if the following com- + mand were executed: + if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi + but the value of the PPAATTHH variable is not used to search for the file + name. + + If bbaasshh is invoked with the name sshh, it tries to mimic the startup + behavior of historical versions of sshh as closely as possible, while + conforming to the POSIX standard as well. When invoked as an interac- + tive login shell, or a non-interactive shell with the ----llooggiinn option, + it first attempts to read and execute commands from _/_e_t_c_/_p_r_o_f_i_l_e and + _~_/_._p_r_o_f_i_l_e, in that order. The ----nnoopprrooffiillee option may be used to + inhibit this behavior. When invoked as an interactive shell with the + name sshh, bbaasshh looks for the variable EENNVV, expands its value if it is + defined, and uses the expanded value as the name of a file to read and + execute. Since a shell invoked as sshh does not attempt to read and exe- + cute commands from any other startup files, the ----rrccffiillee option has no + effect. A non-interactive shell invoked with the name sshh does not + attempt to read any other startup files. When invoked as sshh, bbaasshh + enters _p_o_s_i_x mode after the startup files are read. + + When bbaasshh is started in _p_o_s_i_x mode, as with the ----ppoossiixx command line + option, it follows the POSIX standard for startup files. In this mode, + interactive shells expand the EENNVV variable and commands are read and + executed from the file whose name is the expanded value. No other + startup files are read. + + BBaasshh attempts to determine when it is being run with its standard input + connected to a a network connection, as if by the remote shell daemon, + usually _r_s_h_d, or the secure shell daemon _s_s_h_d. If bbaasshh determines it + is being run in this fashion, it reads and executes commands from + _~_/_._b_a_s_h_r_c, if that file exists and is readable. It will not do this if + invoked as sshh. The ----nnoorrcc option may be used to inhibit this behavior, + and the ----rrccffiillee option may be used to force another file to be read, + but _r_s_h_d does not generally invoke the shell with those options or + allow them to be specified. + + If the shell is started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not supplied, no startup + files are read, shell functions are not inherited from the environment, + the SSHHEELLLLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear in the environment, are ignored, and the effective user id is + set to the real user id. If the --pp option is supplied at invocation, + the startup behavior is the same, but the effective user id is not + reset. + +DDEEFFIINNIITTIIOONNSS + The following definitions are used throughout the rest of this docu- + ment. + bbllaannkk A space or tab. + wwoorrdd A sequence of characters considered as a single unit by the + shell. Also known as a ttookkeenn. + nnaammee A _w_o_r_d consisting only of alphanumeric characters and under- + scores, and beginning with an alphabetic character or an under- + score. Also referred to as an iiddeennttiiffiieerr. + mmeettaacchhaarraacctteerr + A character that, when unquoted, separates words. One of the + following: + || && ;; (( )) << >> ssppaaccee ttaabb + ccoonnttrrooll ooppeerraattoorr + A _t_o_k_e_n that performs a control function. It is one of the fol- + lowing symbols: + |||| && &&&& ;; ;;;; (( )) || ||&& <<nneewwlliinnee>> + +RREESSEERRVVEEDD WWOORRDDSS + _R_e_s_e_r_v_e_d _w_o_r_d_s are words that have a special meaning to the shell. The + following words are recognized as reserved when unquoted and either the + first word of a simple command (see SSHHEELLLL GGRRAAMMMMAARR below) or the third + word of a ccaassee or ffoorr command: + + !! ccaassee ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt tthheenn uunnttiill + wwhhiillee {{ }} ttiimmee [[[[ ]]]] + +SSHHEELLLL GGRRAAMMMMAARR + SSiimmppllee CCoommmmaannddss + A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- + lowed by bbllaannkk-separated words and redirections, and terminated by a + _c_o_n_t_r_o_l _o_p_e_r_a_t_o_r. The first word specifies the command to be executed, + and is passed as argument zero. The remaining words are passed as + arguments to the invoked command. + + The return value of a _s_i_m_p_l_e _c_o_m_m_a_n_d is its exit status, or 128+_n if + the command is terminated by signal _n. + + PPiippeelliinneess + A _p_i_p_e_l_i_n_e is a sequence of one or more commands separated by one of + the control operators || or ||&&. The format for a pipeline is: + + [ttiimmee [--pp]] [ ! ] _c_o_m_m_a_n_d [ [|||||&&] _c_o_m_m_a_n_d_2 ... ] + + The standard output of _c_o_m_m_a_n_d is connected via a pipe to the standard + input of _c_o_m_m_a_n_d_2. This connection is performed before any redirec- + tions specified by the command (see RREEDDIIRREECCTTIIOONN below). If ||&& is used, + the standard error of _c_o_m_m_a_n_d is connected to _c_o_m_m_a_n_d_2's standard input + through the pipe; it is shorthand for 22>>&&11 ||. This implicit redirect- + ion of the standard error is performed after any redirections specified + by the command. + + The return status of a pipeline is the exit status of the last command, + unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the + pipeline's return status is the value of the last (rightmost) command + to exit with a non-zero status, or zero if all commands exit success- + fully. If the reserved word !! precedes a pipeline, the exit status of + that pipeline is the logical negation of the exit status as described + above. The shell waits for all commands in the pipeline to terminate + before returning a value. + + If the ttiimmee reserved word precedes a pipeline, the elapsed as well as + user and system time consumed by its execution are reported when the + pipeline terminates. The --pp option changes the output format to that + specified by POSIX. The TTIIMMEEFFOORRMMAATT variable may be set to a format + string that specifies how the timing information should be displayed; + see the description of TTIIMMEEFFOORRMMAATT under SShheellll VVaarriiaabblleess below. + + Each command in a pipeline is executed as a separate process (i.e., in + a subshell). + + LLiissttss + A _l_i_s_t is a sequence of one or more pipelines separated by one of the + operators ;;, &&, &&&&, or ||||, and optionally terminated by one of ;;, &&, or + <<nneewwlliinnee>>. + + Of these list operators, &&&& and |||| have equal precedence, followed by ;; + and &&, which have equal precedence. + + A sequence of one or more newlines may appear in a _l_i_s_t instead of a + semicolon to delimit commands. + + If a command is terminated by the control operator &&, the shell exe- + cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not + wait for the command to finish, and the return status is 0. Commands + separated by a ;; are executed sequentially; the shell waits for each + command to terminate in turn. The return status is the exit status of + the last command executed. + + AND and OR lists are sequences of one of more pipelines separated by + the &&&& and |||| control operators, respectively. AND and OR lists are + executed with left associativity. An AND list has the form + + _c_o_m_m_a_n_d_1 &&&& _c_o_m_m_a_n_d_2 + + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status + of zero. + + An OR list has the form + + _c_o_m_m_a_n_d_1 |||| _c_o_m_m_a_n_d_2 + + + _c_o_m_m_a_n_d_2 is executed if and only if _c_o_m_m_a_n_d_1 returns a non-zero exit + status. The return status of AND and OR lists is the exit status of + the last command executed in the list. + + CCoommppoouunndd CCoommmmaannddss + A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following: + + (_l_i_s_t) _l_i_s_t is executed in a subshell environment (see CCOOMMMMAANNDD EEXXEECCUU-- + TTIIOONN EENNVVIIRROONNMMEENNTT below). Variable assignments and builtin com- + mands that affect the shell's environment do not remain in + effect after the command completes. The return status is the + exit status of _l_i_s_t. + + { _l_i_s_t; } + _l_i_s_t is simply executed in the current shell environment. _l_i_s_t + must be terminated with a newline or semicolon. This is known + as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of + _l_i_s_t. Note that unlike the metacharacters (( and )), {{ and }} are + _r_e_s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted + to be recognized. Since they do not cause a word break, they + must be separated from _l_i_s_t by whitespace or another shell + metacharacter. + + ((_e_x_p_r_e_s_s_i_o_n)) + The _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules described + below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of the expres- + sion is non-zero, the return status is 0; otherwise the return + status is 1. This is exactly equivalent to lleett ""_e_x_p_r_e_s_s_i_o_n"". + + [[[[ _e_x_p_r_e_s_s_i_o_n ]]]] + Return a status of 0 or 1 depending on the evaluation of the + conditional expression _e_x_p_r_e_s_s_i_o_n. Expressions are composed of + the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + Word splitting and pathname expansion are not performed on the + words between the [[[[ and ]]]]; tilde expansion, parameter and + variable expansion, arithmetic expansion, command substitution, + process substitution, and quote removal are performed. Condi- + tional operators such as --ff must be unquoted to be recognized as + primaries. + + When used with [[[[, The << and >> operators sort lexicographically + using the current locale. + + When the ==== and !!== operators are used, the string to the right + of the operator is considered a pattern and matched according to + the rules described below under PPaatttteerrnn MMaattcchhiinngg. If the shell + option nnooccaasseemmaattcchh is enabled, the match is performed without + regard to the case of alphabetic characters. The return value + is 0 if the string matches (====) or does not match (!!==) the pat- + tern, and 1 otherwise. Any part of the pattern may be quoted to + force it to be matched as a string. + + An additional binary operator, ==~~, is available, with the same + precedence as ==== and !!==. When it is used, the string to the + right of the operator is considered an extended regular expres- + sion and matched accordingly (as in _r_e_g_e_x(3)). The return value + is 0 if the string matches the pattern, and 1 otherwise. If the + regular expression is syntactically incorrect, the conditional + expression's return value is 2. If the shell option nnooccaasseemmaattcchh + is enabled, the match is performed without regard to the case of + alphabetic characters. Any part of the pattern may be quoted to + force it to be matched as a string. Substrings matched by + parenthesized subexpressions within the regular expression are + saved in the array variable BBAASSHH__RREEMMAATTCCHH. The element of + BBAASSHH__RREEMMAATTCCHH with index 0 is the portion of the string matching + the entire regular expression. The element of BBAASSHH__RREEMMAATTCCHH with + index _n is the portion of the string matching the _nth parenthe- + sized subexpression. + + Expressions may be combined using the following operators, + listed in decreasing order of precedence: + + (( _e_x_p_r_e_s_s_i_o_n )) + Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to + override the normal precedence of operators. + !! _e_x_p_r_e_s_s_i_o_n + True if _e_x_p_r_e_s_s_i_o_n is false. + _e_x_p_r_e_s_s_i_o_n_1 &&&& _e_x_p_r_e_s_s_i_o_n_2 + True if both _e_x_p_r_e_s_s_i_o_n_1 and _e_x_p_r_e_s_s_i_o_n_2 are true. + _e_x_p_r_e_s_s_i_o_n_1 |||| _e_x_p_r_e_s_s_i_o_n_2 + True if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true. + + The &&&& and |||| operators do not evaluate _e_x_p_r_e_s_s_i_o_n_2 if the value + of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of + the entire conditional expression. + + ffoorr _n_a_m_e [ [ iinn [ _w_o_r_d _._._. ] ] ; ] ddoo _l_i_s_t ; ddoonnee + The list of words following iinn is expanded, generating a list of + items. The variable _n_a_m_e is set to each element of this list in + turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omit- + ted, the ffoorr command executes _l_i_s_t once for each positional + parameter that is set (see PPAARRAAMMEETTEERRSS below). The return status + is the exit status of the last command that executes. If the + expansion of the items following iinn results in an empty list, no + commands are executed, and the return status is 0. + + ffoorr (( _e_x_p_r_1 ; _e_x_p_r_2 ; _e_x_p_r_3 )) ; ddoo _l_i_s_t ; ddoonnee + First, the arithmetic expression _e_x_p_r_1 is evaluated according to + the rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. The + arithmetic expression _e_x_p_r_2 is then evaluated repeatedly until + it evaluates to zero. Each time _e_x_p_r_2 evaluates to a non-zero + value, _l_i_s_t is executed and the arithmetic expression _e_x_p_r_3 is + evaluated. If any expression is omitted, it behaves as if it + evaluates to 1. The return value is the exit status of the last + command in _l_i_s_t that is executed, or false if any of the expres- + sions is invalid. + + sseelleecctt _n_a_m_e [ iinn _w_o_r_d ] ; ddoo _l_i_s_t ; ddoonnee + The list of words following iinn is expanded, generating a list of + items. The set of expanded words is printed on the standard + error, each preceded by a number. If the iinn _w_o_r_d is omitted, + the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). + The PPSS33 prompt is then displayed and a line read from the stan- + dard input. If the line consists of a number corresponding to + one of the displayed words, then the value of _n_a_m_e is set to + that word. If the line is empty, the words and prompt are dis- + played again. If EOF is read, the command completes. Any other + value read causes _n_a_m_e to be set to null. The line read is + saved in the variable RREEPPLLYY. The _l_i_s_t is executed after each + selection until a bbrreeaakk command is executed. The exit status of + sseelleecctt is the exit status of the last command executed in _l_i_s_t, + or zero if no commands were executed. + + ccaassee _w_o_r_d iinn [ [(] _p_a_t_t_e_r_n [ || _p_a_t_t_e_r_n ] ... ) _l_i_s_t ;; ] ... eessaacc + A ccaassee command first expands _w_o_r_d, and tries to match it against + each _p_a_t_t_e_r_n in turn, using the same matching rules as for path- + name expansion (see PPaatthhnnaammee EExxppaannssiioonn below). The _w_o_r_d is + expanded using tilde expansion, parameter and variable expan- + sion, arithmetic substitution, command substitution, process + substitution and quote removal. Each _p_a_t_t_e_r_n examined is + expanded using tilde expansion, parameter and variable expan- + sion, arithmetic substitution, command substitution, and process + substitution. If the shell option nnooccaasseemmaattcchh is enabled, the + match is performed without regard to the case of alphabetic + characters. When a match is found, the corresponding _l_i_s_t is + executed. If the ;;;; operator is used, no subsequent matches are + attempted after the first pattern match. Using ;;&& in place of + ;;;; causes execution to continue with the _l_i_s_t associated with + the next set of patterns. Using ;;;;&& in place of ;;;; causes the + shell to test the next pattern list in the statement, if any, + and execute any associated _l_i_s_t on a successful match. The exit + status is zero if no pattern matches. Otherwise, it is the exit + status of the last command executed in _l_i_s_t. + + iiff _l_i_s_t; tthheenn _l_i_s_t_; [ eelliiff _l_i_s_t; tthheenn _l_i_s_t; ] ... [ eellssee _l_i_s_t; ] ffii + The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn + _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in + turn, and if its exit status is zero, the corresponding tthheenn + _l_i_s_t is executed and the command completes. Otherwise, the eellssee + _l_i_s_t is executed, if present. The exit status is the exit sta- + tus of the last command executed, or zero if no condition tested + true. + + wwhhiillee _l_i_s_t; ddoo _l_i_s_t; ddoonnee + uunnttiill _l_i_s_t; ddoo _l_i_s_t; ddoonnee + The wwhhiillee command continuously executes the ddoo _l_i_s_t as long as + the last command in _l_i_s_t returns an exit status of zero. The + uunnttiill command is identical to the wwhhiillee command, except that the + test is negated; the ddoo _l_i_s_t is executed as long as the last + command in _l_i_s_t returns a non-zero exit status. The exit status + of the wwhhiillee and uunnttiill commands is the exit status of the last + ddoo _l_i_s_t command executed, or zero if none was executed. + + CCoopprroocceesssseess + A _c_o_p_r_o_c_e_s_s is a shell command preceded by the ccoopprroocc reserved word. A + coprocess is executed asynchronously in a subshell, as if the command + had been terminated with the && control operator, with a two-way pipe + established between the executing shell and the coprocess. + + The format for a coprocess is: + + ccoopprroocc [_N_A_M_E] _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s] + + This creates a coprocess named _N_A_M_E. If _N_A_M_E is not supplied, the + default name is _C_O_P_R_O_C. _N_A_M_E must not be supplied if _c_o_m_m_a_n_d is a _s_i_m_- + _p_l_e _c_o_m_m_a_n_d (see above); otherwise, it is interpreted as the first word + of the simple command. When the coproc is executed, the shell creates + an array variable (see AArrrraayyss below) named _N_A_M_E in the context of the + executing shell. The standard output of _c_o_m_m_a_n_d is connected via a + pipe to a file descriptor in the executing shell, and that file + descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is + connected via a pipe to a file descriptor in the executing shell, and + that file descriptor is assigned to _N_A_M_E[1]. This pipe is established + before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN + below). The file descriptors can be utilized as arguments to shell + commands and redirections using standard word expansions. The process + id of the shell spawned to execute the coprocess is available as the + value of the variable _N_A_M_E_PID. The wwaaiitt builtin command may be used + to wait for the coprocess to terminate. + + The return status of a coprocess is the exit status of _c_o_m_m_a_n_d. + + SShheellll FFuunnccttiioonn DDeeffiinniittiioonnss + A shell function is an object that is called like a simple command and + executes a compound command with a new set of positional parameters. + Shell functions are declared as follows: + + [ ffuunnccttiioonn ] _n_a_m_e () _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] + This defines a function named _n_a_m_e. The reserved word ffuunnccttiioonn + is optional. If the ffuunnccttiioonn reserved word is supplied, the + parentheses are optional. The _b_o_d_y of the function is the com- + pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). + That command is usually a _l_i_s_t of commands between { and }, but + may be any command listed under CCoommppoouunndd CCoommmmaannddss above. _c_o_m_- + _p_o_u_n_d_-_c_o_m_m_a_n_d is executed whenever _n_a_m_e is specified as the name + of a simple command. Any redirections (see RREEDDIIRREECCTTIIOONN below) + specified when a function is defined are performed when the + function is executed. The exit status of a function definition + is zero unless a syntax error occurs or a readonly function with + the same name already exists. When executed, the exit status of + a function is the exit status of the last command executed in + the body. (See FFUUNNCCTTIIOONNSS below.) + +CCOOMMMMEENNTTSS + In a non-interactive shell, or an interactive shell in which the iinntteerr-- + aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## causes that word and + all remaining characters on that line to be ignored. An interactive + shell without the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow + comments. The iinntteerraaccttiivvee__ccoommmmeennttss option is on by default in interac- + tive shells. + +QQUUOOTTIINNGG + _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters 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 _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS 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 (see HHIISS-- + TTOORRYY EEXXPPAANNSSIIOONN below), the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, usually !!, must + be quoted to prevent history expansion. + + There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single + quotes, and double quotes. + + A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the + literal value of the next character that follows, with the exception of + <newline>. If a \\<newline> pair appears, and the backslash is not + itself quoted, the \\<newline> is treated as a line continuation (that + is, it is removed from the input stream and effectively ignored). + + Enclosing characters in single quotes preserves the literal value of + each character within the quotes. A single quote may not occur between + single quotes, even when preceded by a backslash. + + Enclosing characters in double quotes preserves the literal value of + all characters within the quotes, with the exception of $$, ``, \\, and, + when history expansion is enabled, !!. The characters $$ and `` retain + their special meaning within double quotes. The backslash retains its + special meaning only when followed by one of the following characters: + $$, ``, "", \\, or <<nneewwlliinnee>>. A double quote may be quoted within double + quotes by preceding it with a backslash. If enabled, history expansion + will be performed unless an !! appearing in double quotes is escaped + using a backslash. The backslash preceding the !! is not removed. + + The special parameters ** and @@ have special meaning when in double + quotes (see PPAARRAAMMEETTEERRSS below). + + Words of the form $$'_s_t_r_i_n_g' are treated specially. The word expands to + _s_t_r_i_n_g, with backslash-escaped characters replaced as specified by the + ANSI C standard. Backslash escape sequences, if present, are decoded + as follows: + \\aa alert (bell) + \\bb backspace + \\ee + \\EE an escape character + \\ff form feed + \\nn new line + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\\\ backslash + \\'' single quote + \\"" double quote + \\_n_n_n the eight-bit character whose value is the octal value + _n_n_n (one to three digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + \\cc_x a control-_x character + + The expanded result is single-quoted, as if the dollar sign had not + been present. + + A double-quoted string preceded by a dollar sign ($$"_s_t_r_i_n_g") will cause + the string to be translated according to the current locale. If the + current locale is CC or PPOOSSIIXX, the dollar sign is ignored. If the + string is translated and replaced, the replacement is double-quoted. + +PPAARRAAMMEETTEERRSS + A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- + ber, or one of the special characters listed below under SSppeecciiaall PPaarraamm-- + eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a + _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the + ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). + + A parameter is set if it has been assigned a value. The null string is + a valid value. Once a variable is set, it may be unset only by using + the uunnsseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + A _v_a_r_i_a_b_l_e may be assigned to by a statement of the form + + _n_a_m_e=[_v_a_l_u_e] + + If _v_a_l_u_e is not given, the variable is assigned the null string. All + _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- + mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- + SSIIOONN below). If the variable has its iinntteeggeerr attribute set, then _v_a_l_u_e + is evaluated as an arithmetic expression even if the $((...)) expansion + is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting is not + performed, with the exception of ""$$@@"" as explained below under SSppeecciiaall + PPaarraammeetteerrss. Pathname expansion is not performed. Assignment state- + ments may also appear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, + eexxppoorrtt, rreeaaddoonnllyy, and llooccaall builtin commands. + + In the context where an assignment statement is assigning a value to a + shell variable or array index, the += operator can be used to append to + or add to the variable's previous value. When += is applied to a vari- + able for which the integer attribute has been set, _v_a_l_u_e is evaluated + as an arithmetic expression and added to the variable's current value, + which is also evaluated. When += is applied to an array variable using + compound assignment (see AArrrraayyss below), the variable's value is not + unset (as it is when using =), and new values are appended to the array + beginning at one greater than the array's maximum index (for indexed + arrays) or added as additional key-value pairs in an associative array. + When applied to a string-valued variable, _v_a_l_u_e is expanded and + appended to the variable's value. + + PPoossiittiioonnaall PPaarraammeetteerrss + A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, + other than the single digit 0. Positional parameters are assigned from + the shell's arguments when it is invoked, and may be reassigned using + the sseett builtin command. Positional parameters may not be assigned to + with assignment statements. The positional parameters are temporarily + replaced when a shell function is executed (see FFUUNNCCTTIIOONNSS below). + + When a positional parameter consisting of more than a single digit is + expanded, it must be enclosed in braces (see EEXXPPAANNSSIIOONN below). + + SSppeecciiaall PPaarraammeetteerrss + The shell treats several parameters specially. These parameters may + only be referenced; assignment to them is not allowed. + ** Expands to the positional parameters, starting from one. When + the expansion occurs within double quotes, it expands to a sin- + gle word with the value of each parameter separated by the first + character of the IIFFSS special variable. That is, "$$**" is equiva- + lent to "$$11_c$$22_c......", where _c is the first character of the value + of the IIFFSS variable. If IIFFSS is unset, the parameters are sepa- + rated by spaces. If IIFFSS is null, the parameters are joined + without intervening separators. + @@ Expands to the positional parameters, starting from one. When + the expansion occurs within double quotes, each parameter + expands to a separate word. That is, "$$@@" is equivalent to "$$11" + "$$22" ... If the double-quoted expansion occurs within a word, + the expansion of the first parameter is joined with the begin- + ning part of the original word, and the expansion of the last + parameter is joined with the last part of the original word. + When there are no positional parameters, "$$@@" and $$@@ expand to + nothing (i.e., they are removed). + ## Expands to the number of positional parameters in decimal. + ?? Expands to the exit status of the most recently executed fore- + ground pipeline. + -- Expands to the current option flags as specified upon invoca- + tion, by the sseett builtin command, or those set by the shell + itself (such as the --ii option). + $$ Expands to the process ID of the shell. In a () subshell, it + expands to the process ID of the current shell, not the sub- + shell. + !! Expands to the process ID of the most recently executed back- + ground (asynchronous) command. + 00 Expands to the name of the shell or shell script. This is set + at shell initialization. If bbaasshh is invoked with a file of com- + mands, $$00 is set to the name of that file. If bbaasshh is started + with the --cc option, then $$00 is set to the first argument after + the string to be executed, if one is present. Otherwise, it is + set to the file name used to invoke bbaasshh, as given by argument + zero. + __ At shell startup, set to the absolute pathname used to invoke + the shell or shell script being executed as passed in the envi- + ronment or argument list. Subsequently, expands to the last + argument to the previous command, after expansion. Also set to + the full pathname used to invoke each command executed and + placed in the environment exported to that command. When check- + ing mail, this parameter holds the name of the mail file cur- + rently being checked. + + SShheellll VVaarriiaabblleess + The following variables are set by the shell: + + BBAASSHH Expands to the full file name used to invoke this instance of + bbaasshh. + BBAASSHHOOPPTTSS + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --ss option to the sshhoopptt + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options + appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any + startup files. This variable is read-only. + BBAASSHHPPIIDD + Expands to the process id of the current bbaasshh process. This + differs from $$$$ under certain circumstances, such as subshells + that do not require bbaasshh to be re-initialized. + BBAASSHH__AALLIIAASSEESS + An associative array variable whose members correspond to the + internal list of aliases as maintained by the aalliiaass builtin Ele- + ments added to this array appear in the alias list; unsetting + array elements cause aliases to be removed from the alias list. + BBAASSHH__AARRGGCC + An array variable whose values are the number of parameters in + each frame of the current bbaasshh execution call stack. The number + of parameters to the current subroutine (shell function or + script executed with .. or ssoouurrccee) is at the top of the stack. + When a subroutine is executed, the number of parameters passed + is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in + extended debugging mode (see the description of the eexxttddeebbuugg + option to the sshhoopptt builtin below) + BBAASSHH__AARRGGVV + An array variable containing all of the parameters in the cur- + rent bbaasshh execution call stack. The final parameter of the last + subroutine call is at the top of the stack; the first parameter + of the initial call is at the bottom. When a subroutine is exe- + cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The + shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see + the description of the eexxttddeebbuugg option to the sshhoopptt builtin + below) + BBAASSHH__CCMMDDSS + An associative array variable whose members correspond to the + internal hash table of commands as maintained by the hhaasshh + builtin. Elements added to this array appear in the hash table; + unsetting array elements cause commands to be removed from the + hash table. + BBAASSHH__CCOOMMMMAANNDD + The command currently being executed or about to be executed, + unless the shell is executing a command as the result of a trap, + in which case it is the command executing at the time of the + trap. + BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG + The command argument to the --cc invocation option. + BBAASSHH__LLIINNEENNOO + An array variable whose members are the line numbers in source + files corresponding to each member of FFUUNNCCNNAAMMEE. + $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file where + $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if refer- + enced within another shell function). The corresponding source + file name is $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}}. Use LLIINNEENNOO to obtain the cur- + rent line number. + BBAASSHH__RREEMMAATTCCHH + An array variable whose members are assigned by the ==~~ binary + operator to the [[[[ conditional command. The element with index + 0 is the portion of the string matching the entire regular + expression. The element with index _n is the portion of the + string matching the _nth parenthesized subexpression. This vari- + able is read-only. + BBAASSHH__SSOOUURRCCEE + An array variable whose members are the source filenames corre- + sponding to the elements in the FFUUNNCCNNAAMMEE array variable. + BBAASSHH__SSUUBBSSHHEELLLL + Incremented by one each time a subshell or subshell environment + is spawned. The initial value is 0. + BBAASSHH__VVEERRSSIINNFFOO + A readonly array variable whose members hold version information + for this instance of bbaasshh. The values assigned to the array + members are as follows: + BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). + BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). + BBAASSHH__VVEERRSSIINNFFOO[[2]] The patch level. + BBAASSHH__VVEERRSSIINNFFOO[[3]] The build version. + BBAASSHH__VVEERRSSIINNFFOO[[4]] The release status (e.g., _b_e_t_a_1). + BBAASSHH__VVEERRSSIINNFFOO[[5]] The value of MMAACCHHTTYYPPEE. + + BBAASSHH__VVEERRSSIIOONN + Expands to a string describing the version of this instance of + bbaasshh. + + CCOOMMPP__CCWWOORRDD + An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current + cursor position. This variable is available only in shell func- + tions invoked by the programmable completion facilities (see + PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + + CCOOMMPP__KKEEYY + The key (or final key of a key sequence) used to invoke the cur- + rent completion function. + + CCOOMMPP__LLIINNEE + The current command line. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + below). + + CCOOMMPP__PPOOIINNTT + The index of the current cursor position relative to the begin- + ning of the current command. If the current cursor position is + at the end of the current command, the value of this variable is + equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + below). + + CCOOMMPP__TTYYPPEE + Set to an integer value corresponding to the type of completion + attempted that caused a completion function to be called: _T_A_B, + for normal completion, _?, for listing completions after succes- + sive tabs, _!, for listing alternatives on partial word comple- + tion, _@, to list completions if the word is not unmodified, or + _%, for menu completion. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + below). + + CCOOMMPP__WWOORRDDBBRREEAAKKSS + The set of characters that the rreeaaddlliinnee library treats as word + separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS + is unset, it loses its special properties, even if it is subse- + quently reset. + + CCOOMMPP__WWOORRDDSS + An array variable (see AArrrraayyss below) consisting of the individ- + ual words in the current command line. The line is split into + words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as + described above. This variable is available only in shell func- + tions invoked by the programmable completion facilities (see + PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + + DDIIRRSSTTAACCKK + An array variable (see AArrrraayyss below) containing the current con- + tents of the directory stack. Directories appear in the stack + in the order they are displayed by the ddiirrss builtin. Assigning + to members of this array variable may be used to modify directo- + ries already in the stack, but the ppuusshhdd and ppooppdd builtins must + be used to add and remove directories. Assignment to this vari- + able will not change the current directory. If DDIIRRSSTTAACCKK is + unset, it loses its special properties, even if it is subse- + quently reset. + + EEUUIIDD Expands to the effective user ID of the current user, initial- + ized at shell startup. This variable is readonly. + + FFUUNNCCNNAAMMEE + An array variable containing the names of all shell functions + currently in the execution call stack. The element with index 0 + is the name of any currently-executing shell function. The bot- + tom-most element is "main". This variable exists only when a + shell function is executing. Assignments to FFUUNNCCNNAAMMEE have no + effect and return an error status. If FFUUNNCCNNAAMMEE is unset, it + loses its special properties, even if it is subsequently reset. + + GGRROOUUPPSS An array variable containing the list of groups of which the + current user is a member. Assignments to GGRROOUUPPSS have no effect + and return an error status. If GGRROOUUPPSS is unset, it loses its + special properties, even if it is subsequently reset. + + HHIISSTTCCMMDD + The history number, or index in the history list, of the current + command. If HHIISSTTCCMMDD is unset, it loses its special properties, + even if it is subsequently reset. + + HHOOSSTTNNAAMMEE + Automatically set to the name of the current host. + + HHOOSSTTTTYYPPEE + Automatically set to a string that uniquely describes the type + of machine on which bbaasshh is executing. The default is system- + dependent. + + LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a + decimal number representing the current sequential line number + (starting with 1) within a script or function. When not in a + script or function, the value substituted is not guaranteed to + be meaningful. If LLIINNEENNOO is unset, it loses its special proper- + ties, even if it is subsequently reset. + + MMAACCHHTTYYPPEE + Automatically set to a string that fully describes the system + type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- + _p_a_n_y_-_s_y_s_t_e_m format. The default is system-dependent. + + OOLLDDPPWWDD The previous working directory as set by the ccdd command. + + OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + OOSSTTYYPPEE Automatically set to a string that describes the operating sys- + tem on which bbaasshh is executing. The default is system-depen- + dent. + + PPIIPPEESSTTAATTUUSS + An array variable (see AArrrraayyss below) containing a list of exit + status values from the processes in the most-recently-executed + foreground pipeline (which may contain only a single command). + + PPPPIIDD The process ID of the shell's parent. This variable is read- + only. + + PPWWDD The current working directory as set by the ccdd command. + + RRAANNDDOOMM Each time this parameter is referenced, a random integer between + 0 and 32767 is generated. The sequence of random numbers may be + initialized by assigning a value to RRAANNDDOOMM. If RRAANNDDOOMM is unset, + it loses its special properties, even if it is subsequently + reset. + + RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when + no arguments are supplied. + + SSEECCOONNDDSS + Each time this parameter is referenced, the number of seconds + since shell invocation is returned. If a value is assigned to + SSEECCOONNDDSS, the value returned upon subsequent references is the + number of seconds since the assignment plus the value assigned. + If SSEECCOONNDDSS is unset, it loses its special properties, even if it + is subsequently reset. + + SSHHEELLLLOOPPTTSS + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --oo option to the sseett + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options + appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any + startup files. This variable is read-only. + + SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. + + UUIIDD Expands to the user ID of the current user, initialized at shell + startup. This variable is readonly. + + The following variables are used by the shell. In some cases, bbaasshh + assigns a default value to a variable; these cases are noted below. + + BBAASSHH__EENNVV + If this parameter is set when bbaasshh is executing a shell script, + its value is interpreted as a filename containing commands to + initialize the shell, as in _~_/_._b_a_s_h_r_c. The value of BBAASSHH__EENNVV is + subjected to parameter expansion, command substitution, and + arithmetic expansion before being interpreted as a file name. + PPAATTHH is not used to search for the resultant file name. + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + list of directories in which the shell looks for destination + directories specified by the ccdd command. A sample value is + ".:~:/usr". + BBAASSHH__XXTTRRAACCEEFFDD + If set to an integer corresponding to a valid file descriptor, + bbaasshh will write the trace output generated when _s_e_t _-_x is + enabled to that file descriptor. The file descriptor is closed + when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting + BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace + output to be sent to the standard error. Note that setting + BBAASSHH__XXTTRRAACCEEFFDD to 2 (the standard error file descriptor) and then + unsetting it will result in the standard error being closed. + CCOOLLUUMMNNSS + Used by the sseelleecctt builtin command to determine the terminal + width when printing selection lists. Automatically set upon + receipt of a SIGWINCH. + CCOOMMPPRREEPPLLYY + An array variable from which bbaasshh reads the possible completions + generated by a shell function invoked by the programmable com- + pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + EEMMAACCSS If bbaasshh finds this variable in the environment when the shell + starts with value "t", it assumes that the shell is running in + an emacs shell buffer and disables line editing. + FFCCEEDDIITT The default editor for the ffcc builtin command. + FFIIGGNNOORREE + A colon-separated list of suffixes to ignore when performing + filename completion (see RREEAADDLLIINNEE below). A filename whose suf- + fix matches one of the entries in FFIIGGNNOORREE is excluded from the + list of matched filenames. A sample value is ".o:~". + GGLLOOBBIIGGNNOORREE + A colon-separated list of patterns defining the set of filenames + to be ignored by pathname expansion. If a filename matched by a + pathname expansion pattern also matches one of the patterns in + GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. + HHIISSTTCCOONNTTRROOLL + A colon-separated list of values controlling how commands are + saved on the history list. If the list of values includes + _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not + saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines + matching the previous history entry to not be saved. A value of + _i_g_n_o_r_e_b_o_t_h is shorthand for _i_g_n_o_r_e_s_p_a_c_e and _i_g_n_o_r_e_d_u_p_s. A value + of _e_r_a_s_e_d_u_p_s causes all previous lines matching the current line + to be removed from the history list before that line is saved. + Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is + unset, or does not include a valid value, all lines read by the + shell parser are saved on the history list, subject to the value + of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line + compound command are not tested, and are added to the history + regardless of the value of HHIISSTTCCOONNTTRROOLL. + HHIISSTTFFIILLEE + The name of the file in which command history is saved (see HHIISS-- + TTOORRYY below). The default value is _~_/_._b_a_s_h___h_i_s_t_o_r_y. If unset, + the command history is not saved when an interactive shell + exits. + HHIISSTTFFIILLEESSIIZZEE + The maximum number of lines contained in the history file. When + this variable is assigned a value, the history file is trun- + cated, if necessary, by removing the oldest entries, to contain + no more than that number of lines. The default value is 500. + The history file is also truncated to this size after writing it + when an interactive shell exits. + HHIISSTTIIGGNNOORREE + A colon-separated list of patterns used to decide which command + lines should be saved on the history list. Each pattern is + anchored at the beginning of the line and must match the com- + plete line (no implicit `**' is appended). Each pattern is + tested against the line after the checks specified by HHIISSTTCCOONN-- + TTRROOLL are applied. In addition to the normal shell pattern + matching characters, `&&' matches the previous history line. `&&' + may be escaped using a backslash; the backslash is removed + before attempting a match. The second and subsequent lines of a + multi-line compound command are not tested, and are added to the + history regardless of the value of HHIISSTTIIGGNNOORREE. + HHIISSTTSSIIZZEE + The number of commands to remember in the command history (see + HHIISSTTOORRYY below). The default value is 500. + HHIISSTTTTIIMMEEFFOORRMMAATT + If this variable is set and not null, its value is used as a + format string for _s_t_r_f_t_i_m_e(3) to print the time stamp associated + with each history entry displayed by the hhiissttoorryy builtin. If + this variable is set, time stamps are written to the history + file so they may be preserved across shell sessions. This uses + the history comment character to distinguish timestamps from + other history lines. + HHOOMMEE The home directory of the current user; the default argument for + the ccdd builtin command. The value of this variable is also used + when performing tilde expansion. + HHOOSSTTFFIILLEE + Contains the name of a file in the same format as _/_e_t_c_/_h_o_s_t_s + that should be read when the shell needs to complete a hostname. + The list of possible hostname completions may be changed while + the shell is running; the next time hostname completion is + attempted after the value is changed, bbaasshh adds the contents of + the new file to the existing list. If HHOOSSTTFFIILLEE is set, but has + no value, or does not name a readable file, bbaasshh attempts to + read _/_e_t_c_/_h_o_s_t_s to obtain the list of possible hostname comple- + tions. When HHOOSSTTFFIILLEE is unset, the hostname list is cleared. + IIFFSS The _I_n_t_e_r_n_a_l _F_i_e_l_d _S_e_p_a_r_a_t_o_r that is used for word splitting + after expansion and to split lines into words with the rreeaadd + builtin command. The default value is ``<space><tab><new- + line>''. + IIGGNNOORREEEEOOFF + Controls the action of an interactive shell on receipt of an EEOOFF + character as the sole input. If set, the value is the number of + consecutive EEOOFF characters which must be typed as the first + characters on an input line before bbaasshh exits. If the variable + exists but does not have a numeric value, or has no value, the + default value is 10. If it does not exist, EEOOFF signifies the + end of input to the shell. + IINNPPUUTTRRCC + The filename for the rreeaaddlliinnee startup file, overriding the + default of _~_/_._i_n_p_u_t_r_c (see RREEAADDLLIINNEE below). + LLAANNGG Used to determine the locale category for any category not + specifically selected with a variable starting with LLCC__. + LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ + variable specifying a locale category. + LLCC__CCOOLLLLAATTEE + This variable determines the collation order used when sorting + the results of pathname expansion, and determines the behavior + of range expressions, equivalence classes, and collating + sequences within pathname expansion and pattern matching. + LLCC__CCTTYYPPEE + This variable determines the interpretation of characters and + the behavior of character classes within pathname expansion and + pattern matching. + LLCC__MMEESSSSAAGGEESS + This variable determines the locale used to translate double- + quoted strings preceded by a $$. + LLCC__NNUUMMEERRIICC + This variable determines the locale category used for number + formatting. + LLIINNEESS Used by the sseelleecctt builtin command to determine the column + length for printing selection lists. Automatically set upon + receipt of a SSIIGGWWIINNCCHH. + MMAAIILL If this parameter is set to a file name and the MMAAIILLPPAATTHH vari- + able is not set, bbaasshh informs the user of the arrival of mail in + the specified file. + MMAAIILLCCHHEECCKK + Specifies how often (in seconds) bbaasshh checks for mail. 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. + MMAAIILLPPAATTHH + A colon-separated list of file names to be checked for mail. + The message to be printed when mail arrives in a particular file + may be specified by separating the file name from the message + with a `?'. When used in the text of the message, $$__ expands to + the name of the current mailfile. Example: + MMAAIILLPPAATTHH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has + mail!"' + BBaasshh supplies a default value for this variable, but the loca- + tion of the user mail files that it uses is system dependent + (e.g., /var/mail/$$UUSSEERR). + OOPPTTEERRRR If set to the value 1, bbaasshh displays error messages generated by + the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a + shell script is executed. + PPAATTHH The search path for commands. It is a colon-separated list of + directories in which the shell looks for commands (see CCOOMMMMAANNDD + EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the + value of PPAATTHH indicates the current directory. A null directory + name may appear as two adjacent colons, or as an initial or + trailing colon. The default path is system-dependent, and is + set by the administrator who installs bbaasshh. A common value is + ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin''. + PPOOSSIIXXLLYY__CCOORRRREECCTT + If this variable is in the environment when bbaasshh starts, the + shell enters _p_o_s_i_x _m_o_d_e before reading the startup files, as if + the ----ppoossiixx invocation option had been supplied. If it is set + while the shell is running, bbaasshh enables _p_o_s_i_x _m_o_d_e, as if the + command _s_e_t _-_o _p_o_s_i_x had been executed. + PPRROOMMPPTT__CCOOMMMMAANNDD + If set, the value is executed as a command prior to issuing each + primary prompt. + PPRROOMMPPTT__DDIIRRTTRRIIMM + If set to a number greater than zero, the value is used as the + number of trailing directory components to retain when expanding + the \\ww and \\WW prompt string escapes (see PPRROOMMPPTTIINNGG below). + Characters removed are replaced with an ellipsis. + PPSS11 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) + and used as the primary prompt string. The default value is + ``\\ss--\\vv\\$$ ''. + PPSS22 The value of this parameter is expanded as with PPSS11 and used as + the secondary prompt string. The default is ``>> ''. + PPSS33 The value of this parameter is used as the prompt for the sseelleecctt + command (see SSHHEELLLL GGRRAAMMMMAARR above). + PPSS44 The value of this parameter is expanded as with PPSS11 and the + value is printed before each command bbaasshh displays during an + execution trace. The first character of PPSS44 is replicated mul- + tiple times, as necessary, to indicate multiple levels of indi- + rection. The default is ``++ ''. + SSHHEELLLL The full pathname to the shell is kept in this environment vari- + able. If it is not set when the shell starts, bbaasshh assigns to + it the full pathname of the current user's login shell. + TTIIMMEEFFOORRMMAATT + The value of this parameter is used as a format string specify- + ing how the timing information for pipelines prefixed with the + ttiimmee reserved word should be displayed. The %% character intro- + duces an escape sequence that is expanded to a time value or + other information. The escape sequences and their meanings are + as follows; the braces denote optional portions. + %%%% A literal %%. + %%[[_p]][[ll]]RR The elapsed time in seconds. + %%[[_p]][[ll]]UU The number of CPU seconds spent in user mode. + %%[[_p]][[ll]]SS The number of CPU seconds spent in system mode. + %%PP The CPU percentage, computed as (%U + %S) / %R. + + The optional _p is a digit specifying the _p_r_e_c_i_s_i_o_n, the number + of fractional digits after a decimal point. A value of 0 causes + no decimal point or fraction to be output. At most three places + after the decimal point may be specified; values of _p greater + than 3 are changed to 3. If _p is not specified, the value 3 is + used. + + The optional ll specifies a longer format, including minutes, of + the form _M_Mm_S_S._F_Fs. The value of _p determines whether or not + the fraction is included. + + If this variable is not set, bbaasshh acts as if it had the value + $$''\\nnrreeaall\\tt%%33llRR\\nnuusseerr\\tt%%33llUU\\nnssyyss%%33llSS''. If the value is null, no + timing information is displayed. A trailing newline is added + when the format string is displayed. + + TTMMOOUUTT If set to a value greater than zero, TTMMOOUUTT is treated as the + default timeout for the rreeaadd builtin. The sseelleecctt command termi- + nates if input does not arrive after TTMMOOUUTT seconds when input is + coming from a terminal. In an interactive shell, the value is + interpreted as the number of seconds to wait for input after + issuing the primary prompt. BBaasshh terminates after waiting for + that number of seconds if input does not arrive. + + TTMMPPDDIIRR If set, BBaasshh uses its value as the name of a directory in which + BBaasshh creates temporary files for the shell's use. + + aauuttoo__rreessuummee + This variable controls how the shell interacts with the user and + job control. If this variable is set, single word simple com- + mands without redirections are treated as candidates for resump- + tion of an existing stopped job. There is no ambiguity allowed; + if there is more than one job beginning with the string typed, + the job most recently accessed is selected. The _n_a_m_e of a + stopped job, in this context, is the command line used to start + it. If set to the value _e_x_a_c_t, the string supplied must match + the name of a stopped job exactly; if set to _s_u_b_s_t_r_i_n_g, the + string supplied needs to match a substring of the name of a + stopped job. The _s_u_b_s_t_r_i_n_g value provides functionality analo- + gous to the %%?? job identifier (see JJOOBB CCOONNTTRROOLL below). 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 + %%_s_t_r_i_n_g job identifier. + + hhiissttcchhaarrss + The two or three characters which control history expansion and + tokenization (see HHIISSTTOORRYY EEXXPPAANNSSIIOONN below). The first character + is the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, the character which signals + the start of a history expansion, normally `!!'. The second + character is the _q_u_i_c_k _s_u_b_s_t_i_t_u_t_i_o_n character, which is used as + shorthand for re-running the previous command entered, substi- + tuting one string for another in the command. The default is + `^^'. The optional third character is the character which indi- + cates that the remainder of the line is a comment when found as + the first character of a word, normally `##'. The history com- + ment character causes history substitution to be skipped for the + remaining words on the line. It does not necessarily cause the + shell parser to treat the rest of the line as a comment. + + AArrrraayyss + BBaasshh provides one-dimensional indexed and associative array variables. + Any variable may be used as an indexed array; the ddeeccllaarree builtin will + explicitly declare an array. There is no maximum limit on the size of + an array, nor any requirement that members be indexed or assigned con- + tiguously. Indexed arrays are referenced using integers (including + arithmetic expressions) and are zero-based; associative arrays are + referenced using arbitrary strings. + + An indexed array is created automatically if any variable is assigned + to using the syntax _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e. The _s_u_b_s_c_r_i_p_t is treated as + an arithmetic expression that must evaluate to a number greater than or + equal to zero. To explicitly declare an indexed array, use ddeeccllaarree --aa + _n_a_m_e (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). ddeeccllaarree --aa _n_a_m_e[[_s_u_b_s_c_r_i_p_t]] is + also accepted; the _s_u_b_s_c_r_i_p_t is ignored. + + Associative arrays are created using ddeeccllaarree --AA _n_a_m_e. + + Attributes may be specified for an array variable using the ddeeccllaarree and + rreeaaddoonnllyy builtins. Each attribute applies to all members of an array. + + Arrays are assigned to using compound assignments of the form + _n_a_m_e=((value_1 ... value_n)), where each _v_a_l_u_e is of the form [_s_u_b_- + _s_c_r_i_p_t]=_s_t_r_i_n_g. Indexed array assignments do not require the bracket + and subscript. When assigning to indexed arrays, if the optional + brackets and subscript are supplied, that index is assigned to; other- + wise the index of the element assigned is the last index assigned to by + the statement plus one. Indexing starts at zero. + + When assigning to an associative array, the subscript is required. + + This syntax is also accepted by the ddeeccllaarree builtin. Individual array + elements may be assigned to using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax + introduced above. + + Any element of an array may be referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. + The braces are required to avoid conflicts with pathname expansion. If + _s_u_b_s_c_r_i_p_t is @@ or **, the word expands to all members of _n_a_m_e. These + subscripts differ only when the word appears within double quotes. If + the word is double-quoted, ${_n_a_m_e[*]} expands to a single word with the + value of each array member separated by the first character of the IIFFSS + special variable, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a sep- + arate word. When there are no array members, ${_n_a_m_e[@]} expands to + nothing. If the double-quoted expansion occurs within a word, the + expansion of the first parameter is joined with the beginning part of + the original word, and the expansion of the last parameter is joined + with the last part of the original word. This is analogous to the + expansion of the special parameters ** and @@ (see SSppeecciiaall PPaarraammeetteerrss + above). ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_- + _s_c_r_i_p_t]}. If _s_u_b_s_c_r_i_p_t is ** or @@, the expansion is the number of ele- + ments in the array. Referencing an array variable without a subscript + is equivalent to referencing the array with a subscript of 0. + + An array variable is considered set if a subscript has been assigned a + value. The null string is a valid value. + + The uunnsseett builtin is used to destroy arrays. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] + destroys the array element at index _s_u_b_s_c_r_i_p_t. Care must be taken to + avoid unwanted side effects caused by pathname expansion. uunnsseett _n_a_m_e, + where _n_a_m_e is an array, or uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t], where _s_u_b_s_c_r_i_p_t is ** + or @@, removes the entire array. + + The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to + specify an indexed array and a --AA option to specify an associative + array. The rreeaadd builtin accepts a --aa option to assign a list of words + read from the standard input to an array. The sseett and ddeeccllaarree builtins + display array values in a way that allows them to be reused as assign- + ments. + +EEXXPPAANNSSIIOONN + Expansion is performed on the command line after it has been split into + words. There are seven kinds of expansion performed: _b_r_a_c_e _e_x_p_a_n_s_i_o_n, + _t_i_l_d_e _e_x_p_a_n_s_i_o_n, _p_a_r_a_m_e_t_e_r _a_n_d _v_a_r_i_a_b_l_e _e_x_p_a_n_s_i_o_n, _c_o_m_m_a_n_d _s_u_b_s_t_i_t_u_- + _t_i_o_n, _a_r_i_t_h_m_e_t_i_c _e_x_p_a_n_s_i_o_n, _w_o_r_d _s_p_l_i_t_t_i_n_g, and _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n. + + The order of expansions is: brace expansion, tilde expansion, parame- + ter, variable and arithmetic expansion and command substitution (done + in a left-to-right fashion), word splitting, and pathname expansion. + + On systems that can support it, there is an additional expansion avail- + able: _p_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n. + + Only brace expansion, word splitting, and pathname 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 "$$@@" and "$${{_n_a_m_e[[@@]]}}" as explained above (see PPAARRAAMMEETTEERRSS). + + BBrraaccee EExxppaannssiioonn + _B_r_a_c_e _e_x_p_a_n_s_i_o_n is a mechanism by which arbitrary strings may be gener- + ated. This mechanism is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the file- + names generated need not exist. Patterns to be brace expanded take the + form of an optional _p_r_e_a_m_b_l_e, followed by either a series of comma-sep- + arated strings or a sequence expression between a pair of braces, fol- + lowed by an optional _p_o_s_t_s_c_r_i_p_t. The preamble is prefixed to each + string contained within the braces, and the postscript is then appended + to each resulting string, expanding left to right. + + Brace expansions may be nested. The results of each expanded string + are not sorted; left to right order is preserved. For example, + a{{d,c,b}}e expands into `ade ace abe'. + + A sequence expression takes the form {{_x...._y[[...._i_n_c_r]]}}, where _x and _y are + either integers or single characters, and _i_n_c_r, an optional increment, + is an integer. When integers are supplied, the expression expands to + each number between _x and _y, inclusive. Supplied integers may be pre- + fixed with _0 to force each term to have the same width. When either _x + or _y begins with a zero, the shell attempts to force all generated + terms to contain the same number of digits, zero-padding where neces- + sary. When characters are supplied, the expression expands to each + character lexicographically between _x and _y, inclusive. Note that both + _x and _y must be of the same type. When the increment is supplied, it + is used as the difference between each term. The default increment is + 1 or -1 as appropriate. + + Brace expansion is performed before any other expansions, and any char- + acters special to other expansions are preserved in the result. It is + strictly textual. BBaasshh does not apply any syntactic interpretation to + the context of the expansion or the text between the braces. + + A correctly-formed brace expansion must contain unquoted opening and + closing braces, and at least one unquoted comma or a valid sequence + expression. Any incorrectly formed brace expansion is left unchanged. + A {{ or ,, may be quoted with a backslash to prevent its being considered + part of a brace expression. To avoid conflicts with parameter expan- + sion, the string $${{ is not considered eligible for brace expansion. + + This construct is typically used as shorthand when the common prefix of + the strings to be generated is longer than in the above example: + + mkdir /usr/local/src/bash/{old,new,dist,bugs} + or + chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} + + Brace expansion introduces a slight incompatibility with historical + versions of sshh. sshh does not treat opening or closing braces specially + when they appear as part of a word, and preserves them in the output. + BBaasshh removes braces from words as a consequence of brace expansion. + For example, a word entered to sshh as _f_i_l_e_{_1_,_2_} appears identically in + the output. The same word is output as _f_i_l_e_1 _f_i_l_e_2 after expansion by + bbaasshh. If strict compatibility with sshh is desired, start bbaasshh with the + ++BB option or disable brace expansion with the ++BB option to the sseett com- + mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + TTiillddee EExxppaannssiioonn + If a word begins with an unquoted tilde character (`~~'), all of the + characters preceding the first unquoted slash (or all characters, if + there is no unquoted slash) are considered a _t_i_l_d_e_-_p_r_e_f_i_x. If none of + the characters in the tilde-prefix are quoted, the characters in the + tilde-prefix following the tilde are treated as a possible _l_o_g_i_n _n_a_m_e. + If this login name is the null string, the tilde is replaced with the + value of the shell parameter HHOOMMEE. If HHOOMMEE is unset, the home direc- + tory of the user executing the shell is substituted instead. Other- + wise, the tilde-prefix is replaced with the home directory associated + with the specified login name. + + If the tilde-prefix is a `~+', the value of the shell variable PPWWDD + replaces the tilde-prefix. If the tilde-prefix is a `~-', the value of + the shell variable OOLLDDPPWWDD, if it is set, is substituted. If the char- + acters following the tilde in the tilde-prefix consist of 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 ddiirrss builtin invoked with the tilde-prefix as an argu- + ment. If the characters following the tilde in the tilde-prefix con- + sist of a number without a leading `+' or `-', `+' is assumed. + + If the login name is invalid, or the tilde expansion fails, the word is + unchanged. + + Each variable assignment is checked for unquoted tilde-prefixes immedi- + ately following a :: or the first ==. In these cases, tilde expansion is + also performed. Consequently, one may use file names with tildes in + assignments to PPAATTHH, MMAAIILLPPAATTHH, and CCDDPPAATTHH, and the shell assigns the + expanded value. + + PPaarraammeetteerr EExxppaannssiioonn + The `$$' character introduces parameter expansion, command substitution, + or arithmetic expansion. The parameter name or symbol to be expanded + may be enclosed in braces, which are optional but serve to protect the + variable to be expanded from characters immediately following it which + could be interpreted as part of the name. + + When braces are used, the matching ending brace is the first `}}' not + escaped by a backslash or within a quoted string, and not within an + embedded arithmetic expansion, command substitution, or parameter + expansion. + + ${_p_a_r_a_m_e_t_e_r} + The value of _p_a_r_a_m_e_t_e_r is substituted. The braces are required + when _p_a_r_a_m_e_t_e_r is a positional parameter with more than one + digit, or when _p_a_r_a_m_e_t_e_r is followed by a character which is not + to be interpreted as part of its name. + + If the first character of _p_a_r_a_m_e_t_e_r is an exclamation point (!!), a + level of variable indirection is introduced. BBaasshh uses the value of + the variable formed from the rest of _p_a_r_a_m_e_t_e_r as the name of the vari- + able; this variable is then expanded and that value is used in the rest + of the substitution, rather than the value of _p_a_r_a_m_e_t_e_r itself. This + is known as _i_n_d_i_r_e_c_t _e_x_p_a_n_s_i_o_n. The exceptions to this are the expan- + sions of ${!_p_r_e_f_i_x*} and ${!!_n_a_m_e[_@]} described below. The exclamation + point must immediately follow the left brace in order to introduce + indirection. + + In each of the cases below, _w_o_r_d is subject to tilde expansion, parame- + ter expansion, command substitution, and arithmetic expansion. + + When not performing substring expansion, using the forms documented + below, bbaasshh tests for a parameter that is unset or null. Omitting the + colon results in a test only for a parameter that is unset. + + ${_p_a_r_a_m_e_t_e_r::--_w_o_r_d} + UUssee DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the expan- + sion of _w_o_r_d is substituted. Otherwise, the value of _p_a_r_a_m_e_t_e_r + is substituted. + ${_p_a_r_a_m_e_t_e_r::==_w_o_r_d} + AAssssiiggnn DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the + expansion of _w_o_r_d is assigned to _p_a_r_a_m_e_t_e_r. The value of _p_a_r_a_m_- + _e_t_e_r is then substituted. Positional parameters and special + parameters may not be assigned to in this way. + ${_p_a_r_a_m_e_t_e_r::??_w_o_r_d} + DDiissppllaayy EErrrroorr iiff NNuullll oorr UUnnsseett. If _p_a_r_a_m_e_t_e_r is null or unset, + the expansion of _w_o_r_d (or a message to that effect if _w_o_r_d is + not present) is written to the standard error and the shell, if + it is not interactive, exits. Otherwise, the value of _p_a_r_a_m_e_t_e_r + is substituted. + ${_p_a_r_a_m_e_t_e_r::++_w_o_r_d} + UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is null or unset, nothing is + substituted, otherwise the expansion of _w_o_r_d is substituted. + ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t} + ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t::_l_e_n_g_t_h} + SSuubbssttrriinngg EExxppaannssiioonn.. Expands to up to _l_e_n_g_t_h characters of + _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_s_e_t. If + _l_e_n_g_t_h is omitted, expands to the substring of _p_a_r_a_m_e_t_e_r start- + ing at the character specified by _o_f_f_s_e_t. _l_e_n_g_t_h and _o_f_f_s_e_t are + arithmetic expressions (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN below). + _l_e_n_g_t_h must evaluate to a number greater than or equal to zero. + If _o_f_f_s_e_t evaluates to a number less than zero, the value is + used as an offset from the end of the value of _p_a_r_a_m_e_t_e_r. If + _p_a_r_a_m_e_t_e_r is @@, the result is _l_e_n_g_t_h positional parameters + beginning at _o_f_f_s_e_t. If _p_a_r_a_m_e_t_e_r is an indexed array name sub- + scripted by @ or *, the result is the _l_e_n_g_t_h members of the + array beginning with ${_p_a_r_a_m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is + taken relative to one greater than the maximum index of the + specified array. Substring expansion applied to an associative + array produces undefined results. Note that a negative offset + must be separated from the colon by at least one space to avoid + being confused with the :- expansion. Substring indexing is + zero-based unless the positional parameters are used, in which + case the indexing starts at 1 by default. If _o_f_f_s_e_t is 0, and + the positional parameters are used, $$00 is prefixed to the list. + + ${!!_p_r_e_f_i_x**} + ${!!_p_r_e_f_i_x@@} + NNaammeess mmaattcchhiinngg pprreeffiixx.. Expands to the names of variables whose + names begin with _p_r_e_f_i_x, separated by the first character of the + IIFFSS special variable. When _@ is used and the expansion appears + within double quotes, each variable name expands to a separate + word. + + ${!!_n_a_m_e[_@]} + ${!!_n_a_m_e[_*]} + LLiisstt ooff aarrrraayy kkeeyyss.. If _n_a_m_e is an array variable, expands to + the list of array indices (keys) assigned in _n_a_m_e. If _n_a_m_e is + not an array, expands to 0 if _n_a_m_e is set and null otherwise. + When _@ is used and the expansion appears within double quotes, + each key expands to a separate word. + + ${##_p_a_r_a_m_e_t_e_r} + PPaarraammeetteerr lleennggtthh.. The length in characters of the value of + _p_a_r_a_m_e_t_e_r is substituted. If _p_a_r_a_m_e_t_e_r is ** or @@, the value + substituted is the number of positional parameters. If _p_a_r_a_m_e_- + _t_e_r is an array name subscripted by ** or @@, the value substi- + tuted is the number of elements in the array. + + ${_p_a_r_a_m_e_t_e_r##_w_o_r_d} + ${_p_a_r_a_m_e_t_e_r####_w_o_r_d} + RReemmoovvee mmaattcchhiinngg pprreeffiixx ppaatttteerrnn.. The _w_o_r_d is expanded to produce + a pattern just as in pathname expansion. If the pattern matches + the beginning of the value of _p_a_r_a_m_e_t_e_r, then the result of the + expansion is the expanded value of _p_a_r_a_m_e_t_e_r with the shortest + matching pattern (the ``##'' case) or the longest matching pat- + tern (the ``####'' case) deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the + pattern removal operation is applied to each positional parame- + ter in turn, and the expansion is the resultant list. If _p_a_r_a_m_- + _e_t_e_r is an array variable subscripted with @@ or **, the pattern + removal operation is applied to each member of the array in + turn, and the expansion is the resultant list. + + ${_p_a_r_a_m_e_t_e_r%%_w_o_r_d} + ${_p_a_r_a_m_e_t_e_r%%%%_w_o_r_d} + RReemmoovvee mmaattcchhiinngg ssuuffffiixx ppaatttteerrnn.. The _w_o_r_d is expanded to produce + a pattern just as in pathname expansion. If the pattern matches + a trailing portion of the expanded value of _p_a_r_a_m_e_t_e_r, then the + result of the expansion is the expanded value of _p_a_r_a_m_e_t_e_r with + the shortest matching pattern (the ``%%'' case) or the longest + matching pattern (the ``%%%%'' case) deleted. If _p_a_r_a_m_e_t_e_r is @@ + or **, the pattern removal operation is applied to each posi- + tional parameter in turn, and the expansion is the resultant + list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted with @@ or + **, the pattern removal operation is applied to each member of + the array in turn, and the expansion is the resultant list. + + ${_p_a_r_a_m_e_t_e_r//_p_a_t_t_e_r_n//_s_t_r_i_n_g} + PPaatttteerrnn ssuubbssttiittuuttiioonn.. The _p_a_t_t_e_r_n is expanded to produce a pat- + tern just as in pathname expansion. _P_a_r_a_m_e_t_e_r is expanded and + the longest match of _p_a_t_t_e_r_n against its value is replaced with + _s_t_r_i_n_g. If _p_a_t_t_e_r_n begins with //, all matches of _p_a_t_t_e_r_n are + replaced with _s_t_r_i_n_g. Normally only the first match is + replaced. If _p_a_t_t_e_r_n begins with ##, it must match at the begin- + ning of the expanded value of _p_a_r_a_m_e_t_e_r. If _p_a_t_t_e_r_n begins with + %%, it must match at the end of the expanded value of _p_a_r_a_m_e_t_e_r. + If _s_t_r_i_n_g is null, matches of _p_a_t_t_e_r_n are deleted and the // fol- + lowing _p_a_t_t_e_r_n may be omitted. If _p_a_r_a_m_e_t_e_r is @@ or **, the sub- + stitution operation is applied to each positional parameter in + turn, and the expansion is the resultant list. If _p_a_r_a_m_e_t_e_r is + an array variable subscripted with @@ or **, the substitution + operation is applied to each member of the array in turn, and + the expansion is the resultant list. + + ${_p_a_r_a_m_e_t_e_r^^_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r^^^^_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r,,_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r,,,,_p_a_t_t_e_r_n} + CCaassee mmooddiiffiiccaattiioonn.. This expansion modifies the case of alpha- + betic characters in _p_a_r_a_m_e_t_e_r. The _p_a_t_t_e_r_n is expanded to pro- + duce a pattern just as in pathname expansion. The ^^ operator + converts lowercase letters matching _p_a_t_t_e_r_n to uppercase; the ,, + operator converts matching uppercase letters to lowercase. The + ^^^^ and ,,,, expansions convert each matched character in the + expanded value; the ^^ and ,, expansions match and convert only + the first character in the expanded value.. If _p_a_t_t_e_r_n is omit- + ted, it is treated like a ??, which matches every character. If + _p_a_r_a_m_e_t_e_r is @@ or **, the case modification operation is applied + to each positional parameter in turn, and the expansion is the + resultant list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted + with @@ or **, the case modification operation is applied to each + member of the array in turn, and the expansion is the resultant + list. + + CCoommmmaanndd SSuubbssttiittuuttiioonn + _C_o_m_m_a_n_d _s_u_b_s_t_i_t_u_t_i_o_n allows the output of a command to replace the com- + mand name. There are two forms: + + + $$((_c_o_m_m_a_n_d)) + or + ``_c_o_m_m_a_n_d`` + + BBaasshh performs the expansion by executing _c_o_m_m_a_n_d and replacing the com- + mand substitution with the standard output of the command, with any + trailing newlines deleted. Embedded newlines are not deleted, but they + may be removed during word splitting. The command substitution $$((ccaatt + _f_i_l_e)) can be replaced by the equivalent but faster $$((<< _f_i_l_e)). + + When the old-style backquote form of substitution is used, backslash + retains its literal meaning except when followed by $$, ``, or \\. The + first backquote not preceded by a backslash terminates the command sub- + stitution. When using the $(_c_o_m_m_a_n_d) form, all characters between the + parentheses make up the command; none are treated specially. + + Command substitutions may be nested. To nest when using the backquoted + form, escape the inner backquotes with backslashes. + + If the substitution appears within double quotes, word splitting and + pathname expansion are not performed on the results. + + AArriitthhmmeettiicc EExxppaannssiioonn + Arithmetic expansion allows the evaluation of an arithmetic expression + and the substitution of the result. The format for arithmetic expan- + sion is: + + $$((((_e_x_p_r_e_s_s_i_o_n)))) + + The _e_x_p_r_e_s_s_i_o_n is treated as if it were within double quotes, but a + double quote inside the parentheses is not treated specially. All + tokens in the expression undergo parameter expansion, string expansion, + command substitution, and quote removal. Arithmetic expansions may be + nested. + + The evaluation is performed according to the rules listed below under + AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If _e_x_p_r_e_s_s_i_o_n is invalid, bbaasshh prints a message + indicating failure and no substitution occurs. + + PPrroocceessss SSuubbssttiittuuttiioonn + _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n is supported on systems that support named pipes + (_F_I_F_O_s) or the //ddeevv//ffdd method of naming open files. It takes the form + of <<((_l_i_s_t)) or >>((_l_i_s_t)). The process _l_i_s_t is run with its input or out- + put connected to a _F_I_F_O or some file in //ddeevv//ffdd. The name of this file + is passed as an argument to the current command as the result of the + expansion. If the >>((_l_i_s_t)) form is used, writing to the file will pro- + vide input for _l_i_s_t. If the <<((_l_i_s_t)) form is used, the file passed as + an argument should be read to obtain the output of _l_i_s_t. + + When available, process substitution is performed simultaneously with + parameter and variable expansion, command substitution, and arithmetic + expansion. + + WWoorrdd SSpplliittttiinngg + The shell scans the results of parameter expansion, command substitu- + tion, and arithmetic expansion that did not occur within double quotes + for _w_o_r_d _s_p_l_i_t_t_i_n_g. + + The shell treats each character of IIFFSS as a delimiter, and splits the + results of the other expansions into words on these characters. If IIFFSS + is unset, or its value is exactly <<ssppaaccee>><<ttaabb>><<nneewwlliinnee>>, the default, + then sequences of <<ssppaaccee>>, <<ttaabb>>, and <<nneewwlliinnee>> at the beginning and + end of the results of the previous expansions are ignored, and any + sequence of IIFFSS characters not at the beginning or end serves to + delimit words. If IIFFSS has a value other than the default, then + sequences of the whitespace characters ssppaaccee and ttaabb are ignored at the + beginning and end of the word, as long as the whitespace character is + in the value of IIFFSS (an IIFFSS whitespace character). Any character in + IIFFSS that is not IIFFSS whitespace, along with any adjacent IIFFSS whitespace + characters, delimits a field. A sequence of IIFFSS whitespace characters + is also treated as a delimiter. If the value of IIFFSS is null, no word + splitting occurs. + + Explicit null arguments ("""" or '''') are retained. Unquoted implicit + null arguments, resulting from the expansion of parameters that have no + values, are removed. If a parameter with no value is expanded within + double quotes, a null argument results and is retained. + + Note that if no expansion occurs, no splitting is performed. + + PPaatthhnnaammee EExxppaannssiioonn + After word splitting, unless the --ff option has been set, bbaasshh scans + each word for the characters **, ??, and [[. If one of these characters + appears, then the word is regarded as a _p_a_t_t_e_r_n, and replaced with an + alphabetically sorted list of file names matching the pattern. If no + matching file names are found, and the shell option nnuullllgglloobb is not + enabled, the word is left unchanged. If the nnuullllgglloobb option is set, + and no matches are found, the word is removed. If the ffaaiillgglloobb shell + option is set, and no matches are found, an error message is printed + and the command is not executed. If the shell option nnooccaasseegglloobb is + enabled, the match is performed without regard to the case of alpha- + betic characters. When a pattern is used for pathname expansion, the + character ````..'''' at the start of a name or immediately following a + slash must be matched explicitly, unless the shell option ddoottgglloobb is + set. When matching a pathname, the slash character must always be + matched explicitly. In other cases, the ````..'''' character is not + treated specially. See the description of sshhoopptt below under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS for a description of the nnooccaasseegglloobb, nnuullllgglloobb, ffaaiill-- + gglloobb, and ddoottgglloobb shell options. + + The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file + names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching file + name that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed + from the list of matches. The file names ````..'''' and ````....'''' are always + ignored when GGLLOOBBIIGGNNOORREE is set and not null. However, setting GGLLOOBBIIGG-- + NNOORREE to a non-null value has the effect of enabling the ddoottgglloobb shell + option, so all other file names beginning with a ````..'''' will match. To + get the old behavior of ignoring file names beginning with a ````..'''', + make ````..**'''' one of the patterns in GGLLOOBBIIGGNNOORREE. The ddoottgglloobb option is + disabled when GGLLOOBBIIGGNNOORREE is unset. + + PPaatttteerrnn MMaattcchhiinngg + + Any character that appears in a pattern, other than the special pattern + characters described below, matches itself. The NUL character may not + occur in a pattern. A backslash escapes the following character; the + escaping backslash is discarded when matching. The special pattern + characters must be quoted if they are to be matched literally. + + The special pattern characters have the following meanings: + + ** Matches any string, including the null string. When the gglloobb-- + ssttaarr shell option is enabled, and ** is used in a pathname expan- + sion context, two adjacent **s used as a single pattern will + match all files and zero or more directories and subdirectories. + If followed by a //, two adjacent **s will match only directories + and subdirectories. + ?? Matches any single character. + [[......]] Matches any one of the enclosed characters. A pair of charac- + ters separated by a hyphen denotes a _r_a_n_g_e _e_x_p_r_e_s_s_i_o_n; any char- + acter 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. The sorting order + of characters in range expressions is determined by the current + locale and the value of the LLCC__CCOOLLLLAATTEE shell variable, if set. + A -- may be matched by including it as the first or last charac- + ter in the set. A ]] may be matched by including it as the first + character in the set. + + Within [[ and ]], _c_h_a_r_a_c_t_e_r _c_l_a_s_s_e_s can be specified using the + syntax [[::_c_l_a_s_s::]], where _c_l_a_s_s is one of the following classes + defined in the POSIX standard: + aallnnuumm aallpphhaa aasscciiii bbllaannkk ccnnttrrll ddiiggiitt ggrraapphh lloowweerr pprriinntt ppuunncctt + ssppaaccee uuppppeerr wwoorrdd xxddiiggiitt + A character class matches any character belonging to that class. + The wwoorrdd character class matches letters, digits, and the char- + acter _. + + Within [[ and ]], an _e_q_u_i_v_a_l_e_n_c_e _c_l_a_s_s can be specified using the + syntax [[==_c==]], which matches all characters with the same colla- + tion weight (as defined by the current locale) as the character + _c. + + Within [[ and ]], the syntax [[.._s_y_m_b_o_l..]] matches the collating sym- + bol _s_y_m_b_o_l. + + If the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, several + extended pattern matching operators are recognized. In the following + description, a _p_a_t_t_e_r_n_-_l_i_s_t is a list of one or more patterns separated + by a ||. Composite patterns may be formed using one or more of the fol- + lowing sub-patterns: + + ??((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches zero or one occurrence of the given patterns + **((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches zero or more occurrences of the given patterns + ++((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches one or more occurrences of the given patterns + @@((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches one of the given patterns + !!((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches anything except one of the given patterns + + QQuuoottee RReemmoovvaall + After the preceding expansions, all unquoted occurrences of the charac- + ters \\, '', and "" that did not result from one of the above expansions + are removed. + +RREEDDIIRREECCTTIIOONN + Before a command is executed, its input and output may be _r_e_d_i_r_e_c_t_e_d + using a special notation interpreted by the shell. Redirection may + also be used to open and close files for the current shell execution + environment. The following redirection operators may precede or appear + anywhere within a _s_i_m_p_l_e _c_o_m_m_a_n_d or may follow a _c_o_m_m_a_n_d. Redirections + are processed in the order they appear, from left to right. + + Each redirection that may be preceded by a file descriptor number may + instead be preceded by a word of the form {_v_a_r_n_a_m_e}. In this case, for + each redirection operator except >&- and <&-, the shell will allocate a + file descriptor greater than 10 and assign it to _v_a_r_n_a_m_e. If >&- or + <&- is preceded by {_v_a_r_n_a_m_e}, the value of _v_a_r_n_a_m_e defines the file + descriptor to close. + + In the following descriptions, if the file descriptor number is omit- + ted, and the first character of the redirection operator is <<, the re- + direction refers to the standard input (file descriptor 0). If the + first character of the redirection operator is >>, the redirection + refers to the standard output (file descriptor 1). + + The word following the redirection operator in the following descrip- + tions, unless otherwise noted, is subjected to brace expansion, tilde + expansion, parameter expansion, command substitution, arithmetic expan- + sion, quote removal, pathname expansion, and word splitting. If it + expands to more than one word, bbaasshh reports an error. + + Note that the order of redirections is significant. For example, the + command + + ls >> dirlist 2>>&&1 + + directs both standard output and standard error to the file _d_i_r_l_i_s_t, + while the command + + ls 2>>&&1 >> dirlist + + directs only the standard output to file _d_i_r_l_i_s_t, because the standard + error was duplicated from the standard output before the standard out- + put was redirected to _d_i_r_l_i_s_t. + + BBaasshh handles several filenames specially when they are used in redirec- + tions, as described in the following table: + + //ddeevv//ffdd//_f_d + If _f_d is a valid integer, file descriptor _f_d is dupli- + cated. + //ddeevv//ssttddiinn + File descriptor 0 is duplicated. + //ddeevv//ssttddoouutt + File descriptor 1 is duplicated. + //ddeevv//ssttddeerrrr + File descriptor 2 is duplicated. + //ddeevv//ttccpp//_h_o_s_t//_p_o_r_t + If _h_o_s_t is a valid hostname or Internet address, and _p_o_r_t + is an integer port number or service name, bbaasshh attempts + to open a TCP connection to the corresponding socket. + //ddeevv//uuddpp//_h_o_s_t//_p_o_r_t + If _h_o_s_t is a valid hostname or Internet address, and _p_o_r_t + is an integer port number or service name, bbaasshh attempts + to open a UDP connection to the corresponding socket. + + A failure to open or create a file causes the redirection to fail. + + Redirections using file descriptors greater than 9 should be used with + care, as they may conflict with file descriptors the shell uses inter- + nally. + + RReeddiirreeccttiinngg IInnppuutt + Redirection of input causes the file whose name results from the expan- + sion of _w_o_r_d to be opened for reading on file descriptor _n, or the + standard input (file descriptor 0) if _n is not specified. + + The general format for redirecting input is: + + [_n]<<_w_o_r_d + + RReeddiirreeccttiinngg OOuuttppuutt + Redirection of output causes the file whose name results from the + expansion of _w_o_r_d to be opened for writing on file descriptor _n, or the + standard output (file descriptor 1) if _n is not specified. If the file + does not exist it is created; if it does exist it is truncated to zero + size. + + The general format for redirecting output is: + + [_n]>>_w_o_r_d + + If the redirection operator is >>, and the nnoocclloobbbbeerr option to the sseett + builtin has been enabled, the redirection will fail if the file whose + name results from the expansion of _w_o_r_d exists and is a regular file. + If the redirection operator is >>||, or the redirection operator is >> and + the nnoocclloobbbbeerr option to the sseett builtin command is not enabled, the re- + direction is attempted even if the file named by _w_o_r_d exists. + + AAppppeennddiinngg RReeddiirreecctteedd OOuuttppuutt + Redirection of output in this fashion causes the file whose name + results from the expansion of _w_o_r_d to be opened for appending on file + descriptor _n, or the standard output (file descriptor 1) if _n is not + specified. If the file does not exist it is created. + + The general format for appending output is: + + [_n]>>>>_w_o_r_d + + + RReeddiirreeccttiinngg SSttaannddaarrdd OOuuttppuutt aanndd SSttaannddaarrdd EErrrroorr + This construct allows both the standard output (file descriptor 1) and + the standard error output (file descriptor 2) to be redirected to the + file whose name is the expansion of _w_o_r_d. + + There are two formats for redirecting standard output and standard + error: + + &&>>_w_o_r_d + and + >>&&_w_o_r_d + + Of the two forms, the first is preferred. This is semantically equiva- + lent to + + >>_w_o_r_d 2>>&&1 + + + AAppppeennddiinngg SSttaannddaarrdd OOuuttppuutt aanndd SSttaannddaarrdd EErrrroorr + This construct allows both the standard output (file descriptor 1) and + the standard error output (file descriptor 2) to be appended to the + file whose name is the expansion of _w_o_r_d. + + The format for appending standard output and standard error is: + + &&>>>>_w_o_r_d + + This is semantically equivalent to + + >>>>_w_o_r_d 2>>&&1 + + HHeerree DDooccuummeennttss + This type of redirection instructs the shell to read input from the + current source until a line containing only _d_e_l_i_m_i_t_e_r (with no trailing + blanks) is seen. All of the lines read up to that point are then used + as the standard input for a command. + + The format of here-documents is: + + <<<<[--]_w_o_r_d + _h_e_r_e_-_d_o_c_u_m_e_n_t + _d_e_l_i_m_i_t_e_r + + No parameter expansion, command substitution, arithmetic expansion, or + pathname expansion is performed on _w_o_r_d. If any characters in _w_o_r_d are + quoted, the _d_e_l_i_m_i_t_e_r is the result of quote removal on _w_o_r_d, and the + lines in the here-document are not expanded. If _w_o_r_d is unquoted, all + lines of the here-document are subjected to parameter expansion, com- + mand substitution, and arithmetic expansion. In the latter case, the + character sequence \\<<nneewwlliinnee>> is ignored, and \\ must be used to quote + the characters \\, $$, and ``. + + If the redirection operator is <<<<--, then all leading tab characters are + stripped from input lines and the line containing _d_e_l_i_m_i_t_e_r. This + allows here-documents within shell scripts to be indented in a natural + fashion. + + HHeerree SSttrriinnggss + A variant of here documents, the format is: + + <<<<<<_w_o_r_d + + The _w_o_r_d is expanded and supplied to the command on its standard input. + + DDuupplliiccaattiinngg FFiillee DDeessccrriippttoorrss + The redirection operator + + [_n]<<&&_w_o_r_d + + is used to duplicate input file descriptors. If _w_o_r_d expands to one or + more digits, the file descriptor denoted by _n is made to be a copy of + that file descriptor. If the digits in _w_o_r_d do not specify a file + descriptor open for input, a redirection error occurs. If _w_o_r_d evalu- + ates to --, file descriptor _n is closed. If _n is not specified, the + standard input (file descriptor 0) is used. + + The operator + + [_n]>>&&_w_o_r_d + + is used similarly to duplicate output file descriptors. If _n is not + specified, the standard output (file descriptor 1) is used. If the + digits in _w_o_r_d do not specify a file descriptor open for output, a re- + direction error occurs. As a special case, if _n is omitted, and _w_o_r_d + does not expand to one or more digits, the standard output and standard + error are redirected as described previously. + + MMoovviinngg FFiillee DDeessccrriippttoorrss + The redirection operator + + [_n]<<&&_d_i_g_i_t-- + + moves the file descriptor _d_i_g_i_t to file descriptor _n, or the standard + input (file descriptor 0) if _n is not specified. _d_i_g_i_t is closed after + being duplicated to _n. + + Similarly, the redirection operator + + [_n]>>&&_d_i_g_i_t-- + + moves the file descriptor _d_i_g_i_t to file descriptor _n, or the standard + output (file descriptor 1) if _n is not specified. + + OOppeenniinngg FFiillee DDeessccrriippttoorrss ffoorr RReeaaddiinngg aanndd WWrriittiinngg + The redirection operator + + [_n]<<>>_w_o_r_d + + causes the file whose name is the expansion of _w_o_r_d to be opened for + both reading and writing on file descriptor _n, or on file descriptor 0 + if _n is not specified. If the file does not exist, it is created. + +AALLIIAASSEESS + _A_l_i_a_s_e_s allow a string to be substituted for a word when it is used as + the first word of a simple command. The shell maintains a list of + aliases that may be set and unset with the aalliiaass and uunnaalliiaass builtin + commands (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The first word of each + simple command, if unquoted, is checked to see if it has an alias. If + so, that word is replaced by the text of the alias. The characters //, + $$, ``, and == and any of the shell _m_e_t_a_c_h_a_r_a_c_t_e_r_s or quoting characters + listed above may not appear in an alias name. The replacement text may + contain any valid shell input, including shell metacharacters. The + first word of the replacement text is tested for aliases, but a word + that is identical to an alias being expanded is not expanded a second + time. This means that one may alias llss to llss --FF, for instance, and + bbaasshh does not try to recursively expand the replacement text. If the + last character of the alias value is a _b_l_a_n_k, then the next command + word following the alias is also checked for alias expansion. + + Aliases are created and listed with the aalliiaass command, and removed with + the uunnaalliiaass command. + + There is no mechanism for using arguments in the replacement text. If + arguments are needed, a shell function should be used (see FFUUNNCCTTIIOONNSS + below). + + Aliases are not expanded when the shell is not interactive, unless the + eexxppaanndd__aalliiaasseess shell option is set using sshhoopptt (see the description of + sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + The rules concerning the definition and use of aliases are somewhat + confusing. BBaasshh always reads at least one complete line of input + before executing any of the commands on that line. Aliases are + expanded when a command is read, not when it is executed. Therefore, + an alias definition appearing on the same line as another command does + not take effect until the next line of input is read. The commands + following the alias definition on that line are not affected by the new + alias. This behavior is also an issue when functions are executed. + Aliases are expanded when a function definition is read, not when the + function is executed, because a function definition is itself a com- + pound command. As a consequence, aliases defined in a function are not + available until after that function is executed. To be safe, always + put alias definitions on a separate line, and do not use aalliiaass in com- + pound commands. + + For almost every purpose, aliases are superseded by shell functions. + +FFUUNNCCTTIIOONNSS + A shell function, defined as described above under SSHHEELLLL GGRRAAMMMMAARR, + stores a series of commands for later execution. When the name of a + shell function is used as a simple command name, the list of commands + associated with that function name is executed. Functions are executed + in the context of the current shell; no new process is created to + interpret them (contrast this with the execution of a shell script). + When a function is executed, the arguments to the function become the + positional parameters during its execution. The special parameter ## is + updated to reflect the change. Special parameter 0 is unchanged. The + first element of the FFUUNNCCNNAAMMEE variable is set to the name of the func- + tion while the function is executing. + + All other aspects of the shell execution environment are identical + between a function and its caller with these exceptions: the DDEEBBUUGG and + RREETTUURRNN traps (see the description of the ttrraapp builtin under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below) are not inherited unless the function has been + given the ttrraaccee attribute (see the description of the ddeeccllaarree builtin + below) or the --oo ffuunnccttrraaccee shell option has been enabled with the sseett + builtin (in which case all functions inherit the DDEEBBUUGG and RREETTUURRNN + traps), and the EERRRR trap is not inherited unless the --oo eerrrrttrraaccee shell + option has been enabled. + + Variables local to the function may be declared with the llooccaall builtin + command. Ordinarily, variables and their values are shared between the + function and its caller. + + If the builtin command rreettuurrnn is executed in a function, the function + completes and execution resumes with the next command after the func- + tion call. Any command associated with the RREETTUURRNN trap is executed + before execution resumes. When a function completes, the values of the + positional parameters and the special parameter ## are restored to the + values they had prior to the function's execution. + + Function names and definitions may be listed with the --ff option to the + ddeeccllaarree or ttyyppeesseett builtin commands. The --FF option to ddeeccllaarree or ttyyppee-- + sseett will list the function names only (and optionally the source file + and line number, if the eexxttddeebbuugg shell option is enabled). Functions + may be exported so that subshells automatically have them defined with + the --ff option to the eexxppoorrtt builtin. A function definition may be + deleted using the --ff option to the uunnsseett builtin. Note that shell + functions and variables with the same name may result in multiple iden- + tically-named entries in the environment passed to the shell's chil- + dren. Care should be taken in cases where this may cause a problem. + + Functions may be recursive. No limit is imposed on the number of + recursive calls. + +AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN + The shell allows arithmetic expressions to be evaluated, under certain + circumstances (see the lleett and ddeeccllaarree builtin commands and AArriitthhmmeettiicc + EExxppaannssiioonn). Evaluation is done in fixed-width integers with no check + for overflow, though division by 0 is trapped and flagged as an error. + The operators and their precedence, associativity, and values are the + same as in the C language. The following list of operators is grouped + into levels of equal-precedence operators. The levels are listed in + order of decreasing precedence. + + _i_d++++ _i_d---- + variable post-increment and post-decrement + ++++_i_d ----_i_d + variable pre-increment and pre-decrement + -- ++ unary minus and plus + !! ~~ logical and bitwise negation + **** exponentiation + ** // %% multiplication, division, remainder + ++ -- addition, subtraction + <<<< >>>> left and right bitwise shifts + <<== >>== << >> + comparison + ==== !!== equality and inequality + && bitwise AND + ^^ bitwise exclusive OR + || bitwise OR + &&&& logical AND + |||| logical OR + _e_x_p_r??_e_x_p_r::_e_x_p_r + conditional operator + == **== //== %%== ++== --== <<<<== >>>>== &&== ^^== ||== + assignment + _e_x_p_r_1 ,, _e_x_p_r_2 + comma + + Shell variables are allowed as operands; parameter expansion is per- + formed before the expression is evaluated. Within an expression, shell + variables may also be referenced by name without using the parameter + expansion syntax. A shell variable that is null or unset evaluates to + 0 when referenced by name without using the parameter expansion syntax. + The value of a variable is evaluated as an arithmetic expression when + it is referenced, or when a variable which has been given the _i_n_t_e_g_e_r + attribute using ddeeccllaarree --ii is assigned a value. A null value evaluates + to 0. A shell variable need not have its integer attribute turned on + to be used in an expression. + + Constants with a leading 0 are interpreted as octal numbers. A leading + 0x or 0X denotes hexadecimal. Otherwise, numbers take the form + [_b_a_s_e_#]n, where _b_a_s_e is a decimal number between 2 and 64 representing + the arithmetic base, and _n is a number in that base. If _b_a_s_e_# is omit- + ted, then base 10 is used. The digits greater than 9 are represented + by the lowercase letters, the uppercase letters, @, and _, in that + order. If _b_a_s_e is less than or equal to 36, lowercase and uppercase + letters may be used interchangeably to represent numbers between 10 and + 35. + + Operators are evaluated in order of precedence. Sub-expressions in + parentheses are evaluated first and may override the precedence rules + above. + +CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS + Conditional expressions are used by the [[[[ compound command and the + tteesstt and [[ builtin commands to test file attributes and perform string + and arithmetic comparisons. Expressions are formed from the following + unary or binary primaries. If any _f_i_l_e argument to one of the pri- + maries is of the form _/_d_e_v_/_f_d_/_n, then file descriptor _n is checked. If + the _f_i_l_e argument to one of the primaries is one of _/_d_e_v_/_s_t_d_i_n, + _/_d_e_v_/_s_t_d_o_u_t, or _/_d_e_v_/_s_t_d_e_r_r, file descriptor 0, 1, or 2, respectively, + is checked. + + Unless otherwise specified, primaries that operate on files follow sym- + bolic links and operate on the target of the link, rather than the link + itself. + + When used with [[[[, The << and >> operators sort lexicographically using + the current locale. + + --aa _f_i_l_e + True if _f_i_l_e exists. + --bb _f_i_l_e + True if _f_i_l_e exists and is a block special file. + --cc _f_i_l_e + True if _f_i_l_e exists and is a character special file. + --dd _f_i_l_e + True if _f_i_l_e exists and is a directory. + --ee _f_i_l_e + True if _f_i_l_e exists. + --ff _f_i_l_e + True if _f_i_l_e exists and is a regular file. + --gg _f_i_l_e + True if _f_i_l_e exists and is set-group-id. + --hh _f_i_l_e + True if _f_i_l_e exists and is a symbolic link. + --kk _f_i_l_e + True if _f_i_l_e exists and its ``sticky'' bit is set. + --pp _f_i_l_e + True if _f_i_l_e exists and is a named pipe (FIFO). + --rr _f_i_l_e + True if _f_i_l_e exists and is readable. + --ss _f_i_l_e + True if _f_i_l_e exists and has a size greater than zero. + --tt _f_d True if file descriptor _f_d is open and refers to a terminal. + --uu _f_i_l_e + True if _f_i_l_e exists and its set-user-id bit is set. + --ww _f_i_l_e + True if _f_i_l_e exists and is writable. + --xx _f_i_l_e + True if _f_i_l_e exists and is executable. + --OO _f_i_l_e + True if _f_i_l_e exists and is owned by the effective user id. + --GG _f_i_l_e + True if _f_i_l_e exists and is owned by the effective group id. + --LL _f_i_l_e + True if _f_i_l_e exists and is a symbolic link. + --SS _f_i_l_e + True if _f_i_l_e exists and is a socket. + --NN _f_i_l_e + True if _f_i_l_e exists and has been modified since it was last + read. + _f_i_l_e_1 -nntt _f_i_l_e_2 + True if _f_i_l_e_1 is newer (according to modification date) than + _f_i_l_e_2, or if _f_i_l_e_1 exists and _f_i_l_e_2 does not. + _f_i_l_e_1 -oott _f_i_l_e_2 + True if _f_i_l_e_1 is older than _f_i_l_e_2, or if _f_i_l_e_2 exists and _f_i_l_e_1 + does not. + _f_i_l_e_1 --eeff _f_i_l_e_2 + True if _f_i_l_e_1 and _f_i_l_e_2 refer to the same device and inode num- + bers. + --oo _o_p_t_n_a_m_e + True if shell option _o_p_t_n_a_m_e is enabled. See the list of + options under the description of the --oo option to the sseett + builtin below. + --zz _s_t_r_i_n_g + True if the length of _s_t_r_i_n_g is zero. + _s_t_r_i_n_g + --nn _s_t_r_i_n_g + True if the length of _s_t_r_i_n_g is non-zero. + + _s_t_r_i_n_g_1 ==== _s_t_r_i_n_g_2 + _s_t_r_i_n_g_1 == _s_t_r_i_n_g_2 + True if the strings are equal. == should be used with the tteesstt + command for POSIX conformance. + + _s_t_r_i_n_g_1 !!== _s_t_r_i_n_g_2 + True if the strings are not equal. + + _s_t_r_i_n_g_1 << _s_t_r_i_n_g_2 + True if _s_t_r_i_n_g_1 sorts before _s_t_r_i_n_g_2 lexicographically. + + _s_t_r_i_n_g_1 >> _s_t_r_i_n_g_2 + True if _s_t_r_i_n_g_1 sorts after _s_t_r_i_n_g_2 lexicographically. + + _a_r_g_1 OOPP _a_r_g_2 + OOPP is one of --eeqq, --nnee, --lltt, --llee, --ggtt, or --ggee. These arithmetic + binary operators return true if _a_r_g_1 is equal to, not equal to, + less than, less than or equal to, greater than, or greater than + or equal to _a_r_g_2, respectively. _A_r_g_1 and _a_r_g_2 may be positive + or negative integers. + +SSIIMMPPLLEE CCOOMMMMAANNDD EEXXPPAANNSSIIOONN + When a simple command is executed, the shell performs the following + expansions, assignments, and redirections, from left to right. + + 1. The words that the parser has marked as variable assignments + (those preceding the command name) and redirections are saved + for later processing. + + 2. The words that are not variable assignments or redirections are + expanded. 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 under RREEDDIIRREECCTTIIOONN. + + 4. The text after the == in each variable assignment undergoes tilde + expansion, parameter expansion, command substitution, arithmetic + expansion, and quote removal before being assigned to the vari- + able. + + If no command name results, the variable assignments affect the current + shell environment. Otherwise, the variables are added to the environ- + ment of the executed command and do not affect the current shell envi- + ronment. If any of the assignments attempts to assign a value to a + readonly variable, an error occurs, and the command exits with a non- + zero status. + + If no command name results, redirections are performed, but do not + affect the current shell environment. A redirection error causes the + command to exit with a non-zero status. + + If there is a command name left after expansion, execution proceeds as + described below. Otherwise, the command exits. If one of the expan- + sions contained a command substitution, the exit status of the command + is the exit status of the last command substitution performed. If + there were no command substitutions, the command exits with a status of + zero. + +CCOOMMMMAANNDD EEXXEECCUUTTIIOONN + After a command has been split into words, if it results in a simple + command and an optional list of arguments, the following actions are + taken. + + If the command name contains no slashes, the shell attempts to locate + it. If there exists a shell function by that name, that function is + invoked as described above in FFUUNNCCTTIIOONNSS. If the name does not match a + function, the shell searches for it in the list of shell builtins. If + a match is found, that builtin is invoked. + + If the name is neither a shell function nor a builtin, and contains no + slashes, bbaasshh searches each element of the PPAATTHH for a directory con- + taining an executable file by that name. BBaasshh uses a hash table to + remember the full pathnames of executable files (see hhaasshh under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A full search of the directories in PPAATTHH is + performed only if the command is not found in the hash table. If the + search is unsuccessful, the shell searches for a defined shell function + named ccoommmmaanndd__nnoott__ffoouunndd__hhaannddllee. If that function exists, it is invoked + with the original command and the original command's arguments as its + arguments, and the function's exit status becomes the exit status of + the shell. If that function is not defined, the shell prints an error + message and returns an exit status of 127. + + If the search is successful, or if the command name contains one or + more slashes, the shell executes the named program in a separate execu- + tion environment. Argument 0 is set to the name given, and the remain- + ing arguments to the command are set to the arguments given, if any. + + If this execution fails because the file is not in executable format, + and the file is not a directory, it is assumed to be a _s_h_e_l_l _s_c_r_i_p_t, a + file containing shell commands. A subshell is spawned to execute it. + This subshell reinitializes itself, so that the effect is as if a new + shell had been invoked to handle the script, with the exception that + the locations of commands remembered by the parent (see hhaasshh below + under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS) are retained by the child. + + If the program is a file beginning with ##!!, the remainder of the first + line specifies an interpreter for the program. The shell executes the + specified interpreter on operating systems that do not handle this exe- + cutable format themselves. The arguments to the interpreter consist of + a single optional argument following the interpreter name on the first + line of the program, followed by the name of the program, followed by + the command arguments, if any. + +CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + The shell has an _e_x_e_c_u_t_i_o_n _e_n_v_i_r_o_n_m_e_n_t, which consists of the follow- + ing: + + + +o open files inherited by the shell at invocation, as modified by + redirections supplied to the eexxeecc builtin + + +o the current working directory as set by ccdd, ppuusshhdd, or ppooppdd, or + inherited by the shell at invocation + + +o the file creation mode mask as set by uummaasskk or inherited from + the shell's parent + + +o current traps set by ttrraapp + + +o shell parameters that are set by variable assignment or with sseett + or inherited from the shell's parent in the environment + + +o shell functions defined during execution or inherited from the + shell's parent in the environment + + +o options enabled at invocation (either by default or with com- + mand-line arguments) or by sseett + + +o options enabled by sshhoopptt + + +o shell aliases defined with aalliiaass + + +o various process IDs, including those of background jobs, the + value of $$$$, and the value of PPPPIIDD + + When a simple command other than a builtin or shell function is to be + executed, it is invoked in a separate execution environment that con- + sists of the following. Unless otherwise noted, the values are inher- + ited from the shell. + + + +o the shell's open files, plus any modifications and additions + specified by redirections to the command + + +o the current working directory + + +o the file creation mode mask + + +o shell variables and functions marked for export, along with + variables exported for the command, passed in the environment + + +o 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. + + Command substitution, commands grouped with parentheses, and asynchro- + nous commands are invoked in a subshell environment that is a duplicate + of the shell environment, except that traps caught by the shell are + reset to the values that the shell inherited from its parent at invoca- + tion. Builtin commands that are invoked as part of a pipeline are also + executed in a subshell environment. Changes made to the subshell envi- + ronment cannot affect the shell's execution environment. + + Subshells spawned to execute command substitutions inherit the value of + the --ee option from the parent shell. When not in posix mode, Bash + clears the --ee option in such subshells. + + If a command is followed by a && and job control is not active, the + default standard input for the command is the empty file _/_d_e_v_/_n_u_l_l. + Otherwise, the invoked command inherits the file descriptors of the + calling shell as modified by redirections. + +EENNVVIIRROONNMMEENNTT + When a program is invoked it is given an array of strings called the + _e_n_v_i_r_o_n_m_e_n_t. This is a list of _n_a_m_e-_v_a_l_u_e pairs, of the form + _n_a_m_e=_v_a_l_u_e. + + The shell provides several ways to manipulate the environment. On + invocation, the shell scans its own environment and creates a parameter + for each name found, automatically marking it for _e_x_p_o_r_t to child pro- + cesses. Executed commands inherit the environment. The eexxppoorrtt and + ddeeccllaarree --xx commands allow parameters and functions to be added to and + deleted from the environment. If the value of a parameter in the envi- + ronment is modified, the new value becomes part of the environment, + replacing the old. The environment inherited by any executed command + consists of the shell's initial environment, whose values may be modi- + fied in the shell, less any pairs removed by the uunnsseett command, plus + any additions via the eexxppoorrtt and ddeeccllaarree --xx commands. + + The environment for any _s_i_m_p_l_e _c_o_m_m_a_n_d or function may be augmented + temporarily by prefixing it with parameter assignments, as described + above in PPAARRAAMMEETTEERRSS. These assignment statements affect only the envi- + ronment seen by that command. + + If the --kk option is set (see the sseett builtin command below), then _a_l_l + parameter assignments are placed in the environment for a command, not + just those that precede the command name. + + When bbaasshh invokes an external command, the variable __ is set to the + full file name of the command and passed to that command in its envi- + ronment. + +EEXXIITT SSTTAATTUUSS + The exit status of an executed command is the value returned by the + _w_a_i_t_p_i_d system call or equivalent function. Exit statuses fall between + 0 and 255, though, as explained below, the shell may use values above + 125 specially. Exit statuses from shell builtins and compound commands + are also limited to this range. Under certain circumstances, the shell + will use special values to indicate specific failure modes. + + For the shell's purposes, a command which exits with a zero exit status + has succeeded. An exit status of zero indicates success. A non-zero + exit status indicates failure. When a command terminates on a fatal + signal _N, bbaasshh uses the value of 128+_N as the exit status. + + If a command is not found, the child process created to execute it + returns a status of 127. If a command is found but is not executable, + the return status is 126. + + If a command fails because of an error during expansion or redirection, + the exit status is greater than zero. + + Shell builtin commands return a status of 0 (_t_r_u_e) if successful, and + non-zero (_f_a_l_s_e) if an error occurs while they execute. All builtins + return an exit status of 2 to indicate incorrect usage. + + BBaasshh itself returns the exit status of the last command executed, + unless a syntax error occurs, in which case it exits with a non-zero + value. See also the eexxiitt builtin command below. + +SSIIGGNNAALLSS + When bbaasshh is interactive, in the absence of any traps, it ignores + SSIIGGTTEERRMM (so that kkiillll 00 does not kill an interactive shell), and SSIIGGIINNTT + is caught and handled (so that the wwaaiitt builtin is interruptible). In + all cases, bbaasshh ignores SSIIGGQQUUIITT. If job control is in effect, bbaasshh + ignores SSIIGGTTTTIINN, SSIIGGTTTTOOUU, and SSIIGGTTSSTTPP. + + Non-builtin commands run by bbaasshh have signal handlers set to the values + inherited by the shell from its parent. When job control is not in + effect, asynchronous commands ignore SSIIGGIINNTT and SSIIGGQQUUIITT in addition to + these inherited handlers. Commands run as a result of command substi- + tution ignore the keyboard-generated job control signals SSIIGGTTTTIINN, SSIIGGTT-- + TTOOUU, and SSIIGGTTSSTTPP. + + The shell exits by default upon receipt of a SSIIGGHHUUPP. Before exiting, + an interactive shell resends the SSIIGGHHUUPP to all jobs, running or + stopped. Stopped jobs are sent SSIIGGCCOONNTT to ensure that they receive the + SSIIGGHHUUPP. To prevent the shell from sending the signal to a particular + job, it should be removed from the jobs table with the ddiissoowwnn builtin + (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) or marked to not receive SSIIGGHHUUPP + using ddiissoowwnn --hh. + + If the hhuuppoonneexxiitt shell option has been set with sshhoopptt, bbaasshh sends a + SSIIGGHHUUPP to all jobs when an interactive login shell exits. + + If bbaasshh is waiting for a command to complete and receives a signal for + which a trap has been set, the trap will not be executed until the com- + mand completes. When bbaasshh is waiting for an asynchronous command via + the wwaaiitt builtin, the reception of a signal for which a trap has been + set will cause the wwaaiitt builtin to return immediately with an exit sta- + tus greater than 128, immediately after which the trap is executed. + +JJOOBB CCOONNTTRROOLL + _J_o_b _c_o_n_t_r_o_l refers to the ability to selectively stop (_s_u_s_p_e_n_d) the + execution of processes and continue (_r_e_s_u_m_e) their execution at a later + point. A user typically employs this facility via an interactive + interface supplied jointly by the operating system kernel's terminal + driver and bbaasshh. + + The shell associates a _j_o_b with each pipeline. It keeps a table of + currently executing jobs, which may be listed with the jjoobbss command. + When bbaasshh starts a job asynchronously (in the _b_a_c_k_g_r_o_u_n_d), it prints a + line that looks like: + + [1] 25647 + + indicating that this job is job number 1 and that the process ID of the + last process in the pipeline associated with this job is 25647. All of + the processes in a single pipeline are members of the same job. BBaasshh + uses the _j_o_b abstraction as the basis for job control. + + To facilitate the implementation of the user interface to job control, + the operating system maintains the notion of a _c_u_r_r_e_n_t _t_e_r_m_i_n_a_l _p_r_o_c_e_s_s + _g_r_o_u_p _I_D. Members of this process group (processes whose process group + ID is equal to the current terminal process group ID) receive keyboard- + generated signals such as SSIIGGIINNTT. These processes are said to be in + the _f_o_r_e_g_r_o_u_n_d. _B_a_c_k_g_r_o_u_n_d processes are those whose process group ID + differs from the terminal's; such processes are immune to keyboard-gen- + erated signals. Only foreground processes are allowed to read from or, + if the user so specifies with stty tostop, write to the terminal. + Background processes which attempt to read from (write to when stty + tostop is in effect) the terminal are sent a SSIIGGTTTTIINN ((SSIIGGTTTTOOUU)) signal + by the kernel's terminal driver, which, unless caught, suspends the + process. + + If the operating system on which bbaasshh is running supports job control, + bbaasshh contains facilities to use it. Typing the _s_u_s_p_e_n_d character (typ- + ically ^^ZZ, Control-Z) while a process is running causes that process to + be stopped and returns control to bbaasshh. Typing the _d_e_l_a_y_e_d _s_u_s_p_e_n_d + character (typically ^^YY, Control-Y) causes the process to be stopped + when it attempts to read input from the terminal, and control to be + returned to bbaasshh. The user may then manipulate the state of this job, + using the bbgg command to continue it in the background, the ffgg command + to continue it in the foreground, or the kkiillll command to kill it. A ^^ZZ + takes effect immediately, and has the additional side effect of causing + pending output and typeahead to be discarded. + + There are a number of ways to refer to a job in the shell. The charac- + ter %% introduces a job specification (_j_o_b_s_p_e_c). Job number _n may be + referred to as %%nn. A job may also be referred to using a prefix of the + name used to start it, or using a substring that appears in its command + line. For example, %%ccee refers to a stopped ccee job. If a prefix + matches more than one job, bbaasshh reports an error. Using %%??ccee, on the + other hand, refers to any job containing the string ccee in its command + line. If the substring matches more than one job, bbaasshh reports an + error. The symbols %%%% and %%++ refer to the shell's notion of the _c_u_r_- + _r_e_n_t _j_o_b, which is the last job stopped while it was in the foreground + or started in the background. The _p_r_e_v_i_o_u_s _j_o_b may be referenced using + %%--. If there is only a single job, %%++ and %%-- can both be used to refer + to that job. In output pertaining to jobs (e.g., the output of the + jjoobbss command), the current job is always flagged with a ++, and the pre- + vious job with a --. A single % (with no accompanying job specifica- + tion) also refers to the current job. + + Simply naming a job can be used to bring it into the foreground: %%11 is + a synonym for ````ffgg %%11'''', bringing job 1 from the background into the + foreground. Similarly, ````%%11 &&'''' resumes job 1 in the background, + equivalent to ````bbgg %%11''''. + + The shell learns immediately whenever a job changes state. Normally, + bbaasshh 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 --bb + option to the sseett builtin command is enabled, bbaasshh reports such changes + immediately. Any trap on SSIIGGCCHHLLDD is executed for each child that + exits. + + If an attempt to exit bbaasshh is made while jobs are stopped (or, if the + cchheecckkjjoobbss shell option has been enabled using the sshhoopptt builtin, run- + ning), the shell prints a warning message, and, if the cchheecckkjjoobbss option + is enabled, lists the jobs and their statuses. The jjoobbss command may + then be used to inspect their status. If a second attempt to exit is + made without an intervening command, the shell does not print another + warning, and any stopped jobs are terminated. + +PPRROOMMPPTTIINNGG + When executing interactively, bbaasshh displays the primary prompt PPSS11 when + it is ready to read a command, and the secondary prompt PPSS22 when it + needs more input to complete a command. BBaasshh allows these prompt + strings to be customized by inserting a number of backslash-escaped + special characters that are decoded as follows: + \\aa an ASCII bell character (07) + \\dd the date in "Weekday Month Date" format (e.g., "Tue May + 26") + \\DD{{_f_o_r_m_a_t}} + the _f_o_r_m_a_t is passed to _s_t_r_f_t_i_m_e(3) and the result is + inserted into the prompt string; an empty _f_o_r_m_a_t results + in a locale-specific time representation. The braces are + required + \\ee an ASCII escape character (033) + \\hh the hostname up to the first `.' + \\HH the hostname + \\jj the number of jobs currently managed by the shell + \\ll the basename of the shell's terminal device name + \\nn newline + \\rr carriage return + \\ss the name of the shell, the basename of $$00 (the portion + following the final slash) + \\tt the current time in 24-hour HH:MM:SS format + \\TT the current time in 12-hour HH:MM:SS format + \\@@ the current time in 12-hour am/pm format + \\AA the current time in 24-hour HH:MM format + \\uu the username of the current user + \\vv the version of bbaasshh (e.g., 2.00) + \\VV the release of bbaasshh, version + patch level (e.g., 2.00.0) + \\ww the current working directory, with $$HHOOMMEE abbreviated + with a tilde (uses the value of the PPRROOMMPPTT__DDIIRRTTRRIIMM vari- + able) + \\WW the basename of the current working directory, with $$HHOOMMEE + abbreviated with a tilde + \\!! the history number of this command + \\## the command number of this command + \\$$ if the effective UID is 0, a ##, otherwise a $$ + \\_n_n_n the character corresponding to the octal number _n_n_n + \\\\ a backslash + \\[[ begin a sequence of non-printing characters, which could + be used to embed a terminal control sequence into the + prompt + \\]] end a sequence of non-printing characters + + 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 (see HHIISSTTOORRYY + below), 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 substitu- + tion, arithmetic expansion, and quote removal, subject to the value of + the pprroommppttvvaarrss shell option (see the description of the sshhoopptt command + under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + +RREEAADDLLIINNEE + This is the library that handles reading input when using an interac- + tive shell, unless the ----nnooeeddiittiinngg option is given at shell invocation. + Line editing is also used when using the --ee option to the rreeaadd builtin. + By default, the line editing commands are similar to those of emacs. A + vi-style line editing interface is also available. Line editing can be + enabled at any time using the --oo eemmaaccss or --oo vvii options to the sseett + builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). To turn off line editing + after the shell is running, use the ++oo eemmaaccss or ++oo vvii options to the + sseett builtin. + + RReeaaddlliinnee NNoottaattiioonn + In this section, the emacs-style notation is used to denote keystrokes. + Control keys are denoted by C-_k_e_y, e.g., C-n means Control-N. Simi- + larly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x means Meta-X. (On key- + boards without a _m_e_t_a key, M-_x means ESC _x, i.e., press the Escape key + then the _x key. This makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x + means ESC-Control-_x, or press the Escape key then hold the Control key + while pressing the _x key.) + + Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which normally act as + a repeat count. Sometimes, however, it is the sign of the argument + that is significant. Passing a negative argument to a command that + acts in the forward direction (e.g., kkiillll--lliinnee) causes that command to + act in a backward direction. Commands whose behavior with arguments + deviates from this are noted below. + + When a command is described as _k_i_l_l_i_n_g text, the text deleted is saved + for possible future retrieval (_y_a_n_k_i_n_g). The killed text is saved in a + _k_i_l_l _r_i_n_g. Consecutive kills cause the text to be accumulated into one + unit, which can be yanked all at once. Commands which do not kill text + separate the chunks of text on the kill ring. + + RReeaaddlliinnee IInniittiiaalliizzaattiioonn + Readline is customized by putting commands in an initialization file + (the _i_n_p_u_t_r_c file). The name of this file is taken from the value of + the IINNPPUUTTRRCC variable. If that variable is unset, the default is + _~_/_._i_n_p_u_t_r_c. When a program which uses the readline library starts up, + the initialization file is read, and the key bindings and variables are + set. There are only a few basic constructs allowed in the readline + initialization file. Blank lines are ignored. Lines beginning with a + ## are comments. Lines beginning with a $$ indicate conditional con- + structs. Other lines denote key bindings and variable settings. + + The default key-bindings may be changed with an _i_n_p_u_t_r_c file. Other + programs that use this library may add their own commands and bindings. + + For example, placing + + M-Control-u: universal-argument + or + C-Meta-u: universal-argument + into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_- + _s_a_l_-_a_r_g_u_m_e_n_t. + + The following symbolic character names are recognized: _R_U_B_O_U_T, _D_E_L, + _E_S_C, _L_F_D, _N_E_W_L_I_N_E, _R_E_T, _R_E_T_U_R_N, _S_P_C, _S_P_A_C_E, and _T_A_B. + + In addition to command names, readline allows keys to be bound to a + string that is inserted when the key is pressed (a _m_a_c_r_o). + + RReeaaddlliinnee KKeeyy BBiinnddiinnggss + The syntax for controlling key bindings in the _i_n_p_u_t_r_c file is simple. + All that is required is the name of the command or the text of a macro + and a key sequence to which it should be bound. The name may be speci- + fied in one of two ways: as a symbolic key name, possibly with _M_e_t_a_- or + _C_o_n_t_r_o_l_- prefixes, or as a key sequence. + + When using the form kkeeyynnaammee:_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, _k_e_y_n_a_m_e is the name + of a key spelled out in English. For example: + + Control-u: universal-argument + Meta-Rubout: backward-kill-word + Control-o: "> output" + + In the above example, _C_-_u is bound to the function uunniivveerrssaall--aarrgguummeenntt, + _M_-_D_E_L is bound to the function bbaacckkwwaarrdd--kkiillll--wwoorrdd, 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). + + In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyysseeqq differs + from kkeeyynnaammee above in that strings denoting an entire key sequence may + be specified by placing the sequence within double quotes. Some GNU + Emacs style key escapes can be used, as in the following example, but + the symbolic character names are not recognized. + + "\C-u": universal-argument + "\C-x\C-r": re-read-init-file + "\e[11~": "Function Key 1" + + In this example, _C_-_u is again bound to the function uunniivveerrssaall--aarrgguummeenntt. + _C_-_x _C_-_r is bound to the function rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is + bound to insert the text ``Function Key 1''. + + The full set of GNU Emacs style escape sequences is + \\CC-- control prefix + \\MM-- meta prefix + \\ee an escape character + \\\\ backslash + \\"" literal " + \\'' literal ' + + In addition to the GNU Emacs style escape sequences, a second set of + backslash escapes is available: + \\aa alert (bell) + \\bb backspace + \\dd delete + \\ff form feed + \\nn newline + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\_n_n_n the eight-bit character whose value is the octal value + _n_n_n (one to three digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + + When entering the text of a macro, single or double quotes must be used + to indicate a macro definition. Unquoted text is assumed to be a func- + tion name. In the macro body, the backslash escapes described above + are expanded. Backslash will quote any other character in the macro + text, including " and '. + + BBaasshh allows the current readline key bindings to be displayed or modi- + fied with the bbiinndd builtin command. The editing mode may be switched + during interactive use by using the --oo option to the sseett builtin com- + mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + RReeaaddlliinnee VVaarriiaabblleess + Readline has variables that can be used to further customize its behav- + ior. A variable may be set in the _i_n_p_u_t_r_c file with a statement of the + form + + sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e + + Except where noted, readline variables can take the values OOnn or OOffff + (without regard to case). Unrecognized variable names are ignored. + When a variable value is read, empty or null values, "on" (case-insen- + sitive), and "1" are equivalent to OOnn. All other values are equivalent + to OOffff. The variables and their default values are: + + bbeellll--ssttyyllee ((aauuddiibbllee)) + Controls what happens when readline wants to ring the terminal + bell. If set to nnoonnee, readline never rings the bell. If set to + vviissiibbllee, readline uses a visible bell if one is available. If + set to aauuddiibbllee, readline attempts to ring the terminal's bell. + bbiinndd--ttttyy--ssppeecciiaall--cchhaarrss ((OOnn)) + If set to OOnn, readline attempts to bind the control characters + treated specially by the kernel's terminal driver to their read- + line equivalents. + ccoommmmeenntt--bbeeggiinn ((````##'''')) + The string that is inserted when the readline iinnsseerrtt--ccoommmmeenntt + command is executed. This command is bound to MM--## in emacs mode + and to ## in vi command mode. + ccoommpplleettiioonn--iiggnnoorree--ccaassee ((OOffff)) + If set to OOnn, readline performs filename matching and completion + in a case-insensitive fashion. + ccoommpplleettiioonn--pprreeffiixx--ddiissppllaayy--lleennggtthh ((00)) + The length in characters of the common prefix of a list of pos- + sible completions that is displayed without modification. When + set to a value greater than zero, common prefixes longer than + this value are replaced with an ellipsis when displaying possi- + ble completions. + ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000)) + This determines when the user is queried about viewing the num- + ber of possible completions generated by the ppoossssiibbllee--ccoommppllee-- + ttiioonnss command. It may be set to any integer value greater than + or equal to zero. If the number of possible completions is + greater than or equal to the value of this variable, the user is + asked whether or not he wishes to view them; otherwise they are + simply listed on the terminal. + ccoonnvveerrtt--mmeettaa ((OOnn)) + If set to OOnn, readline will convert characters with the eighth + bit set to an ASCII key sequence by stripping the eighth bit and + prefixing an escape character (in effect, using escape as the + _m_e_t_a _p_r_e_f_i_x). + ddiissaabbllee--ccoommpplleettiioonn ((OOffff)) + If set to OOnn, readline will inhibit word completion. Completion + characters will be inserted into the line as if they had been + mapped to sseellff--iinnsseerrtt. + eeddiittiinngg--mmooddee ((eemmaaccss)) + Controls whether readline begins with a set of key bindings sim- + ilar to _e_m_a_c_s or _v_i. eeddiittiinngg--mmooddee can be set to either eemmaaccss or + vvii. + eecchhoo--ccoonnttrrooll--cchhaarraacctteerrss ((OOnn)) + When set to OOnn, on operating systems that indicate they support + it, readline echoes a character corresponding to a signal gener- + ated from the keyboard. + eennaabbllee--kkeeyyppaadd ((OOffff)) + When set to OOnn, readline will try to enable the application key- + pad when it is called. Some systems need this to enable the + arrow keys. + eennaabbllee--mmeettaa--kkeeyy ((OOnn)) + When set to OOnn, readline will try to enable any meta modifier + key the terminal claims to support when it is called. On many + terminals, the meta key is used to send eight-bit characters. + eexxppaanndd--ttiillddee ((OOffff)) + If set to oonn, tilde expansion is performed when readline + attempts word completion. + hhiissttoorryy--pprreesseerrvvee--ppooiinntt ((OOffff)) + If set to oonn, the history code attempts to place point at the + same location on each history line retrieved with pprreevviioouuss--hhiiss-- + ttoorryy or nneexxtt--hhiissttoorryy. + hhiissttoorryy--ssiizzee ((00)) + Set the maximum number of history entries saved in the history + list. If set to zero, the number of entries in the history list + is not limited. + hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff)) + When set to OOnn, makes readline use a single line for display, + scrolling the input horizontally on a single screen line when it + becomes longer than the screen width rather than wrapping to a + new line. + iinnppuutt--mmeettaa ((OOffff)) + If set to OOnn, readline will enable eight-bit input (that is, it + will not strip the high bit from the characters it reads), + regardless of what the terminal claims it can support. The name + mmeettaa--ffllaagg is a synonym for this variable. + iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ'''')) + The string of characters that should terminate an incremental + search without subsequently executing the character as a com- + mand. If this variable has not been given a value, the charac- + ters _E_S_C and _C_-_J will terminate an incremental search. + kkeeyymmaapp ((eemmaaccss)) + Set the current readline keymap. The set of valid keymap names + is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- + _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the + value of eeddiittiinngg--mmooddee also affects the default keymap. + mmaarrkk--ddiirreeccttoorriieess ((OOnn)) + If set to OOnn, completed directory names have a slash appended. + mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff)) + If set to OOnn, history lines that have been modified are dis- + played with a preceding asterisk (**). + mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess ((OOffff)) + If set to OOnn, completed names which are symbolic links to direc- + tories have a slash appended (subject to the value of + mmaarrkk--ddiirreeccttoorriieess). + mmaattcchh--hhiiddddeenn--ffiilleess ((OOnn)) + This variable, when set to OOnn, causes readline to match files + whose names begin with a `.' (hidden files) when performing + filename completion, unless the leading `.' is supplied by the + user in the filename to be completed. + oouuttppuutt--mmeettaa ((OOffff)) + If set to OOnn, readline will display characters with the eighth + bit set directly rather than as a meta-prefixed escape sequence. + ppaaggee--ccoommpplleettiioonnss ((OOnn)) + If set to OOnn, readline uses an internal _m_o_r_e-like pager to dis- + play a screenful of possible completions at a time. + pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff)) + If set to OOnn, readline will display completions with matches + sorted horizontally in alphabetical order, rather than down the + screen. + rreevveerrtt--aallll--aatt--nneewwlliinnee ((OOffff)) + If set to oonn, readline will undo all changes to history lines + before returning when aacccceepptt--lliinnee is executed. By default, his- + tory lines may be modified and retain individual undo lists + across calls to rreeaaddlliinnee. + sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff)) + This alters the default behavior of the completion functions. + If set to oonn, words which have more than one possible completion + cause the matches to be listed immediately instead of ringing + the bell. + sshhooww--aallll--iiff--uunnmmooddiiffiieedd ((OOffff)) + This alters the default behavior of the completion functions in + a fashion similar to sshhooww--aallll--iiff--aammbbiigguuoouuss. If set to oonn, words + which have more than one possible completion without any possi- + ble partial completion (the possible completions don't share a + common prefix) cause the matches to be listed immediately + instead of ringing the bell. + sskkiipp--ccoommpplleetteedd--tteexxtt ((OOffff)) + If set to OOnn, this alters the default completion behavior when + inserting a single match into the line. It's only active when + performing completion in the middle of a word. If enabled, + readline does not insert characters from the completion that + match characters after point in the word being completed, so + portions of the word following the cursor are not duplicated. + vviissiibbllee--ssttaattss ((OOffff)) + If set to OOnn, a character denoting a file's type as reported by + _s_t_a_t(2) is appended to the filename when listing possible com- + pletions. + + RReeaaddlliinnee CCoonnddiittiioonnaall CCoonnssttrruuccttss + Readline implements a facility similar in spirit to the conditional + compilation features of the C preprocessor which allows key bindings + and variable settings to be performed as the result of tests. There + are four parser directives used. + + $$iiff The $$iiff construct allows bindings to be made based on the edit- + ing mode, the terminal being used, or the application using + readline. The text of the test extends to the end of the line; + no characters are required to isolate it. + + mmooddee The mmooddee== form of the $$iiff directive is used to test + whether readline is in emacs or vi mode. This may be + used in conjunction with the sseett kkeeyymmaapp command, for + instance, to set bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and + _e_m_a_c_s_-_c_t_l_x keymaps only if readline is starting out in + emacs mode. + + tteerrmm The tteerrmm== form may be used to include terminal-specific + key bindings, perhaps to bind the key sequences output by + the terminal's function keys. The word on the right side + of the == is tested against the both full name of the ter- + minal and the portion of the terminal name before the + first --. This allows _s_u_n to match both _s_u_n and _s_u_n_-_c_m_d, + for instance. + + aapppplliiccaattiioonn + The aapppplliiccaattiioonn construct is used to include application- + specific settings. Each program using the readline + library sets the _a_p_p_l_i_c_a_t_i_o_n _n_a_m_e, and an initialization + file can test 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: + + $$iiff Bash + # Quote the current or previous word + "\C-xq": "\eb\"\ef\"" + $$eennddiiff + + $$eennddiiff This command, as seen in the previous example, terminates an $$iiff + command. + + $$eellssee Commands in this branch of the $$iiff directive are executed if the + test fails. + + $$iinncclluuddee + This directive takes a single filename as an argument and reads + commands and bindings from that file. For example, the follow- + ing directive would read _/_e_t_c_/_i_n_p_u_t_r_c: + + $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c + + SSeeaarrcchhiinngg + Readline provides commands for searching through the command history + (see HHIISSTTOORRYY below) for lines containing a specified string. There are + two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-_i_n_c_r_e_m_e_n_t_a_l. + + Incremental searches begin before the user has finished typing the + search string. As each character of the search string is typed, read- + line 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. The characters present in + the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used to terminate an + incremental search. If that variable has not been assigned a value the + Escape and Control-J characters will terminate an incremental search. + Control-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 Control-S or + Control-R 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 _n_e_w_l_i_n_e will termi- + nate the search and accept the line, thereby executing the command from + the history list. + + Readline remembers the last incremental search string. If two Control- + Rs are typed without any intervening characters defining a new search + string, any remembered search string is used. + + Non-incremental searches read the entire search string before starting + to search for matching history lines. The search string may be typed + by the user or be part of the contents of the current line. + + RReeaaddlliinnee CCoommmmaanndd NNaammeess + The following is a list of the names of the commands and the default + key sequences to which they are bound. Command names without an accom- + panying key sequence are unbound by default. In the following descrip- + tions, _p_o_i_n_t refers to the current cursor position, and _m_a_r_k refers to + a cursor position saved by the sseett--mmaarrkk command. The text between the + point and mark is referred to as the _r_e_g_i_o_n. + + CCoommmmaannddss ffoorr MMoovviinngg + bbeeggiinnnniinngg--ooff--lliinnee ((CC--aa)) + Move to the start of the current line. + eenndd--ooff--lliinnee ((CC--ee)) + Move to the end of the line. + ffoorrwwaarrdd--cchhaarr ((CC--ff)) + Move forward a character. + bbaacckkwwaarrdd--cchhaarr ((CC--bb)) + Move back a character. + ffoorrwwaarrdd--wwoorrdd ((MM--ff)) + Move forward to the end of the next word. Words are composed of + alphanumeric characters (letters and digits). + bbaacckkwwaarrdd--wwoorrdd ((MM--bb)) + Move back to the start of the current or previous word. Words + are composed of alphanumeric characters (letters and digits). + sshheellll--ffoorrwwaarrdd--wwoorrdd + Move forward to the end of the next word. Words are delimited + by non-quoted shell metacharacters. + sshheellll--bbaacckkwwaarrdd--wwoorrdd + Move back to the start of the current or previous word. Words + are delimited by non-quoted shell metacharacters. + cclleeaarr--ssccrreeeenn ((CC--ll)) + Clear the screen leaving the current line at the top of the + screen. With an argument, refresh the current line without + clearing the screen. + rreeddrraaww--ccuurrrreenntt--lliinnee + Refresh the current line. + + CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy + aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn)) + Accept the line regardless of where the cursor is. If this line + is non-empty, add it to the history list according to the state + of the HHIISSTTCCOONNTTRROOLL variable. If the line is a modified history + line, then restore the history line to its original state. + pprreevviioouuss--hhiissttoorryy ((CC--pp)) + Fetch the previous command from the history list, moving back in + the list. + nneexxtt--hhiissttoorryy ((CC--nn)) + Fetch the next command from the history list, moving forward in + the list. + bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<)) + Move to the first line in the history. + eenndd--ooff--hhiissttoorryy ((MM-->>)) + Move to the end of the input history, i.e., the line currently + being entered. + rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr)) + Search backward starting at the current line and moving `up' + through the history as necessary. This is an incremental + search. + ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss)) + Search forward starting at the current line and moving `down' + through the history as necessary. This is an incremental + search. + nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp)) + Search backward through the history starting at the current line + using a non-incremental search for a string supplied by the + user. + nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn)) + Search forward through the history using a non-incremental + search for a string supplied by the user. + hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd + Search forward through the history for the string of characters + between the start of the current line and the point. This is a + non-incremental search. + hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd + Search backward through the history for the string of characters + between the start of the current line and the point. This is a + non-incremental search. + yyaannkk--nntthh--aarrgg ((MM--CC--yy)) + Insert the first argument to the previous command (usually the + 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. Once + the argument _n is computed, the argument is extracted as if the + "!_n" history expansion had been specified. + yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__)) + Insert the last argument to the previous command (the last word + of the previous history entry). With an argument, behave + exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg + move back through the history list, inserting the last argument + of each line in turn. The history expansion facilities are used + to extract the last argument, as if the "!$" history expansion + had been specified. + sshheellll--eexxppaanndd--lliinnee ((MM--CC--ee)) + Expand the line as the shell does. This performs alias and his- + tory expansion as well as all of the shell word expansions. See + HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. + hhiissttoorryy--eexxppaanndd--lliinnee ((MM--^^)) + Perform history expansion on the current line. See HHIISSTTOORRYY + EEXXPPAANNSSIIOONN below for a description of history expansion. + mmaaggiicc--ssppaaccee + Perform history expansion on the current line and insert a + space. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history + expansion. + aalliiaass--eexxppaanndd--lliinnee + Perform alias expansion on the current line. See AALLIIAASSEESS above + for a description of alias expansion. + hhiissttoorryy--aanndd--aalliiaass--eexxppaanndd--lliinnee + Perform history and alias expansion on the current line. + iinnsseerrtt--llaasstt--aarrgguummeenntt ((MM--..,, MM--__)) + A synonym for yyaannkk--llaasstt--aarrgg. + ooppeerraattee--aanndd--ggeett--nneexxtt ((CC--oo)) + Accept the current line for execution and fetch the next line + relative to the current line from the history for editing. Any + argument is ignored. + eeddiitt--aanndd--eexxeeccuuttee--ccoommmmaanndd ((CC--xxCC--ee)) + Invoke an editor on the current command line, and execute the + result as shell commands. BBaasshh attempts to invoke $$VVIISSUUAALL, + $$EEDDIITTOORR, and _e_m_a_c_s as the editor, in that order. + + CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt + ddeelleettee--cchhaarr ((CC--dd)) + 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 ddeelleettee--cchhaarr, then return EEOOFF. + bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt)) + Delete the character behind the cursor. When given a numeric + argument, save the deleted text on the kill ring. + ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr + Delete the character under the cursor, unless the cursor is at + the end of the line, in which case the character behind the cur- + sor is deleted. + qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv)) + Add the next character typed to the line verbatim. This is how + to insert characters like CC--qq, for example. + ttaabb--iinnsseerrtt ((CC--vv TTAABB)) + Insert a tab character. + sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ......)) + Insert the character typed. + ttrraannssppoossee--cchhaarrss ((CC--tt)) + Drag the character before point forward over the character at + point, moving point forward as well. If point is at the end of + the line, then this transposes the two characters before point. + Negative arguments have no effect. + ttrraannssppoossee--wwoorrddss ((MM--tt)) + Drag the word before point past the word after point, moving + point over that word as well. If point is at the end of the + line, this transposes the last two words on the line. + uuppccaassee--wwoorrdd ((MM--uu)) + Uppercase the current (or following) word. With a negative + argument, uppercase the previous word, but do not move point. + ddoowwnnccaassee--wwoorrdd ((MM--ll)) + Lowercase the current (or following) word. With a negative + argument, lowercase the previous word, but do not move point. + ccaappiittaalliizzee--wwoorrdd ((MM--cc)) + Capitalize the current (or following) word. With a negative + argument, capitalize the previous word, but do not move point. + oovveerrwwrriittee--mmooddee + Toggle overwrite mode. With an explicit positive numeric argu- + ment, switches to overwrite mode. With an explicit non-positive + numeric argument, switches to insert mode. This command affects + only eemmaaccss mode; vvii mode does overwrite differently. Each call + to _r_e_a_d_l_i_n_e_(_) starts in insert mode. In overwrite mode, charac- + ters bound to sseellff--iinnsseerrtt replace the text at point rather than + pushing the text to the right. Characters bound to bbaacckk-- + wwaarrdd--ddeelleettee--cchhaarr replace the character before point with a + space. By default, this command is unbound. + + KKiilllliinngg aanndd YYaannkkiinngg + kkiillll--lliinnee ((CC--kk)) + Kill the text from point to the end of the line. + bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt)) + Kill backward to the beginning of the line. + uunniixx--lliinnee--ddiissccaarrdd ((CC--uu)) + Kill backward from point to the beginning of the line. The + killed text is saved on the kill-ring. + kkiillll--wwhhoollee--lliinnee + Kill all characters on the current line, no matter where point + is. + kkiillll--wwoorrdd ((MM--dd)) + 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 those used by ffoorrwwaarrdd--wwoorrdd. + bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) + Kill the word behind point. Word boundaries are the same as + those used by bbaacckkwwaarrdd--wwoorrdd. + sshheellll--kkiillll--wwoorrdd ((MM--dd)) + 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 those used by sshheellll--ffoorrwwaarrdd--wwoorrdd. + sshheellll--bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) + Kill the word behind point. Word boundaries are the same as + those used by sshheellll--bbaacckkwwaarrdd--wwoorrdd. + uunniixx--wwoorrdd--rruubboouutt ((CC--ww)) + Kill the word behind point, using white space as a word bound- + ary. The killed text is saved on the kill-ring. + uunniixx--ffiilleennaammee--rruubboouutt + Kill the word behind point, using white space and the slash + character as the word boundaries. The killed text is saved on + the kill-ring. + ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\)) + Delete all spaces and tabs around point. + kkiillll--rreeggiioonn + Kill the text in the current region. + ccooppyy--rreeggiioonn--aass--kkiillll + Copy the text in the region to the kill buffer. + ccooppyy--bbaacckkwwaarrdd--wwoorrdd + Copy the word before point to the kill buffer. The word bound- + aries are the same as bbaacckkwwaarrdd--wwoorrdd. + ccooppyy--ffoorrwwaarrdd--wwoorrdd + Copy the word following point to the kill buffer. The word + boundaries are the same as ffoorrwwaarrdd--wwoorrdd. + yyaannkk ((CC--yy)) + Yank the top of the kill ring into the buffer at point. + yyaannkk--ppoopp ((MM--yy)) + Rotate the kill ring, and yank the new top. Only works follow- + ing yyaannkk or yyaannkk--ppoopp. + + NNuummeerriicc AArrgguummeennttss + ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----)) + Add this digit to the argument already accumulating, or start a + new argument. M-- starts a negative argument. + uunniivveerrssaall--aarrgguummeenntt + This is another way to specify an argument. If this command is + followed by one or more digits, optionally with a leading minus + sign, those digits define the argument. If the command is fol- + lowed by digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the + numeric argument, but is otherwise ignored. As a special case, + if this command is immediately followed by a character that is + neither a digit or minus sign, the argument count for the next + command is multiplied by four. The argument count is initially + one, so executing this function the first time makes the argu- + ment count four, a second time makes the argument count sixteen, + and so on. + + CCoommpplleettiinngg + ccoommpplleettee ((TTAABB)) + Attempt to perform completion on the text before point. BBaasshh + 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. + ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) + List the possible completions of the text before point. + iinnsseerrtt--ccoommpplleettiioonnss ((MM--**)) + Insert all completions of the text before point that would have + been generated by ppoossssiibbllee--ccoommpplleettiioonnss. + mmeennuu--ccoommpplleettee + Similar to ccoommpplleettee, but replaces the word to be completed with + a single match from the list of possible completions. Repeated + execution of mmeennuu--ccoommpplleettee steps through the list of possible + completions, inserting each match in turn. At the end of the + list of completions, the bell is rung (subject to the setting of + bbeellll--ssttyyllee) 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 TTAABB, but is unbound by + default.cc + mmeennuu--ccoommpplleettee--kkrrdd + Identicwwal to mmeennuu--ccoommpplleettee, but moves backward through the list + of possible completions, as if mmeennuu--ccoommpplleettee had been given a + negative argument. This command is unbound by default. + ddeelleettee--cchhaarr--oorr--lliisstt + Deletes the character under the cursor if not at the beginning + or end of the line (like ddeelleettee--cchhaarr). If at the end of the + line, behaves identically to ppoossssiibbllee--ccoommpplleettiioonnss. This command + is unbound by default. + ccoommpplleettee--ffiilleennaammee ((MM--//)) + Attempt filename completion on the text before point. + ppoossssiibbllee--ffiilleennaammee--ccoommpplleettiioonnss ((CC--xx //)) + List the possible completions of the text before point, treating + it as a filename. + ccoommpplleettee--uusseerrnnaammee ((MM--~~)) + Attempt completion on the text before point, treating it as a + username. + ppoossssiibbllee--uusseerrnnaammee--ccoommpplleettiioonnss ((CC--xx ~~)) + List the possible completions of the text before point, treating + it as a username. + ccoommpplleettee--vvaarriiaabbllee ((MM--$$)) + Attempt completion on the text before point, treating it as a + shell variable. + ppoossssiibbllee--vvaarriiaabbllee--ccoommpplleettiioonnss ((CC--xx $$)) + List the possible completions of the text before point, treating + it as a shell variable. + ccoommpplleettee--hhoossttnnaammee ((MM--@@)) + Attempt completion on the text before point, treating it as a + hostname. + ppoossssiibbllee--hhoossttnnaammee--ccoommpplleettiioonnss ((CC--xx @@)) + List the possible completions of the text before point, treating + it as a hostname. + ccoommpplleettee--ccoommmmaanndd ((MM--!!)) + Attempt completion on the text before point, treating it as a + command name. Command completion attempts to match the text + against aliases, reserved words, shell functions, shell + builtins, and finally executable filenames, in that order. + ppoossssiibbllee--ccoommmmaanndd--ccoommpplleettiioonnss ((CC--xx !!)) + List the possible completions of the text before point, treating + it as a command name. + ddyynnaammiicc--ccoommpplleettee--hhiissttoorryy ((MM--TTAABB)) + Attempt completion on the text before point, comparing the text + against lines from the history list for possible completion + matches. + ddaabbbbrreevv--eexxppaanndd + Attempt menu completion on the text before point, comparing the + text against lines from the history list for possible completion + matches. + ccoommpplleettee--iinnttoo--bbrraacceess ((MM--{{)) + Perform filename completion and insert the list of possible com- + pletions enclosed within braces so the list is available to the + shell (see BBrraaccee EExxppaannssiioonn above). + + KKeeyybbooaarrdd MMaaccrrooss + ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (()) + Begin saving the characters typed into the current keyboard + macro. + eenndd--kkbbdd--mmaaccrroo ((CC--xx )))) + Stop saving the characters typed into the current keyboard macro + and store the definition. + ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee)) + Re-execute the last keyboard macro defined, by making the char- + acters in the macro appear as if typed at the keyboard. + + MMiisscceellllaanneeoouuss + rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr)) + Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any + bindings or variable assignments found there. + aabboorrtt ((CC--gg)) + Abort the current editing command and ring the terminal's bell + (subject to the setting of bbeellll--ssttyyllee). + ddoo--uuppppeerrccaassee--vveerrssiioonn ((MM--aa,, MM--bb,, MM--_x,, ......)) + If the metafied character _x is lowercase, run the command that + is bound to the corresponding uppercase character. + pprreeffiixx--mmeettaa ((EESSCC)) + Metafy the next character typed. EESSCC ff is equivalent to MMeettaa--ff. + uunnddoo ((CC--__,, CC--xx CC--uu)) + Incremental undo, separately remembered for each line. + rreevveerrtt--lliinnee ((MM--rr)) + Undo all changes made to this line. This is like executing the + uunnddoo command enough times to return the line to its initial + state. + ttiillddee--eexxppaanndd ((MM--&&)) + Perform tilde expansion on the current word. + sseett--mmaarrkk ((CC--@@,, MM--<<ssppaaccee>>)) + Set the mark to the point. If a numeric argument is supplied, + the mark is set to that position. + eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx)) + Swap the point with the mark. The current cursor position is + set to the saved position, and the old cursor position is saved + as the mark. + cchhaarraacctteerr--sseeaarrcchh ((CC--]])) + A character is read and point is moved to the next occurrence of + that character. A negative count searches for previous occur- + rences. + cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]])) + A character is read and point is moved to the previous occur- + rence of that character. A negative count searches for subse- + quent occurrences. + sskkiipp--ccssii--sseeqquueennccee (()) + Read enough characters to consume a multi-key sequence such as + those defined for keys like Home and End. Such sequences begin + with a Control Sequence Indicator (CSI), usually ESC-[. If this + sequence is bound to "\[", keys producing such sequences will + have no effect unless explicitly bound to a readline command, + instead of inserting stray characters into the editing buffer. + This is unbound by default, but usually bound to ESC-[. + iinnsseerrtt--ccoommmmeenntt ((MM--##)) + Without a numeric argument, the value of the readline ccoomm-- + mmeenntt--bbeeggiinn variable is inserted at the beginning of the current + line. If a numeric argument is supplied, this command acts as a + toggle: if the characters at the beginning of the line do not + match the value of ccoommmmeenntt--bbeeggiinn, the value is inserted, other- + wise the characters in ccoommmmeenntt--bbeeggiinn are deleted from the begin- + ning of the line. In either case, the line is accepted as if a + newline had been typed. The default value of ccoommmmeenntt--bbeeggiinn + causes this command to make the current line a shell comment. + If a numeric argument causes the comment character to be + removed, the line will be executed by the shell. + gglloobb--ccoommpplleettee--wwoorrdd ((MM--gg)) + The word before point is treated as a pattern for pathname + expansion, with an asterisk implicitly appended. This pattern + is used to generate a list of matching file names for possible + completions. + gglloobb--eexxppaanndd--wwoorrdd ((CC--xx **)) + The word before point is treated as a pattern for pathname + expansion, and the list of matching file names is inserted, + replacing the word. If a numeric argument is supplied, an + asterisk is appended before pathname expansion. + gglloobb--lliisstt--eexxppaannssiioonnss ((CC--xx gg)) + The list of expansions that would have been generated by + gglloobb--eexxppaanndd--wwoorrdd is displayed, and the line is redrawn. If a + numeric argument is supplied, an asterisk is appended before + pathname expansion. + dduummpp--ffuunnccttiioonnss + Print all of the functions and their key bindings to the read- + line output stream. If a numeric argument is supplied, the out- + put is formatted in such a way that it can be made part of an + _i_n_p_u_t_r_c file. + dduummpp--vvaarriiaabblleess + Print all of the settable readline variables and their values to + the readline output stream. If a numeric argument is supplied, + the output is formatted in such a way that it can be made part + of an _i_n_p_u_t_r_c file. + dduummpp--mmaaccrrooss + Print all of the readline key sequences bound to macros and the + 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 + _i_n_p_u_t_r_c file. + ddiissppllaayy--sshheellll--vveerrssiioonn ((CC--xx CC--vv)) + Display version information about the current instance of bbaasshh. + + PPrrooggrraammmmaabbllee CCoommpplleettiioonn + When word completion is attempted for an argument to a command for + which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using + the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the pro- + grammable completion facilities are invoked. + + First, the command name is identified. If the command word is the + empty string (completion attempted at the beginning of an empty line), + any compspec defined with the --EE option to ccoommpplleettee is used. If a + compspec has been defined for that command, the compspec is used to + generate the list of possible completions for the word. If the command + word is a full pathname, a compspec for the full pathname is searched + for first. If no compspec is found for the full pathname, an attempt + is made to find a compspec for the portion following the final slash. + If those searches to not result in a compspec, any compspec defined + with the --DD option to ccoommpplleettee is used as the default. + + Once a compspec has been found, it is used to generate the list of + matching words. If a compspec is not found, the default bbaasshh comple- + tion as described above under CCoommpplleettiinngg 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 + --ff or --dd option is used for filename or directory name completion, the + shell variable FFIIGGNNOORREE is used to filter the matches. + + Any completions specified by a pathname expansion pattern to the --GG + option are generated next. The words generated by the pattern need not + match the word being completed. The GGLLOOBBIIGGNNOORREE shell variable is not + used to filter the matches, but the FFIIGGNNOORREE variable is used. + + Next, the string specified as the argument to the --WW option is consid- + ered. The string is first split using the characters in the IIFFSS spe- + cial variable as delimiters. Shell quoting is honored. Each word is + then expanded using brace expansion, tilde expansion, parameter and + variable expansion, command substitution, and arithmetic expansion, as + described above under EEXXPPAANNSSIIOONN. The results are split using the rules + described above under WWoorrdd SSpplliittttiinngg. The results of the expansion are + prefix-matched against the word being completed, and the matching words + become the possible completions. + + After these matches have been generated, any shell function or command + specified with the --FF and --CC options is invoked. When the command or + function is invoked, the CCOOMMPP__LLIINNEE, CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and CCOOMMPP__TTYYPPEE + variables are assigned values as described above under SShheellll VVaarriiaabblleess. + If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD + 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 completed, and the + third argument is the word preceding the word being completed on the + current command line. No filtering of the generated completions + against the word being completed is performed; the function or command + has complete freedom in generating the matches. + + Any function specified with --FF is invoked first. The function may use + any of the shell facilities, including the ccoommppggeenn builtin described + below, to generate the matches. It must put the possible completions + in the CCOOMMPPRREEPPLLYY array variable. + + Next, any command specified with the --CC option is invoked in an envi- + ronment equivalent to command substitution. It should print a list of + completions, one per line, to the standard output. Backslash may be + used to escape a newline, if necessary. + + After all of the possible completions are generated, any filter speci- + fied with the --XX option is applied to the list. The filter is a pat- + tern as used for pathname expansion; a && in the pattern is replaced + with the text of the word being completed. A literal && may be escaped + with a backslash; the backslash is removed before attempting a match. + Any completion that matches the pattern will be removed from the list. + A leading !! negates the pattern; in this case any completion not match- + ing the pattern will be removed. + + Finally, any prefix and suffix specified with the --PP and --SS 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 the previously-applied actions do not generate any matches, and the + --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was + defined, directory name completion is attempted. + + If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec + was defined, directory name completion is attempted and any matches are + added to the results of the other actions. + + 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 bbaasshh completions are not attempted, and the readline default of + filename completion is disabled. If the --oo bbaasshhddeeffaauulltt option was sup- + plied to ccoommpplleettee when the compspec was defined, the bbaasshh default com- + pletions are attempted if the compspec generates no matches. If the --oo + ddeeffaauulltt option was supplied to ccoommpplleettee when the compspec was defined, + readline's default completion will be performed if the compspec (and, + if attempted, the default bbaasshh completions) generate no matches. + + When a compspec indicates that directory name completion is desired, + the programmable completion functions force readline to append a slash + to completed names which are symbolic links to directories, subject to + the value of the mmaarrkk--ddiirreeccttoorriieess readline variable, regardless of the + setting of the mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess readline variable. + + There is some support for dynamically modifying completions. This is + most useful when used in combination with a default completion speci- + fied with ccoommpplleettee --DD. It's possible for shell functions executed as + completion handlers to indicate that completion should be retried by + returning an exit status of 124. If a shell function returns 124, and + changes the compspec associated with the command on which completion is + being attempted (supplied as the first argument when the function is + executed), programmable completion restarts from the beginning, with an + attempt to find a compspec for that command. This allows a set of com- + pletions to be built dynamically as completion is attempted, rather + than being loaded all at once. + + For instance, assuming that there is a library of compspecs, each kept + in a file corresponding to the name of the command, the following + default completion function would load completions dynamically: + + _completion_loader() + { + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 + } + complete -D -F _completion_loader + + +HHIISSTTOORRYY + When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell + provides access to the _c_o_m_m_a_n_d _h_i_s_t_o_r_y, the list of commands previously + typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of + commands to save in a history list. The text of the last HHIISSTTSSIIZZEE com- + mands (default 500) is saved. The shell stores each command in the + history list prior to parameter and variable expansion (see EEXXPPAANNSSIIOONN + above) but after history expansion is performed, subject to the values + of the shell variables HHIISSTTIIGGNNOORREE and HHIISSTTCCOONNTTRROOLL. + + On startup, the history is initialized from the file named by the vari- + able HHIISSTTFFIILLEE (default _~_/_._b_a_s_h___h_i_s_t_o_r_y). The file named by the value + of HHIISSTTFFIILLEE is truncated, if necessary, to contain no more than the + number of lines specified by the value of HHIISSTTFFIILLEESSIIZZEE. When the his- + tory file is read, lines beginning with the history comment character + followed immediately by a digit are interpreted as timestamps for the + preceding history line. These timestamps are optionally displayed + depending on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When an inter- + active shell exits, the last $$HHIISSTTSSIIZZEE lines are copied from the his- + tory list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell option is enabled (see + the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the lines + are appended to the history file, otherwise the history file is over- + written. If HHIISSTTFFIILLEE is unset, or if the history file is unwritable, + the history is not saved. If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, time + stamps are written to the history file, marked with the history comment + character, so they may be preserved across shell sessions. This uses + the history comment character to distinguish timestamps from other his- + tory lines. After saving the history, the history file is truncated to + contain no more than HHIISSTTFFIILLEESSIIZZEE lines. If HHIISSTTFFIILLEESSIIZZEE is not set, + no truncation is performed. + + The builtin command ffcc (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) may be used + to list or edit and re-execute a portion of the history list. The hhiiss-- + ttoorryy 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. + + The shell allows control over which commands are saved on the history + list. The HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables may be set to cause the + shell to save only a subset of the commands entered. The ccmmddhhiisstt shell + option, if enabled, causes the shell to attempt to save each line of a + multi-line command in the same history entry, adding semicolons where + necessary to preserve syntactic correctness. The lliitthhiisstt shell option + causes the shell to save the command with embedded newlines instead of + semicolons. See the description of the sshhoopptt builtin below under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS for information on setting and unsetting shell + options. + +HHIISSTTOORRYY EEXXPPAANNSSIIOONN + The shell supports a history expansion feature that is similar to the + history expansion in ccsshh.. This section describes what syntax features + are available. This feature is enabled by default for interactive + shells, and can be disabled using the ++HH option to the sseett builtin com- + mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). Non-interactive shells do not + perform history expansion by default. + + History expansions introduce words from the history list into the input + stream, making it easy to repeat commands, insert the arguments to a + previous command into the current input line, or fix errors in previous + commands quickly. + + History expansion is performed immediately after a complete line is + read, before the shell breaks it into words. It takes place in two + parts. The first is to determine which line from the history list to + use during substitution. The second is to select portions of that line + for inclusion into the current one. The line selected from the history + is the _e_v_e_n_t, and the portions of that line that are acted upon are + _w_o_r_d_s. Various _m_o_d_i_f_i_e_r_s are available to manipulate the selected + words. The line is broken into words in the same fashion as when read- + ing input, so that several _m_e_t_a_c_h_a_r_a_c_t_e_r-separated words surrounded by + quotes are considered one word. History expansions are introduced by + the appearance of the history expansion character, which is !! by + default. Only backslash (\\) and single quotes can quote the history + expansion character. + + Several characters inhibit history expansion if found immediately fol- + lowing the history expansion character, even if it is unquoted: space, + tab, newline, carriage return, and ==. If the eexxttgglloobb shell option is + enabled, (( will also inhibit expansion. + + Several shell options settable with the sshhoopptt builtin may be used to + tailor the behavior of history expansion. If the hhiissttvveerriiffyy shell + option is enabled (see the description of the sshhoopptt builtin below), and + rreeaaddlliinnee is being used, history substitutions are not immediately + passed to the shell parser. Instead, the expanded line is reloaded + into the rreeaaddlliinnee editing buffer for further modification. If rreeaaddlliinnee + is being used, and the hhiissttrreeeeddiitt shell option is enabled, a failed + history substitution will be reloaded into the rreeaaddlliinnee editing buffer + for correction. The --pp option to the hhiissttoorryy builtin command may be + used to see what a history expansion will do before using it. The --ss + option to the hhiissttoorryy builtin may be used to add commands to the end of + the history list without actually executing them, so that they are + available for subsequent recall. + + The shell allows control of the various characters used by the history + expansion mechanism (see the description of hhiissttcchhaarrss above under SShheellll + VVaarriiaabblleess). The shell uses the history comment character to mark his- + tory timestamps when writing the history file. + + EEvveenntt DDeessiiggnnaattoorrss + An event designator is a reference to a command line entry in the his- + tory list. + + !! Start a history substitution, except when followed by a bbllaannkk, + newline, carriage return, = or ( (when the eexxttgglloobb shell option + is enabled using the sshhoopptt builtin). + !!_n Refer to command line _n. + !!--_n Refer to the current command line minus _n. + !!!! Refer to the previous command. This is a synonym for `!-1'. + !!_s_t_r_i_n_g + Refer to the most recent command starting with _s_t_r_i_n_g. + !!??_s_t_r_i_n_g[[??]] + Refer to the most recent command containing _s_t_r_i_n_g. The trail- + ing ?? may be omitted if _s_t_r_i_n_g is followed immediately by a new- + line. + ^^_s_t_r_i_n_g_1^^_s_t_r_i_n_g_2^^ + Quick substitution. Repeat the last command, replacing _s_t_r_i_n_g_1 + with _s_t_r_i_n_g_2. Equivalent to ``!!:s/_s_t_r_i_n_g_1/_s_t_r_i_n_g_2/'' (see MMoodd-- + iiffiieerrss below). + !!## The entire command line typed so far. + + WWoorrdd DDeessiiggnnaattoorrss + Word designators are used to select desired words from the event. A :: + separates the event specification from the word designator. It may be + omitted if the word designator begins with a ^^, $$, **, --, or %%. Words + are numbered from the beginning of the line, with the first word being + denoted by 0 (zero). Words are inserted into the current line sepa- + rated by single spaces. + + 00 ((zzeerroo)) + The zeroth word. For the shell, this is the command word. + _n The _nth word. + ^^ The first argument. That is, word 1. + $$ The last argument. + %% The word matched by the most recent `?_s_t_r_i_n_g?' search. + _x--_y A range of words; `-_y' abbreviates `0-_y'. + ** All of the words but the zeroth. This is a synonym for `_1_-_$'. + It is not an error to use ** if there is just one word in the + event; the empty string is returned in that case. + xx** Abbreviates _x_-_$. + xx-- Abbreviates _x_-_$ like xx**, but omits the last word. + + If a word designator is supplied without an event specification, the + previous command is used as the event. + + MMooddiiffiieerrss + After the optional word designator, there may appear a sequence of one + or more of the following modifiers, each preceded by a `:'. + + hh Remove a trailing file name component, leaving only the head. + tt Remove all leading file name components, leaving the tail. + rr Remove a trailing suffix of the form _._x_x_x, leaving the basename. + ee Remove all but the trailing suffix. + pp Print the new command but do not execute it. + qq Quote the substituted words, escaping further substitutions. + xx Quote the substituted words as with qq, but break into words at + bbllaannkkss and newlines. + ss//_o_l_d//_n_e_w// + Substitute _n_e_w for the first occurrence of _o_l_d in the event + line. Any delimiter can be used in place of /. The final + delimiter is optional if it is the last character of the event + line. The delimiter may be quoted in _o_l_d and _n_e_w with a single + backslash. If & appears in _n_e_w, it is replaced by _o_l_d. A sin- + gle backslash will quote the &. If _o_l_d is null, it is set to + the last _o_l_d substituted, or, if no previous history substitu- + tions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. + && Repeat the previous substitution. + gg Cause changes to be applied over the entire event line. This is + used in conjunction with `::ss' (e.g., `::ggss//_o_l_d//_n_e_w//') or `::&&'. + If used with `::ss', any delimiter can be used in place of /, and + the final delimiter is optional if it is the last character of + the event line. An aa may be used as a synonym for gg. + GG Apply the following `ss' modifier once to each word in the event + line. + +SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS + Unless otherwise noted, each builtin command documented in this section + as accepting options preceded by -- accepts ---- to signify the end of the + options. The ::, ttrruuee, ffaallssee, and tteesstt builtins do not accept options + and do not treat ---- specially. The eexxiitt, llooggoouutt, bbrreeaakk, ccoonnttiinnuuee, lleett, + and sshhiifftt builtins accept and process arguments beginning with -- with- + out requiring ----. Other builtins that accept arguments but are not + specified as accepting options interpret arguments beginning with -- as + invalid options and require ---- to prevent this interpretation. + :: [_a_r_g_u_m_e_n_t_s] + No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s + and performing any specified redirections. A zero exit code is + returned. + + .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + Read and execute commands from _f_i_l_e_n_a_m_e in the current shell + environment and return the exit status of the last command exe- + cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, file + names in PPAATTHH are used to find the directory containing _f_i_l_e_- + _n_a_m_e. The file searched for in PPAATTHH need not be executable. + When bbaasshh is not in _p_o_s_i_x _m_o_d_e, the current directory is + searched if no file is found in PPAATTHH. If the ssoouurrcceeppaatthh option + to the sshhoopptt builtin command is turned off, the PPAATTHH is not + searched. If any _a_r_g_u_m_e_n_t_s are supplied, they become the posi- + tional parameters when _f_i_l_e_n_a_m_e is executed. Otherwise the + positional parameters are unchanged. The return status is the + status of the last command exited within the script (0 if no + commands are executed), and false if _f_i_l_e_n_a_m_e is not found or + cannot be read. + + aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + AAlliiaass with no arguments or with the --pp option prints the list of + aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When + arguments are supplied, an alias is defined for each _n_a_m_e whose + _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word + to be checked for alias substitution when the alias is expanded. + For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- + plied, the name and value of the alias is printed. AAlliiaass + returns true unless a _n_a_m_e is given for which no alias has been + defined. + + bbgg [_j_o_b_s_p_e_c ...] + Resume each suspended job _j_o_b_s_p_e_c in the background, as if it + had been started with &&. If _j_o_b_s_p_e_c is not present, the shell's + notion of the _c_u_r_r_e_n_t _j_o_b is used. bbgg _j_o_b_s_p_e_c returns 0 unless + run when job control is disabled or, when run with job control + enabled, any specified _j_o_b_s_p_e_c was not found or was started + without job control. + + bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVV] + bbiinndd [--mm _k_e_y_m_a_p] [--qq _f_u_n_c_t_i_o_n] [--uu _f_u_n_c_t_i_o_n] [--rr _k_e_y_s_e_q] + bbiinndd [--mm _k_e_y_m_a_p] --ff _f_i_l_e_n_a_m_e + bbiinndd [--mm _k_e_y_m_a_p] --xx _k_e_y_s_e_q:_s_h_e_l_l_-_c_o_m_m_a_n_d + bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_f_u_n_c_t_i_o_n_-_n_a_m_e + bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee + variable. Each non-option argument is a command as it would + appear in _._i_n_p_u_t_r_c, but each binding or command must be passed + as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'. + Options, if supplied, have the following meanings: + --mm _k_e_y_m_a_p + Use _k_e_y_m_a_p as the keymap to be affected by the subsequent + bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_- + _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, + and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. + --ll List the names of all rreeaaddlliinnee functions. + --pp Display rreeaaddlliinnee function names and bindings in such a + way that they can be re-read. + --PP List current rreeaaddlliinnee function names and bindings. + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be re- + read. + --SS Display rreeaaddlliinnee key sequences bound to macros and the + strings they output. + --vv Display rreeaaddlliinnee variable names and values in such a way + that they can be re-read. + --VV List current rreeaaddlliinnee variable names and values. + --ff _f_i_l_e_n_a_m_e + Read key bindings from _f_i_l_e_n_a_m_e. + --qq _f_u_n_c_t_i_o_n + Query about which keys invoke the named _f_u_n_c_t_i_o_n. + --uu _f_u_n_c_t_i_o_n + Unbind all keys bound to the named _f_u_n_c_t_i_o_n. + --rr _k_e_y_s_e_q + Remove any current binding for _k_e_y_s_e_q. + --xx _k_e_y_s_e_q::_s_h_e_l_l_-_c_o_m_m_a_n_d + Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is + entered. When _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets + the RREEAADDLLIINNEE__LLIINNEE variable to the contents of the rreeaadd-- + lliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT variable to the + current location of the insertion point. If the executed + command changes the value of RREEAADDLLIINNEE__LLIINNEE or RREEAADD-- + LLIINNEE__PPOOIINNTT, those new values will be reflected in the + editing state. + + The return value is 0 unless an unrecognized option is given or + an error occurred. + + bbrreeaakk [_n] + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are + exited. The return value is 0 unless _n is not greater than or + equal to 1. + + bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] + Execute the specified shell builtin, passing it _a_r_g_u_m_e_n_t_s, and + return its exit status. This is useful when defining a function + whose name is the same as a shell builtin, retaining the func- + tionality of the builtin within the function. The ccdd builtin is + commonly redefined this way. The return status is false if + _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command. + + ccaalllleerr [_e_x_p_r] + Returns the context of any active subroutine call (a shell func- + tion or a script executed with the .. or ssoouurrccee builtins. With- + out _e_x_p_r, ccaalllleerr displays the line number and source filename of + the current subroutine call. If a non-negative integer is sup- + plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, + and source file corresponding to that position in the current + execution call stack. This extra information may be used, for + example, to print a stack trace. The current frame is frame 0. + The return value is 0 unless the shell is not executing a sub- + routine call or _e_x_p_r does not correspond to a valid position in + the call stack. + + ccdd [--LL||--PP] [_d_i_r] + Change the current directory to _d_i_r. The variable HHOOMMEE is the + default _d_i_r. The variable CCDDPPAATTHH defines the search path for + the directory containing _d_i_r. Alternative directory names in + CCDDPPAATTHH are separated by a colon (:). A null directory name in + CCDDPPAATTHH is the same as the current directory, i.e., ``..''. If + _d_i_r begins with a slash (/), then CCDDPPAATTHH is not used. The --PP + option says to use the physical directory structure instead of + following symbolic links (see also the --PP option to the sseett + builtin command); the --LL option forces symbolic links to be fol- + lowed. An argument of -- is equivalent to $$OOLLDDPPWWDD. If a non- + empty directory name from CCDDPPAATTHH is used, or if -- is the first + argument, and the directory change is successful, the absolute + pathname of the new working directory is written to the standard + output. The return value is true if the directory was success- + fully changed; false otherwise. + + ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] + Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function + lookup. Only builtin commands or commands found in the PPAATTHH are + executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is + performed using a default value for PPAATTHH that is guaranteed to + find all of the standard utilities. If either the --VV or --vv + option is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or file name + used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a + more verbose description. If the --VV or --vv option is supplied, + the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If + neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- + not be found, the exit status is 127. Otherwise, the exit sta- + tus of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d. + + ccoommppggeenn [_o_p_t_i_o_n] [_w_o_r_d] + Generate possible completion matches for _w_o_r_d according to the + _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee + builtin with the exception of --pp and --rr, and write the matches + to the standard output. When using the --FF or --CC options, the + various shell variables set by the programmable completion + facilities, while available, will not have useful values. + + The matches will be generated in the same way as if the pro- + grammable completion code had generated them directly from a + completion specification with the same flags. If _w_o_r_d is speci- + fied, only those completions matching _w_o_r_d will be displayed. + + The return value is true unless an invalid option is supplied, + or no matches were generated. + + ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEE] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_- + _p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] + [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.] + ccoommpplleettee --pprr [--DDEE] [_n_a_m_e ...] + Specify how arguments to each _n_a_m_e should be completed. If the + --pp option is supplied, or if no options are supplied, existing + completion specifications are printed in a way that allows them + to be reused as input. The --rr option removes a completion spec- + ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- + pletion specifications. The --DD option indicates that the + remaining options and actions should apply to the ``default'' + command completion; that is, completion attempted on a command + for which no completion has previously been defined. The --EE + option indicates that the remaining options and actions should + apply to ``empty'' command completion; that is, completion + attempted on a blank line. + + The process of applying these completion specifications when + word completion is attempted is described above under PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn. + + Other options, if specified, have the following meanings. The + arguments to the --GG, --WW, and --XX options (and, if necessary, the + --PP and --SS options) should be quoted to protect them from expan- + sion before the ccoommpplleettee builtin is invoked. + --oo _c_o_m_p_-_o_p_t_i_o_n + The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- + spec's behavior beyond the simple generation of comple- + tions. _c_o_m_p_-_o_p_t_i_o_n may be one of: + bbaasshhddeeffaauulltt + Perform the rest of the default bbaasshh completions + if the compspec generates no matches. + ddeeffaauulltt Use readline's default filename completion if + the compspec generates no matches. + ddiirrnnaammeess + Perform directory name completion if the comp- + spec generates no matches. + ffiilleennaammeess + Tell readline that the compspec generates file- + names, so it can perform any filename-specific + processing (like adding a slash to directory + names, quoting special characters, or suppress- + ing trailing spaces). Intended to be used with + shell functions. + nnoossppaaccee Tell readline not to append a space (the + default) to words completed at the end of the + line. + pplluussddiirrss + After any matches defined by the compspec are + generated, directory name completion is + attempted and any matches are added to the + results of the other actions. + --AA _a_c_t_i_o_n + The _a_c_t_i_o_n may be one of the following to generate a + list of possible completions: + aalliiaass Alias names. May also be specified as --aa. + aarrrraayyvvaarr + Array variable names. + bbiinnddiinngg RReeaaddlliinnee key binding names. + bbuuiillttiinn Names of shell builtin commands. May also be + specified as --bb. + ccoommmmaanndd Command names. May also be specified as --cc. + ddiirreeccttoorryy + Directory names. May also be specified as --dd. + ddiissaabblleedd + Names of disabled shell builtins. + eennaabblleedd Names of enabled shell builtins. + eexxppoorrtt Names of exported shell variables. May also be + specified as --ee. + ffiillee File names. May also be specified as --ff. + ffuunnccttiioonn + Names of shell functions. + ggrroouupp Group names. May also be specified as --gg. + hheellppttooppiicc + Help topics as accepted by the hheellpp builtin. + hhoossttnnaammee + Hostnames, as taken from the file specified by + the HHOOSSTTFFIILLEE shell variable. + jjoobb Job names, if job control is active. May also + be specified as --jj. + kkeeyywwoorrdd Shell reserved words. May also be specified as + --kk. + rruunnnniinngg Names of running jobs, if job control is active. + sseerrvviiccee Service names. May also be specified as --ss. + sseettoopptt Valid arguments for the --oo option to the sseett + builtin. + sshhoopptt Shell option names as accepted by the sshhoopptt + builtin. + ssiiggnnaall Signal names. + ssttooppppeedd Names of stopped jobs, if job control is active. + uusseerr User names. May also be specified as --uu. + vvaarriiaabbllee + Names of all shell variables. May also be spec- + ified as --vv. + --GG _g_l_o_b_p_a_t + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + generate the possible completions. + --WW _w_o_r_d_l_i_s_t + The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS + special variable as delimiters, and each resultant word + is expanded. The possible completions are the members + of the resultant list which match the word being com- + pleted. + --CC _c_o_m_m_a_n_d + _c_o_m_m_a_n_d is executed in a subshell environment, and its + output is used as the possible completions. + --FF _f_u_n_c_t_i_o_n + The shell function _f_u_n_c_t_i_o_n is executed in the current + shell environment. When it finishes, the possible com- + pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY + array variable. + --XX _f_i_l_t_e_r_p_a_t + _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. + It is applied to the list of possible completions gener- + ated by the preceding options and arguments, and each + completion matching _f_i_l_t_e_r_p_a_t is removed from the list. + A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this + case, any completion not matching _f_i_l_t_e_r_p_a_t is removed. + --PP _p_r_e_f_i_x + _p_r_e_f_i_x is added at the beginning of each possible com- + pletion after all other options have been applied. + --SS _s_u_f_f_i_x + _s_u_f_f_i_x is appended to each possible completion after all + other options have been applied. + + The return value is true unless an invalid option is supplied, + an option other than --pp or --rr is supplied without a _n_a_m_e argu- + ment, an attempt is made to remove a completion specification + for a _n_a_m_e for which no specification exists, or an error occurs + adding a completion specification. + + ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEE] [++oo _o_p_t_i_o_n] [_n_a_m_e] + Modify completion options for each _n_a_m_e according to the + _o_p_t_i_o_ns, or for the currently-execution completion if no _n_a_m_es + are supplied. If no _o_p_t_i_o_ns are given, display the completion + options for each _n_a_m_e or the current completion. The possible + values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin + described above. The --DD option indicates that the remaining + options should apply to the ``default'' command completion; that + is, completion attempted on a command for which no completion + has previously been defined. The --EE option indicates that the + remaining options should apply to ``empty'' command completion; + that is, completion attempted on a blank line. + + The return value is true unless an invalid option is supplied, an + attempt is made to modify the options for a _n_a_m_e for which no comple- + tion specification exists, or an output error occurs. + + ccoonnttiinnuuee [_n] + Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of + enclosing loops, the last enclosing loop (the ``top-level'' + loop) is resumed. The return value is 0 unless _n is not greater + than or equal to 1. + + ddeeccllaarree [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + ttyyppeesseett [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. The --pp option will + display the attributes and values of each _n_a_m_e. When --pp is used + with _n_a_m_e arguments, additional options are ignored. When --pp is + supplied without _n_a_m_e arguments, it will display the attributes + and values of all variables having the attributes specified by + the additional options. If no other options are supplied with + --pp, ddeeccllaarree will display the attributes and values of all shell + variables. The --ff option will restrict the display to shell + functions. The --FF option inhibits the display of function defi- + nitions; only the function name and attributes are printed. If + the eexxttddeebbuugg shell option is enabled using sshhoopptt, the source + file name and line number where the function is defined are dis- + played as well. The --FF option implies --ff. The following + options can be used to restrict output to variables with the + specified attribute or to give variables attributes: + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss + above). + --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss + above). + --ff Use function names only. + --ii The variable is treated as an integer; arithmetic evalua- + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above) is performed when + the variable is assigned a value. + --ll When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case + attribute is disabled. + --rr Make _n_a_m_es readonly. These names cannot then be assigned + values by subsequent assignment statements or unset. + --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions + inherit the DDEEBBUUGG and RREETTUURRNN traps from the calling + shell. The trace attribute has no special meaning for + variables. + --uu When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case + attribute is disabled. + --xx Mark _n_a_m_es for export to subsequent commands via the + environment. + + Using `+' instead of `-' turns off the attribute instead, with + the exceptions that ++aa may not be used to destroy an array vari- + able and ++rr will not remove the readonly attribute. When used + in a function, makes each _n_a_m_e local, as with the llooccaall command. + If a variable name is followed by =_v_a_l_u_e, the value of the vari- + able is set to _v_a_l_u_e. The return value is 0 unless an invalid + option is encountered, an attempt is made to define a function + using ``-f foo=bar'', an attempt is made to assign a value to a + readonly variable, an attempt is made to assign a value to an + array variable without using the compound assignment syntax (see + AArrrraayyss above), one of the _n_a_m_e_s is not a valid shell variable + name, an attempt is made to turn off readonly status for a read- + only variable, an attempt is made to turn off array status for + an array variable, or an attempt is made to display a non-exis- + tent function with --ff. + + ddiirrss [[++_n]] [[--_n]] [[--ccppllvv]] + Without options, displays the list of currently remembered + directories. The default display is on a single line with + directory names separated by spaces. Directories are added to + the list with the ppuusshhdd command; the ppooppdd command removes + entries from the list. + ++_n Displays the _nth entry counting from the left of the list + shown by ddiirrss when invoked without options, starting with + zero. + --_n Displays the _nth entry counting from the right of the + list shown by ddiirrss when invoked without options, starting + with zero. + --cc Clears the directory stack by deleting all of the + entries. + --ll Produces a longer listing; the default listing format + uses a tilde to denote the home directory. + --pp Print the directory stack with one entry per line. + --vv Print the directory stack with one entry per line, pre- + fixing each entry with its index in the stack. + + The return value is 0 unless an invalid option is supplied or _n + indexes beyond the end of the directory stack. + + ddiissoowwnn [--aarr] [--hh] [_j_o_b_s_p_e_c ...] + Without options, each _j_o_b_s_p_e_c is removed from the table of + active jobs. If _j_o_b_s_p_e_c is not present, and neither --aa nor --rr + is supplied, the shell's notion of the _c_u_r_r_e_n_t _j_o_b is used. If + the --hh option is given, each _j_o_b_s_p_e_c is not removed from the ta- + ble, but is marked so that SSIIGGHHUUPP is not sent to the job if the + shell receives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is present, and neither + the --aa nor the --rr option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. + If no _j_o_b_s_p_e_c is supplied, the --aa option means to remove or mark + all jobs; the --rr option without a _j_o_b_s_p_e_c argument restricts + operation to running jobs. The return value is 0 unless a _j_o_b_- + _s_p_e_c does not specify a valid job. + + eecchhoo [--nneeEE] [_a_r_g ...] + Output the _a_r_gs, separated by spaces, followed by a newline. + The return status is always 0. If --nn is specified, the trailing + newline is suppressed. If the --ee option is given, interpreta- + tion of the following backslash-escaped characters is enabled. + The --EE option disables the interpretation of these escape char- + acters, even on systems where they are interpreted by default. + The xxppgg__eecchhoo shell option may be used to dynamically determine + whether or not eecchhoo expands these escape characters by default. + eecchhoo does not interpret ---- to mean the end of options. eecchhoo + interprets the following escape sequences: + \\aa alert (bell) + \\bb backspace + \\cc suppress further output + \\ee an escape character + \\ff form feed + \\nn new line + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\\\ backslash + \\00_n_n_n the eight-bit character whose value is the octal value + _n_n_n (zero to three octal digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + + eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...] + Enable and disable builtin shell commands. Disabling a builtin + allows a disk command which has the same name as a shell builtin + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are + enabled. For example, to use the tteesstt binary found via the PPAATTHH + instead of the shell builtin version, run ``enable -n test''. + The --ff option means to load the new builtin command _n_a_m_e from + shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading. + The --dd option will delete a builtin previously loaded with --ff. + If no _n_a_m_e arguments are given, or if the --pp option is supplied, + a list of shell builtins is printed. With no other option argu- + ments, the list consists of all enabled shell builtins. If --nn + is supplied, only disabled builtins are printed. If --aa is sup- + plied, the list printed includes all builtins, with an indica- + tion of whether or not each is enabled. If --ss is supplied, the + output is restricted to the POSIX _s_p_e_c_i_a_l builtins. The return + value is 0 unless a _n_a_m_e is not a shell builtin or there is an + error loading a new builtin from a shared object. + + eevvaall [_a_r_g ...] + The _a_r_gs are read and concatenated together into a single com- + mand. This command is then read and executed by the shell, and + its exit status is returned as the value of eevvaall. If there are + no _a_r_g_s, or only null arguments, eevvaall returns 0. + + eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]] + If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process + is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If + the --ll option is supplied, the shell places a dash at the begin- + ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what + _l_o_g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with + an empty environment. If --aa is supplied, the shell passes _n_a_m_e + as the zeroth argument to the executed command. If _c_o_m_m_a_n_d can- + not be executed for some reason, a non-interactive shell exits, + unless the shell option eexxeeccffaaiill is enabled, in which case it + returns failure. An interactive shell returns failure if the + file cannot be executed. If _c_o_m_m_a_n_d is not specified, any redi- + rections take effect in the current shell, and the return status + is 0. If there is a redirection error, the return status is 1. + + eexxiitt [_n] + Cause the shell to exit with a status of _n. If _n is omitted, + the exit status is that of the last command executed. A trap on + EEXXIITT is executed before the shell terminates. + + eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ... + eexxppoorrtt --pp + The supplied _n_a_m_e_s are marked for automatic export to the envi- + ronment of subsequently executed commands. If the --ff option is + given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or + if the --pp option is supplied, a list of all names that are + exported in this shell is printed. The --nn option causes the + export property to be removed from each _n_a_m_e. If a variable + name is followed by =_w_o_r_d, the value of the variable is set to + _w_o_r_d. eexxppoorrtt returns an exit status of 0 unless an invalid + option is encountered, one of the _n_a_m_e_s is not a valid shell + variable name, or --ff is supplied with a _n_a_m_e that is not a func- + tion. + + ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t] + ffcc --ss [_p_a_t=_r_e_p] [_c_m_d] + Fix Command. In the first form, a range of commands from _f_i_r_s_t + to _l_a_s_t is selected from the history list. _F_i_r_s_t and _l_a_s_t may + be specified as a string (to locate the last command beginning + with that string) or as a number (an index into the history + list, where a negative number is used as an offset from the cur- + rent command number). If _l_a_s_t is not specified it is set to the + current command for listing (so that ``fc -l -10'' prints the + last 10 commands) and to _f_i_r_s_t otherwise. If _f_i_r_s_t is not spec- + ified it is set to the previous command for editing and -16 for + listing. + + The --nn option suppresses the command numbers when listing. The + --rr option reverses the order of the commands. If the --ll option + is given, the commands are listed on standard output. Other- + wise, the editor given by _e_n_a_m_e is invoked on a file containing + those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT + variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. + If neither variable is set, _v_i is used. When editing is com- + plete, the edited commands are echoed and executed. + + In the second form, _c_o_m_m_a_n_d is re-executed after each instance + of _p_a_t is replaced by _r_e_p. A useful alias to use with this is + ``r="fc -s"'', so that typing ``r cc'' runs the last command + beginning with ``cc'' and typing ``r'' re-executes the last com- + mand. + + If the first form is used, the return value is 0 unless an + invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history + lines out of range. If the --ee option is supplied, the return + value is the value of the last command executed or failure if an + error occurs with the temporary file of commands. If the second + form is used, the return status is that of the command re-exe- + cuted, unless _c_m_d does not specify a valid history line, in + which case ffcc returns failure. + + ffgg [_j_o_b_s_p_e_c] + Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. + If _j_o_b_s_p_e_c is not present, the shell's notion of the _c_u_r_r_e_n_t _j_o_b + is used. The return value is that of the command placed into + the foreground, or failure if run when job control is disabled + or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec- + ify a valid job or _j_o_b_s_p_e_c specifies a job that was started + without job control. + + ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g_s] + ggeettooppttss is used by shell procedures to parse positional parame- + ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- + nized; if a character is followed by a colon, the option is + expected to have an argument, which should be separated from it + by white space. The colon and question mark characters may not + be used as option characters. Each time it is invoked, ggeettooppttss + places the next option in the shell variable _n_a_m_e, initializing + _n_a_m_e if it does not exist, and the index of the next argument to + be processed into the variable OOPPTTIINNDD. OOPPTTIINNDD is initialized to + 1 each time the shell or a shell script is invoked. When an + option requires an argument, ggeettooppttss places that argument into + the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automati- + cally; it must be manually reset between multiple calls to + ggeettooppttss within the same shell invocation if a new set of parame- + ters is to be used. + + When the end of options is encountered, ggeettooppttss exits with a + return value greater than zero. OOPPTTIINNDD is set to the index of + the first non-option argument, and nnaammee is set to ?. + + ggeettooppttss normally parses the positional parameters, but if more + arguments are given in _a_r_g_s, ggeettooppttss parses those instead. + + ggeettooppttss can report errors in two ways. If the first character + of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In + normal operation diagnostic messages are printed when invalid + options or missing option arguments are encountered. If the + variable OOPPTTEERRRR is set to 0, no error messages will be dis- + played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. + + If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if + not silent, prints an error message and unsets OOPPTTAARRGG. If + ggeettooppttss is silent, the option character found is placed in + OOPPTTAARRGG and no diagnostic message is printed. + + If a required argument is not found, and ggeettooppttss is not silent, + a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a + diagnostic message is printed. If ggeettooppttss is silent, then a + colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option + character found. + + ggeettooppttss returns true if an option, specified or unspecified, is + found. It returns false if the end of options is encountered or + an error occurs. + + hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e] + For each _n_a_m_e, the full file name of the command is determined + by searching the directories in $$PPAATTHH and remembered. If the --pp + option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e is + used as the full file name of the command. The --rr option causes + the shell to forget all remembered locations. The --dd option + causes the shell to forget the remembered location of each _n_a_m_e. + If the --tt option is supplied, the full pathname to which each + _n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are + supplied with --tt, the _n_a_m_e is printed before the hashed full + pathname. The --ll option causes output to be displayed in a for- + mat that may be reused as input. If no arguments are given, or + if only --ll is supplied, information about remembered commands is + printed. The return status is true unless a _n_a_m_e is not found + or an invalid option is supplied. + + hheellpp [--ddmmss] [_p_a_t_t_e_r_n] + Display helpful information about builtin commands. If _p_a_t_t_e_r_n + is specified, hheellpp gives detailed help on all commands matching + _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control + structures is printed. + --dd Display a short description of each _p_a_t_t_e_r_n + --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like + format + --ss Display only a short usage synopsis for each _p_a_t_t_e_r_n + The return status is 0 unless no command matches _p_a_t_t_e_r_n. + + hhiissttoorryy [[_n]] + hhiissttoorryy --cc + hhiissttoorryy --dd _o_f_f_s_e_t + hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e] + hhiissttoorryy --pp _a_r_g [_a_r_g _._._.] + hhiissttoorryy --ss _a_r_g [_a_r_g _._._.] + With no options, display the command history list with line num- + bers. Lines listed with a ** have been modified. An argument of + _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. No intervening blank is printed between + the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is + supplied, it is used as the name of the history file; if not, + the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the + following meanings: + --cc Clear the history list by deleting all the entries. + --dd _o_f_f_s_e_t + Delete the history entry at position _o_f_f_s_e_t. + --aa Append the ``new'' history lines (history lines entered + since the beginning of the current bbaasshh session) to the + history file. + --nn Read the history lines not already read from the history + file into the current history list. These are lines + appended to the history file since the beginning of the + current bbaasshh session. + --rr Read the contents of the history file and use them as the + current history. + --ww Write the current history to the history file, overwrit- + ing the history file's contents. + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output. Does not + store the results in the history list. Each _a_r_g must be + quoted to disable normal history expansion. + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before + the _a_r_g_s are added. + + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- + tion associated with each history entry is written to the his- + tory file, marked with the history comment character. When the + history file is read, lines beginning with the history comment + character followed immediately by a digit are interpreted as + timestamps for the previous history line. The return value is 0 + unless an invalid option is encountered, an error occurs while + reading or writing the history file, an invalid _o_f_f_s_e_t is sup- + plied as an argument to --dd, or the history expansion supplied as + an argument to --pp fails. + + jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ] + jjoobbss --xx _c_o_m_m_a_n_d [ _a_r_g_s ... ] + The first form lists the active jobs. The options have the fol- + lowing meanings: + --ll List process IDs in addition to the normal information. + --pp List only the process ID of the job's process group + leader. + --nn Display information only about jobs that have changed + status since the user was last notified of their status. + --rr Restrict output to running jobs. + --ss Restrict output to stopped jobs. + + If _j_o_b_s_p_e_c is given, output is restricted to information about + that job. The return status is 0 unless an invalid option is + encountered or an invalid _j_o_b_s_p_e_c is supplied. + + If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in + _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and + executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status. + + kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ... + kkiillll --ll [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] + Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive + signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or + a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not + present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the + signal names. If any arguments are supplied when --ll is given, + the names of the signals corresponding to the arguments are + listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. kkiillll returns true + if at least one signal was successfully sent, or false if an + error occurs or an invalid option is encountered. + + lleett _a_r_g [_a_r_g ...] + Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- + MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett + returns 1; 0 is returned otherwise. + + llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ...] + For each argument, a local variable named _n_a_m_e is created, and + assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted + by ddeeccllaarree. When llooccaall is used within a function, it causes the + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. With no operands, llooccaall writes a list of + local variables to the standard output. It is an error to use + llooccaall when not within a function. The return status is 0 unless + llooccaall is used outside a function, an invalid _n_a_m_e is supplied, + or _n_a_m_e is a readonly variable. + + llooggoouutt Exit a login shell. + + mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + Read lines from the standard input into the indexed array vari- + able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- + plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + supplied, have the following meanings: + --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are + copied. + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + index is 0. + --ss Discard the first _c_o_u_n_t lines read. + --tt Remove a trailing newline from each line read. + --uu Read lines from file descriptor _f_d instead of the stan- + dard input. + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --cc option specifies _q_u_a_n_t_u_m. + --cc Specify the number of lines read between each call to + _c_a_l_l_b_a_c_k. + + If --CC is specified without --cc, the default quantum is 5000. + When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next + array element to be assigned as an additional argument. _c_a_l_l_- + _b_a_c_k is evaluated after the line is read but before the array + element is assigned. + + If not supplied with an explicit origin, mmaappffiillee will clear + _a_r_r_a_y before assigning to it. + + mmaappffiillee returns successfully unless an invalid option or option + argument is supplied, _a_r_r_a_y is invalid or unassignable, or if + _a_r_r_a_y is not an indexed array. + + ppooppdd [-nn] [+_n] [-_n] + Removes entries from the directory stack. With no arguments, + removes the top directory from the stack, and performs a ccdd to + the new top directory. Arguments, if supplied, have the follow- + ing meanings: + --nn Suppresses the normal change of directory when removing + directories from the stack, so that only the stack is + manipulated. + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero. For example: ``popd + +0'' removes the first directory, ``popd +1'' the second. + --_n Removes the _nth entry counting from the right of the list + shown by ddiirrss, starting with zero. For example: ``popd + -0'' removes the last directory, ``popd -1'' the next to + last. + + If the ppooppdd command is successful, a ddiirrss is performed as well, + and the return status is 0. ppooppdd returns false if an invalid + option is encountered, the directory stack is empty, a non-exis- + tent directory stack entry is specified, or the directory change + fails. + + pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which + contains three types of objects: plain characters, which are + simply copied to standard output, character escape sequences, + which are converted and copied to the standard output, and for- + mat specifications, each of which causes printing of the next + successive _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(1) for- + mats, %%bb causes pprriinnttff to expand backslash escape sequences in + the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output, + backslashes in \\'', \\"", and \\?? are not removed, and octal escapes + beginning with \\00 may contain up to four digits), and %%qq causes + pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a format that can + be reused as shell input. + + The --vv option causes the output to be assigned to the variable + _v_a_r rather than being printed to the standard output. + + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, + the extra format specifications behave as if a zero value or + null string, as appropriate, had been supplied. The return + value is zero on success, non-zero on failure. + + ppuusshhdd [--nn] [+_n] [-_n] + ppuusshhdd [--nn] [_d_i_r] + Adds a directory to the top of the directory stack, or rotates + the stack, making the new top of the stack the current working + directory. With no arguments, exchanges the top two directories + and returns 0, unless the directory stack is empty. Arguments, + if supplied, have the following meanings: + --nn Suppresses the normal change of directory when adding + directories to the stack, so that only the stack is + manipulated. + ++_n Rotates the stack so that the _nth directory (counting + from the left of the list shown by ddiirrss, starting with + zero) is at the top. + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with + zero) is at the top. + _d_i_r Adds _d_i_r to the directory stack at the top, making it the + new current working directory. + + If the ppuusshhdd command is successful, a ddiirrss is performed as well. + If the first form is used, ppuusshhdd returns 0 unless the cd to _d_i_r + fails. With the second form, ppuusshhdd returns 0 unless the direc- + tory stack is empty, a non-existent directory stack element is + specified, or the directory change to the specified new current + directory fails. + + ppwwdd [--LLPP] + Print the absolute pathname of the current working directory. + The pathname printed contains no symbolic links if the --PP option + is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command + is enabled. If the --LL option is used, the pathname printed may + contain symbolic links. The return status is 0 unless an error + occurs while reading the name of the current directory or an + invalid option is supplied. + + rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp + _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] + One line is read from the standard input, or from the file + descriptor _f_d supplied as an argument to the --uu option, and the + first word is assigned to the first _n_a_m_e, the second word to the + second _n_a_m_e, and so on, with leftover words and their interven- + ing separators assigned to the last _n_a_m_e. If there are fewer + words read from the input stream than names, the remaining names + are assigned empty values. The characters in IIFFSS are used to + split the line into words. The backslash character (\\) may be + used to remove any special meaning for the next character read + and for line continuation. Options, if supplied, have the fol- + lowing meanings: + --aa _a_n_a_m_e + The words are assigned to sequential indices of the array + variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any + new values are assigned. Other _n_a_m_e arguments are + ignored. + --dd _d_e_l_i_m + The first character of _d_e_l_i_m is used to terminate the + input line, rather than newline. + --ee If the standard input is coming from a terminal, rreeaaddlliinnee + (see RREEAADDLLIINNEE above) is used to obtain the line. Read- + line uses the current (or default, if line editing was + not previously active) editing settings. + --ii _t_e_x_t + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + placed into the editing buffer before editing begins. + --nn _n_c_h_a_r_s + rreeaadd returns after reading _n_c_h_a_r_s characters rather than + waiting for a complete line of input, but honor a delim- + iter if fewer than _n_c_h_a_r_s characters are read before the + delimiter. + --NN _n_c_h_a_r_s + rreeaadd returns after reading exactly _n_c_h_a_r_s characters + rather than waiting for a complete line of input, unless + EOF is encountered or rreeaadd times out. Delimiter charac- + ters encountered in the input are not treated specially + and do not cause rreeaadd to return until _n_c_h_a_r_s characters + are read. + --pp _p_r_o_m_p_t + Display _p_r_o_m_p_t on standard error, without a trailing new- + line, before attempting to read any input. The prompt is + displayed only if input is coming from a terminal. + --rr Backslash does not act as an escape character. The back- + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not be used as a line + continuation. + --ss Silent mode. If input is coming from a terminal, charac- + ters are not echoed. + --tt _t_i_m_e_o_u_t + Cause rreeaadd to time out and return failure if a complete + line of input is not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_- + _o_u_t may be a decimal number with a fractional portion + following the decimal point. This option is only effec- + tive if rreeaadd is reading input from a terminal, pipe, or + other special file; it has no effect when reading from + regular files. If _t_i_m_e_o_u_t is 0, rreeaadd returns success if + input is available on the specified file descriptor, + failure otherwise. The exit status is greater than 128 + if the timeout is exceeded. + --uu _f_d Read input from file descriptor _f_d. + + If no _n_a_m_e_s are supplied, the line read is assigned to the vari- + able RREEPPLLYY. The return code is zero, unless end-of-file is + encountered, rreeaadd times out (in which case the return code is + greater than 128), or an invalid file descriptor is supplied as + the argument to --uu. + + rreeaaddoonnllyy [--aaAAppff] [_n_a_m_e[=_w_o_r_d] ...] + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + may not be changed by subsequent assignment. If the --ff option + is supplied, the functions corresponding to the _n_a_m_e_s are so + marked. The --aa option restricts the variables to indexed + arrays; the --AA option restricts the variables to associative + arrays. If no _n_a_m_e arguments are given, or if the --pp option is + supplied, a list of all readonly names is printed. The --pp + option causes output to be displayed in a format that may be + reused as input. If a variable name is followed by =_w_o_r_d, the + value of the variable is set to _w_o_r_d. The return status is 0 + unless an invalid option is encountered, one of the _n_a_m_e_s is not + a valid shell variable name, or --ff is supplied with a _n_a_m_e that + is not a function. + + rreettuurrnn [_n] + Causes a function to exit with the return value specified by _n. + If _n is omitted, the return status is that of the last command + executed in the function body. If used outside a function, but + during execution of a script by the .. (ssoouurrccee) command, it + causes the shell to stop executing that script and return either + _n or the exit status of the last command executed within the + script as the exit status of the script. If used outside a + function and not during execution of a script by .., the return + status is false. Any command associated with the RREETTUURRNN trap is + executed before execution resumes after the function or script. + + sseett [----aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n] [_a_r_g ...] + sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n] [_a_r_g ...] + Without options, the name and value of each shell variable are + displayed in a format that can be reused as input for setting or + resetting the currently-set variables. Read-only variables can- + not be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. + The output is sorted according to the current locale. When + options are specified, they set or unset shell attributes. Any + arguments remaining after option processing are treated as val- + ues for the positional parameters and are assigned, in order, to + $$11, $$22, ...... $$_n. Options, if specified, have the following + meanings: + --aa Automatically mark variables and functions which are + modified or created for export to the environment of + subsequent commands. + --bb Report the status of terminated background jobs immedi- + ately, rather than before the next primary prompt. This + is effective only when job control is enabled. + --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a + single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _s_u_b_s_h_e_l_l command enclosed in + parentheses, or one of the commands executed as part of + a command list enclosed by braces (see SSHHEELLLL GGRRAAMMMMAARR + above) exits with a non-zero status. The shell does not + exit if the command that fails is part of the command + list immediately following a wwhhiillee or uunnttiill keyword, + part of the test following the iiff or eelliiff reserved + words, part of any command executed in a &&&& or |||| list + except the command following the final &&&& or ||||, any + command in a pipeline but the last, or if the command's + return value is being inverted with !!. A trap on EERRRR, + if set, is executed before the shell exits. This option + applies to the shell environment and each subshell envi- + ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + above), and may cause subshells to exit before executing + all the commands in the subshell. + --ff Disable pathname expansion. + --hh Remember the location of commands as they are looked up + for execution. This is enabled by default. + --kk All arguments in the form of assignment statements are + placed in the environment for a command, not just those + that precede the command name. + --mm Monitor mode. Job control is enabled. This option is + on by default for interactive shells on systems that + support it (see JJOOBB CCOONNTTRROOLL above). Background pro- + cesses run in a separate process group and a line con- + taining their exit status is printed upon their comple- + tion. + --nn Read commands but do not execute them. This may be used + to check a shell script for syntax errors. This is + ignored by interactive shells. + --oo _o_p_t_i_o_n_-_n_a_m_e + The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: + aalllleexxppoorrtt + Same as --aa. + bbrraacceeeexxppaanndd + Same as --BB. + eemmaaccss Use an emacs-style command line editing inter- + face. This is enabled by default when the shell + is interactive, unless the shell is started with + the ----nnooeeddiittiinngg option. This also affects the + editing interface used for rreeaadd --ee. + eerrrreexxiitt Same as --ee. + eerrrrttrraaccee + Same as --EE. + ffuunnccttrraaccee + Same as --TT. + hhaasshhaallll Same as --hh. + hhiisstteexxppaanndd + Same as --HH. + hhiissttoorryy Enable command history, as described above under + HHIISSTTOORRYY. This option is on by default in inter- + active shells. + iiggnnoorreeeeooff + The effect is as if the shell command + ``IGNOREEOF=10'' had been executed (see SShheellll + VVaarriiaabblleess above). + kkeeyywwoorrdd Same as --kk. + mmoonniittoorr Same as --mm. + nnoocclloobbbbeerr + Same as --CC. + nnooeexxeecc Same as --nn. + nnoogglloobb Same as --ff. + nnoolloogg Currently ignored. + nnoottiiffyy Same as --bb. + nnoouunnsseett Same as --uu. + oonneeccmmdd Same as --tt. + pphhyyssiiccaall + Same as --PP. + ppiippeeffaaiill + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option + is disabled by default. + ppoossiixx Change the behavior of bbaasshh where the default + operation differs from the POSIX standard to + match the standard (_p_o_s_i_x _m_o_d_e). + pprriivviilleeggeedd + Same as --pp. + vveerrbboossee Same as --vv. + vvii Use a vi-style command line editing interface. + This also affects the editing interface used for + rreeaadd --ee. + xxttrraaccee Same as --xx. + If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, the values of the + current options are printed. If ++oo is supplied with no + _o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the + current option settings is displayed on the standard + output. + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear in the environment, are ignored. If the shell is + started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not sup- + plied, these actions are taken and the effective user id + is set to the real user id. If the --pp option is sup- + plied at startup, the effective user id is not reset. + Turning this option off causes the effective user and + group ids to be set to the real user and group ids. + --tt Exit after reading and executing one command. + --uu Treat unset variables and parameters other than the spe- + cial parameters "@" and "*" as an error when performing + parameter expansion. If expansion is attempted on an + unset variable or parameter, the shell prints an error + message, and, if not interactive, exits with a non-zero + status. + --vv Print shell input lines as they are read. + --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee + command, sseelleecctt command, or arithmetic ffoorr command, dis- + play the expanded value of PPSS44, followed by the command + and its expanded arguments or associated word list. + --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn + above). This is on by default. + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. This may be + overridden when creating output files by using the redi- + rection operator >>|| instead of >>. + --EE If set, any trap on EERRRR is inherited by shell functions, + command substitutions, and commands executed in a sub- + shell environment. The EERRRR trap is normally not inher- + ited in such cases. + --HH Enable !! style history substitution. This option is on + by default when the shell is interactive. + --PP If set, the shell does not follow symbolic links when + executing commands such as ccdd that change the current + working directory. It uses the physical directory + structure instead. By default, bbaasshh follows the logical + chain of directories when performing commands which + change the current directory. + --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by + shell functions, command substitutions, and commands + executed in a subshell environment. The DDEEBBUUGG and + RREETTUURRNN traps are normally not inherited in such cases. + ---- If no arguments follow this option, then the positional + parameters are unset. Otherwise, the positional parame- + ters are set to the _a_r_gs, even if some of them begin + with a --. + -- Signal the end of options, cause all remaining _a_r_gs to + be assigned to the positional parameters. The --xx and --vv + options are turned off. If there are no _a_r_gs, the posi- + tional parameters remain unchanged. + + The options are off by default unless otherwise noted. Using + + rather than - causes these options to be turned off. The + options can also be specified as arguments to an invocation of + the shell. The current set of options may be found in $$--. The + return status is always true unless an invalid option is encoun- + tered. + + sshhiifftt [_n] + The positional parameters from _n+1 ... are renamed to $$11 ........ + Parameters represented by the numbers $$## down to $$##-_n+1 are + unset. _n must be a non-negative number less than or equal to + $$##. If _n is 0, no parameters are changed. If _n is not given, + it is assumed to be 1. If _n is greater than $$##, the positional + parameters are not changed. The return status is greater than + zero if _n is greater than $$## or less than zero; otherwise 0. + + sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...] + Toggle the values of variables controlling optional shell behav- + ior. With no options, or with the --pp option, a list of all set- + table options is displayed, with an indication of whether or not + each is set. The --pp option causes output to be displayed in a + form that may be reused as input. Other options have the fol- + lowing meanings: + --ss Enable (set) each _o_p_t_n_a_m_e. + --uu Disable (unset) each _o_p_t_n_a_m_e. + --qq Suppresses normal output (quiet mode); the return status + indicates whether the _o_p_t_n_a_m_e is set or unset. If multi- + ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- + tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- + wise. + --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for + the --oo option to the sseett builtin. + + If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, the dis- + play is limited to those options which are set or unset, respec- + tively. Unless otherwise noted, the sshhoopptt options are disabled + (unset) by default. + + The return status when listing options is zero if all _o_p_t_n_a_m_e_s + are enabled, non-zero otherwise. When setting or unsetting + options, the return status is zero unless an _o_p_t_n_a_m_e is not a + valid shell option. + + The list of sshhoopptt options is: + + aauuttooccdd If set, a command name that is the name of a directory + is executed as if it were the argument to the ccdd com- + mand. This option is only used by interactive shells. + ccddaabbllee__vvaarrss + If set, an argument to the ccdd builtin command that is + not a directory is assumed to be the name of a variable + whose value is the directory to change to. + ccddssppeellll If set, minor errors in the spelling of a directory com- + ponent in a ccdd command will be corrected. The errors + checked for are transposed characters, a missing charac- + ter, and one character too many. If a correction is + found, the corrected file name is printed, and the com- + mand proceeds. This option is only used by interactive + shells. + cchheecckkhhaasshh + If set, bbaasshh checks that a command found in the hash ta- + ble exists before trying to execute it. If a hashed + command no longer exists, a normal path search is per- + formed. + cchheecckkjjoobbss + If set, bbaasshh lists the status of any stopped and running + jobs before exiting an interactive shell. If any jobs + are running, this causes the exit to be deferred until a + second exit is attempted without an intervening command + (see JJOOBB CCOONNTTRROOLL above). The shell always postpones + exiting if any jobs are stopped. + cchheecckkwwiinnssiizzee + If set, bbaasshh checks the window size after each command + and, if necessary, updates the values of LLIINNEESS and CCOOLL-- + UUMMNNSS. + ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- + line command in the same history entry. This allows + easy re-editing of multi-line commands. + ccoommppaatt3311 + If set, bbaasshh changes its behavior to that of version 3.1 + with respect to quoted arguments to the conditional com- + mand's =~ operator. + ccoommppaatt3322 + If set, bbaasshh changes its behavior to that of version 3.2 + with respect to locale-specific string comparison when + using the conditional command's < and > operators. + ccoommppaatt4400 + If set, bbaasshh changes its behavior to that of version 4.0 + with respect to locale-specific string comparison when + using the conditional command's < and > operators and + the effect of interrupting a command list. + ddiirrssppeellll + If set, bbaasshh attempts spelling correction on directory + names during word completion if the directory name ini- + tially supplied does not exist. + ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in + the results of pathname expansion. + eexxeeccffaaiill + If set, a non-interactive shell will not exit if it can- + not execute the file specified as an argument to the + eexxeecc builtin command. An interactive shell does not + exit if eexxeecc fails. + eexxppaanndd__aalliiaasseess + If set, aliases are expanded as described above under + AALLIIAASSEESS. This option is enabled by default for interac- + tive shells. + eexxttddeebbuugg + If set, behavior intended for use by debuggers is + enabled: + 11.. The --FF option to the ddeeccllaarree builtin displays the + source file name and line number corresponding to + each function name supplied as an argument. + 22.. If the command run by the DDEEBBUUGG trap returns a + non-zero value, the next command is skipped and + not executed. + 33.. If the command run by the DDEEBBUUGG trap returns a + value of 2, and the shell is executing in a sub- + routine (a shell function or a shell script exe- + cuted by the .. or ssoouurrccee builtins), a call to + rreettuurrnn is simulated. + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + in their descriptions above. + 55.. Function tracing is enabled: command substitu- + tion, shell functions, and subshells invoked with + (( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps. + 66.. Error tracing is enabled: command substitution, + shell functions, and subshells invoked with (( + _c_o_m_m_a_n_d )) inherit the EERRRROORR trap. + eexxttgglloobb If set, the extended pattern matching features described + above under PPaatthhnnaammee EExxppaannssiioonn are enabled. + eexxttqquuoottee + If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed + within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double + quotes. This option is enabled by default. + ffaaiillgglloobb + If set, patterns which fail to match filenames during + pathname expansion result in an expansion error. + ffoorrccee__ffiiggnnoorree + If set, the suffixes specified by the FFIIGGNNOORREE shell + variable cause words to be ignored when performing word + completion even if the ignored words are the only possi- + ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a + description of FFIIGGNNOORREE. This option is enabled by + default. + gglloobbssttaarr + If set, the pattern **** used in a pathname expansion con- + text will match a files and zero or more directories and + subdirectories. If the pattern is followed by a //, only + directories and subdirectories match. + ggnnuu__eerrrrffmmtt + If set, shell error messages are written in the standard + GNU error message format. + hhiissttaappppeenndd + If set, the history list is appended to the file named + by the value of the HHIISSTTFFIILLEE variable when the shell + exits, rather than overwriting the file. + hhiissttrreeeeddiitt + If set, and rreeaaddlliinnee is being used, a user is given the + opportunity to re-edit a failed history substitution. + hhiissttvveerriiffyy + If set, and rreeaaddlliinnee is being used, the results of his- + tory substitution are not immediately passed to the + shell parser. Instead, the resulting line is loaded + into the rreeaaddlliinnee editing buffer, allowing further modi- + fication. + hhoossttccoommpplleettee + If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to + perform hostname completion when a word containing a @@ + is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE + above). This is enabled by default. + hhuuppoonneexxiitt + If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter- + active login shell exits. + iinntteerraaccttiivvee__ccoommmmeennttss + If set, allow a word beginning with ## to cause that word + and all remaining characters on that line to be ignored + in an interactive shell (see CCOOMMMMEENNTTSS above). This + option is enabled by default. + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + commands are saved to the history with embedded newlines + rather than using semicolon separators where possible. + llooggiinn__sshheellll + The shell sets this option if it is started as a login + shell (see IINNVVOOCCAATTIIOONN above). The value may not be + changed. + mmaaiillwwaarrnn + If set, and a file that bbaasshh is checking for mail has + been accessed since the last time it was checked, the + message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- + played. + nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn + If set, and rreeaaddlliinnee is being used, bbaasshh will not + attempt to search the PPAATTHH for possible completions when + completion is attempted on an empty line. + nnooccaasseegglloobb + If set, bbaasshh matches filenames in a case-insensitive + fashion when performing pathname expansion (see PPaatthhnnaammee + EExxppaannssiioonn above). + nnooccaasseemmaattcchh + If set, bbaasshh matches patterns in a case-insensitive + fashion when performing matching while executing ccaassee or + [[[[ conditional commands. + nnuullllgglloobb + If set, bbaasshh allows patterns which match no files (see + PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string, + rather than themselves. + pprrooggccoommpp + If set, the programmable completion facilities (see PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn above) are enabled. This option is + enabled by default. + pprroommppttvvaarrss + If set, prompt strings undergo parameter expansion, com- + mand substitution, arithmetic expansion, and quote + removal after being expanded as described in PPRROOMMPPTTIINNGG + above. This option is enabled by default. + rreessttrriicctteedd__sshheellll + The shell sets this option if it is started in + restricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value + may not be changed. This is not reset when the startup + files are executed, allowing the startup files to dis- + cover whether or not a shell is restricted. + sshhiifftt__vveerrbboossee + If set, the sshhiifftt builtin prints an error message when + the shift count exceeds the number of positional parame- + ters. + ssoouurrcceeppaatthh + If set, the ssoouurrccee (..) builtin uses the value of PPAATTHH to + find the directory containing the file supplied as an + argument. This option is enabled by default. + xxppgg__eecchhoo + If set, the eecchhoo builtin expands backslash-escape + sequences by default. + ssuussppeenndd [--ff] + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell cannot be suspended; the --ff option can be + used to override this and force the suspension. The return sta- + tus is 0 unless the shell is a login shell and --ff is not sup- + plied, or if job control is not enabled. + tteesstt _e_x_p_r + [[ _e_x_p_r ]] + Return a status of 0 or 1 depending on the evaluation of the + conditional expression _e_x_p_r. Each operator and operand must be + a separate argument. Expressions are composed of the primaries + described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. tteesstt does not + accept any options, nor does it accept and ignore an argument of + ---- as signifying the end of options. + + Expressions may be combined using the following operators, + listed in decreasing order of precedence. The evaluation + depends on the number of arguments; see below. + !! _e_x_p_r True if _e_x_p_r is false. + (( _e_x_p_r )) + Returns the value of _e_x_p_r. This may be used to override + the normal precedence of operators. + _e_x_p_r_1 -aa _e_x_p_r_2 + True if both _e_x_p_r_1 and _e_x_p_r_2 are true. + _e_x_p_r_1 -oo _e_x_p_r_2 + True if either _e_x_p_r_1 or _e_x_p_r_2 is true. + + tteesstt and [[ evaluate conditional expressions using a set of rules + based on the number of arguments. + + 0 arguments + The expression is false. + 1 argument + The expression is true if and only if the argument is not + null. + 2 arguments + If the first argument is !!, the expression is true if and + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed + above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + true if the unary test is true. If the first argument is + not a valid unary conditional operator, the expression is + false. + 3 arguments + If the second argument is one of the binary conditional + operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the + result of the expression is the result of the binary test + using the first and third arguments as operands. The --aa + and --oo operators are considered binary operators when + there are three arguments. If the first argument is !!, + the value is the negation of the two-argument test using + the second and third arguments. If the first argument is + exactly (( and the third argument is exactly )), the result + is the one-argument test of the second argument. Other- + wise, the expression is false. + 4 arguments + If the first argument is !!, the result is the negation of + the three-argument expression composed of the remaining + arguments. Otherwise, the expression is parsed and eval- + uated according to precedence using the rules listed + above. + 5 or more arguments + The expression is parsed and evaluated according to + precedence using the rules listed above. + + ttiimmeess Print the accumulated user and system times for the shell and + for processes run from the shell. The return status is 0. + + ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...] + The command _a_r_g is to be read and executed when the shell + receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_r_g is the null string the signal specified by each + _s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes. + If _a_r_g is not present and --pp has been supplied, then the trap + commands associated with each _s_i_g_s_p_e_c are displayed. If no + arguments are supplied or if only --pp is given, ttrraapp prints the + list of commands associated with each signal. The --ll option + causes the shell to print a list of signal names and their cor- + responding numbers. Each _s_i_g_s_p_e_c is either a signal name + defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are + case insensitive and the SIG prefix is optional. + + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe- + cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, + _s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the + first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR + above). Refer to the description of the eexxttddeebbuugg option to the + sshhoopptt builtin for details of its effect on the DDEEBBUUGG trap. If a + _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is executed each time a shell + function or a script executed with the .. or ssoouurrccee builtins fin- + ishes executing. + + If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a sim- + ple command has a non-zero exit status, subject to the following + conditions. The EERRRR trap is not executed if the failed command + is part of the command list immediately following a wwhhiillee or + uunnttiill keyword, part of the test in an _i_f statement, part of a + command executed in a &&&& or |||| list, or if the command's return + value is being inverted via !!. These are the same conditions + obeyed by the eerrrreexxiitt option. + + Signals ignored upon entry to the shell cannot be trapped or + reset. Trapped signals that are not being ignored are reset to + their original values in a subshell or subshell environment when + one is created. The return status is false if any _s_i_g_s_p_e_c is + invalid; otherwise ttrraapp returns true. + + ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] + With no options, indicate how each _n_a_m_e would be interpreted if + used as a command name. If the --tt option is used, ttyyppee prints a + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or disk file, respectively. If the _n_a_m_e is not found, + then nothing is printed, and an exit status of false is + returned. If the --pp option is used, ttyyppee either returns the + name of the disk file that would be executed if _n_a_m_e were speci- + fied as a command name, or nothing if ``type -t name'' would not + return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e, + even if ``type -t name'' would not return _f_i_l_e. If a command is + hashed, --pp and --PP print the hashed value, not necessarily the + file that appears first in PPAATTHH. If the --aa option is used, ttyyppee + prints all of the places that contain an executable named _n_a_m_e. + This includes aliases and functions, if and only if the --pp + option is not also used. The table of hashed commands is not + consulted when using --aa. The --ff option suppresses shell func- + tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if + all of the arguments are found, false if any are not found. + + uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_l_i_m_i_t]] + Provides control over the resources available to the shell and + to processes started by it, on systems that allow such control. + The --HH and --SS options specify that the hard or soft limit is set + for the given resource. A hard limit cannot be increased by a + non-root user once it is set; a soft limit may be increased up + to the value of the hard limit. If neither --HH nor --SS is speci- + fied, both the soft and hard limits are set. The value of _l_i_m_i_t + can be a number in the unit specified for the resource or one of + the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the + current hard limit, the current soft limit, and no limit, + respectively. If _l_i_m_i_t is omitted, the current value of the + soft limit of the resource is printed, unless the --HH option is + given. When more than one resource is specified, the limit name + and unit are printed before the value. Other options are inter- + preted as follows: + --aa All current limits are reported + --bb The maximum socket buffer size + --cc The maximum size of core files created + --dd The maximum size of a process's data segment + --ee The maximum scheduling priority ("nice") + --ff The maximum size of files written by the shell and its + children + --ii The maximum number of pending signals + --ll The maximum size that may be locked into memory + --mm The maximum resident set size (many systems do not honor + this limit) + --nn The maximum number of open file descriptors (most systems + do not allow this value to be set) + --pp The pipe size in 512-byte blocks (this may not be set) + --qq The maximum number of bytes in POSIX message queues + --rr The maximum real-time scheduling priority + --ss The maximum stack size + --tt The maximum amount of cpu time in seconds + --uu The maximum number of processes available to a single + user + --vv The maximum amount of virtual memory available to the + shell + --xx The maximum number of file locks + --TT The maximum number of threads + + If _l_i_m_i_t is given, it is the new value of the specified resource + (the --aa option is display only). If no option is given, then --ff + is assumed. Values are in 1024-byte increments, except for --tt, + which is in seconds, --pp, which is in units of 512-byte blocks, + and --TT, --bb, --nn, and --uu, which are unscaled values. The return + status is 0 unless an invalid option or argument is supplied, or + an error occurs while setting a new limit. + + uummaasskk [--pp] [--SS] [_m_o_d_e] + The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp + option is supplied, and _m_o_d_e is omitted, the output is in a form + that may be reused as input. The return status is 0 if the mode + was successfully changed or if no _m_o_d_e argument was supplied, + and false otherwise. + + uunnaalliiaass [-aa] [_n_a_m_e ...] + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value + is true unless a supplied _n_a_m_e is not a defined alias. + + uunnsseett [-ffvv] [_n_a_m_e ...] + For each _n_a_m_e, remove the corresponding variable or function. + If no options are supplied, or the --vv option is given, each _n_a_m_e + refers to a shell variable. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. Each unset vari- + able or function is removed from the environment passed to sub- + sequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANNDDOOMM, SSEECCOONNDDSS, + LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they + lose their special properties, even if they are subsequently + reset. The exit status is true unless a _n_a_m_e is readonly. + + wwaaiitt [_n _._._.] + Wait for each specified process and return its termination sta- + tus. Each _n may be a process ID or a job specification; if a + job spec is given, all processes in that job's pipeline are + waited for. If _n is not given, all currently active child pro- + cesses are waited for, and the return status is zero. If _n + specifies a non-existent process or job, the return status is + 127. Otherwise, the return status is the exit status of the + last process or job waited for. + +RREESSTTRRIICCTTEEDD SSHHEELLLL + If bbaasshh is started with the name rrbbaasshh, or the --rr option is supplied at + invocation, the shell becomes restricted. A restricted shell is used + to set up an environment more controlled than the standard shell. It + behaves identically to bbaasshh with the exception that the following are + disallowed or not performed: + + +o changing directories with ccdd + + +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, EENNVV, or BBAASSHH__EENNVV + + +o specifying command names containing // + + +o specifying a file name containing a // as an argument to the .. + builtin command + + +o Specifying a filename containing a slash as an argument to the + --pp option to the hhaasshh builtin command + + +o importing function definitions from the shell environment at + startup + + +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at + startup + + +o redirecting output using the >, >|, <>, >&, &>, and >> redirect- + ion operators + + +o using the eexxeecc builtin command to replace the shell with another + command + + +o adding or deleting builtin commands with the --ff and --dd options + to the eennaabbllee builtin command + + +o Using the eennaabbllee builtin command to enable disabled shell + builtins + + +o specifying the --pp option to the ccoommmmaanndd builtin command + + +o turning off restricted mode with sseett ++rr or sseett ++oo rreessttrriicctteedd. + + These restrictions are enforced after any startup files are read. + + When a command that is found to be a shell script is executed (see CCOOMM-- + MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell + spawned to execute the script. + +SSEEEE AALLSSOO + _B_a_s_h _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, Brian Fox and Chet Ramey + _T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey + _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey + _P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_- + _t_i_e_s, IEEE + _s_h(1), _k_s_h(1), _c_s_h(1) + _e_m_a_c_s(1), _v_i(1) + _r_e_a_d_l_i_n_e(3) + +FFIILLEESS + _/_b_i_n_/_b_a_s_h + The bbaasshh executable + _/_e_t_c_/_p_r_o_f_i_l_e + The systemwide initialization file, executed for login shells + _~_/_._b_a_s_h___p_r_o_f_i_l_e + The personal initialization file, executed for login shells + _~_/_._b_a_s_h_r_c + The individual per-interactive-shell startup file + _~_/_._b_a_s_h___l_o_g_o_u_t + The individual login shell cleanup file, executed when a login + shell exits + _~_/_._i_n_p_u_t_r_c + Individual _r_e_a_d_l_i_n_e initialization file + +AAUUTTHHOORRSS + Brian Fox, Free Software Foundation + bfox@gnu.org + + Chet Ramey, Case Western Reserve University + chet.ramey@case.edu + +BBUUGG RREEPPOORRTTSS + If you find a bug in bbaasshh,, you should report it. But first, you should + make sure that it really is a bug, and that it appears in the latest + version of bbaasshh. The latest version is always available from + _f_t_p_:_/_/_f_t_p_._g_n_u_._o_r_g_/_p_u_b_/_b_a_s_h_/. + + Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g + command to submit a bug report. If you have a fix, you are encouraged + to mail that as well! Suggestions and `philosophical' bug reports may + be mailed to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or posted to the Usenet newsgroup + ggnnuu..bbaasshh..bbuugg. + + ALL bug reports should include: + + The version number of bbaasshh + The hardware and operating system + The compiler used to compile + A description of the bug behaviour + A short script or `recipe' which exercises the bug + + _b_a_s_h_b_u_g inserts the first three items automatically into the template + it provides for filing a bug report. + + Comments and bug reports concerning this manual page should be directed + to _c_h_e_t_@_p_o_._c_w_r_u_._e_d_u. + +BBUUGGSS + It's too big and too slow. + + There are some subtle differences between bbaasshh and traditional versions + of sshh, mostly because of the PPOOSSIIXX specification. + + Aliases are confusing in some uses. + + Shell builtin commands and functions are not stoppable/restartable. + + Compound commands and command sequences of the form `a ; b ; c' are not + handled gracefully when process suspension is attempted. When a + process is stopped, the shell immediately executes the next command in + the sequence. It suffices to place the sequence of commands between + parentheses to force it into a subshell, which may be stopped as a + unit. + + Array variables may not (yet) be exported. + + There may be only one active coprocess at a time. + + + +GNU Bash-4.1 2009 December 29 BASH(1) @@ -2,16 +2,15 @@ .\" MAN PAGE COMMENTS to .\" .\" Chet Ramey -.\" Information Network Services .\" Case Western Reserve University .\" chet@po.cwru.edu .\" -.\" Last Change: Thu Sep 28 10:25:59 EDT 2006 +.\" Last Change: Tue Dec 29 15:36:16 EST 2009 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2006 September 28" "GNU Bash-3.2" +.TH BASH 1 "2009 December 29" "GNU Bash-4.1" .\" .\" There's some problem with having a `@' .\" in a tagged paragraph with the BSD man macros. @@ -51,8 +50,8 @@ bash \- GNU Bourne-Again SHell [options] [file] .SH COPYRIGHT -.if n Bash is Copyright (C) 1989-2005 by the Free Software Foundation, Inc. -.if t Bash is Copyright \(co 1989-2005 by the Free Software Foundation, Inc. +.if n Bash is Copyright (C) 1989-2009 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2009 by the Free Software Foundation, Inc. .SH DESCRIPTION .B Bash is an \fBsh\fR-compatible command language interpreter that @@ -185,9 +184,7 @@ Display a usage message on standard output and exit successfully. .PD Execute commands from .I file -instead of the system wide initialization file -.I /etc/bash.bashrc -and the standard personal initialization file +instead of the standard personal initialization file .I ~/.bashrc if the shell is interactive (see .SM @@ -218,9 +215,7 @@ reads these files when it is invoked as a login shell (see below). .TP .B \-\-norc -Do not read and execute the system wide initialization file -.I /etc/bash.bashrc -and the personal initialization file +Do not read and execute the personal initialization file .I ~/.bashrc if the shell is interactive. This option is on by default if the shell is invoked as @@ -328,15 +323,13 @@ exists. .PP When an interactive shell that is not a login shell is started, .B bash -reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, -if these files exist. +reads and executes commands from \fI~/.bashrc\fP, if that file exists. This may be inhibited by using the .B \-\-norc option. The \fB\-\-rcfile\fP \fIfile\fP option will force .B bash -to read and execute commands from \fIfile\fP instead of -\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. +to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP. .PP When .B bash @@ -416,13 +409,13 @@ whose name is the expanded value. No other startup files are read. .PP .B Bash -attempts to determine when it is being run by the remote shell -daemon, usually \fIrshd\fP. +attempts to determine when it is being run with its standard input +connected to a a network connection, as if by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. If .B bash -determines it is being run by \fIrshd\fP, it reads and executes -commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, -if these files exist and are readable. +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP, if that file exists and is readable. It will not do this if invoked as \fBsh\fP. The .B \-\-norc @@ -436,8 +429,15 @@ If the shell is started with the effective user (group) id not equal to the real user (group) id, and the \fB\-p\fP option is not supplied, no startup files are read, shell functions are not inherited from the environment, the .SM -.B SHELLOPTS -variable, if it appears in the environment, is ignored, +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, and the effective user id is set to the real user id. If the \fB\-p\fP option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset. @@ -478,8 +478,8 @@ A \fItoken\fP that performs a control function. It is one of the following symbols: .RS .PP -.if t \fB\(bv\(bv & && ; ;; ( ) | <newline>\fP -.if n \fB|| & && ; ;; ( ) | <newline>\fP +.if t \fB\(bv\(bv & && ; ;; ( ) | |& <newline>\fP +.if n \fB|| & && ; ;; ( ) | |& <newline>\fP .RE .PD .SH "RESERVED WORDS" @@ -514,12 +514,13 @@ The return value of a \fIsimple command\fP is its exit status, or .SS Pipelines .PP A \fIpipeline\fP is a sequence of one or more commands separated by -the character -.BR | . +one of the control operators +.B | +or \fB|&\fP. The format for a pipeline is: .RS .PP -[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ \fB|\fP \fIcommand2\fP ... ] +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] .RE .PP The standard output of @@ -531,6 +532,11 @@ command (see .SM .B REDIRECTION below). +If \fB|&\fP is used, the standard error of \fIcommand\fP is connected to +\fIcommand2\fP's standard input through the pipe; it is shorthand for +\fB2>&1 |\fP. +This implicit redirection of the standard error is performed after any +redirections specified by the command. .PP The return status of a pipeline is the exit status of the last command, unless the \fBpipefail\fP option is enabled. @@ -585,7 +591,7 @@ and have equal precedence, followed by .B ; and -.BR &, +.BR & , which have equal precedence. .PP A sequence of one or more newlines may appear in a \fIlist\fP instead @@ -601,11 +607,9 @@ are executed sequentially; the shell waits for each command to terminate in turn. The return status is the exit status of the last command executed. .PP -The control operators -.B && -and -.B \(bv\(bv -denote AND lists and OR lists, respectively. +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB\(bv\(bv\fP control operators, respectively. +AND and OR lists are executed with left associativity. An AND list has the form .RS .PP @@ -627,7 +631,8 @@ An OR list has the form .I command2 is executed if and only if .I command1 -returns a non-zero exit status. The return status of +returns a non-zero exit status. +The return status of AND and OR lists is the exit status of the last command executed in the list. .SS Compound Commands @@ -653,7 +658,8 @@ The return status is the exit status of Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and \fB}\fP are \fIreserved words\fP and must occur where a reserved word is permitted to be recognized. Since they do not cause a word -break, they must be separated from \fIlist\fP by whitespace. +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. .TP ((\fIexpression\fP)) The \fIexpression\fP is evaluated according to the rules described @@ -678,6 +684,10 @@ Conditional operators such as \fB\-f\fP must be unquoted to be recognized as primaries. .if t .sp 0.5 .if n .sp 1 +When used with \fB[[\fP, The \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.if t .sp 0.5 +.if n .sp 1 When the \fB==\fP and \fB!=\fP operators are used, the string to the right of the operator is considered a pattern and matched according to the rules described below under \fBPattern Matching\fP. @@ -703,11 +713,21 @@ If the shell option .B nocasematch is enabled, the match is performed without regard to the case of alphabetic characters. +Any part of the pattern may be quoted to force it to be matched as a +string. Substrings matched by parenthesized subexpressions within the regular -expression are saved in the array variable \fBBASH_REMATCH\fP. -The element of \fBBASH_REMATCH\fP with index 0 is the portion of the string +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string matching the entire regular expression. -The element of \fBBASH_REMATCH\fP with index \fIn\fP is the portion of the +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the string matching the \fIn\fPth parenthesized subexpression. .if t .sp 0.5 .if n .sp 1 @@ -751,7 +771,7 @@ operators do not evaluate \fIexpression2\fP if the value of the entire conditional expression. .RE .TP -\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP The list of words following \fBin\fP is expanded, generating a list of items. The variable \fIname\fP is set to each element of this list @@ -786,6 +806,7 @@ error, each preceded by a number. If the \fBin\fP .SM .B PARAMETERS below). The +.SM .B PS3 prompt is then displayed and a line read from the standard input. If the line consists of a number corresponding to one of @@ -796,6 +817,7 @@ are displayed again. If EOF is read, the command completes. Any other value read causes .I name to be set to null. The line read is saved in the variable +.SM .BR REPLY . The .I list @@ -825,9 +847,15 @@ If the shell option .B nocasematch is enabled, the match is performed without regard to the case of alphabetic characters. -When a match is found, the -corresponding \fIlist\fP is executed. After the first match, no -subsequent matches are attempted. The exit status is zero if no +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no pattern matches. Otherwise, it is the exit status of the last command executed in \fIlist\fP. .TP @@ -864,6 +892,49 @@ The exit status of the \fBwhile\fP and \fBuntil\fP commands is the exit status of the last \fBdo\fP \fIlist\fP command executed, or zero if none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fICOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coproc is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The process id of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +The return status of a coprocess is the exit status of \fIcommand\fP. .SS Shell Function Definitions .PP A shell function is an object that is called like a simple command and @@ -949,19 +1020,19 @@ between single quotes, even when preceded by a backslash. Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of .BR $ , -.BR ` , +.BR \` , .BR \e , and, when history expansion is enabled, .BR ! . The characters .B $ and -.B ` +.B \` retain their special meaning within double quotes. The backslash retains its special meaning only when followed by one of the following characters: .BR $ , -.BR ` , +.BR \` , \^\fB"\fP\^, .BR \e , or @@ -999,6 +1070,8 @@ alert (bell) backspace .TP .B \ee +.TP +.B \eE an escape character .TP .B \ef @@ -1021,6 +1094,9 @@ backslash .TP .B \e\(aq single quote +.TP +.B \e\(dq +double quote .TP .B \e\fInnn\fP the eight-bit character whose value is the octal value \fInnn\fP @@ -1038,8 +1114,8 @@ a control-\fIx\fP character The expanded result is single-quoted, as if the dollar sign had not been present. .PP -A double-quoted string preceded by a dollar sign (\fB$\fP) will cause -the string to be translated according to the current locale. +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign is ignored. If the string is translated and replaced, the replacement is @@ -1123,7 +1199,9 @@ When += is applied to an array variable using compound assignment (see .B Arrays below), the variable's value is not unset (as it is when using =), and new values are -appended to the array beginning at one greater than the array's maximum index. +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. When applied to a string-valued variable, \fIvalue\fP is expanded and appended to the variable's value. .SS Positional Parameters @@ -1192,7 +1270,7 @@ expand to nothing (i.e., they are removed). Expands to the number of positional parameters in decimal. .TP .B ? -Expands to the status of the most recently executed foreground +Expands to the exit status of the most recently executed foreground pipeline. .TP .B \- @@ -1252,34 +1330,80 @@ The following variables are set by the shell: Expands to the full file name used to invoke this instance of .BR bash . .TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process id of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP .B BASH_ARGC An array variable whose values are the number of parameters in each -frame of the current bash execution call stack. +frame of the current \fBbash\fP execution call stack. The number of parameters to the current subroutine (shell function or script executed with \fB.\fP or \fBsource\fP) is at the top of the stack. When a subroutine is executed, the number of parameters passed is pushed onto -\fBBASH_ARGC\fP. -The shell sets \fBBASH_ARGC\fP only when in extended debugging mode -(see the description of the +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the .B extdebug option to the .B shopt builtin below) .TP .B BASH_ARGV -An array variable containing all of the parameters in the current bash +An array variable containing all of the parameters in the current \fBbash\fP execution call stack. The final parameter of the last subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is executed, the parameters supplied -are pushed onto \fBBASH_ARGV\fP. -The shell sets \fBBASH_ARGV\fP only when in extended debugging mode +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode (see the description of the .B extdebug option to the .B shopt builtin below) .TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP .B BASH_COMMAND The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, @@ -1290,11 +1414,18 @@ The command argument to the \fB\-c\fP invocation option. .TP .B BASH_LINENO An array variable whose members are the line numbers in source files -corresponding to each member of \fBFUNCNAME\fP. +corresponding to each member of +.SM +.BR FUNCNAME . \fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source -file where \fB${FUNCNAME[\fP\fI$ifP\fB]}\fP was called. -The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fB. -Use \fBLINENO\fP to obtain the current line number. +file where \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP. +Use +.SM +.B LINENO +to obtain the current line number. .TP .B BASH_REMATCH An array variable whose members are assigned by the \fB=~\fP binary @@ -1307,7 +1438,10 @@ This variable is read-only. .TP .B BASH_SOURCE An array variable whose members are the source filenames corresponding -to the elements in the \fBFUNCNAME\fP array variable. +to the elements in the +.SM +.B FUNCNAME +array variable. .TP .B BASH_SUBSHELL Incremented by one each time a subshell or subshell environment is spawned. @@ -1338,7 +1472,9 @@ The build version. The release status (e.g., \fIbeta1\fP). .TP .B BASH_VERSINFO[\fR5\fP] -The value of \fBMACHTYPE\fP. +The value of +.SM +.BR MACHTYPE . .PD .RE .TP @@ -1353,6 +1489,10 @@ This variable is available only in shell functions invoked by the programmable completion facilities (see \fBProgrammable Completion\fP below). .TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP .B COMP_LINE The current command line. This variable is available only in shell functions and external @@ -1370,8 +1510,22 @@ commands invoked by the programmable completion facilities (see \fBProgrammable Completion\fP below). .TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP .B COMP_WORDBREAKS -The set of characters that the Readline library treats as word +The set of characters that the \fBreadline\fP library treats as word separators when performing word completion. If .SM @@ -1382,8 +1536,10 @@ subsequently reset. .B COMP_WORDS An array variable (see \fBArrays\fP below) consisting of the individual words in the current command line. -The words are split on shell metacharacters as the shell parser would -separate them. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. This variable is available only in shell functions invoked by the programmable completion facilities (see \fBProgrammable Completion\fP below). @@ -1417,7 +1573,9 @@ An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. -The bottom-most element is "main". +The bottom-most element is +.if t \f(CW"main"\fP. +.if n "main". This variable exists only when a shell function is executing. Assignments to .SM @@ -1620,6 +1778,28 @@ A sample value is .if t \f(CW".:~:/usr"\fP. .if n ".:~:/usr". .TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP .B COLUMNS Used by the \fBselect\fP builtin command to determine the terminal width when printing selection lists. Automatically set upon receipt of a SIGWINCH. @@ -1654,9 +1834,7 @@ A filename whose suffix matches one of the entries in is excluded from the list of matched filenames. A sample value is .if t \f(CW".o:~"\fP. -.if n ".o:~" -(Quoting is needed when assigning a value to this variable, -which contains tildes). +.if n ".o:~". .TP .B GLOBIGNORE A colon-separated list of patterns defining the set of filenames to @@ -1686,12 +1864,17 @@ A value of causes all previous lines matching the current line to be removed from the history list before that line is saved. Any value not in the above list is ignored. -If \fBHISTCONTROL\fP is unset, or does not include a valid value, +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of +.SM .BR HISTIGNORE . The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of +.SM .BR HISTCONTROL . .TP .B HISTFILE @@ -1715,6 +1898,7 @@ should be saved on the history list. Each pattern is anchored at the beginning of the line and must match the complete line (no implicit `\fB*\fP' is appended). Each pattern is tested against the line after the checks specified by +.SM .B HISTCONTROL are applied. In addition to the normal shell pattern matching characters, `\fB&\fP' @@ -1722,6 +1906,7 @@ matches the previous history line. `\fB&\fP' may be escaped using a backslash; the backslash is removed before attempting a match. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of +.SM .BR HISTIGNORE . .TP .B HISTSIZE @@ -1736,6 +1921,8 @@ for \fIstrftime\fP(3) to print the time stamp associated with each history entry displayed by the \fBhistory\fP builtin. If this variable is set, time stamps are written to the history file so they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. .TP .B HOME The home directory of the current user; the default argument for the @@ -1756,7 +1943,8 @@ adds the contents of the new file to the existing list. If .SM .B HOSTFILE -is set, but has no value, \fBbash\fP attempts to read +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read .FN /etc/hosts to obtain the list of possible hostname completions. When @@ -1807,7 +1995,10 @@ Used to determine the locale category for any category not specifically selected with a variable starting with \fBLC_\fP. .TP .B LC_ALL -This variable overrides the value of \fBLANG\fP and any other +This variable overrides the value of +.SM +.B LANG +and any other \fBLC_\fP variable specifying a locale category. .TP .B LC_COLLATE @@ -1830,7 +2021,9 @@ This variable determines the locale category used for number formatting. .TP .B LINES Used by the \fBselect\fP builtin command to determine the column length -for printing selection lists. Automatically set upon receipt of a SIGWINCH. +for printing selection lists. Automatically set upon receipt of a +.SM +.BR SIGWINCH . .TP .B MAIL If this parameter is set to a file name and the @@ -1886,8 +2079,10 @@ the shell looks for commands (see .SM .B COMMAND EXECUTION below). -A zero-length (null) directory name in the value of \fBPATH\fP indicates the -current directory. +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. A null directory name may appear as two adjacent colons, or as an initial or trailing colon. The default path is system-dependent, @@ -1911,6 +2106,14 @@ had been executed. If set, the value is executed as a command prior to issuing each primary prompt. .TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP .B PS1 The value of this parameter is expanded (see .SM @@ -1920,6 +2123,7 @@ below) and used as the primary prompt string. The default value is .TP .B PS2 The value of this parameter is expanded as with +.SM .B PS1 and used as the secondary prompt string. The default is ``\fB> \fP''. @@ -1934,6 +2138,7 @@ above). .TP .B PS4 The value of this parameter is expanded as with +.SM .B PS1 and the value is printed before each command .B bash @@ -1997,10 +2202,16 @@ If the value is null, no timing information is displayed. A trailing newline is added when the format string is displayed. .TP .B TMOUT -If set to a value greater than zero, \fBTMOUT\fP is treated as the +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the default timeout for the \fBread\fP builtin. The \fBselect\fP command terminates if input does not arrive -after \fBTMOUT\fP seconds when input is coming from a terminal. +after +.SM +.B TMOUT +seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. .B Bash @@ -2038,13 +2249,6 @@ below). 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 \fB%\fP\fIstring\fP job identifier. .TP -.B command_not_found_handle -The name of a shell function to be called if a command cannot be -found. The return value of this function should be 0, if the command -is available after execution of the function, otherwise 127 (EX_NOTFOUND). -Enabled only in interactive, non POSIX mode shells. This is a Debian -extension. -.TP .B histchars The two or three characters which control history expansion and tokenization (see @@ -2066,26 +2270,35 @@ parser to treat the rest of the line as a comment. .PD .SS Arrays .B Bash -provides one-dimensional array variables. Any variable may be used as -an array; the +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the .B declare -builtin will explicitly declare an array. There is no maximum +builtin will explicitly declare an array. +There is no maximum limit on the size of an array, nor any requirement that members -be indexed or assigned contiguously. Arrays are indexed using -integers and are zero-based. +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. .PP -An array is created automatically if any variable is assigned to using -the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The .I subscript is treated as an arithmetic expression that must evaluate to a number -greater than or equal to zero. To explicitly declare an array, use +greater than or equal to zero. To explicitly declare an indexed array, +use .B declare \-a \fIname\fP (see .SM .B SHELL BUILTIN COMMANDS below). .B declare \-a \fIname\fP[\fIsubscript\fP] -is also accepted; the \fIsubscript\fP is ignored. Attributes may be +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be specified for an array variable using the .B declare and @@ -2094,11 +2307,15 @@ builtins. Each attribute applies to all members of an array. .PP Arrays are assigned to using compound assignments of the form \fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each -\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. Only -\fIstring\fP is required. If -the optional brackets and subscript are supplied, that index is assigned to; +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require the bracket and subscript. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; otherwise the index of the element assigned is the last index assigned to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP This syntax is also accepted by the .B declare builtin. Individual array elements may be assigned to using the @@ -2129,14 +2346,17 @@ above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of ${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or \fB@\fP, the expansion is the number of elements in the array. Referencing an array variable without a subscript is equivalent to -referencing element zero. +referencing the array with a subscript of 0. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. .PP The .B unset builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] destroys the array element at index \fIsubscript\fP. -Care must be taken to avoid unwanted side effects caused by filename -generation. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. \fBunset\fP \fIname\fP, where \fIname\fP is an array, or \fBunset\fP \fIname\fP[\fIsubscript\fP], where \fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. @@ -2148,7 +2368,10 @@ and .B readonly builtins each accept a .B \-a -option to specify an array. The +option to specify an indexed array and a +.B \-A +option to specify an associative array. +The .B read builtin accepts a .B \-a @@ -2209,13 +2432,21 @@ Brace expansions may be nested. The results of each expanded string are not sorted; left to right order is preserved. For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. .PP -A sequence expression takes the form \fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB}\fP, -where \fIx\fP and \fIy\fP are either integers or single characters. +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. When integers are supplied, the expression expands to each number between \fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. When characters are supplied, the expression expands to each character lexicographically between \fIx\fP and \fIy\fP, inclusive. Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. .PP Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved @@ -2357,7 +2588,7 @@ is followed by a character which is not to be interpreted as part of its name. .PD .PP -If the first character of \fIparameter\fP is an exclamation point, +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), a level of variable indirection is introduced. \fBBash\fP uses the value of the variable formed from the rest of \fIparameter\fP as the name of the variable; this variable is then @@ -2371,9 +2602,10 @@ introduce indirection. .PP In each of the cases below, \fIword\fP is subject to tilde expansion, parameter expansion, command substitution, and arithmetic expansion. -When not performing substring expansion, \fBbash\fP tests for a parameter -that is unset or null; omitting the colon results in a test only for a -parameter that is unset. +.PP +When not performing substring expansion, using the forms documented below, +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. .PP .PD 0 .TP @@ -2436,37 +2668,42 @@ below). \fIlength\fP must evaluate to a number greater than or equal to zero. If \fIoffset\fP evaluates to a number less than zero, the value is used as an offset from the end of the value of \fIparameter\fP. -Arithmetic expressions starting with a - must be separated by whitespace -from the preceding : to be -distinguished from the \fBUse Default Values\fP expansion. If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional parameters beginning at \fIoffset\fP. -If \fIparameter\fP is an array name indexed by @ or *, +If \fIparameter\fP is an indexed array name subscripted by @ or *, the result is the \fIlength\fP members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. A negative \fIoffset\fP is taken relative to one greater than the maximum index of the specified array. +Substring expansion applied to an associative array produces undefined +results. Note that a negative offset must be separated from the colon by at least one space to avoid being confused with the :- expansion. Substring indexing is zero-based unless the positional parameters -are used, in which case the indexing starts at 1. +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. .TP ${\fB!\fP\fIprefix\fP\fB*\fP} .PD 0 .TP ${\fB!\fP\fIprefix\fP\fB@\fP} .PD +\fBNames matching prefix.\fP Expands to the names of variables whose names begin with \fIprefix\fP, separated by the first character of the .SM .B IFS special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. .TP ${\fB!\fP\fIname\fP[\fI@\fP]} .PD 0 .TP ${\fB!\fP\fIname\fP[\fI*\fP]} .PD +\fBList of array keys.\fP If \fIname\fP is an array variable, expands to the list of array indices (keys) assigned in \fIname\fP. If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null @@ -2475,6 +2712,7 @@ When \fI@\fP is used and the expansion appears within double quotes, each key expands to a separate word. .TP ${\fB#\fP\fIparameter\fP} +\fBParameter length.\fP The length in characters of the value of \fIparameter\fP is substituted. If .I parameter @@ -2496,6 +2734,7 @@ ${\fIparameter\fP\fB#\fP\fIword\fP} .TP ${\fIparameter\fP\fB##\fP\fIword\fP} .PD +\fBRemove matching prefix pattern.\fP The .I word is expanded to produce a pattern just as in pathname @@ -2528,6 +2767,7 @@ ${\fIparameter\fP\fB%\fP\fIword\fP} .TP ${\fIparameter\fP\fB%%\fP\fIword\fP} .PD +\fBRemove matching suffix pattern.\fP The \fIword\fP is expanded to produce a pattern just as in pathname expansion. If the pattern matches a trailing portion of the expanded value of @@ -2554,11 +2794,12 @@ the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list. .TP ${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution.\fP The \fIpattern\fP is expanded to produce a pattern just as in pathname expansion. \fIParameter\fP is expanded and the longest match of \fIpattern\fP against its value is replaced with \fIstring\fP. -If \Ipattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are replaced with \fIstring\fP. Normally only the first match is replaced. If \fIpattern\fP begins with \fB#\fP, it must match at the beginning of the expanded value of \fIparameter\fP. @@ -2582,6 +2823,44 @@ or .BR * , the substitution operation is applied to each member of the array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification.\fP +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value.. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. .SS Command Substitution .PP \fICommand substitution\fP allows the output of a command to replace @@ -2593,7 +2872,7 @@ the command name. There are two forms: .RE or .RS -\fB`\fP\fIcommand\fP\fB`\fP +\fB\`\fP\fIcommand\fP\fB\`\fP .RE .PP .B Bash @@ -2608,7 +2887,7 @@ the equivalent but faster \fB$(< \fIfile\fP)\fR. When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by .BR $ , -.BR ` , +.BR \` , or .BR \e . The first backquote not preceded by a backslash terminates the @@ -2630,9 +2909,6 @@ and the substitution of the result. The format for arithmetic expansion is: \fB$((\fP\fIexpression\fP\fB))\fP .RE .PP -The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will -be removed in upcoming versions of bash. -.PP The .I expression is treated as if it were within double quotes, but a double quote @@ -2690,10 +2966,18 @@ is unset, or its value is exactly .BR <space><tab><newline> , the default, then +sequences of +.BR <space> , +.BR <tab> , +and +.B <newline> +at the beginning and end of the results of the previous +expansions are ignored, and any sequence of .SM .B IFS -characters serves to delimit words. If +characters not at the beginning or end serves to delimit words. +If .SM .B IFS has a value other than the default, then sequences of @@ -2757,7 +3041,7 @@ file names matching the pattern. If no matching file names are found, and the shell option .B nullglob -is disabled, the word is left unchanged. +is not enabled, the word is left unchanged. If the .B nullglob option is set, and no matches are found, @@ -2770,10 +3054,6 @@ If the shell option .B nocaseglob is enabled, the match is performed without regard to the case of alphabetic characters. -Note that when using range expressions like -[a-z] (see below), letters of the other case may be included, -depending on the setting of -.B LC_COLLATE. When a pattern is used for pathname expansion, the character .B ``.'' @@ -2855,6 +3135,12 @@ The special pattern characters have the following meanings: .TP .B * Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. .TP .B ? Matches any single character. @@ -2873,7 +3159,10 @@ or a .B ^ then any character not enclosed is matched. The sorting order of characters in range expressions is determined by -the current locale and the value of the \fBLC_COLLATE\fP shell variable, +the current locale and the value of the +.SM +.B LC_COLLATE +shell variable, if set. A .B \- @@ -2972,6 +3261,14 @@ or may follow a Redirections are processed in the order they appear, from left to right. .PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than 10 and assign it to \fIvarname\fP. If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP In the following descriptions, if the file descriptor number is omitted, and the first character of the redirection operator is .BR < , @@ -3006,7 +3303,7 @@ ls 2\fB>&\fP1 \fB>\fP dirlist .PP directs only the standard output to file .IR dirlist , -because the standard error was duplicated as standard output +because the standard error was duplicated from the standard output before the standard output was redirected to .IR dirlist . .PP @@ -3040,9 +3337,6 @@ a UDP connection to the corresponding socket. .PD .RE .PP -\fBNOTE:\fP Bash, as packaged for Debian, does \fBnot\fP support using -the \fB/dev/tcp\fP and \fB/dev/udp\fP files. -.PP A failure to open or create a file causes the redirection to fail. .PP Redirections using file descriptors greater than 9 should be used with @@ -3121,14 +3415,12 @@ The general format for appending output is: .PP .SS Redirecting Standard Output and Standard Error .PP -.B Bash -allows both the +This construct allows both the standard output (file descriptor 1) and the standard error output (file descriptor 2) to be redirected to the file whose name is the expansion of -.I word -with this construct. +.IR word . .PP There are two formats for redirecting standard output and standard error: @@ -3147,11 +3439,32 @@ This is semantically equivalent to .PP \fB>\fP\fIword\fP 2\fB>&\fP1 .RE +.PP +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE .SS Here Documents .PP This type of redirection instructs the shell to read input from the current source until a line containing only -.I word +.I delimiter (with no trailing blanks) is seen. All of the lines read up to that point are then used as the standard @@ -3188,7 +3501,7 @@ must be used to quote the characters .BR \e , .BR $ , and -.BR ` . +.BR \` . .PP If the redirection operator is .BR <<\- , @@ -3302,7 +3615,7 @@ below). The first word of each simple command, if unquoted, is checked to see if it has an alias. If so, that word is replaced by the text of the alias. -The characters \fB/\fP, \fB$\fP, \fB`\fP, and \fB=\fP and +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and any of the shell \fImetacharacters\fP or quoting characters listed above may not appear in an alias name. The replacement text may contain any valid shell input, @@ -3391,9 +3704,10 @@ The first element of the .B FUNCNAME variable is set to the name of the function while the function is executing. +.PP All other aspects of the shell execution environment are identical between a function and its caller -with the exception that the +with these exceptions: the .SM .B DEBUG and @@ -3410,7 +3724,12 @@ below) are not inherited unless the function has been given the builtin below) or the \fB\-o functrace\fP shell option has been enabled with the \fBset\fP builtin -(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps). +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. .PP Variables local to the function may be declared with the .B local @@ -3572,10 +3891,10 @@ descriptor 0, 1, or 2, respectively, is checked. .PP Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself. -.PP -See the description of the \fItest\fP builtin command (section SHELL -BUILTIN COMMANDS below) for the handling of parameters (i.e. -missing parameters). +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, The \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. .sp 1 .PD 0 .TP @@ -3679,19 +3998,21 @@ True if the length of is non-zero. .TP \fIstring1\fP \fB==\fP \fIstring2\fP -True if the strings are equal. \fB=\fP may be used in place of -\fB==\fP for strict POSIX compliance. +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. .TP \fIstring1\fP \fB!=\fP \fIstring2\fP True if the strings are not equal. .TP \fIstring1\fP \fB<\fP \fIstring2\fP -True if \fIstring1\fP sorts before \fIstring2\fP lexicographically -in the current locale. +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. .TP \fIstring1\fP \fB>\fP \fIstring2\fP -True if \fIstring1\fP sorts after \fIstring2\fP lexicographically -in the current locale. +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. .TP .I \fIarg1\fP \fBOP\fP \fIarg2\fP .SM @@ -3781,7 +4102,12 @@ A full search of the directories in .SM .B PATH is performed only if the command is not found in the hash table. -If the search is unsuccessful, the shell prints an error +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error message and returns an exit status of 127. .PP If the search is successful, or if the command name contains @@ -3817,7 +4143,7 @@ arguments, if any. .SH COMMAND EXECUTION ENVIRONMENT The shell has an \fIexecution environment\fP, which consists of the following: -.sp 1 +.if n .sp 1 .IP \(bu open files inherited by the shell at invocation, as modified by redirections supplied to the \fBexec\fP builtin @@ -3844,14 +4170,16 @@ options enabled by \fBshopt\fP shell aliases defined with \fBalias\fP .IP \(bu various process IDs, including those of background jobs, the value -of \fB$$\fP, and the value of \fB$PPID\fP +of \fB$$\fP, and the value of +.SM +.B PPID .PP When a simple command other than a builtin or shell function is to be executed, it is invoked in a separate execution environment that consists of the following. Unless otherwise noted, the values are inherited from the shell. -.sp 1 +.if n .sp 1 .IP \(bu the shell's open files, plus any modifications and additions specified by redirections to the command @@ -3878,6 +4206,10 @@ commands that are invoked as part of a pipeline are also executed in a subshell environment. Changes made to the subshell environment cannot affect the shell's execution environment. .PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in posix mode, +Bash clears the \fB\-e\fP option in such subshells. +.PP If a command is followed by a \fB&\fP and job control is not active, the default standard input for the command is the empty file \fI/dev/null\fP. Otherwise, the invoked command inherits the file descriptors of the calling @@ -3939,6 +4271,15 @@ invokes an external command, the variable is set to the full file name of the command and passed to that command in its environment. .SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP For the shell's purposes, a command which exits with a zero exit status has succeeded. An exit status of zero indicates success. A non-zero exit status indicates failure. @@ -4054,7 +4395,7 @@ refers to the ability to selectively stop (\fIsuspend\fP) the execution of processes and continue (\fIresume\fP) their execution at a later point. A user typically employs this facility via an interactive interface supplied jointly -by the system's terminal driver and +by the operating system kernel's terminal driver and .BR bash . .PP The shell associates a @@ -4092,12 +4433,15 @@ These processes are said to be in the .I Background processes are those whose process group ID differs from the terminal's; such processes are immune to keyboard-generated signals. -Only foreground processes are allowed to read from or write to the -terminal. Background processes which attempt to read from (write to) the +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the terminal are sent a .SM .B SIGTTIN (SIGTTOU) -signal by the terminal driver, +signal by the kernel's terminal driver, which, unless caught, suspends the process. .PP If the operating system on which @@ -4135,7 +4479,7 @@ and typeahead to be discarded. There are a number of ways to refer to a job in the shell. The character .B % -introduces a job name. Job number +introduces a job specification (\fIjobspec\fP). Job number .I n may be referred to as .BR %n . @@ -4165,6 +4509,8 @@ The .I "previous job" may be referenced using .BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. In output pertaining to jobs (e.g., the output of the .B jobs command), the current job is always flagged with a @@ -4205,11 +4551,15 @@ is executed for each child that exits. .PP If an attempt to exit .B bash -is made while jobs are stopped, the shell prints a warning message. The +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The .B jobs -command may then be used to inspect their status. +command may then be used to inspect their status. If a second attempt to exit is made without an intervening command, -the shell does not print another warning, and the stopped +the shell does not print another warning, and any stopped jobs are terminated. .SH PROMPTING When executing interactively, @@ -4286,10 +4636,19 @@ the version of \fBbash\fP (e.g., 2.00) the release of \fBbash\fP, version + patch level (e.g., 2.00.0) .TP .B \ew -the current working directory, with \fB$HOME\fP abbreviated with a tilde +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) .TP .B \eW -the basename of the current working directory, with \fB$HOME\fP +the basename of the current working directory, with +.SM +.B $HOME abbreviated with a tilde .TP .B \e! @@ -4342,18 +4701,27 @@ This is the library that handles reading input when using an interactive shell, unless the .B \-\-noediting option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. By default, the line editing commands are similar to those of emacs. A vi-style line editing interface is also available. -To turn off line editing after the shell is running, use the -.B +o emacs +Line editing can be enabled at any time using the +.B \-o emacs or -.B +o vi +.B \-o vi options to the .B set builtin (see .SM .B SHELL BUILTIN COMMANDS below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. .SS "Readline Notation" .PP In this section, the emacs-style notation is used to denote @@ -4644,6 +5012,12 @@ in vi command mode. If set to \fBOn\fP, readline performs filename matching and completion in a case\-insensitive fashion. .TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP .B completion\-query\-items (100) This determines when the user is queried about viewing the number of possible completions @@ -4674,11 +5048,21 @@ can be set to either or .BR vi . .TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP .B enable\-keypad (Off) When set to \fBOn\fP, readline will try to enable the application keypad when it is called. Some systems need this to enable the arrow keys. .TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP .B expand\-tilde (Off) If set to \fBon\fP, tilde expansion is performed when readline attempts word completion. @@ -4688,6 +5072,10 @@ If set to \fBon\fP, the history code attempts to place point at the same location on each history line retrieved with \fBprevious-history\fP or \fBnext-history\fP. .TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. If +set to zero, the number of entries in the history list is not limited. +.TP .B horizontal\-scroll\-mode (Off) When set to \fBOn\fP, makes readline use a single line for display, scrolling the input horizontally on a single screen line when it @@ -4749,6 +5137,12 @@ to display a screenful of possible completions at a time. .B print\-completions\-horizontally (Off) If set to \fBOn\fP, readline will display completions with matches sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBon\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. .TP .B show\-all\-if\-ambiguous (Off) This alters the default behavior of the completion functions. If @@ -4767,6 +5161,14 @@ possible partial completion (the possible completions don't share a common prefix) cause the matches to be listed immediately instead of ringing the bell. .TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP .B visible\-stats (Off) If set to \fBOn\fP, a character denoting a file's type as reported by \fIstat\fP(2) is appended to the filename when listing possible @@ -4913,8 +5315,16 @@ Move forward to the end of the next word. Words are composed of alphanumeric characters (letters and digits). .TP .B backward\-word (M\-b) -Move back to the start of the current or previous word. Words are -composed of alphanumeric characters (letters and digits). +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. .TP .B clear\-screen (C\-l) Clear the screen leaving the current line at the top of the screen. @@ -5043,7 +5453,7 @@ Invoke an editor on the current command line, and execute the result as shell commands. \fBBash\fP attempts to invoke .SM -.BR $FCEDIT , +.BR $VISUAL , .SM .BR $EDITOR , and \fIemacs\fP as the editor, in that order. @@ -5142,6 +5552,15 @@ Word boundaries are the same as those used by \fBforward\-word\fP. Kill the word behind point. Word boundaries are the same as those used by \fBbackward\-word\fP. .TP +.B shell\-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 those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP .B unix\-word\-rubout (C\-w) Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring. @@ -5234,6 +5653,11 @@ through the list. This command is intended to be bound to \fBTAB\fP, but is unbound by default. .TP +.B menu\-complete-\backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP .B delete\-char\-or\-list Deletes the character under the cursor if not at the beginning or end of the line (like \fBdelete\-char\fP). @@ -5288,6 +5712,11 @@ Attempt completion on the text before point, comparing the text against lines from the history list for possible completion matches. .TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP .B 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 (see @@ -5361,6 +5790,15 @@ character. A negative count searches for previous occurrences. A character is read and point is moved to the previous occurrence of that character. A negative count searches for subsequent occurrences. .TP +.B skip\-csi\-sequence () +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP .B insert\-comment (M\-#) Without a numeric argument, the value of the readline .B comment\-begin @@ -5368,7 +5806,7 @@ variable is inserted at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if the characters at the beginning of the line do not match the value of \fBcomment\-begin\fP, the value is inserted, otherwise -the characters in \fBcomment-begin\fP are deleted from the beginning of +the characters in \fBcomment\-begin\fP are deleted from the beginning of the line. In either case, the line is accepted as if a newline had been typed. The default value of @@ -5427,12 +5865,17 @@ using the \fBcomplete\fP builtin (see below), the programmable completion facilities are invoked. .PP First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. If a compspec has been defined for that command, the compspec is used to generate the list of possible completions for the word. If the command word is a full pathname, a compspec for the full pathname is searched for first. If no compspec is found for the full pathname, an attempt is made to find a compspec for the portion following the final slash. +If those searches to not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. .PP Once a compspec has been found, it is used to generate the list of matching words. @@ -5452,7 +5895,7 @@ variable .B FIGNORE is used to filter the matches. .PP -Any completions specified by a filename expansion pattern to the +Any completions specified by a pathname expansion pattern to the \fB\-G\fP option are generated next. The words generated by the pattern need not match the word being completed. @@ -5486,10 +5929,14 @@ After these matches have been generated, any shell function or command specified with the \fB\-F\fP and \fB\-C\fP options is invoked. When the command or function is invoked, the .SM -.B COMP_LINE +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , and .SM -.B COMP_POINT +.B COMP_TYPE variables are assigned values as described above under \fBShell Variables\fP. If a shell function is being invoked, the @@ -5561,6 +6008,35 @@ the programmable completion functions force readline to append a slash to completed names which are symbolic links to directories, subject to the value of the \fBmark\-directories\fP readline variable, regardless of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader +.br +\fP .SH HISTORY When the .B \-o history @@ -5569,7 +6045,10 @@ option to the builtin is enabled, the shell provides access to the \fIcommand history\fP, the list of commands previously typed. -The value of the \fBHISTSIZE\fP variable is used as the +The value of the +.SM +.B HISTSIZE +variable is used as the number of commands to save in a history list. The text of the last .SM @@ -5599,6 +6078,13 @@ is truncated, if necessary, to contain no more than the number of lines specified by the value of .SM .BR HISTFILESIZE . +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. When an interactive shell exits, the last .SM .B $HISTSIZE @@ -5619,7 +6105,16 @@ If .SM .B HISTFILE is unset, or if the history file is unwritable, the history is -not saved. After saving the history, the history file is truncated +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated to contain no more than .SM .B HISTFILESIZE @@ -5719,7 +6214,7 @@ If the .B histverify shell option is enabled (see the description of the .B shopt -builtin), and +builtin below), and .B readline is being used, history substitutions are not immediately passed to the shell parser. @@ -5753,6 +6248,9 @@ history expansion mechanism (see the description of .B histchars above under .BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. .SS Event Designators .PP An event designator is a reference to a command line entry in the @@ -5940,8 +6438,14 @@ section as accepting options preceded by accepts .B \-\- to signify the end of the options. -For example, the \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins -do not accept options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. .sp .5 .PD 0 .TP @@ -6012,8 +6516,9 @@ no alias has been defined. Resume each suspended job \fIjobspec\fP in the background, as if it had been started with .BR & . -If \fIjobspec\fP is not present, the shell's notion of the -\fIcurrent job\fP is used. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. .B bg .I jobspec returns 0 unless run when job control is disabled or, when run with @@ -6071,13 +6576,6 @@ that they can be re-read. .B \-P List current \fBreadline\fP function names and bindings. .TP -.B \-v -Display \fBreadline\fP variable names and values in such a way that they -can be re-read. -.TP -.B \-V -List current \fBreadline\fP variable names and values. -.TP .B \-s Display \fBreadline\fP key sequences bound to macros and the strings they output in such a way that they can be re-read. @@ -6086,6 +6584,13 @@ they output in such a way that they can be re-read. Display \fBreadline\fP key sequences bound to macros and the strings they output. .TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP .B \-f \fIfilename\fP Read key bindings from \fIfilename\fP. .TP @@ -6101,6 +6606,20 @@ Remove any current binding for \fIkeyseq\fP. .B \-x \fIkeyseq\fP:\fIshell\-command\fP Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. .PD .PP The return value is 0 unless an unrecognized option is given or an @@ -6119,10 +6638,8 @@ loop. If \fIn\fP is specified, break \fIn\fP levels. must be \(>= 1. If .I n is greater than the number of enclosing loops, all enclosing loops -are exited. The return value is 0 unless the shell is not executing -a loop when -.B break -is executed. +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. .TP \fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] Execute the specified shell builtin, passing it @@ -6136,6 +6653,20 @@ The return status is false if .I shell\-builtin is not a shell builtin command. .TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins. +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP \fBcd\fP [\fB\-L|-P\fP] [\fIdir\fP] Change the current directory to \fIdir\fP. The variable .SM @@ -6174,27 +6705,16 @@ option forces symbolic links to be followed. An argument of is equivalent to .SM .BR $OLDPWD . -If a non-empty directory name from \fBCDPATH\fP is used, or if +If a non-empty directory name from +.SM +.B CDPATH +is used, or if \fB\-\fP is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. The return value is true if the directory was successfully changed; false otherwise. .TP -\fBcaller\fP [\fIexpr\fP] -Returns the context of any active subroutine call (a shell function or -a script executed with the \fB.\fP or \fBsource\fP builtins. -Without \fIexpr\fP, \fBcaller\fP displays the line number and source -filename of the current subroutine call. -If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP -displays the line number, subroutine name, and source file corresponding -to that position in the current execution call stack. This extra -information may be used, for example, to print a stack trace. The -current frame is frame 0. -The return value is 0 unless the shell is not executing a subroutine -call or \fIexpr\fP does not correspond to a valid position in the -call stack. -.TP \fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] Run .I command @@ -6209,6 +6729,7 @@ are executed. If the option is given, the search for .I command is performed using a default value for +.SM .B PATH that is guaranteed to find all of the standard utilities. If either the @@ -6258,12 +6779,12 @@ will be displayed. The return value is true unless an invalid option is supplied, or no matches were generated. .TP -\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] .br -[\fB\-X\fP \fIfilterpat\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] \fIname\fP [\fIname ...\fP] +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] .PD 0 .TP -\fBcomplete\fP \fB\-pr\fP [\fIname\fP ...] +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] .PD Specify how arguments to each \fIname\fP should be completed. If the \fB\-p\fP option is supplied, or if no options are supplied, @@ -6272,6 +6793,12 @@ them to be reused as input. The \fB\-r\fP option removes a completion specification for each \fIname\fP, or, if no \fIname\fPs are supplied, all completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. .sp 1 The process of applying these completion specifications when word completion is attempted is described above under \fBProgrammable Completion\fP. @@ -6304,8 +6831,9 @@ Perform directory name completion if the compspec generates no matches. .TP 8 .B 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). Intended to be used with shell functions. +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. .TP 8 .B nospace Tell readline not to append a space (the default) to words completed at @@ -6399,7 +6927,7 @@ Names of all shell variables. May also be specified as \fB\-v\fP. .RE .TP 8 \fB\-G\fP \fIglobpat\fP -The filename expansion pattern \fIglobpat\fP is expanded to generate +The pathname expansion pattern \fIglobpat\fP is expanded to generate the possible completions. .TP 8 \fB\-W\fP \fIwordlist\fP @@ -6424,7 +6952,7 @@ of the array variable. .TP 8 \fB\-X\fP \fIfilterpat\fP -\fIfilterpat\fP is a pattern as used for filename expansion. +\fIfilterpat\fP is a pattern as used for pathname expansion. It is applied to the list of possible completions generated by the preceding options and arguments, and each completion matching \fIfilterpat\fP is removed from the list. @@ -6447,6 +6975,25 @@ a \fIname\fP for which no specification exists, or an error occurs adding a completion specification. .RE .TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-execution completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.PP +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP \fBcontinue\fP [\fIn\fP] Resume the next iteration of the enclosing .BR for , @@ -6462,15 +7009,13 @@ is specified, resume at the \fIn\fPth enclosing loop. must be \(>= 1. If .I n is greater than the number of enclosing loops, the last enclosing loop -(the ``top-level'' loop) is resumed. The return value is 0 unless the -shell is not executing a loop when -.B continue -is executed. +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. .TP -\fBdeclare\fP [\fB\-afFirtx\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBdeclare\fP [\fB\-aAfFilrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] .PD 0 .TP -\fBtypeset\fP [\fB\-afFirtx\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBtypeset\fP [\fB\-aAfFilrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] .PD Declare variables and/or give them attributes. If no \fIname\fPs are given then display the values of variables. @@ -6480,7 +7025,15 @@ option will display the attributes and values of each .IR name . When .B \-p -is used, additional options are ignored. +is used with \fIname\fP arguments, additional options are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. The .B \-F option inhibits the display of function definitions; only the @@ -6498,7 +7051,12 @@ to give variables attributes: .PD 0 .TP .B \-a -Each \fIname\fP is an array variable (see +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see .B Arrays above). .TP @@ -6508,8 +7066,13 @@ Use function names only. .B \-i The variable is treated as an integer; arithmetic evaluation (see .SM -.B "ARITHMETIC EVALUATION" ") " -is performed when the variable is assigned a value. +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. .TP .B \-r Make \fIname\fPs readonly. These names cannot then be assigned values @@ -6521,13 +7084,21 @@ Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from the calling shell. The trace attribute has no special meaning for variables. .TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP .B \-x Mark \fIname\fPs for export to subsequent commands via the environment. .PD .PP Using `+' instead of `\-' -turns off the attribute instead, with the exception that \fB+a\fP -may not be used to destroy an array variable. When used in a function, +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, makes each \fIname\fP local, as with the .B local @@ -6548,7 +7119,7 @@ an attempt is made to turn off array status for an array variable, or an attempt is made to display a non-existent function with \fB\-f\fP. .RE .TP -.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +.B dirs [+\fIn\fP] [\-\fIn\fP] [\fB\-cplv\fP] Without options, displays the list of currently remembered directories. The default display is on a single line with directory names separated by spaces. @@ -6596,6 +7167,10 @@ of the directory stack. Without options, each .I jobspec is removed from the table of active jobs. +If +.I jobspec +is not present, and neither \fB\-a\fP nor \fB\-r\fP is supplied, +the shell's notion of the \fIcurrent job\fP is used. If the \fB\-h\fP option is given, each .I jobspec is not removed from the table, but is marked so that @@ -6650,7 +7225,7 @@ alert (bell) backspace .TP .B \ec -suppress trailing newline +suppress further output .TP .B \ee an escape character @@ -6683,7 +7258,7 @@ the eight-bit character whose value is the hexadecimal value \fIHH\fP .PD .RE .TP -\fBenable\fP [\fB\-adnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] Enable and disable builtin shell commands. Disabling a builtin allows a disk command which has the same name as a shell builtin to be executed without specifying a full pathname, @@ -6744,7 +7319,7 @@ become the arguments to \fIcommand\fP. If the .B \-l option is supplied, -the shell places a dash at the beginning of the zeroth arg passed to +the shell places a dash at the beginning of the zeroth argument passed to .IR command . This is what .IR login (1) @@ -6815,7 +7390,7 @@ is supplied with a .I name that is not a function. .TP -\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-nlr\fP] [\fIfirst\fP] [\fIlast\fP] +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] .PD 0 .TP \fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] @@ -6963,7 +7538,9 @@ is to be used. .sp 1 When the end of options is encountered, \fBgetopts\fP exits with a return value greater than zero. -\fBOPTIND\fP is set to the index of the first non-option argument, +.SM +.B OPTIND +is set to the index of the first non-option argument, and \fBname\fP is set to ?. .sp 1 .B getopts @@ -7060,7 +7637,7 @@ The return status is true unless a .I name is not found or an invalid option is supplied. .TP -\fBhelp\fP [\fB\-s\fP] [\fIpattern\fP] +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] Display helpful information about builtin commands. If .I pattern is specified, @@ -7069,8 +7646,19 @@ gives detailed help on all commands matching .IR pattern ; otherwise help for all the builtins and shell control structures is printed. -The \fB\-s\fP option restricts the information displayed to a short -usage synopsis. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.RE The return status is 0 unless no command matches .IR pattern . .TP @@ -7096,7 +7684,10 @@ have been modified. An argument of lists only the last .I n lines. -If the shell variable \fBHISTTIMEFORMAT\fP is set and not null, +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, it is used as a format string for \fIstrftime\fP(3) to display the time stamp associated with each displayed history entry. No intervening blank is printed between the formatted time stamp @@ -7148,8 +7739,15 @@ history list is removed before the are added. .PD .PP -If the \fBHISTTIMEFORMAT\fP is set, the time stamp information -associated with each history entry is written to the history file. +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. The return value is 0 unless an invalid option is encountered, an error occurs while reading or writing the history file, an invalid \fIoffset\fP is supplied as an argument to \fB\-d\fP, or the @@ -7259,7 +7857,8 @@ Each .I arg is an arithmetic expression to be evaluated (see .SM -.BR "ARITHMETIC EVALUATION" ). +.B "ARITHMETIC EVALUATION" +above). If the last .I arg evaluates to 0, @@ -7292,6 +7891,76 @@ is supplied, or .B logout Exit a login shell. .TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned as an additional argument. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP \fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] Removes entries from the directory stack. With no arguments, removes the top directory from the stack, and performs a @@ -7301,6 +7970,10 @@ Arguments, if supplied, have the following meanings: .RS .PD 0 .TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP \fB+\fP\fIn\fP Removes the \fIn\fPth entry counting from the left of the list shown by @@ -7324,10 +7997,6 @@ removes the last directory, .if n ``popd -1'' .if t \f(CWpopd -1\fP the next to last. -.TP -.B \-n -Suppresses the normal change of directory when removing directories -from the stack, so that only the stack is manipulated. .PD .PP If the @@ -7366,10 +8035,10 @@ extra format specifications behave as if a zero value or null string, as appropriate, had been supplied. The return value is zero on success, non-zero on failure. .TP -\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] .PD 0 .TP -\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] .PD Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working @@ -7379,6 +8048,10 @@ Arguments, if supplied, have the following meanings: .RS .PD 0 .TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP \fB+\fP\fIn\fP Rotates the stack so that the \fIn\fPth directory (counting from the left of the list shown by @@ -7392,10 +8065,6 @@ Rotates the stack so that the \fIn\fPth directory .BR dirs , starting with zero) is at the top. .TP -.B \-n -Suppresses the normal change of directory when adding directories -to the stack, so that only the stack is manipulated. -.TP .I dir Adds .I dir @@ -7436,7 +8105,7 @@ The return status is 0 unless an error occurs while reading the name of the current directory or an invalid option is supplied. .TP -\fBread\fP [\fB\-ers\fP] [\fB\-u\fP \fIfd\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-a\fP \fIaname\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-n\fP \fInchars\fP] [\fB\-d\fP \fIdelim\fP] [\fIname\fP ...] +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] One line is read from the standard input, or from the file descriptor \fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word is assigned to the first @@ -7479,10 +8148,27 @@ is coming from a terminal, .SM .B READLINE above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. .TP .B \-n \fInchars\fP \fBread\fP returns after reading \fInchars\fP characters rather than -waiting for a complete line of input. +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. .TP .B \-p \fIprompt\fP Display \fIprompt\fP on standard error, without a @@ -7502,8 +8188,14 @@ not echoed. .B \-t \fItimeout\fP Cause \fBread\fP to time out and return failure if a complete line of input is not read within \fItimeout\fP seconds. -This option has no effect if \fBread\fP is not reading input from the -terminal or a pipe. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fItimeout\fP is 0, \fBread\fP returns success if input is available on +the specified file descriptor, failure otherwise. +The exit status is greater than 128 if the timeout is exceeded. .TP .B \-u \fIfd\fP Read input from file descriptor \fIfd\fP. @@ -7515,11 +8207,11 @@ are supplied, the line read is assigned to the variable .SM .BR REPLY . The return code is zero, unless end-of-file is encountered, \fBread\fP -times out, or an invalid file descriptor is supplied as the argument to -\fB\-u\fP. +times out (in which case the return code is greater than 128), or an +invalid file descriptor is supplied as the argument to \fB\-u\fP. .RE .TP -\fBreadonly\fP [\fB\-apf\fP] [\fIname\fP[=\fIword\fP] ...] +\fBreadonly\fP [\fB\-aApf\fP] [\fIname\fP[=\fIword\fP] ...] .PD The given \fInames\fP are marked readonly; the values of these @@ -7532,7 +8224,9 @@ option is supplied, the functions corresponding to the marked. The .B \-a -option restricts the variables to arrays. +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. If no .I name arguments are given, or if the @@ -7572,7 +8266,11 @@ the return status is false. Any command associated with the \fBRETURN\fP trap is executed before execution resumes after the function or script. .TP -\fBset\fP [\fB\-\-abefhkmnptuvxBCHP\fP] [\fB\-o\fP \fIoption\fP] [\fIarg\fP ...] +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\fP] [\fIarg\fP ...] +.PD Without options, the name and value of each shell variable are displayed in a format that can be reused as input for setting or resetting the currently-set variables. @@ -7580,7 +8278,7 @@ Read-only variables cannot be reset. In \fIposix mode\fP, only shell variables are listed. The output is sorted according to the current locale. When options are specified, they set or unset shell attributes. -Any arguments remaining after the options are processed are treated +Any arguments remaining after option processing are treated as values for the positional parameters and are assigned, in order, to .BR $1 , .BR $2 , @@ -7600,7 +8298,10 @@ immediately, rather than before the next primary prompt. This is effective only when job control is enabled. .TP 8 .B \-e -Exit immediately if a \fIsimple command\fP (see +Exit immediately if a \fIpipeline\fP (which may consist of a single +\fIsimple command\fP), a \fIsubshell\fP command enclosed in parentheses, +or one of the commands executed as part of a command list enclosed +by braces (see .SM .B SHELL GRAMMAR above) exits with a non-zero status. @@ -7610,16 +8311,26 @@ command that fails is part of the command list immediately following a or .B until keyword, -part of the test in an -.I if -statement, part of a +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a .B && or .B \(bv\(bv -list, or if the command's return value is -being inverted via +list except the command following the final \fB&&\fP or \fB\(bv\(bv\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with .BR ! . A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. .TP 8 .B \-f Disable pathname expansion. @@ -7666,6 +8377,11 @@ by default when the shell is interactive, unless the shell is started with the .B \-\-noediting option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . .TP 8 .B errtrace Same as @@ -7675,10 +8391,6 @@ Same as Same as .BR \-T . .TP 8 -.B errexit -Same as -.BR \-e . -.TP 8 .B hashall Same as .BR \-h . @@ -7721,6 +8433,7 @@ Same as .B noglob Same as .BR \-f . +.TP 8 .B nolog Currently ignored. .TP 8 @@ -7762,6 +8475,7 @@ Same as .TP 8 .B vi Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. .TP 8 .B xtrace Same as @@ -7792,8 +8506,15 @@ and files are not processed, shell functions are not inherited from the environment, and the .SM -.B SHELLOPTS -variable, if it appears in the environment, is ignored. +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. If the shell is started with the effective user (group) id not equal to the real user (group) id, and the \fB\-p\fP option is not supplied, these actions are taken and the effective user id is set to the real user id. @@ -7806,9 +8527,10 @@ and group ids to be set to the real user and group ids. Exit after reading and executing one command. .TP 8 .B \-u -Treat unset variables as an error when performing +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing parameter expansion. If expansion is attempted on an -unset variable, the shell prints an error message, and, +unset variable or parameter, the shell prints an error message, and, if not interactive, exits with a non-zero status. .TP 8 .B \-v @@ -7972,6 +8694,11 @@ The list of \fBshopt\fP options is: .if n .sp 1v .PD 0 .TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 .B cdable_vars If set, an argument to the .B cd @@ -7994,6 +8721,16 @@ If set, \fBbash\fP checks that a command found in the hash table exists before trying to execute it. If a hashed command no longer exists, a normal path search is performed. .TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 .B checkwinsize If set, \fBbash\fP checks the window size after each command and, if necessary, updates the values of @@ -8010,6 +8747,31 @@ attempts to save all lines of a multiple-line command in the same history entry. This allows easy re-editing of multi-line commands. .TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the conditional command's =~ operator. +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to locale-specific +string comparison when using the conditional command's < and > operators. +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the conditional command's < and > operators +and the effect of interrupting a command list. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 .B dotglob If set, .B bash @@ -8050,8 +8812,12 @@ executed by the \fB.\fP or \fBsource\fP builtins), a call to \fBreturn\fP is simulated. .TP .B 4. -\fBBASH_ARGC\fP and \fBBASH_ARGV\fP are updated as described in their -descriptions above. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. .TP .B 5. Function tracing is enabled: command substitution, shell functions, and @@ -8078,15 +8844,26 @@ If set, patterns which fail to match filenames during pathname expansion result in an expansion error. .TP 8 .B force_fignore -If set, the suffixes specified by the \fBFIGNORE\fP shell variable +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable cause words to be ignored when performing word completion even if the ignored words are the only possible completions. See .SM \fBSHELL VARIABLES\fP -above for a description of \fBFIGNORE\fP. +above for a description of +.SM +.BR FIGNORE . This option is enabled by default. .TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match a files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 .B gnu_errfmt If set, shell error messages are written in the standard GNU error message format. @@ -8094,6 +8871,7 @@ message format. .B histappend If set, the history list is appended to the file named by the value of the +.SM .B HISTFILE variable when the shell exits, rather than overwriting the file. .TP 8 @@ -8160,7 +8938,10 @@ If set, and .B readline is being used, .B bash -will not attempt to search the \fBPATH\fP for possible completions when +will not attempt to search the +.SM +.B PATH +for possible completions when completion is attempted on an empty line. .TP 8 .B nocaseglob @@ -8231,11 +9012,10 @@ by default. Suspend the execution of this shell until it receives a .SM .B SIGCONT -signal. The +signal. A login shell cannot be suspended; the .B \-f -option says not to complain if this is -a login shell; just suspend anyway. The return status is 0 unless -the shell is a login shell and +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and .B \-f is not supplied, or if job control is not enabled. .TP @@ -8256,6 +9036,7 @@ an argument of \fB\-\-\fP as signifying the end of options. .if n .sp 1 Expressions may be combined using the following operators, listed in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. .RS .PD 0 .TP @@ -8313,14 +9094,14 @@ under .BR "CONDITIONAL EXPRESSIONS" , the result of the expression is the result of the binary test using the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. If the first argument is \fB!\fP, the value is the negation of the two-argument test using the second and third arguments. If the first argument is exactly \fB(\fP and the third argument is exactly \fB)\fP, the result is the one-argument test of the second argument. Otherwise, the expression is false. -The \fB\-a\fP and \fB\-o\fP operators are considered binary operators -in this case. .TP 4 arguments If the first argument is \fB!\fP, the result is the negation of @@ -8377,6 +9158,8 @@ Each is either a signal name defined in <\fIsignal.h\fP>, or a signal number. Signal names are case insensitive and the SIG prefix is optional. +.if t .sp 0.5 +.if n .sp 1 If a .I sigspec is @@ -8404,6 +9187,17 @@ If a .I sigspec is .SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with the +\fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM .BR ERR , the command .I arg @@ -8420,7 +9214,7 @@ or keyword, part of the test in an .I if -statement, part of a +statement, part of a command executed in a .B && or .B \(bv\(bv @@ -8428,18 +9222,11 @@ list, or if the command's return value is being inverted via .BR ! . These are the same conditions obeyed by the \fBerrexit\fP option. -If a -.I sigspec -is -.SM -.BR RETURN , -the command -.I arg -is executed each time a shell function or a script executed with the -\fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 Signals ignored upon entry to the shell cannot be trapped or reset. Trapped signals that are not being ignored are reset to their original -values in a child process when it is created. +values in a subshell or subshell environment when one is created. The return status is false if any .I sigspec is invalid; otherwise @@ -8519,15 +9306,16 @@ The .B \-f option suppresses shell function lookup, as with the \fBcommand\fP builtin. .B type -returns true if any of the arguments are found, false if -none are found. +returns true if all of the arguments are found, false if +any are not found. .TP -\fBulimit\fP [\fB\-SHacdefilmnpqrstuvx\fP [\fIlimit\fP]] +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] Provides control over the resources available to the shell and to processes started by it, on systems that allow such control. The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is -set for the given resource. A hard limit cannot be increased once it -is set; a soft limit may be increased up to the value of the hard limit. +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard limits are set. The value of @@ -8552,6 +9340,9 @@ Other options are interpreted as follows: .B \-a All current limits are reported .TP +.B \-b +The maximum socket buffer size +.TP .B \-c The maximum size of core files created .TP @@ -8571,7 +9362,7 @@ The maximum number of pending signals The maximum size that may be locked into memory .TP .B \-m -The maximum resident set size +The maximum resident set size (many systems do not honor this limit) .TP .B \-n The maximum number of open file descriptors (most systems do not @@ -8600,6 +9391,9 @@ The maximum amount of virtual memory available to the shell .TP .B \-x The maximum number of file locks +.TP +.B \-T +The maximum number of threads .PD .PP If @@ -8615,7 +9409,9 @@ which is in seconds, .BR \-p , which is in units of 512-byte blocks, and -.B \-n +.BR \-T , +.BR \-b , +.BR \-n , and .BR \-u , which are unscaled values. @@ -8676,6 +9472,8 @@ Each unset variable or function is removed from the environment passed to subsequent commands. If any of .SM +.BR COMP_WORDBREAKS , +.SM .BR RANDOM , .SM .BR SECONDS , @@ -8732,10 +9530,14 @@ with the exception that the following are disallowed or not performed: changing directories with \fBcd\fP .IP \(bu setting or unsetting the values of +.SM .BR SHELL , +.SM .BR PATH , +.SM .BR ENV , or +.SM .B BASH_ENV .IP \(bu specifying command names containing @@ -8755,7 +9557,10 @@ builtin command .IP \(bu importing function definitions from the shell environment at startup .IP \(bu -parsing the value of \fBSHELLOPTS\fP from the shell environment at startup +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup .IP \(bu redirecting output using the >, >|, <>, >&, &>, and >> redirection operators .IP \(bu @@ -8822,12 +9627,6 @@ The \fBbash\fP executable .FN /etc/profile The systemwide initialization file, executed for login shells .TP -.FN /etc/bash.bashrc -The systemwide per-interactive-shell startup file -.TP -.FN /etc/bash.logout -The systemwide login shell cleanup file, executed when a login shell exits -.TP .FN ~/.bash_profile The personal initialization file, executed for login shells .TP @@ -8847,7 +9646,7 @@ bfox@gnu.org .PP Chet Ramey, Case Western Reserve University .br -chet@po.cwru.edu +chet.ramey@case.edu .SH BUG REPORTS If you find a bug in .B bash, @@ -8914,12 +9713,8 @@ It suffices to place the sequence of commands between parentheses to force it into a subshell, which may be stopped as a unit. .PP -Commands inside of \fB$(\fP...\fB)\fP command substitution are not -parsed until substitution is attempted. This will delay error -reporting until some time after the command is entered. For example, -unmatched parentheses, even inside shell comments, will result in -error messages while the construct is being read. -.PP Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. .zZ .zY diff --git a/doc/bash.html b/doc/bash.html new file mode 100644 index 0000000..2aa2825 --- /dev/null +++ b/doc/bash.html @@ -0,0 +1,12571 @@ +<HTML><HEAD> +<TITLE>BASH(1) Manual Page</TITLE> +</HEAD> +<BODY><TABLE WIDTH=100%> +<TR> +<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2009 December 29<TH ALIGN=RIGHT width=33%>BASH(1) +</TR> +</TABLE> +<BR><A HREF="#index">Index</A> +<HR> + + + + + + + + + + + + + + + + + + + +<A NAME="lbAB"> </A> +<H3>NAME</H3> + +bash - GNU Bourne-Again SHell +<A NAME="lbAC"> </A> +<H3>SYNOPSIS</H3> + +<B>bash</B> + +[options] +[file] +<A NAME="lbAD"> </A> +<H3>COPYRIGHT</H3> + + +Bash is Copyright © 1989-2009 by the Free Software Foundation, Inc. +<A NAME="lbAE"> </A> +<H3>DESCRIPTION</H3> + +<B>Bash</B> + +is an <B>sh</B>-compatible command language interpreter that +executes commands read from the standard input or from a file. +<B>Bash</B> + +also incorporates useful features from the <I>Korn</I> and <I>C</I> +shells (<B>ksh</B> and <B>csh</B>). +<P> + +<B>Bash</B> + +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +<B>Bash</B> + +can be configured to be POSIX-conformant by default. +<A NAME="lbAF"> </A> +<H3>OPTIONS</H3> + +In addition to the single-character shell options documented in the +description of the <B>set</B> builtin command, <B>bash</B> +interprets the following options when it is invoked: +<P> + + +<DL COMPACT> +<DT><B>-c</B><I> string</I> + +<DD> +If the +<B>-c</B> + +option is present, then commands are read from +<I>string</I>. + +If there are arguments after the +<I>string</I>, + +they are assigned to the positional parameters, starting with +<B>$0</B>. + +<DT><B>-i</B> + +<DD> +If the +<B>-i</B> + +option is present, the shell is +<I>interactive</I>. + +<DT><B>-l</B> + +<DD> +Make +<B>bash</B> + +act as if it had been invoked as a login shell (see +<FONT SIZE=-1><B>INVOCATION</B> + +</FONT> +below). +<DT><B>-r</B> + +<DD> +If the +<B>-r</B> + +option is present, the shell becomes +<I>restricted</I> + +(see +<FONT SIZE=-1><B>RESTRICTED SHELL</B> + +</FONT> +below). +<DT><B>-s</B> + +<DD> +If the +<B>-s</B> + +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +<DT><B>-D</B> + +<DD> +A list of all double-quoted strings preceded by <B>$</B> +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not <B>C</B> or <B>POSIX</B>. +This implies the <B>-n</B> option; no commands will be executed. +<DT><B>[-+]O [</B><I>shopt_option</I>] + +<DD> +<I>shopt_option</I> is one of the shell options accepted by the +<B>shopt</B> builtin (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +If <I>shopt_option</I> is present, <B>-O</B> sets the value of that option; +<B>+O</B> unsets it. +If <I>shopt_option</I> is not supplied, the names and values of the shell +options accepted by <B>shopt</B> are printed on the standard output. +If the invocation option is <B>+O</B>, the output is displayed in a format +that may be reused as input. +<DT><B>--</B> + +<DD> +A +<B>--</B> + +signals the end of options and disables further option processing. +Any arguments after the +<B>--</B> + +are treated as filenames and arguments. An argument of +<B>-</B> + +is equivalent to <B>--</B>. + +</DL> +<P> + +<B>Bash</B> + +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +<P> + + +<DL COMPACT> +<DT><B>--debugger</B> + +<DD> +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +<B>extdebug</B> + +option to the +<B>shopt</B> + +builtin below) +and shell function tracing (see the description of the +<B>-o functrace</B> option to the +<B>set</B> + +builtin below). +<DT><B>--dump-po-strings</B> + +<DD> +Equivalent to <B>-D</B>, but the output is in the GNU <I>gettext</I> +<B>po</B> (portable object) file format. +<DT><B>--dump-strings</B> + +<DD> +Equivalent to <B>-D</B>. +<DT><B>--help</B> + +<DD> +Display a usage message on standard output and exit successfully. +<DT><B>--init-file</B> <I>file</I><DD> + +<DT><B>--rcfile</B> <I>file</I><DD> + +Execute commands from +<I>file</I> + +instead of the standard personal initialization file +<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A> + +if the shell is interactive (see +<FONT SIZE=-1><B>INVOCATION</B> + +</FONT> +below). +<DT><B>--login</B> + +<DD> +Equivalent to <B>-l</B>. +<DT><B>--noediting</B> + +<DD> +Do not use the GNU +<B>readline</B> + +library to read command lines when the shell is interactive. +<DT><B>--noprofile</B> + +<DD> +Do not read either the system-wide startup file + +<A HREF="file:/etc/profile"><I>/etc/profile</I></A> + +or any of the personal initialization files +<A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A>, + +<A HREF="file:~/.bash_login"><I>~/.bash_login</I></A>, + +or +<A HREF="file:~/.profile"><I>~/.profile</I></A>. + +By default, +<B>bash</B> + +reads these files when it is invoked as a login shell (see +<FONT SIZE=-1><B>INVOCATION</B> + +</FONT> +below). +<DT><B>--norc</B> + +<DD> +Do not read and execute the personal initialization file +<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A> + +if the shell is interactive. +This option is on by default if the shell is invoked as +<B>sh</B>. + +<DT><B>--posix</B> + +<DD> +Change the behavior of <B>bash</B> where the default operation differs +from the POSIX standard to match the standard (<I>posix mode</I>). +<DT><B>--restricted</B> + +<DD> +The shell becomes restricted (see +<FONT SIZE=-1><B>RESTRICTED SHELL</B> + +</FONT> +below). +<DT><B>--verbose</B> + +<DD> +Equivalent to <B>-v</B>. +<DT><B>--version</B> + +<DD> +Show version information for this instance of +<B>bash</B> + +on the standard output and exit successfully. + +</DL> +<A NAME="lbAG"> </A> +<H3>ARGUMENTS</H3> + +If arguments remain after option processing, and neither the +<B>-c</B> + +nor the +<B>-s</B> + +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +<B>bash</B> + +is invoked in this fashion, +<B>$0</B> + +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +<B>Bash</B> + +reads and executes commands from this file, then exits. +<B>Bash</B>'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. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +<FONT SIZE=-1><B>PATH</B> + +</FONT> +for the script. +<A NAME="lbAH"> </A> +<H3>INVOCATION</H3> + +A <I>login shell</I> is one whose first character of argument zero is a +<B>-</B>, + +or one started with the +<B>--login</B> + +option. +<P> + +An <I>interactive</I> shell is one started without non-option arguments +and without the +<B>-c</B> + +option +whose standard input and error are +both connected to terminals (as determined by +<I>isatty</I>(3)), + +or one started with the +<B>-i</B> + +option. +<FONT SIZE=-1><B>PS1</B> + +</FONT> +is set and +<B>$-</B> + +includes +<B>i</B> + +if +<B>bash</B> + +is interactive, +allowing a shell script or a startup file to test this state. +<P> + +The following paragraphs describe how +<B>bash</B> + +executes its startup files. +If any of the files exist but cannot be read, +<B>bash</B> + +reports an error. +Tildes are expanded in file names as described below under +<B>Tilde Expansion</B> + +in the +<FONT SIZE=-1><B>EXPANSION</B> + +</FONT> +section. +<P> + +When +<B>bash</B> + +is invoked as an interactive login shell, or as a non-interactive shell +with the <B>--login</B> option, it first reads and +executes commands from the file <A HREF="file:/etc/profile"><I>/etc/profile</I></A>, if that +file exists. +After reading that file, it looks for <A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A>, +<A HREF="file:~/.bash_login"><I>~/.bash_login</I></A>, and <A HREF="file:~/.profile"><I>~/.profile</I></A>, in that order, and reads +and executes commands from the first one that exists and is readable. +The +<B>--noprofile</B> + +option may be used when the shell is started to inhibit this behavior. +<P> + +When a login shell exits, +<B>bash</B> + +reads and executes commands from the file <A HREF="file:~/.bash_logout"><I>~/.bash_logout</I></A>, if it +exists. +<P> + +When an interactive shell that is not a login shell is started, +<B>bash</B> + +reads and executes commands from <A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>, if that file exists. +This may be inhibited by using the +<B>--norc</B> + +option. +The <B>--rcfile</B> <I>file</I> option will force +<B>bash</B> + +to read and execute commands from <I>file</I> instead of <A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>. +<P> + +When +<B>bash</B> + +is started non-interactively, to run a shell script, for example, it +looks for the variable +<FONT SIZE=-1><B>BASH_ENV</B> + +</FONT> +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +<B>Bash</B> + +behaves as if the following command were executed: +<P> +<DL COMPACT><DT><DD> +<TT>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</TT> + +</DL> + +<P> +but the value of the +<FONT SIZE=-1><B>PATH</B> + +</FONT> +variable is not used to search for the file name. +<P> + +If +<B>bash</B> + +is invoked with the name +<B>sh</B>, + +it tries to mimic the startup behavior of historical versions of +<B>sh</B> + +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the <B>--login</B> option, it first attempts to +read and execute commands from +<A HREF="file:/etc/profile"><I>/etc/profile</I></A> + +and +<A HREF="file:~/.profile"><I>~/.profile</I></A>, + +in that order. +The +<B>--noprofile</B> + +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +<B>sh</B>, + +<B>bash</B> + +looks for the variable +<FONT SIZE=-1><B>ENV</B>, + +</FONT> +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +<B>sh</B> + +does not attempt to read and execute commands from any other startup +files, the +<B>--rcfile</B> + +option has no effect. +A non-interactive shell invoked with the name +<B>sh</B> + +does not attempt to read any other startup files. +When invoked as +<B>sh</B>, + +<B>bash</B> + +enters +<I>posix</I> + +mode after the startup files are read. +<P> + +When +<B>bash</B> + +is started in +<I>posix</I> + +mode, as with the +<B>--posix</B> + +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +<FONT SIZE=-1><B>ENV</B> + +</FONT> +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +<P> + +<B>Bash</B> + +attempts to determine when it is being run with its standard input +connected to a a network connection, as if by the remote shell +daemon, usually <I>rshd</I>, or the secure shell daemon <I>sshd</I>. +If +<B>bash</B> + +determines it is being run in this fashion, it reads and executes +commands from <A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>, if that file exists and is readable. +It will not do this if invoked as <B>sh</B>. +The +<B>--norc</B> + +option may be used to inhibit this behavior, and the +<B>--rcfile</B> + +option may be used to force another file to be read, but +<I>rshd</I> does not generally invoke the shell with those options +or allow them to be specified. +<P> + +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the <B>-p</B> option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +<FONT SIZE=-1><B>SHELLOPTS</B>, + +</FONT> +<FONT SIZE=-1><B>BASHOPTS</B>, + +</FONT> +<FONT SIZE=-1><B>CDPATH</B>, + +</FONT> +and +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the <B>-p</B> option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +<A NAME="lbAI"> </A> +<H3>DEFINITIONS</H3> + +<P> + +The following definitions are used throughout the rest of this +document. + +<DL COMPACT> +<DT><B>blank </B> + +<DD> +A space or tab. +<DT><B>word</B> + +<DD> +A sequence of characters considered as a single unit by the shell. +Also known as a +<B>token</B>. + +<DT><B>name</B> + +<DD> +A +<I>word</I> + +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +<B>identifier</B>. + +<DT><B>metacharacter</B> + +<DD> +A character that, when unquoted, separates words. One of the following: +<BR> + +<DL COMPACT><DT><DD> +<P> + +<B>| & ; ( ) < > space tab</B> + +</DL> + +</DL> +<P> + +<DL COMPACT> +<DT><B>control operator</B> + +<DD> +A <I>token</I> that performs a control function. It is one of the following +symbols: +<DL COMPACT><DT><DD> +<P> + +<B>|| & && ; ;; ( ) | |& <newline></B> + +</DL> + + +</DL> +<A NAME="lbAJ"> </A> +<H3>RESERVED WORDS</H3> + +<I>Reserved words</I> are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +<FONT SIZE=-1><B>SHELL GRAMMAR</B> + +</FONT> +below) or the third word of a +<B>case </B> + +or +<B>for</B> + +command: +<DL COMPACT><DT><DD> + +<P> + +<B> +</B> + +! case do done elif else esac fi for function if in select then until while { } time [[ ]] +</DL> + + +<A NAME="lbAK"> </A> +<H3>SHELL GRAMMAR</H3> + +<A NAME="lbAL"> </A> +<H4>Simple Commands</H4> + +<P> + +A <I>simple command</I> is a sequence of optional variable assignments +followed by <B>blank</B>-separated words and redirections, and +terminated by a <I>control operator</I>. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +<P> + +The return value of a <I>simple command</I> is its exit status, or +128+<I>n</I> if the command is terminated by signal +<I>n</I>. + +<A NAME="lbAM"> </A> +<H4>Pipelines</H4> + +<P> + +A <I>pipeline</I> is a sequence of one or more commands separated by +one of the control operators +<B>|</B> + +or <B>|&</B>. +The format for a pipeline is: +<DL COMPACT><DT><DD> +<P> + +[<B>time</B> [<B>-p</B>]] [ ! ] <I>command</I> [ [<B>|</B>|<B>|&</B>] <I>command2</I> ... ] +</DL> + +<P> + +The standard output of +<I>command</I> + +is connected via a pipe to the standard input of +<I>command2</I>. + +This connection is performed before any redirections specified by the +command (see +<FONT SIZE=-1><B>REDIRECTION</B> + +</FONT> +below). +If <B>|&</B> is used, the standard error of <I>command</I> is connected to +<I>command2</I>'s standard input through the pipe; it is shorthand for +<B>2>&1 |</B>. +This implicit redirection of the standard error is performed after any +redirections specified by the command. +<P> + +The return status of a pipeline is the exit status of the last +command, unless the <B>pipefail</B> option is enabled. +If <B>pipefail</B> is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +<B>!</B> + +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +<P> + +If the +<B>time</B> + +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The <B>-p</B> option changes the output format to that specified by POSIX. +The +<FONT SIZE=-1><B>TIMEFORMAT</B> + +</FONT> +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +<FONT SIZE=-1><B>TIMEFORMAT</B> + +</FONT> +under +<B>Shell Variables</B> + +below. +<P> + +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +<A NAME="lbAN"> </A> +<H4>Lists</H4> + +<P> + +A <I>list</I> is a sequence of one or more pipelines separated by one +of the operators +<B>;</B>, + +<B>&</B>, + +<B>&&</B>, + +or +<B>||</B>, + +and optionally terminated by one of +<B>;</B>, + +<B>&</B>, + +or +<B><newline></B>. + +<P> + +Of these list operators, +<B>&&</B> + +and +<B>||</B> + +have equal precedence, followed by +<B>;</B> + +and +<B>&</B>, + +which have equal precedence. +<P> + +A sequence of one or more newlines may appear in a <I>list</I> instead +of a semicolon to delimit commands. +<P> + +If a command is terminated by the control operator +<B>&</B>, + +the shell executes the command in the <I>background</I> +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +<B>;</B> + +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +<P> + +AND and OR lists are sequences of one of more pipelines separated by the +<B>&&</B> and <B>||</B> control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +<DL COMPACT><DT><DD> +<P> + +<I>command1</I> <B>&&</B> <I>command2</I> +</DL> + +<P> + +<I>command2</I> + +is executed if, and only if, +<I>command1</I> + +returns an exit status of zero. +<P> + +An OR list has the form +<DL COMPACT><DT><DD> +<P> + +<I>command1</I> <B>||</B> <I>command2</I> +<P> + +</DL> + +<P> + +<I>command2</I> + +is executed if and only if +<I>command1</I> + +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +<A NAME="lbAO"> </A> +<H4>Compound Commands</H4> + +<P> + +A <I>compound command</I> is one of the following: +<DL COMPACT> +<DT>(<I>list</I>)<DD> +<I>list</I> is executed in a subshell environment (see +<FONT SIZE=-1><B>COMMAND EXECUTION ENVIRONMENT</B></FONT> +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +<I>list</I>. +<DT>{ <I>list</I>; }<DD> +<I>list</I> is simply executed in the current shell environment. +<I>list</I> must be terminated with a newline or semicolon. +This is known as a <I>group command</I>. +The return status is the exit status of +<I>list</I>. +Note that unlike the metacharacters <B>(</B> and <B>)</B>, <B>{</B> and +<B>}</B> are <I>reserved words</I> and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from <I>list</I> by whitespace or another +shell metacharacter. +<DT>((<I>expression</I>))<DD> +The <I>expression</I> is evaluated according to the rules described +below under +<FONT SIZE=-1><B>ARITHMETIC EVALUATION</B>. + +</FONT> +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 +<B>let "</B><I>expression</I>". +<DT><B>[[</B> <I>expression</I> <B>]]</B><DD> +Return a status of 0 or 1 depending on the evaluation of +the conditional expression <I>expression</I>. +Expressions are composed of the primaries described below under +<FONT SIZE=-1><B>CONDITIONAL EXPRESSIONS</B>. + +</FONT> +Word splitting and pathname expansion are not performed on the words +between the <B>[[</B> and <B>]]</B>; tilde expansion, parameter and +variable expansion, arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as <B>-f</B> must be unquoted to be recognized +as primaries. +<P> + + +When used with <B>[[</B>, The <B><</B> and <B>></B> operators sort +lexicographically using the current locale. +<P> + + +When the <B>==</B> and <B>!=</B> operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under <B>Pattern Matching</B>. +If the shell option +<B>nocasematch</B> + +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (<B>==</B>) or does not match +(<B>!=</B>) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force it to be matched as a +string. +<P> + + +An additional binary operator, <B>=~</B>, is available, with the same +precedence as <B>==</B> and <B>!=</B>. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in <I>regex</I>(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +<B>nocasematch</B> + +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force it to be matched as a +string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +<FONT SIZE=-1><B>BASH_REMATCH</B>. + +</FONT> +The element of +<FONT SIZE=-1><B>BASH_REMATCH</B> + +</FONT> +with index 0 is the portion of the string +matching the entire regular expression. +The element of +<FONT SIZE=-1><B>BASH_REMATCH</B> + +</FONT> +with index <I>n</I> is the portion of the +string matching the <I>n</I>th parenthesized subexpression. +<P> + + +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +<P> + + +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>( </B><I>expression</I> ) + +<DD> +Returns the value of <I>expression</I>. +This may be used to override the normal precedence of operators. +<DT><B>! </B><I>expression</I> + +<DD> +True if +<I>expression</I> + +is false. +<DT><I>expression1</I> <B>&&</B> <I>expression2</I><DD> +True if both +<I>expression1</I> + +and +<I>expression2</I> + +are true. +<DT><I>expression1</I> <B>||</B> <I>expression2</I> +<DD> + +True if either +<I>expression1</I> + +or +<I>expression2</I> + +is true. + +</DL> +<P> + +The <B>&&</B> and +<B>||</B> + +operators do not evaluate <I>expression2</I> if the value of +<I>expression1</I> is sufficient to determine the return value of +the entire conditional expression. +</DL> + +<DT><B>for</B> <I>name</I> [ [ <B>in</B> [ <I>word ...</I> ] ] ; ] <B>do</B> <I>list</I> ; <B>done</B><DD> +The list of words following <B>in</B> is expanded, generating a list +of items. +The variable <I>name</I> is set to each element of this list +in turn, and <I>list</I> is executed each time. +If the <B>in</B> <I>word</I> is omitted, the <B>for</B> command executes +<I>list</I> once for each positional parameter that is set (see +<FONT SIZE=-1><B>PARAMETERS</B> + +</FONT> +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following <B>in</B> results in an empty +list, no commands are executed, and the return status is 0. +<DT><B>for</B> (( <I>expr1</I> ; <I>expr2</I> ; <I>expr3</I> )) ; <B>do</B> <I>list</I> ; <B>done</B><DD> +First, the arithmetic expression <I>expr1</I> is evaluated according +to the rules described below under +<FONT SIZE=-1><B>ARITHMETIC EVALUATION</B>. + +</FONT> +The arithmetic expression <I>expr2</I> is then evaluated repeatedly +until it evaluates to zero. +Each time <I>expr2</I> evaluates to a non-zero value, <I>list</I> is +executed and the arithmetic expression <I>expr3</I> is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in <I>list</I> +that is executed, or false if any of the expressions is invalid. +<DT><B>select</B> <I>name</I> [ <B>in</B> <I>word</I> ] ; <B>do</B> <I>list</I> ; <B>done</B><DD> +The list of words following <B>in</B> is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the <B>in</B> +<I>word</I> is omitted, the positional parameters are printed (see +<FONT SIZE=-1><B>PARAMETERS</B> + +</FONT> +below). The +<FONT SIZE=-1><B>PS3</B> + +</FONT> +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +<I>name</I> + +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +<I>name</I> + +to be set to null. The line read is saved in the variable +<FONT SIZE=-1><B>REPLY</B>. + +</FONT> +The +<I>list</I> + +is executed after each selection until a +<B>break</B> + +command is executed. +The exit status of +<B>select</B> + +is the exit status of the last command executed in +<I>list</I>, + +or zero if no commands were executed. +<DT><B>case</B> <I>word</I> <B>in</B> [ [(] <I>pattern</I> [ <B>|</B> <I>pattern</I> ] +<DD> +A <B>case</B> command first expands <I>word</I>, and tries to match +it against each <I>pattern</I> in turn, using the same matching rules +as for pathname expansion (see +<B>Pathname Expansion</B> + +below). +The <I>word</I> is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each <I>pattern</I> examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +<B>nocasematch</B> + +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding <I>list</I> is executed. +If the <B>;;</B> operator is used, no subsequent matches are attempted after +the first pattern match. +Using <B>;&</B> in place of <B>;;</B> causes execution to continue with +the <I>list</I> associated with the next set of patterns. +Using <B>;;&</B> in place of <B>;;</B> causes the shell to test the next +pattern list in the statement, if any, and execute any associated <I>list</I> +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in <I>list</I>. +<DT><B>if</B> <I>list</I>; <B>then</B> <I>list;</I> [ <B>elif</B> <I>list</I>; <B>then</B> <I>list</I>; ] ... [ <B>else</B> <I>list</I>; ] <B>fi</B><DD> +The +<B>if </B> + +<I>list</I> + +is executed. If its exit status is zero, the +<B>then</B> <I>list</I> is executed. Otherwise, each <B>elif</B> +<I>list</I> is executed in turn, and if its exit status is zero, +the corresponding <B>then</B> <I>list</I> is executed and the +command completes. Otherwise, the <B>else</B> <I>list</I> is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +<DT><B>while</B> <I>list</I>; <B>do</B> <I>list</I>; <B>done</B><DD> + +<DT><B>until</B> <I>list</I>; <B>do</B> <I>list</I>; <B>done</B><DD> + +The <B>while</B> command continuously executes the <B>do</B> +<I>list</I> as long as the last command in <I>list</I> returns +an exit status of zero. The <B>until</B> command is identical +to the <B>while</B> command, except that the test is negated; +the +<B>do</B> + +<I>list</I> + +is executed as long as the last command in +<I>list</I> + +returns a non-zero exit status. +The exit status of the <B>while</B> and <B>until</B> commands +is the exit status +of the last <B>do</B> <I>list</I> command executed, or zero if +none was executed. +</DL> +<A NAME="lbAP"> </A> +<H4>Coprocesses</H4> + +<P> + +A <I>coprocess</I> is a shell command preceded by the <B>coproc</B> reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the <B>&</B> control operator, with a two-way pipe +established between the executing shell and the coprocess. +<P> + +The format for a coprocess is: +<DL COMPACT><DT><DD> +<P> + +<B>coproc</B> [<I>NAME</I>] <I>command</I> [<I>redirections</I>] +</DL> + +<P> + +This creates a coprocess named <I>NAME</I>. +If <I>NAME</I> is not supplied, the default name is <I>COPROC</I>. +<I>NAME</I> must not be supplied if <I>command</I> is a <I>simple +command</I> (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coproc is executed, the shell creates an array variable (see +<B>Arrays</B> + +below) named <I>NAME</I> in the context of the executing shell. +The standard output of +<I>command</I> + +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to <I>NAME</I>[0]. +The standard input of +<I>command</I> + +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to <I>NAME</I>[1]. +This pipe is established before any redirections specified by the +command (see +<FONT SIZE=-1><B>REDIRECTION</B> + +</FONT> +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The process id of the shell spawned to execute the coprocess is +available as the value of the variable <I>NAME</I>_PID. +The <B>wait</B> +builtin command may be used to wait for the coprocess to terminate. +<P> + +The return status of a coprocess is the exit status of <I>command</I>. +<A NAME="lbAQ"> </A> +<H4>Shell Function Definitions</H4> + +<P> + +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +<DL COMPACT> +<DT>[ <B>function</B> ] <I>name</I> () <I>compound-command</I> [<I>redirection</I>]<DD> +This defines a function named <I>name</I>. +The reserved word <B>function</B> is optional. +If the <B>function</B> reserved word is supplied, the parentheses are optional. +The <I>body</I> of the function is the compound command +<I>compound-command </I> + +(see <B>Compound Commands</B> above). +That command is usually a <I>list</I> of commands between { and }, but +may be any command listed under <B>Compound Commands</B> above. +<I>compound-command</I> is executed whenever <I>name</I> is specified as the +name of a simple command. +Any redirections (see +<FONT SIZE=-1><B>REDIRECTION</B> + +</FONT> +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +<FONT SIZE=-1><B>FUNCTIONS</B> + +</FONT> +below.) +</DL> +<A NAME="lbAR"> </A> +<H3>COMMENTS</H3> + +In a non-interactive shell, or an interactive shell in which the +<B>interactive_comments</B> + +option to the +<B>shopt</B> + +builtin is enabled (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below), a word beginning with +<B>#</B> + +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +<B>interactive_comments</B> + +option enabled does not allow comments. The +<B>interactive_comments</B> + +option is on by default in interactive shells. +<A NAME="lbAS"> </A> +<H3>QUOTING</H3> + +<I>Quoting</I> is used to remove the special meaning of certain +characters 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. +<P> + +Each of the <I>metacharacters</I> listed above under +<FONT SIZE=-1><B>DEFINITIONS</B> + +</FONT> +has special meaning to the shell and must be quoted if it is to +represent itself. +<P> + +When the command history expansion facilities are being used +(see +<FONT SIZE=-1><B>HISTORY EXPANSION</B> + +</FONT> +below), the +<I>history expansion</I> character, usually <B>!</B>, must be quoted +to prevent history expansion. +<P> + +There are three quoting mechanisms: the +<I>escape character</I>, + +single quotes, and double quotes. +<P> + +A non-quoted backslash (<B>\</B>) is the +<I>escape character</I>. + +It preserves the literal value of the next character that follows, +with the exception of <newline>. If a <B>\</B><newline> pair +appears, and the backslash is not itself quoted, the <B>\</B><newline> +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +<P> + +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +<P> + +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +<B>$</B>, + +<B>`</B>, + +<B>\</B>, + +and, when history expansion is enabled, +<B>!</B>. + +The characters +<B>$</B> + +and +<B>`</B> + +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +<B>$</B>, + +<B>`</B>, + +<B>"</B>, +<B>\</B>, + +or +<B><newline></B>. + +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +<B>!</B> + +appearing in double quotes is escaped using a backslash. +The backslash preceding the +<B>!</B> + +is not removed. +<P> + +The special parameters +<B>*</B> + +and +<B>@</B> + +have special meaning when in double +quotes (see +<FONT SIZE=-1><B>PARAMETERS</B> + +</FONT> +below). +<P> + +Words of the form <B>$</B>aq<I>string</I>aq are treated specially. The +word expands to <I>string</I>, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>\a</B> + +<DD> +alert (bell) +<DT><B>\b</B> + +<DD> +backspace +<DT><B>\e</B> + +<DD> +<DT><B>\E</B> + +<DD> +an escape character +<DT><B>\f</B> + +<DD> +form feed +<DT><B>\n</B> + +<DD> +new line +<DT><B>\r</B> + +<DD> +carriage return +<DT><B>\t</B> + +<DD> +horizontal tab +<DT><B>\v</B> + +<DD> +vertical tab +<DT><B>\\</B> + +<DD> +backslash +<DT><B>\aq</B> + +<DD> +single quote +<DT><B>\dq</B> + +<DD> +double quote +<DT><B>\</B><I>nnn</I> + +<DD> +the eight-bit character whose value is the octal value <I>nnn</I> +(one to three digits) +<DT><B>\x</B><I>HH</I> + +<DD> +the eight-bit character whose value is the hexadecimal value <I>HH</I> +(one or two hex digits) +<DT><B>\c</B><I>x</I> + +<DD> +a control-<I>x</I> character + +</DL></DL> + +<P> + +The expanded result is single-quoted, as if the dollar sign had +not been present. +<P> + +A double-quoted string preceded by a dollar sign (<B>$</B>dq<I>string</I>dq) +will cause the string to be translated according to the current locale. +If the current locale is <B>C</B> or <B>POSIX</B>, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +<A NAME="lbAT"> </A> +<H3>PARAMETERS</H3> + +A +<I>parameter</I> + +is an entity that stores values. +It can be a +<I>name</I>, + +a number, or one of the special characters listed below under +<B>Special Parameters</B>. + +A +<I>variable</I> + +is a parameter denoted by a +<I>name</I>. + +A variable has a <I>value</I> and zero or more <I>attributes</I>. +Attributes are assigned using the +<B>declare</B> + +builtin command (see +<B>declare</B> + +below in +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B>). + +</FONT> +<P> + +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +<B>unset</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<P> + +A +<I>variable</I> + +may be assigned to by a statement of the form +<DL COMPACT><DT><DD> +<P> + +<I>name</I>=[<I>value</I>] +</DL> + +<P> + +If +<I>value</I> + +is not given, the variable is assigned the null string. All +<I>values</I> + +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +<FONT SIZE=-1><B>EXPANSION</B> + +</FONT> +below). If the variable has its +<B>integer</B> + +attribute set, then +<I>value</I> + +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +<B>Arithmetic Expansion</B> + +below). +Word splitting is not performed, with the exception +of <B>"$@"</B> as explained below under +<B>Special Parameters</B>. + +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +<B>alias</B>, + +<B>declare</B>, + +<B>typeset</B>, + +<B>export</B>, + +<B>readonly</B>, + +and +<B>local</B> + +builtin commands. +<P> + +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the integer attribute has been +set, <I>value</I> is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +<B>Arrays</B> + +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key-value pairs in an +associative array. +When applied to a string-valued variable, <I>value</I> is expanded and +appended to the variable's value. +<A NAME="lbAU"> </A> +<H4>Positional Parameters</H4> + +<P> + +A +<I>positional parameter</I> + +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +<B>set</B> + +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +<FONT SIZE=-1><B>FUNCTIONS</B> + +</FONT> +below). +<P> + +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +<FONT SIZE=-1><B>EXPANSION</B> + +</FONT> +below). +<A NAME="lbAV"> </A> +<H4>Special Parameters</H4> + +<P> + +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. + +<DL COMPACT> +<DT><B>*</B> + +<DD> +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +<FONT SIZE=-1><B>IFS</B> + +</FONT> +special variable. That is, "<B>$*</B>" is equivalent +to "<B>$1</B><I>c</I><B>$2</B><I>c</I><B>...</B>", where +<I>c</I> + +is the first character of the value of the +<FONT SIZE=-1><B>IFS</B> + +</FONT> +variable. If +<FONT SIZE=-1><B>IFS</B> + +</FONT> +is unset, the parameters are separated by spaces. +If +<FONT SIZE=-1><B>IFS</B> + +</FONT> +is null, the parameters are joined without intervening separators. +<DT><B>@</B> + +<DD> +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "<B>$@</B>" is equivalent to +"<B>$1</B>" "<B>$2</B>" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "<B>$@</B>" and +<B>$@</B> + +expand to nothing (i.e., they are removed). +<DT><B>#</B> + +<DD> +Expands to the number of positional parameters in decimal. +<DT><B>?</B> + +<DD> +Expands to the exit status of the most recently executed foreground +pipeline. +<DT><B>-</B> + +<DD> +Expands to the current option flags as specified upon invocation, +by the +<B>set</B> + +builtin command, or those set by the shell itself +(such as the +<B>-i</B> + +option). +<DT><B>$</B> + +<DD> +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +<DT><B>!</B> + +<DD> +Expands to the process ID of the most recently executed background +(asynchronous) command. +<DT><B>0</B> + +<DD> +Expands to the name of the shell or shell script. This is set at +shell initialization. If +<B>bash</B> + +is invoked with a file of commands, +<B>$0</B> + +is set to the name of that file. If +<B>bash</B> + +is started with the +<B>-c</B> + +option, then +<B>$0</B> + +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the file name used to invoke +<B>bash</B>, + +as given by argument zero. +<DT><B>_</B> + +<DD> +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. + +</DL> +<A NAME="lbAW"> </A> +<H4>Shell Variables</H4> + +<P> + +The following variables are set by the shell: +<P> + + +<DL COMPACT> +<DT><B>BASH</B> + +<DD> +Expands to the full file name used to invoke this instance of +<B>bash</B>. + +<DT><B>BASHOPTS</B> + +<DD> +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +<B>-s</B> + +option to the +<B>shopt</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). The options appearing in +<FONT SIZE=-1><B>BASHOPTS</B> + +</FONT> +are those reported as +<I>on</I> + +by <B>shopt</B>. +If this variable is in the environment when +<B>bash</B> + +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +<DT><B>BASHPID</B> + +<DD> +Expands to the process id of the current <B>bash</B> process. +This differs from <B>$$</B> under certain circumstances, such as subshells +that do not require <B>bash</B> to be re-initialized. +<DT><B>BASH_ALIASES</B> + +<DD> +An associative array variable whose members correspond to the internal +list of aliases as maintained by the <B>alias</B> builtin +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +<DT><B>BASH_ARGC</B> + +<DD> +An array variable whose values are the number of parameters in each +frame of the current <B>bash</B> execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with <B>.</B> or <B>source</B>) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +<FONT SIZE=-1><B>BASH_ARGC</B>. + +</FONT> +The shell sets +<FONT SIZE=-1><B>BASH_ARGC</B> + +</FONT> +only when in extended debugging mode (see the description of the +<B>extdebug</B> + +option to the +<B>shopt</B> + +builtin below) +<DT><B>BASH_ARGV</B> + +<DD> +An array variable containing all of the parameters in the current <B>bash</B> +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +<FONT SIZE=-1><B>BASH_ARGV</B>. + +</FONT> +The shell sets +<FONT SIZE=-1><B>BASH_ARGV</B> + +</FONT> +only when in extended debugging mode +(see the description of the +<B>extdebug</B> + +option to the +<B>shopt</B> + +builtin below) +<DT><B>BASH_CMDS</B> + +<DD> +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the <B>hash</B> builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +<DT><B>BASH_COMMAND</B> + +<DD> +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +<DT><B>BASH_EXECUTION_STRING</B> + +<DD> +The command argument to the <B>-c</B> invocation option. +<DT><B>BASH_LINENO</B> + +<DD> +An array variable whose members are the line numbers in source files +corresponding to each member of +<FONT SIZE=-1><B>FUNCNAME</B>. + +</FONT> +<B>${BASH_LINENO[</B><I>$i</I><B>]}</B> is the line number in the source +file where <B>${FUNCNAME[</B><I>$i</I><B>]}</B> was called +(or <B>${BASH_LINENO[</B><I>$i-1</I><B>]}</B> if referenced within another +shell function). +The corresponding source file name is <B>${BASH_SOURCE[</B><I>$i</I><B>]}</B>. +Use +<FONT SIZE=-1><B>LINENO</B> + +</FONT> +to obtain the current line number. +<DT><B>BASH_REMATCH</B> + +<DD> +An array variable whose members are assigned by the <B>=~</B> binary +operator to the <B>[[</B> conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index <I>n</I> is the portion of the +string matching the <I>n</I>th parenthesized subexpression. +This variable is read-only. +<DT><B>BASH_SOURCE</B> + +<DD> +An array variable whose members are the source filenames corresponding +to the elements in the +<FONT SIZE=-1><B>FUNCNAME</B> + +</FONT> +array variable. +<DT><B>BASH_SUBSHELL</B> + +<DD> +Incremented by one each time a subshell or subshell environment is spawned. +The initial value is 0. +<DT><B>BASH_VERSINFO</B> + +<DD> +A readonly array variable whose members hold version information for +this instance of +<B>bash</B>. + +The values assigned to the array members are as follows: +<P> +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>BASH_VERSINFO[</B>0] + +<DD> +The major version number (the <I>release</I>). +<DT><B>BASH_VERSINFO[</B>1] + +<DD> +The minor version number (the <I>version</I>). +<DT><B>BASH_VERSINFO[</B>2] + +<DD> +The patch level. +<DT><B>BASH_VERSINFO[</B>3] + +<DD> +The build version. +<DT><B>BASH_VERSINFO[</B>4] + +<DD> +The release status (e.g., <I>beta1</I>). +<DT><B>BASH_VERSINFO[</B>5] + +<DD> +The value of +<FONT SIZE=-1><B>MACHTYPE</B>. + +</FONT> + +</DL></DL> + +<DT><B>BASH_VERSION</B> + +<DD> +Expands to a string describing the version of this instance of +<B>bash</B>. + +<DT><B>COMP_CWORD</B> + +<DD> +An index into <B>${COMP_WORDS}</B> of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see <B>Programmable Completion</B> +below). +<DT><B>COMP_KEY</B> + +<DD> +The key (or final key of a key sequence) used to invoke the current +completion function. +<DT><B>COMP_LINE</B> + +<DD> +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see <B>Programmable Completion</B> +below). +<DT><B>COMP_POINT</B> + +<DD> +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to <B>${#COMP_LINE}</B>. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see <B>Programmable Completion</B> +below). +<DT><B>COMP_TYPE</B> + +<DD> +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +<I>TAB</I>, for normal completion, +<I>?</I>, for listing completions after successive tabs, +<I>!</I>, for listing alternatives on partial word completion, +<I>@</I>, to list completions if the word is not unmodified, +or +<I>%</I>, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see <B>Programmable Completion</B> +below). +<DT><B>COMP_WORDBREAKS</B> + +<DD> +The set of characters that the <B>readline</B> library treats as word +separators when performing word completion. +If +<FONT SIZE=-1><B>COMP_WORDBREAKS</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>COMP_WORDS</B> + +<DD> +An array variable (see <B>Arrays</B> below) consisting of the individual +words in the current command line. +The line is split into words as <B>readline</B> would split it, using +<FONT SIZE=-1><B>COMP_WORDBREAKS</B> + +</FONT> +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see <B>Programmable Completion</B> +below). +<DT><B>DIRSTACK</B> + +<DD> +An array variable (see +<B>Arrays</B> + +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +<B>dirs</B> + +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +<B>pushd</B> + +and +<B>popd</B> + +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +<FONT SIZE=-1><B>DIRSTACK</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>EUID</B> + +<DD> +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +<DT><B>FUNCNAME</B> + +<DD> +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element is +<TT>"main"</TT>. + +This variable exists only when a shell function is executing. +Assignments to +<FONT SIZE=-1><B>FUNCNAME</B> + +</FONT> +have no effect and return an error status. +If +<FONT SIZE=-1><B>FUNCNAME</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>GROUPS</B> + +<DD> +An array variable containing the list of groups of which the current +user is a member. +Assignments to +<FONT SIZE=-1><B>GROUPS</B> + +</FONT> +have no effect and return an error status. +If +<FONT SIZE=-1><B>GROUPS</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>HISTCMD</B> + +<DD> +The history number, or index in the history list, of the current +command. +If +<FONT SIZE=-1><B>HISTCMD</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>HOSTNAME</B> + +<DD> +Automatically set to the name of the current host. +<DT><B>HOSTTYPE</B> + +<DD> +Automatically set to a string that uniquely +describes the type of machine on which +<B>bash</B> + +is executing. +The default is system-dependent. +<DT><B>LINENO</B> + +<DD> +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +<FONT SIZE=-1><B>LINENO</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>MACHTYPE</B> + +<DD> +Automatically set to a string that fully describes the system +type on which +<B>bash</B> + +is executing, in the standard GNU <I>cpu-company-system</I> format. +The default is system-dependent. +<DT><B>OLDPWD</B> + +<DD> +The previous working directory as set by the +<B>cd</B> + +command. +<DT><B>OPTARG</B> + +<DD> +The value of the last option argument processed by the +<B>getopts</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<DT><B>OPTIND</B> + +<DD> +The index of the next argument to be processed by the +<B>getopts</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<DT><B>OSTYPE</B> + +<DD> +Automatically set to a string that +describes the operating system on which +<B>bash</B> + +is executing. +The default is system-dependent. +<DT><B>PIPESTATUS</B> + +<DD> +An array variable (see +<B>Arrays</B> + +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +<DT><B>PPID</B> + +<DD> +The process ID of the shell's parent. This variable is readonly. +<DT><B>PWD</B> + +<DD> +The current working directory as set by the +<B>cd</B> + +command. +<DT><B>RANDOM</B> + +<DD> +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +<FONT SIZE=-1><B>RANDOM</B>. + +</FONT> +If +<FONT SIZE=-1><B>RANDOM</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>REPLY</B> + +<DD> +Set to the line of input read by the +<B>read</B> + +builtin command when no arguments are supplied. +<DT><B>SECONDS</B> + +<DD> +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +<FONT SIZE=-1><B>SECONDS</B>, + +</FONT> +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +<FONT SIZE=-1><B>SECONDS</B> + +</FONT> +is unset, it loses its special properties, even if it is +subsequently reset. +<DT><B>SHELLOPTS</B> + +<DD> +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +<B>-o</B> + +option to the +<B>set</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). The options appearing in +<FONT SIZE=-1><B>SHELLOPTS</B> + +</FONT> +are those reported as +<I>on</I> + +by <B>set -o</B>. +If this variable is in the environment when +<B>bash</B> + +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +<DT><B>SHLVL</B> + +<DD> +Incremented by one each time an instance of +<B>bash</B> + +is started. +<DT><B>UID</B> + +<DD> +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. + +</DL> +<P> + +The following variables are used by the shell. In some cases, +<B>bash</B> + +assigns a default value to a variable; these cases are noted +below. +<P> + + +<DL COMPACT> +<DT><B>BASH_ENV</B> + +<DD> +If this parameter is set when <B>bash</B> is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>. + +The value of +<FONT SIZE=-1><B>BASH_ENV</B> + +</FONT> +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a file name. +<FONT SIZE=-1><B>PATH</B> + +</FONT> +is not used to search for the resultant file name. +<DT><B>CDPATH</B> + +<DD> +The search path for the +<B>cd</B> + +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +<B>cd</B> + +command. +A sample value is +<TT>".:~:/usr"</TT>. + +<DT><B>BASH_XTRACEFD</B> + +<DD> +If set to an integer corresponding to a valid file descriptor, <B>bash</B> +will write the trace output generated when +<TT>set -x</TT> + +is enabled to that file descriptor. +The file descriptor is closed when +<FONT SIZE=-1><B>BASH_XTRACEFD</B> + +</FONT> +is unset or assigned a new value. +Unsetting +<FONT SIZE=-1><B>BASH_XTRACEFD</B> + +</FONT> +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +<FONT SIZE=-1><B>BASH_XTRACEFD</B> + +</FONT> +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +<DT><B>COLUMNS</B> + +<DD> +Used by the <B>select</B> builtin command to determine the terminal width +when printing selection lists. Automatically set upon receipt of a SIGWINCH. +<DT><B>COMPREPLY</B> + +<DD> +An array variable from which <B>bash</B> reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see <B>Programmable Completion</B> below). +<DT><B>EMACS</B> + +<DD> +If <B>bash</B> finds this variable in the environment when the shell starts +with value +<TT>t</TT>, + +it assumes that the shell is running in an emacs shell buffer and disables +line editing. +<DT><B>FCEDIT</B> + +<DD> +The default editor for the +<B>fc</B> + +builtin command. +<DT><B>FIGNORE</B> + +<DD> +A colon-separated list of suffixes to ignore when performing +filename completion (see +<FONT SIZE=-1><B>READLINE</B> + +</FONT> +below). +A filename whose suffix matches one of the entries in +<FONT SIZE=-1><B>FIGNORE</B> + +</FONT> +is excluded from the list of matched filenames. +A sample value is +<TT>".o:~"</TT>. + +<DT><B>GLOBIGNORE</B> + +<DD> +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +<FONT SIZE=-1><B>GLOBIGNORE</B>, + +</FONT> +it is removed from the list of matches. +<DT><B>HISTCONTROL</B> + +<DD> +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +<I>ignorespace</I>, + +lines which begin with a +<B>space</B> + +character are not saved in the history list. +A value of +<I>ignoredups</I> + +causes lines matching the previous history entry to not be saved. +A value of +<I>ignoreboth</I> + +is shorthand for <I>ignorespace</I> and <I>ignoredups</I>. +A value of +<I>erasedups</I> + +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +<FONT SIZE=-1><B>HISTCONTROL</B> + +</FONT> +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +<FONT SIZE=-1><B>HISTIGNORE</B>. + +</FONT> +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +<FONT SIZE=-1><B>HISTCONTROL</B>. + +</FONT> +<DT><B>HISTFILE</B> + +<DD> +The name of the file in which command history is saved (see +<FONT SIZE=-1><B>HISTORY</B> + +</FONT> +below). The default value is <A HREF="file:~/.bash_history"><I>~/.bash_history</I></A>. If unset, the +command history is not saved when an interactive shell exits. +<DT><B>HISTFILESIZE</B> + +<DD> +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, by removing the oldest entries, +to contain no more than that number of lines. The default +value is 500. The history file is also truncated to this size after +writing it when an interactive shell exits. +<DT><B>HISTIGNORE</B> + +<DD> +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`<B>*</B>' is appended). Each pattern is tested against the line +after the checks specified by +<FONT SIZE=-1><B>HISTCONTROL</B> + +</FONT> +are applied. +In addition to the normal shell pattern matching characters, `<B>&</B>' +matches the previous history line. `<B>&</B>' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +<FONT SIZE=-1><B>HISTIGNORE</B>. + +</FONT> +<DT><B>HISTSIZE</B> + +<DD> +The number of commands to remember in the command history (see +<FONT SIZE=-1><B>HISTORY</B> + +</FONT> +below). The default value is 500. +<DT><B>HISTTIMEFORMAT</B> + +<DD> +If this variable is set and not null, its value is used as a format string +for <I>strftime</I>(3) to print the time stamp associated with each history +entry displayed by the <B>history</B> builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +<DT><B>HOME</B> + +<DD> +The home directory of the current user; the default argument for the +<B>cd</B> builtin command. +The value of this variable is also used when performing tilde expansion. +<DT><B>HOSTFILE</B> + +<DD> +Contains the name of a file in the same format as + +<I>/etc/hosts</I> + +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +<B>bash</B> + +adds the contents of the new file to the existing list. +If +<FONT SIZE=-1><B>HOSTFILE</B> + +</FONT> +is set, but has no value, or does not name a readable file, +<B>bash</B> attempts to read + +<I>/etc/hosts</I> + +to obtain the list of possible hostname completions. +When +<FONT SIZE=-1><B>HOSTFILE</B> + +</FONT> +is unset, the hostname list is cleared. +<DT><B>IFS</B> + +<DD> +The +<I>Internal Field Separator</I> + +that is used +for word splitting after expansion and to +split lines into words with the +<B>read</B> + +builtin command. The default value is +``<space><tab><newline>''. +<DT><B>IGNOREEOF</B> + +<DD> +Controls the +action of an interactive shell on receipt of an +<FONT SIZE=-1><B>EOF</B> + +</FONT> +character as the sole input. If set, the value is the number of +consecutive +<FONT SIZE=-1><B>EOF</B> + +</FONT> +characters which must be +typed as the first characters on an input line before +<B>bash</B> + +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +<FONT SIZE=-1><B>EOF</B> + +</FONT> +signifies the end of input to the shell. +<DT><B>INPUTRC</B> + +<DD> +The filename for the +<B>readline</B> + +startup file, overriding the default of + +<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A> + +(see +<FONT SIZE=-1><B>READLINE</B> + +</FONT> +below). +<DT><B>LANG</B> + +<DD> +Used to determine the locale category for any category not specifically +selected with a variable starting with <B>LC_</B>. +<DT><B>LC_ALL</B> + +<DD> +This variable overrides the value of +<FONT SIZE=-1><B>LANG</B> + +</FONT> +and any other +<B>LC_</B> variable specifying a locale category. +<DT><B>LC_COLLATE</B> + +<DD> +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +<DT><B>LC_CTYPE</B> + +<DD> +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +<DT><B>LC_MESSAGES</B> + +<DD> +This variable determines the locale used to translate double-quoted +strings preceded by a <B>$</B>. +<DT><B>LC_NUMERIC</B> + +<DD> +This variable determines the locale category used for number formatting. +<DT><B>LINES</B> + +<DD> +Used by the <B>select</B> builtin command to determine the column length +for printing selection lists. Automatically set upon receipt of a +<FONT SIZE=-1><B>SIGWINCH</B>. + +</FONT> +<DT><B>MAIL</B> + +<DD> +If this parameter is set to a file name and the +<FONT SIZE=-1><B>MAILPATH</B> + +</FONT> +variable is not set, +<B>bash</B> + +informs the user of the arrival of mail in the specified file. +<DT><B>MAILCHECK</B> + +<DD> +Specifies how +often (in seconds) +<B>bash</B> + +checks for mail. 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. +<DT><B>MAILPATH</B> + +<DD> +A colon-separated list of file names to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the file name from the message with a `?'. +When used in the text of the message, <B>$_</B> expands to the name of +the current mailfile. +Example: +<DL COMPACT><DT><DD> +<P> + +<B>MAILPATH</B>=aq/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"aq +<P> + +<B>Bash</B> + +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/<B>$USER</B>). +</DL> + +<DT><B>OPTERR</B> + +<DD> +If set to the value 1, +<B>bash</B> + +displays error messages generated by the +<B>getopts</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<FONT SIZE=-1><B>OPTERR</B> + +</FONT> +is initialized to 1 each time the shell is invoked or a shell +script is executed. +<DT><B>PATH</B> + +<DD> +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +<FONT SIZE=-1><B>COMMAND EXECUTION</B> + +</FONT> +below). +A zero-length (null) directory name in the value of +<FONT SIZE=-1><B>PATH</B> + +</FONT> +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +<B>bash</B>. + +A common value is +<TT>/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin</TT>. + +<DT><B>POSIXLY_CORRECT</B> + +<DD> +If this variable is in the environment when <B>bash</B> starts, the shell +enters <I>posix mode</I> before reading the startup files, as if the +<B>--posix</B> + +invocation option had been supplied. If it is set while the shell is +running, <B>bash</B> enables <I>posix mode</I>, as if the command +<TT>set -o posix</TT> + +had been executed. +<DT><B>PROMPT_COMMAND</B> + +<DD> +If set, the value is executed as a command prior to issuing each primary +prompt. +<DT><B>PROMPT_DIRTRIM</B> + +<DD> +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the <B>\w</B> and +<B>\W</B> prompt string escapes (see +<FONT SIZE=-1><B>PROMPTING</B> + +</FONT> +below). Characters removed are replaced with an ellipsis. +<DT><B>PS1</B> + +<DD> +The value of this parameter is expanded (see +<FONT SIZE=-1><B>PROMPTING</B> + +</FONT> +below) and used as the primary prompt string. The default value is +``<B>\s-\v\$ </B>''. +<DT><B>PS2</B> + +<DD> +The value of this parameter is expanded as with +<FONT SIZE=-1><B>PS1</B> + +</FONT> +and used as the secondary prompt string. The default is +``<B>> </B>''. +<DT><B>PS3</B> + +<DD> +The value of this parameter is used as the prompt for the +<B>select</B> + +command (see +<FONT SIZE=-1><B>SHELL GRAMMAR</B> + +</FONT> +above). +<DT><B>PS4</B> + +<DD> +The value of this parameter is expanded as with +<FONT SIZE=-1><B>PS1</B> + +</FONT> +and the value is printed before each command +<B>bash</B> + +displays during an execution trace. The first character of +<FONT SIZE=-1><B>PS4</B> + +</FONT> +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``<B>+ </B>''. +<DT><B>SHELL</B> + +<DD> +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +<B>bash</B> + +assigns to it the full pathname of the current user's login shell. +<DT><B>TIMEFORMAT</B> + +<DD> +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +<B>time</B> + +reserved word should be displayed. +The <B>%</B> character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +<P> +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>%%</B> + +<DD> +A literal <B>%</B>. +<DT><B>%[</B><I>p</I>][l]R + +<DD> +The elapsed time in seconds. +<DT><B>%[</B><I>p</I>][l]U + +<DD> +The number of CPU seconds spent in user mode. +<DT><B>%[</B><I>p</I>][l]S + +<DD> +The number of CPU seconds spent in system mode. +<DT><B>%P</B> + +<DD> +The CPU percentage, computed as (%U + %S) / %R. + +</DL></DL> + +<DT><DD> +The optional <I>p</I> is a digit specifying the <I>precision</I>, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of <I>p</I> greater than 3 are changed to 3. +If <I>p</I> is not specified, the value 3 is used. +<DT><DD> +The optional <B>l</B> specifies a longer format, including +minutes, of the form <I>MM</I>m<I>SS</I>.<I>FF</I>s. +The value of <I>p</I> determines whether or not the fraction is +included. +<DT><DD> +If this variable is not set, <B>bash</B> acts as if it had the +value <B>$aq\nreal\t%3lR\nuser\t%3lU\nsys %3lSaq</B>. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +<DT><B>TMOUT</B> + +<DD> +If set to a value greater than zero, +<FONT SIZE=-1><B>TMOUT</B> + +</FONT> +is treated as the +default timeout for the <B>read</B> builtin. +The <B>select</B> command terminates if input does not arrive +after +<FONT SIZE=-1><B>TMOUT</B> + +</FONT> +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for input after issuing the primary prompt. +<B>Bash</B> + +terminates after waiting for that number of seconds if input does +not arrive. +<DT><B>TMPDIR</B> + +<DD> +If set, <B>Bash</B> uses its value as the name of a directory in which +<B>Bash</B> creates temporary files for the shell's use. +<DT><B>auto_resume</B> + +<DD> +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +<I>name</I> + +of a stopped job, in this context, is the command line used to +start it. +If set to the value +<I>exact</I>, + +the string supplied must match the name of a stopped job exactly; +if set to +<I>substring</I>, + +the string supplied needs to match a substring of the name of a +stopped job. The +<I>substring</I> + +value provides functionality analogous to the +<B>%?</B> + +job identifier (see +<FONT SIZE=-1><B>JOB CONTROL</B> + +</FONT> +below). 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 <B>%</B><I>string</I> job identifier. +<DT><B>histchars</B> + +<DD> +The two or three characters which control history expansion +and tokenization (see +<FONT SIZE=-1><B>HISTORY EXPANSION</B> + +</FONT> +below). The first character is the <I>history expansion</I> character, +the character which signals the start of a history +expansion, normally `<B>!</B>'. +The second character is the <I>quick substitution</I> +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `<B>^</B>'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `<B>#</B>'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. + +</DL> +<A NAME="lbAX"> </A> +<H4>Arrays</H4> + +<B>Bash</B> + +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +<B>declare</B> + +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +<P> + +An indexed array is created automatically if any variable is assigned to +using the syntax <I>name</I>[<I>subscript</I>]=<I>value</I>. The +<I>subscript</I> + +is treated as an arithmetic expression that must evaluate to a number +greater than or equal to zero. To explicitly declare an indexed array, +use +<B>declare -a </B><I>name</I> + +(see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<B>declare -a </B><I>name</I>[<I>subscript</I>] + +is also accepted; the <I>subscript</I> is ignored. +<P> + +Associative arrays are created using +<B>declare -A </B><I>name</I>. + +<P> + +Attributes may be +specified for an array variable using the +<B>declare</B> + +and +<B>readonly</B> + +builtins. Each attribute applies to all members of an array. +<P> + +Arrays are assigned to using compound assignments of the form +<I>name</I>=<B>(</B>value<I>1</I> ... value<I>n</I><B>)</B>, where each +<I>value</I> is of the form [<I>subscript</I>]=<I>string</I>. +Indexed array assignments do not require the bracket and subscript. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +<P> + +When assigning to an associative array, the subscript is required. +<P> + +This syntax is also accepted by the +<B>declare</B> + +builtin. Individual array elements may be assigned to using the +<I>name</I>[<I>subscript</I>]=<I>value</I> syntax introduced above. +<P> + +Any element of an array may be referenced using +${<I>name</I>[<I>subscript</I>]}. The braces are required to avoid +conflicts with pathname expansion. If +<I>subscript</I> is <B>@</B> or <B>*</B>, the word expands to +all members of <I>name</I>. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${<I>name</I>[*]} expands to a single +word with the value of each array member separated by the first +character of the +<FONT SIZE=-1><B>IFS</B> + +</FONT> +special variable, and ${<I>name</I>[@]} expands each element of +<I>name</I> to a separate word. When there are no array members, +${<I>name</I>[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters <B>*</B> and <B>@</B> (see +<B>Special Parameters</B> + +above). ${#<I>name</I>[<I>subscript</I>]} expands to the length of +${<I>name</I>[<I>subscript</I>]}. If <I>subscript</I> is <B>*</B> or +<B>@</B>, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +<P> + +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +<P> + +The +<B>unset</B> + +builtin is used to destroy arrays. <B>unset</B> <I>name</I>[<I>subscript</I>] +destroys the array element at index <I>subscript</I>. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +<B>unset</B> <I>name</I>, where <I>name</I> is an array, or +<B>unset</B> <I>name</I>[<I>subscript</I>], where +<I>subscript</I> is <B>*</B> or <B>@</B>, removes the entire array. +<P> + +The +<B>declare</B>, + +<B>local</B>, + +and +<B>readonly</B> + +builtins each accept a +<B>-a</B> + +option to specify an indexed array and a +<B>-A</B> + +option to specify an associative array. +The +<B>read</B> + +builtin accepts a +<B>-a</B> + +option to assign a list of words read from the standard input +to an array. The +<B>set</B> + +and +<B>declare</B> + +builtins display array values in a way that allows them to be +reused as assignments. +<A NAME="lbAY"> </A> +<H3>EXPANSION</H3> + +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +<I>brace expansion</I>, + +<I>tilde expansion</I>, + +<I>parameter and variable expansion</I>, + +<I>command substitution</I>, + +<I>arithmetic expansion</I>, + +<I>word splitting</I>, + +and +<I>pathname expansion</I>. + +<P> + +The order of expansions is: brace expansion, tilde expansion, +parameter, variable and arithmetic expansion and +command substitution +(done in a left-to-right fashion), word splitting, and pathname +expansion. +<P> + +On systems that can support it, there is an additional expansion +available: <I>process substitution</I>. +<P> + +Only brace expansion, word splitting, and pathname 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 +"<B>$@</B>" and "<B>${</B><I>name</I><B>[@]}</B>" +as explained above (see +<FONT SIZE=-1><B>PARAMETERS</B>). + +</FONT> +<A NAME="lbAZ"> </A> +<H4>Brace Expansion</H4> + +<P> + +<I>Brace expansion</I> + +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +<I>pathname expansion</I>, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +<I>preamble</I>, + +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +<I>postscript</I>. + +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +<P> + +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a<B>{</B>d,c,b<B>}</B>e expands into `ade ace abe'. +<P> + +A sequence expression takes the form +<B>{</B><I>x</I><B>..</B><I>y</I><B>[..</B><I>incr</I><B>]}</B>, +where <I>x</I> and <I>y</I> are either integers or single characters, +and <I>incr</I>, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +<I>x</I> and <I>y</I>, inclusive. +Supplied integers may be prefixed with <I>0</I> to force each term to have the +same width. When either <I>x</I> or y begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between <I>x</I> and <I>y</I>, inclusive. Note that +both <I>x</I> and <I>y</I> must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +<P> + +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +<B>Bash</B> + +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +<P> + +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A <B>{</B> or <B>,</B> may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string <B>${</B> +is not considered eligible for brace expansion. +<P> + +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +<DL COMPACT><DT><DD> +<P> + +mkdir /usr/local/src/bash/{old,new,dist,bugs} +</DL> + +or +<DL COMPACT><DT><DD> +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +</DL> + +<P> + +Brace expansion introduces a slight incompatibility with +historical versions of +<B>sh</B>. + +<B>sh</B> + +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +<B>Bash</B> + +removes braces from words as a consequence of brace +expansion. For example, a word entered to +<B>sh</B> + +as <I>file{1,2}</I> +appears identically in the output. The same word is +output as +<I>file1 file2</I> + +after expansion by +<B>bash</B>. + +If strict compatibility with +<B>sh</B> + +is desired, start +<B>bash</B> + +with the +<B>+B </B> + +option or disable brace expansion with the +<B>+B</B> + +option to the +<B>set</B> + +command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<A NAME="lbBA"> </A> +<H4>Tilde Expansion</H4> + +<P> + +If a word begins with an unquoted tilde character (`<B>~</B>'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a <I>tilde-prefix</I>. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible <I>login name</I>. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +<FONT SIZE=-1><B>HOME</B>. + +</FONT> +If +<FONT SIZE=-1><B>HOME</B> + +</FONT> +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +<P> + +If the tilde-prefix is a `~+', the value of the shell variable +<FONT SIZE=-1><B>PWD</B> + +</FONT> +replaces the tilde-prefix. +If the tilde-prefix is a `~-', the value of the shell variable +<FONT SIZE=-1><B>OLDPWD</B>, + +</FONT> +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number <I>N</I>, 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 +<B>dirs</B> + +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `-', `+' is assumed. +<P> + +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +<P> + +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +<B>:</B> + +or the first +<B>=</B>. + +In these cases, tilde expansion is also performed. +Consequently, one may use file names with tildes in assignments to +<FONT SIZE=-1><B>PATH</B>, + +</FONT> +<FONT SIZE=-1><B>MAILPATH</B>, + +</FONT> +and +<FONT SIZE=-1><B>CDPATH</B>, + +</FONT> +and the shell assigns the expanded value. +<A NAME="lbBB"> </A> +<H4>Parameter Expansion</H4> + +<P> + +The `<B>$</B>' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +<P> + +When braces are used, the matching ending brace is the first `<B>}</B>' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +<P> + + +<DL COMPACT> +<DT>${<I>parameter</I>}<DD> +The value of <I>parameter</I> is substituted. The braces are required +when +<I>parameter</I> + +is a positional parameter with more than one digit, +or when +<I>parameter</I> + +is followed by a character which is not to be +interpreted as part of its name. + +</DL> +<P> + +If the first character of <I>parameter</I> is an exclamation point (<B>!</B>), +a level of variable indirection is introduced. +<B>Bash</B> uses the value of the variable formed from the rest of +<I>parameter</I> as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of <I>parameter</I> itself. +This is known as <I>indirect expansion</I>. +The exceptions to this are the expansions of ${!<I>prefix</I>*} and +${<B>!</B><I>name</I>[<I>@</I>]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +<P> + +In each of the cases below, <I>word</I> is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +<P> + +When not performing substring expansion, using the forms documented below, +<B>bash</B> tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +<P> + + +<DL COMPACT> +<DT>${<I>parameter</I><B>:-</B><I>word</I>}<DD> +<B>Use Default Values</B>. If +<I>parameter</I> + +is unset or null, the expansion of +<I>word</I> + +is substituted. Otherwise, the value of +<I>parameter</I> + +is substituted. +<DT>${<I>parameter</I><B>:=</B><I>word</I>}<DD> +<B>Assign Default Values</B>. +If +<I>parameter</I> + +is unset or null, the expansion of +<I>word</I> + +is assigned to +<I>parameter</I>. + +The value of +<I>parameter</I> + +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +<DT>${<I>parameter</I><B>:?</B><I>word</I>}<DD> +<B>Display Error if Null or Unset</B>. +If +<I>parameter</I> + +is null or unset, the expansion of <I>word</I> (or a message to that effect +if +<I>word</I> + +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of <I>parameter</I> is +substituted. +<DT>${<I>parameter</I><B>:+</B><I>word</I>}<DD> +<B>Use Alternate Value</B>. +If +<I>parameter</I> + +is null or unset, nothing is substituted, otherwise the expansion of +<I>word</I> + +is substituted. +<DT>${<I>parameter</I><B>:</B><I>offset</I>}<DD> + +<DT>${<I>parameter</I><B>:</B><I>offset</I><B>:</B><I>length</I>}<DD> + +<B>Substring Expansion.</B> +Expands to up to <I>length</I> characters of <I>parameter</I> +starting at the character specified by <I>offset</I>. +If <I>length</I> is omitted, expands to the substring of +<I>parameter</I> starting at the character specified by <I>offset</I>. +<I>length</I> and <I>offset</I> are arithmetic expressions (see +<FONT SIZE=-1><B>ARITHMETIC EVALUATION</B> + +</FONT> +below). +<I>length</I> must evaluate to a number greater than or equal to zero. +If <I>offset</I> evaluates to a number less than zero, the value +is used as an offset from the end of the value of <I>parameter</I>. +If <I>parameter</I> is <B>@</B>, the result is <I>length</I> positional +parameters beginning at <I>offset</I>. +If <I>parameter</I> is an indexed array name subscripted by @ or *, +the result is the <I>length</I> +members of the array beginning with ${<I>parameter</I>[<I>offset</I>]}. +A negative <I>offset</I> is taken relative to one greater than the maximum +index of the specified array. +Substring expansion applied to an associative array produces undefined +results. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the :- expansion. +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If <I>offset</I> is 0, and the positional parameters are used, <B>$0</B> is +prefixed to the list. +<DT>${<B>!</B><I>prefix</I><B>*</B>}<DD> + +<DT>${<B>!</B><I>prefix</I><B>@</B>}<DD> + +<B>Names matching prefix.</B> +Expands to the names of variables whose names begin with <I>prefix</I>, +separated by the first character of the +<FONT SIZE=-1><B>IFS</B> + +</FONT> +special variable. +When <I>@</I> is used and the expansion appears within double quotes, each +variable name expands to a separate word. +<DT>${<B>!</B><I>name</I>[<I>@</I>]}<DD> + +<DT>${<B>!</B><I>name</I>[<I>*</I>]}<DD> + +<B>List of array keys.</B> +If <I>name</I> is an array variable, expands to the list of array indices +(keys) assigned in <I>name</I>. +If <I>name</I> is not an array, expands to 0 if <I>name</I> is set and null +otherwise. +When <I>@</I> is used and the expansion appears within double quotes, each +key expands to a separate word. +<DT>${<B>#</B><I>parameter</I>}<DD> +<B>Parameter length.</B> +The length in characters of the value of <I>parameter</I> is substituted. +If +<I>parameter</I> + +is +<B>*</B> + +or +<B>@</B>, + +the value substituted is the number of positional parameters. +If +<I>parameter</I> + +is an array name subscripted by +<B>*</B> + +or +<B>@</B>, + +the value substituted is the number of elements in the array. +<DT>${<I>parameter</I><B>#</B><I>word</I>}<DD> + +<DT>${<I>parameter</I><B>##</B><I>word</I>}<DD> + +<B>Remove matching prefix pattern.</B> +The +<I>word</I> + +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +<I>parameter</I>, + +then the result of the expansion is the expanded value of +<I>parameter</I> + +with the shortest matching pattern (the ``<B>#</B>'' case) or the +longest matching pattern (the ``<B>##</B>'' case) deleted. +If +<I>parameter</I> + +is +<B>@</B> + +or +<B>*</B>, + +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +<I>parameter</I> + +is an array variable subscripted with +<B>@</B> + +or +<B>*</B>, + +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +<DT>${<I>parameter</I><B>%</B><I>word</I>}<DD> + +<DT>${<I>parameter</I><B>%%</B><I>word</I>}<DD> + +<B>Remove matching suffix pattern.</B> +The <I>word</I> is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +<I>parameter</I>, + +then the result of the expansion is the expanded value of +<I>parameter</I> + +with the shortest matching pattern (the ``<B>%</B>'' case) or the +longest matching pattern (the ``<B>%%</B>'' case) deleted. +If +<I>parameter</I> + +is +<B>@</B> + +or +<B>*</B>, + +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +<I>parameter</I> + +is an array variable subscripted with +<B>@</B> + +or +<B>*</B>, + +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +<DT>${<I>parameter</I><B>/</B><I>pattern</I><B>/</B><I>string</I>}<DD> +<B>Pattern substitution.</B> +The <I>pattern</I> is expanded to produce a pattern just as in +pathname expansion. +<I>Parameter</I> is expanded and the longest match of <I>pattern</I> +against its value is replaced with <I>string</I>. +If <I>pattern</I> begins with <B>/</B>, all matches of <I>pattern</I> are +replaced with <I>string</I>. Normally only the first match is replaced. +If <I>pattern</I> begins with <B>#</B>, it must match at the beginning +of the expanded value of <I>parameter</I>. +If <I>pattern</I> begins with <B>%</B>, it must match at the end +of the expanded value of <I>parameter</I>. +If <I>string</I> is null, matches of <I>pattern</I> are deleted +and the <B>/</B> following <I>pattern</I> may be omitted. +If +<I>parameter</I> + +is +<B>@</B> + +or +<B>*</B>, + +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +<I>parameter</I> + +is an array variable subscripted with +<B>@</B> + +or +<B>*</B>, + +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +<DT>${<I>parameter</I><B>^</B><I>pattern</I>}<DD> + +<DT>${<I>parameter</I><B>^^</B><I>pattern</I>}<DD> +<DT>${<I>parameter</I><B>,</B><I>pattern</I>}<DD> +<DT>${<I>parameter</I><B>,,</B><I>pattern</I>}<DD> + +<B>Case modification.</B> +This expansion modifies the case of alphabetic characters in <I>parameter</I>. +The <I>pattern</I> is expanded to produce a pattern just as in +pathname expansion. +The <B>^</B> operator converts lowercase letters matching <I>pattern</I> +to uppercase; the <B>,</B> operator converts matching uppercase letters +to lowercase. +The <B>^^</B> and <B>,,</B> expansions convert each matched character in the +expanded value; the <B>^</B> and <B>,</B> expansions match and convert only +the first character in the expanded value.. +If <I>pattern</I> is omitted, it is treated like a <B>?</B>, which matches +every character. +If +<I>parameter</I> + +is +<B>@</B> + +or +<B>*</B>, + +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +<I>parameter</I> + +is an array variable subscripted with +<B>@</B> + +or +<B>*</B>, + +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +</DL> +<A NAME="lbBC"> </A> +<H4>Command Substitution</H4> + +<P> + +<I>Command substitution</I> allows the output of a command to replace +the command name. There are two forms: +<P> + +<DL COMPACT><DT><DD> +<P> + +<B>$(</B><I>command</I><B>)</B> +</DL> + +or +<DL COMPACT><DT><DD> +<B>`</B><I>command</I><B>`</B> +</DL> + +<P> + +<B>Bash</B> + +performs the expansion by executing <I>command</I> and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution <B>$(cat </B><I>file</I>) can be replaced by +the equivalent but faster <B>$(< </B><I>file</I>). +<P> + +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +<B>$</B>, + +<B>`</B>, + +or +<B>\</B>. + +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(<I>command</I>) form, all characters between the +parentheses make up the command; none are treated specially. +<P> + +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +<P> + +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +<A NAME="lbBD"> </A> +<H4>Arithmetic Expansion</H4> + +<P> + +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +<DL COMPACT><DT><DD> +<P> + +<B>$((</B><I>expression</I><B>))</B> +</DL> + +<P> + +The +<I>expression</I> + +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter expansion, string +expansion, command substitution, and quote removal. +Arithmetic expansions may be nested. +<P> + +The evaluation is performed according to the rules listed below under +<FONT SIZE=-1><B>ARITHMETIC EVALUATION</B>. + +</FONT> +If +<I>expression</I> + +is invalid, +<B>bash</B> + +prints a message indicating failure and no substitution occurs. +<A NAME="lbBE"> </A> +<H4>Process Substitution</H4> + +<P> + +<I>Process substitution</I> is supported on systems that support named +pipes (<I>FIFOs</I>) or the <B>/dev/fd</B> method of naming open files. +It takes the form of +<B><(</B><I>list</I><B>)</B> +or +<B>>(</B><I>list</I><B>)</B>. +The process <I>list</I> is run with its input or output connected to a +<I>FIFO</I> or some file in <B>/dev/fd</B>. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the <B>>(</B><I>list</I><B>)</B> form is used, writing to +the file will provide input for <I>list</I>. If the +<B><(</B><I>list</I><B>)</B> form is used, the file passed as an +argument should be read to obtain the output of <I>list</I>. +<P> + +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +<A NAME="lbBF"> </A> +<H4>Word Splitting</H4> + +<P> + +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +<I>word splitting</I>. + +<P> + +The shell treats each character of +<FONT SIZE=-1><B>IFS</B> + +</FONT> +as a delimiter, and splits the results of the other +expansions into words on these characters. If +<FONT SIZE=-1><B>IFS</B> + +</FONT> +is unset, or its +value is exactly +<B><space><tab><newline></B>, + +the default, then +sequences of +<B><space></B>, + +<B><tab></B>, + +and +<B><newline></B> + +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +<FONT SIZE=-1><B>IFS</B> + +</FONT> +characters not at the beginning or end serves to delimit words. +If +<FONT SIZE=-1><B>IFS</B> + +</FONT> +has a value other than the default, then sequences of +the whitespace characters +<B>space</B> + +and +<B>tab</B> + +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +<FONT SIZE=-1><B>IFS</B> + +</FONT> +(an +<FONT SIZE=-1><B>IFS</B> + +</FONT> +whitespace character). +Any character in +<FONT SIZE=-1><B>IFS</B> + +</FONT> +that is not +<FONT SIZE=-1><B>IFS</B> + +</FONT> +whitespace, along with any adjacent +<FONT SIZE=-1><B>IFS</B> + +</FONT> +whitespace characters, delimits a field. +A sequence of +<FONT SIZE=-1><B>IFS</B> + +</FONT> +whitespace characters is also treated as a delimiter. +If the value of +<FONT SIZE=-1><B>IFS</B> + +</FONT> +is null, no word splitting occurs. +<P> + +Explicit null arguments (<B>""</B> or <B>aqaq</B>) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +<P> + +Note that if no expansion occurs, no splitting +is performed. +<A NAME="lbBG"> </A> +<H4>Pathname Expansion</H4> + +<P> + +After word splitting, +unless the +<B>-f</B> + +option has been set, +<B>bash</B> + +scans each word for the characters +<B>*</B>, + +<B>?</B>, + +and +<B>[</B>. + +If one of these characters appears, then the word is +regarded as a +<I>pattern</I>, + +and replaced with an alphabetically sorted list of +file names matching the pattern. +If no matching file names are found, +and the shell option +<B>nullglob</B> + +is not enabled, the word is left unchanged. +If the +<B>nullglob</B> + +option is set, and no matches are found, +the word is removed. +If the +<B>failglob</B> + +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +<B>nocaseglob</B> + +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a pattern is used for pathname expansion, +the character +<B>``.''</B> + +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +<B>dotglob</B> + +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +<B>``.''</B> + +character is not treated specially. +See the description of +<B>shopt</B> + +below under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +for a description of the +<B>nocaseglob</B>, + +<B>nullglob</B>, + +<B>failglob</B>, + +and +<B>dotglob</B> + +shell options. +<P> + +The +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +shell variable may be used to restrict the set of file names matching a +<I>pattern</I>. + +If +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +is set, each matching file name that also matches one of the patterns in +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +is removed from the list of matches. +The file names +<B>``.''</B> + +and +<B>``..''</B> + +are always ignored when +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +is set and not null. However, setting +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +to a non-null value has the effect of enabling the +<B>dotglob</B> + +shell option, so all other file names beginning with a +<B>``.''</B> + +will match. +To get the old behavior of ignoring file names beginning with a +<B>``.''</B>, + +make +<B>``.*''</B> + +one of the patterns in +<FONT SIZE=-1><B>GLOBIGNORE</B>. + +</FONT> +The +<B>dotglob</B> + +option is disabled when +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +is unset. +<P> + +<B>Pattern Matching</B> +<P> + +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +<P> + +The special pattern characters have the following meanings: +<P> + + +<DL COMPACT> +<DT><B>*</B> + +<DD> +Matches any string, including the null string. +When the <B>globstar</B> shell option is enabled, and <B>*</B> is used in +a pathname expansion context, two adjacent <B>*</B>s used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a <B>/</B>, two adjacent <B>*</B>s will match only directories +and subdirectories. +<DT><B>?</B> + +<DD> +Matches any single character. +<DT><B>[...]</B> + +<DD> +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +<I>range expression</I>; +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 +<B>[</B> + +is a +<B>!</B> + +or a +<B>^</B> + +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the value of the +<FONT SIZE=-1><B>LC_COLLATE</B> + +</FONT> +shell variable, +if set. +A +<B>-</B> + +may be matched by including it as the first or last character +in the set. +A +<B>]</B> + +may be matched by including it as the first character +in the set. +<BR> + +<P> + + +Within +<B>[</B> + +and +<B>]</B>, + +<I>character classes</I> can be specified using the syntax +<B>[:</B><I>class</I><B>:]</B>, where <I>class</I> is one of the +following classes defined in the POSIX standard: +</DL> +<P> + +<DL COMPACT><DT><DD> +<B> +</B> + +alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +<BR> + +A character class matches any character belonging to that class. +The <B>word</B> character class matches letters, digits, and the character _. +<BR> + +<P> + + +Within +<B>[</B> + +and +<B>]</B>, + +an <I>equivalence class</I> can be specified using the syntax +<B>[=</B><I>c</I><B>=]</B>, which matches all characters with the +same collation weight (as defined by the current locale) as +the character <I>c</I>. +<BR> + +<P> + + +Within +<B>[</B> + +and +<B>]</B>, + +the syntax <B>[.</B><I>symbol</I><B>.]</B> matches the collating symbol +<I>symbol</I>. +</DL> + + +<P> + +If the <B>extglob</B> shell option is enabled using the <B>shopt</B> +builtin, several extended pattern matching operators are recognized. +In the following description, a <I>pattern-list</I> is a list of one +or more patterns separated by a <B>|</B>. +Composite patterns may be formed using one or more of the following +sub-patterns: +<P> + +<DL COMPACT><DT><DD> +<DL COMPACT> +<DT><B>?(</B><I>pattern-list</I><B>)</B><DD> +Matches zero or one occurrence of the given patterns +<DT><B>*(</B><I>pattern-list</I><B>)</B><DD> +Matches zero or more occurrences of the given patterns +<DT><B>+(</B><I>pattern-list</I><B>)</B><DD> +Matches one or more occurrences of the given patterns +<DT><B>@(</B><I>pattern-list</I><B>)</B><DD> +Matches one of the given patterns +<DT><B>!(</B><I>pattern-list</I><B>)</B><DD> +Matches anything except one of the given patterns +</DL></DL> + + +<A NAME="lbBH"> </A> +<H4>Quote Removal</H4> + +<P> + +After the preceding expansions, all unquoted occurrences of the +characters +<B>\</B>, + +<B>aq</B>, + +and <B>"</B> that did not result from one of the above +expansions are removed. +<A NAME="lbBI"> </A> +<H3>REDIRECTION</H3> + +Before a command is executed, its input and output +may be +<I>redirected</I> + +using a special notation interpreted by the shell. +Redirection may also be used to open and close files for the +current shell execution environment. The following redirection +operators may precede or appear anywhere within a +<I>simple command</I> + +or may follow a +<I>command</I>. + +Redirections are processed in the order they appear, from +left to right. +<P> + +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {<I>varname</I>}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than 10 and assign it to <I>varname</I>. If >&- or <&- is preceded +by {<I>varname</I>}, the value of <I>varname</I> defines the file +descriptor to close. +<P> + +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +<B><</B>, + +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +<B>></B>, + +the redirection refers to the standard output (file descriptor +1). +<P> + +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to brace expansion, +tilde expansion, parameter expansion, command substitution, arithmetic +expansion, quote removal, pathname expansion, and word splitting. +If it expands to more than one word, +<B>bash</B> + +reports an error. +<P> + +Note that the order of redirections is significant. For example, +the command +<DL COMPACT><DT><DD> +<P> + +ls <B>></B> dirlist 2<B>>&</B>1 +</DL> + +<P> + +directs both standard output and standard error to the file +<I>dirlist</I>, + +while the command +<DL COMPACT><DT><DD> +<P> + +ls 2<B>>&</B>1 <B>></B> dirlist +</DL> + +<P> + +directs only the standard output to file +<I>dirlist</I>, + +because the standard error was duplicated from the standard output +before the standard output was redirected to +<I>dirlist</I>. + +<P> + +<B>Bash</B> handles several filenames specially when they are used in +redirections, as described in the following table: +<DL COMPACT><DT><DD> +<P> + + +<DL COMPACT> +<DT><B>/dev/fd/</B><I>fd</I> + +<DD> +If <I>fd</I> is a valid integer, file descriptor <I>fd</I> is duplicated. +<DT><B>/dev/stdin</B> + +<DD> +File descriptor 0 is duplicated. +<DT><B>/dev/stdout</B> + +<DD> +File descriptor 1 is duplicated. +<DT><B>/dev/stderr</B> + +<DD> +File descriptor 2 is duplicated. +<DT><B>/dev/tcp/</B><I>host</I>/<I>port</I> + +<DD> +If <I>host</I> is a valid hostname or Internet address, and <I>port</I> +is an integer port number or service name, <B>bash</B> attempts to open +a TCP connection to the corresponding socket. +<DT><B>/dev/udp/</B><I>host</I>/<I>port</I> + +<DD> +If <I>host</I> is a valid hostname or Internet address, and <I>port</I> +is an integer port number or service name, <B>bash</B> attempts to open +a UDP connection to the corresponding socket. + +</DL></DL> + +<P> + +A failure to open or create a file causes the redirection to fail. +<P> + +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +<A NAME="lbBJ"> </A> +<H4>Redirecting Input</H4> + +<P> + +Redirection of input causes the file whose name results from +the expansion of +<I>word</I> + +to be opened for reading on file descriptor +<I>n</I>, + +or the standard input (file descriptor 0) if +<I>n</I> + +is not specified. +<P> + +The general format for redirecting input is: +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B><</B><I>word</I> +</DL> + +<A NAME="lbBK"> </A> +<H4>Redirecting Output</H4> + +<P> + +Redirection of output causes the file whose name results from +the expansion of +<I>word</I> + +to be opened for writing on file descriptor +<I>n</I>, + +or the standard output (file descriptor 1) if +<I>n</I> + +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +<P> + +The general format for redirecting output is: +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B>></B><I>word</I> +</DL> + +<P> + +If the redirection operator is +<B>></B>, + +and the +<B>noclobber</B> + +option to the +<B>set</B> + +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of <I>word</I> exists and is +a regular file. +If the redirection operator is +<B>>|</B>, + +or the redirection operator is +<B>></B> + +and the +<B>noclobber</B> + +option to the +<B>set</B> + +builtin command is not enabled, the redirection is attempted even +if the file named by <I>word</I> exists. +<A NAME="lbBL"> </A> +<H4>Appending Redirected Output</H4> + +<P> + +Redirection of output in this fashion +causes the file whose name results from +the expansion of +<I>word</I> + +to be opened for appending on file descriptor +<I>n</I>, + +or the standard output (file descriptor 1) if +<I>n</I> + +is not specified. If the file does not exist it is created. +<P> + +The general format for appending output is: +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B>>></B><I>word</I> +</DL> + +<P> + +<A NAME="lbBM"> </A> +<H4>Redirecting Standard Output and Standard Error</H4> + +<P> + +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +<I>word</I>. + +<P> + +There are two formats for redirecting standard output and +standard error: +<DL COMPACT><DT><DD> +<P> + +<B>&></B><I>word</I> +</DL> + +and +<DL COMPACT><DT><DD> +<B>>&</B><I>word</I> +</DL> + +<P> + +Of the two forms, the first is preferred. +This is semantically equivalent to +<DL COMPACT><DT><DD> +<P> + +<B>></B><I>word</I> 2<B>>&</B>1 +</DL> + +<P> + +<A NAME="lbBN"> </A> +<H4>Appending Standard Output and Standard Error</H4> + +<P> + +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +<I>word</I>. + +<P> + +The format for appending standard output and standard error is: +<DL COMPACT><DT><DD> +<P> + +<B>&>></B><I>word</I> +</DL> + +<P> + +This is semantically equivalent to +<DL COMPACT><DT><DD> +<P> + +<B>>></B><I>word</I> 2<B>>&</B>1 +</DL> + +<A NAME="lbBO"> </A> +<H4>Here Documents</H4> + +<P> + +This type of redirection instructs the shell to read input from the +current source until a line containing only +<I>delimiter</I> + +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +<P> + +The format of here-documents is: +<DL COMPACT><DT><DD> +<P> + +<PRE> +<B><<</B>[<B>-</B>]<I>word</I> + <I>here-document</I> +<I>delimiter</I> +</PRE> + +</DL> + +<P> + +No parameter expansion, command substitution, arithmetic expansion, +or pathname expansion is performed on +<I>word</I>. + +If any characters in +<I>word</I> + +are quoted, the +<I>delimiter</I> + +is the result of quote removal on +<I>word</I>, + +and the lines in the here-document are not expanded. +If <I>word</I> is unquoted, +all lines of the here-document are subjected to parameter expansion, +command substitution, and arithmetic expansion. In the latter +case, the character sequence +<B>\<newline></B> + +is ignored, and +<B>\</B> + +must be used to quote the characters +<B>\</B>, + +<B>$</B>, + +and +<B>`</B>. + +<P> + +If the redirection operator is +<B><<-</B>, + +then all leading tab characters are stripped from input lines and the +line containing +<I>delimiter</I>. + +This allows +here-documents within shell scripts to be indented in a +natural fashion. +<A NAME="lbBP"> </A> +<H4>Here Strings</H4> + +A variant of here documents, the format is: +<DL COMPACT><DT><DD> +<P> + +<PRE> +<B><<<</B><I>word</I> +</PRE> + +</DL> + +<P> + +The <I>word</I> is expanded and supplied to the command on its standard +input. +<A NAME="lbBQ"> </A> +<H4>Duplicating File Descriptors</H4> + +<P> + +The redirection operator +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B><&</B><I>word</I> +</DL> + +<P> + +is used to duplicate input file descriptors. +If +<I>word</I> + +expands to one or more digits, the file descriptor denoted by +<I>n</I> + +is made to be a copy of that file descriptor. +If the digits in +<I>word</I> + +do not specify a file descriptor open for input, a redirection error occurs. +If +<I>word</I> + +evaluates to +<B>-</B>, + +file descriptor +<I>n</I> + +is closed. If +<I>n</I> + +is not specified, the standard input (file descriptor 0) is used. +<P> + +The operator +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B>>&</B><I>word</I> +</DL> + +<P> + +is used similarly to duplicate output file descriptors. If +<I>n</I> + +is not specified, the standard output (file descriptor 1) is used. +If the digits in +<I>word</I> + +do not specify a file descriptor open for output, a redirection error occurs. +As a special case, if <I>n</I> is omitted, and <I>word</I> does not +expand to one or more digits, the standard output and standard +error are redirected as described previously. +<A NAME="lbBR"> </A> +<H4>Moving File Descriptors</H4> + +<P> + +The redirection operator +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B><&</B><I>digit</I><B>-</B> +</DL> + +<P> + +moves the file descriptor <I>digit</I> to file descriptor +<I>n</I>, + +or the standard input (file descriptor 0) if <I>n</I> is not specified. +<I>digit</I> is closed after being duplicated to <I>n</I>. +<P> + +Similarly, the redirection operator +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B>>&</B><I>digit</I><B>-</B> +</DL> + +<P> + +moves the file descriptor <I>digit</I> to file descriptor +<I>n</I>, + +or the standard output (file descriptor 1) if <I>n</I> is not specified. +<A NAME="lbBS"> </A> +<H4>Opening File Descriptors for Reading and Writing</H4> + +<P> + +The redirection operator +<DL COMPACT><DT><DD> +<P> + +[<I>n</I>]<B><></B><I>word</I> +</DL> + +<P> + +causes the file whose name is the expansion of +<I>word</I> + +to be opened for both reading and writing on file descriptor +<I>n</I>, + +or on file descriptor 0 if +<I>n</I> + +is not specified. If the file does not exist, it is created. +<A NAME="lbBT"> </A> +<H3>ALIASES</H3> + +<I>Aliases</I> allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +<B>alias</B> + +and +<B>unalias</B> + +builtin commands (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters <B>/</B>, <B>$</B>, <B>`</B>, and <B>=</B> and +any of the shell <I>metacharacters</I> or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +<B>ls</B> + +to +<B>ls -F</B>, + +for instance, and +<B>bash</B> + +does not try to recursively expand the replacement text. +If the last character of the alias value is a +<I>blank</I>, + +then the next command +word following the alias is also checked for alias expansion. +<P> + +Aliases are created and listed with the +<B>alias</B> + +command, and removed with the +<B>unalias</B> + +command. +<P> + +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +<FONT SIZE=-1><B>FUNCTIONS</B> + +</FONT> +below). +<P> + +Aliases are not expanded when the shell is not interactive, unless +the +<B>expand_aliases</B> + +shell option is set using +<B>shopt</B> + +(see the description of +<B>shopt</B> + +under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B></FONT> +below). +<P> + +The rules concerning the definition and use of aliases are +somewhat confusing. +<B>Bash</B> + +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +<B>alias</B> + +in compound commands. +<P> + +For almost every purpose, aliases are superseded by +shell functions. +<A NAME="lbBU"> </A> +<H3>FUNCTIONS</H3> + +A shell function, defined as described above under +<FONT SIZE=-1><B>SHELL GRAMMAR</B>, + +</FONT> +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +<B>#</B> + +is updated to reflect the change. Special parameter 0 +is unchanged. +The first element of the +<FONT SIZE=-1><B>FUNCNAME</B> + +</FONT> +variable is set to the name of the function while the function +is executing. +<P> + +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +<FONT SIZE=-1><B>DEBUG</B> + +</FONT> +and +<B>RETURN</B> + +traps (see the description of the +<B>trap</B> + +builtin under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below) are not inherited unless the function has been given the +<B>trace</B> attribute (see the description of the +<FONT SIZE=-1><B>declare</B> + +</FONT> +builtin below) or the +<B>-o functrace</B> shell option has been enabled with +the <B>set</B> builtin +(in which case all functions inherit the <B>DEBUG</B> and <B>RETURN</B> traps), +and the +<FONT SIZE=-1><B>ERR</B> + +</FONT> +trap is not inherited unless the <B>-o errtrace</B> shell option has +been enabled. +<P> + +Variables local to the function may be declared with the +<B>local</B> + +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +<P> + +If the builtin command +<B>return</B> + +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the <B>RETURN</B> trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +<B>#</B> + +are restored to the values they had prior to the function's +execution. +<P> + +Function names and definitions may be listed with the +<B>-f</B> + +option to the +<B>declare</B> + +or +<B>typeset</B> + +builtin commands. The +<B>-F</B> + +option to +<B>declare</B> + +or +<B>typeset</B> + +will list the function names only +(and optionally the source file and line number, if the <B>extdebug</B> +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +<B>-f</B> + +option to the +<B>export</B> + +builtin. +A function definition may be deleted using the <B>-f</B> option to +the +<B>unset</B> + +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +<P> + +Functions may be recursive. No limit is imposed on the number +of recursive calls. +<A NAME="lbBV"> </A> +<H3>ARITHMETIC EVALUATION</H3> + +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the <B>let</B> and <B>declare</B> builtin +commands and <B>Arithmetic Expansion</B>). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +<P> + + +<DL COMPACT> +<DT><B></B><I>id</I>++ <I>id</I>-- + +<DD> +variable post-increment and post-decrement +<DT><B>++</B><I>id</I> --<I>id</I> + +<DD> +variable pre-increment and pre-decrement +<DT><B>- +</B> + +<DD> +unary minus and plus +<DT><B>! ~</B> + +<DD> +logical and bitwise negation +<DT><B>**</B> + +<DD> +exponentiation +<DT><B>* / %</B> + +<DD> +multiplication, division, remainder +<DT><B>+ -</B> + +<DD> +addition, subtraction +<DT><B><< >></B> + +<DD> +left and right bitwise shifts +<DT><B><= >= < ></B> + +<DD> +comparison +<DT><B>== !=</B> + +<DD> +equality and inequality +<DT><B>&</B> + +<DD> +bitwise AND +<DT><B>^</B> + +<DD> +bitwise exclusive OR +<DT><B>|</B> + +<DD> +bitwise OR +<DT><B>&&</B> + +<DD> +logical AND +<DT><B>||</B> + +<DD> +logical OR +<DT><B></B><I>expr</I>?<I>expr</I>:<I>expr</I> + +<DD> +conditional operator +<DT><B>= *= /= %= += -= <<= >>= &= ^= |=</B> + +<DD> +assignment +<DT><B></B><I>expr1</I> , <I>expr2</I> + +<DD> +comma + +</DL> +<P> + +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +<I>integer</I> attribute using <B>declare -i</B> is assigned a value. +A null value evaluates to 0. +A shell variable need not have its integer attribute +turned on to be used in an expression. +<P> + +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [<I>base#</I>]n, where <I>base</I> +is a decimal number between 2 and 64 representing the arithmetic +base, and <I>n</I> is a number in that base. +If <I>base#</I> is omitted, then base 10 is used. +The digits greater than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If <I>base</I> is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +<P> + +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +<A NAME="lbBW"> </A> +<H3>CONDITIONAL EXPRESSIONS</H3> + +Conditional expressions are used by the <B>[[</B> compound command and +the <B>test</B> and <B>[</B> builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any <I>file</I> argument to one of the primaries is of the form +<I>/dev/fd/n</I>, then file descriptor <I>n</I> is checked. +If the <I>file</I> argument to one of the primaries is one of +<I>/dev/stdin</I>, <I>/dev/stdout</I>, or <I>/dev/stderr</I>, file +descriptor 0, 1, or 2, respectively, is checked. +<P> + +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +<P> + + +When used with <B>[[</B>, The <B><</B> and <B>></B> operators sort +lexicographically using the current locale. +<P> + +<DL COMPACT> +<DT><B>-a </B><I>file</I> + +<DD> +True if <I>file</I> exists. +<DT><B>-b </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a block special file. +<DT><B>-c </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a character special file. +<DT><B>-d </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a directory. +<DT><B>-e </B><I>file</I> + +<DD> +True if <I>file</I> exists. +<DT><B>-f </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a regular file. +<DT><B>-g </B><I>file</I> + +<DD> +True if <I>file</I> exists and is set-group-id. +<DT><B>-h </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a symbolic link. +<DT><B>-k </B><I>file</I> + +<DD> +True if <I>file</I> exists and its ``sticky'' bit is set. +<DT><B>-p </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a named pipe (FIFO). +<DT><B>-r </B><I>file</I> + +<DD> +True if <I>file</I> exists and is readable. +<DT><B>-s </B><I>file</I> + +<DD> +True if <I>file</I> exists and has a size greater than zero. +<DT><B>-t </B><I>fd</I> + +<DD> +True if file descriptor +<I>fd</I> + +is open and refers to a terminal. +<DT><B>-u </B><I>file</I> + +<DD> +True if <I>file</I> exists and its set-user-id bit is set. +<DT><B>-w </B><I>file</I> + +<DD> +True if <I>file</I> exists and is writable. +<DT><B>-x </B><I>file</I> + +<DD> +True if <I>file</I> exists and is executable. +<DT><B>-O </B><I>file</I> + +<DD> +True if <I>file</I> exists and is owned by the effective user id. +<DT><B>-G </B><I>file</I> + +<DD> +True if <I>file</I> exists and is owned by the effective group id. +<DT><B>-L </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a symbolic link. +<DT><B>-S </B><I>file</I> + +<DD> +True if <I>file</I> exists and is a socket. +<DT><B>-N </B><I>file</I> + +<DD> +True if <I>file</I> exists and has been modified since it was last read. +<DT><I>file1</I> -<B>nt</B> <I>file2</I><DD> +True if <I>file1</I> is newer (according to modification date) than <I>file2</I>, +or if <I>file1</I> exists and file2 does not. +<DT><I>file1</I> -<B>ot</B> <I>file2</I><DD> +True if <I>file1</I> is older than <I>file2</I>, or if <I>file2</I> exists +and <I>file1</I> does not. +<DT><I>file1</I> <B>-ef</B> <I>file2</I><DD> +True if <I>file1</I> and <I>file2</I> refer to the same device and +inode numbers. +<DT><B>-o </B><I>optname</I> + +<DD> +True if shell option +<I>optname</I> + +is enabled. +See the list of options under the description of the +<B>-o</B> + +option to the +<B>set</B> + +builtin below. +<DT><B>-z </B><I>string</I> + +<DD> +True if the length of <I>string</I> is zero. +<DT><I>string</I><DD> + +<DT><B>-n </B><I>string</I> + +<DD> + +True if the length of +<I>string</I> + +is non-zero. +<DT><I>string1</I> <B>==</B> <I>string2</I><DD> + +<DT><I>string1</I> <B>=</B> <I>string2</I><DD> + +True if the strings are equal. <B>=</B> should be used +with the <B>test</B> command for POSIX conformance. +<DT><I>string1</I> <B>!=</B> <I>string2</I><DD> +True if the strings are not equal. +<DT><I>string1</I> <B><</B> <I>string2</I><DD> +True if <I>string1</I> sorts before <I>string2</I> lexicographically. +<DT><I>string1</I> <B>></B> <I>string2</I><DD> +True if <I>string1</I> sorts after <I>string2</I> lexicographically. +<DT><I>arg1</I> <B>OP</B> <I>arg2</I> + +<DD> +<FONT SIZE=-1><B>OP</B> + +</FONT> +is one of +<B>-eq</B>, + +<B>-ne</B>, + +<B>-lt</B>, + +<B>-le</B>, + +<B>-gt</B>, + +or +<B>-ge</B>. + +These arithmetic binary operators return true if <I>arg1</I> +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to <I>arg2</I>, respectively. +<I>Arg1</I> + +and +<I>arg2</I> + +may be positive or negative integers. + +</DL> +<A NAME="lbBX"> </A> +<H3>SIMPLE COMMAND EXPANSION</H3> + +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +<DL COMPACT> +<DT>1.<DD> +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +<DT>2.<DD> +The words that are not variable assignments or redirections are +expanded. 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. +<DT>3.<DD> +Redirections are performed as described above under +<FONT SIZE=-1><B>REDIRECTION</B>. + +</FONT> +<DT>4.<DD> +The text after the <B>=</B> in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +</DL> +<P> + +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +<P> + +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +<P> + +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +<A NAME="lbBY"> </A> +<H3>COMMAND EXECUTION</H3> + +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +<P> + +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +<FONT SIZE=-1><B>FUNCTIONS</B>. + +</FONT> +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +<P> + +If the name is neither a shell function nor a builtin, +and contains no slashes, +<B>bash</B> + +searches each element of the +<FONT SIZE=-1><B>PATH</B> + +</FONT> +for a directory containing an executable file by that name. +<B>Bash</B> + +uses a hash table to remember the full pathnames of executable +files (see +<B>hash</B> + +under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +A full search of the directories in +<FONT SIZE=-1><B>PATH</B> + +</FONT> +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named <B>command_not_found_handle</B>. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +<P> + +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +<P> + +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a <I>shell script</I>, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +<B>hash</B> + +below under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B>)</FONT> +are retained by the child. +<P> + +If the program is a file beginning with +<B>#!</B>, + +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +<A NAME="lbBZ"> </A> +<H3>COMMAND EXECUTION ENVIRONMENT</H3> + +The shell has an <I>execution environment</I>, which consists of the +following: + +<DL COMPACT> +<DT>*<DD> +open files inherited by the shell at invocation, as modified by +redirections supplied to the <B>exec</B> builtin +<DT>*<DD> +the current working directory as set by <B>cd</B>, <B>pushd</B>, or +<B>popd</B>, or inherited by the shell at invocation +<DT>*<DD> +the file creation mode mask as set by <B>umask</B> or inherited from +the shell's parent +<DT>*<DD> +current traps set by <B>trap</B> +<DT>*<DD> +shell parameters that are set by variable assignment or with <B>set</B> +or inherited from the shell's parent in the environment +<DT>*<DD> +shell functions defined during execution or inherited from the shell's +parent in the environment +<DT>*<DD> +options enabled at invocation (either by default or with command-line +arguments) or by <B>set</B> +<DT>*<DD> +options enabled by <B>shopt</B> +<DT>*<DD> +shell aliases defined with <B>alias</B> +<DT>*<DD> +various process IDs, including those of background jobs, the value +of <B>$$</B>, and the value of +<FONT SIZE=-1><B>PPID</B> + +</FONT> +</DL> +<P> + +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. + +<DL COMPACT> +<DT>*<DD> +the shell's open files, plus any modifications and additions specified +by redirections to the command +<DT>*<DD> +the current working directory +<DT>*<DD> +the file creation mode mask +<DT>*<DD> +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +<DT>*<DD> +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +</DL> +<P> + +A command invoked in this separate environment cannot affect the +shell's execution environment. +<P> + +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +<P> + +Subshells spawned to execute command substitutions inherit the value of +the <B>-e</B> option from the parent shell. When not in posix mode, +Bash clears the <B>-e</B> option in such subshells. +<P> + +If a command is followed by a <B>&</B> and job control is not active, the +default standard input for the command is the empty file <I>/dev/null</I>. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +<A NAME="lbCA"> </A> +<H3>ENVIRONMENT</H3> + +When a program is invoked it is given an array of strings +called the +<I>environment</I>. + +This is a list of +<I>name</I>-<I>value</I> pairs, of the form +<I>name</I>=value. + +<P> + +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +<I>export</I> + +to child processes. Executed commands inherit the environment. +The +<B>export</B> + +and +<B>declare -x</B> + +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +<B>unset</B> + +command, plus any additions via the +<B>export</B> + +and +<B>declare -x</B> + +commands. +<P> + +The environment for any +<I>simple command</I> + +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +<FONT SIZE=-1><B>PARAMETERS</B>. + +</FONT> +These assignment statements affect only the environment seen +by that command. +<P> + +If the +<B>-k</B> + +option is set (see the +<B>set</B> + +builtin command below), then +<I>all</I> + +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +<P> + +When +<B>bash</B> + +invokes an external command, the variable +<B>_</B> + +is set to the full file name of the command and passed to that +command in its environment. +<A NAME="lbCB"> </A> +<H3>EXIT STATUS</H3> + +<P> + +The exit status of an executed command is the value returned by the +<I>waitpid</I> system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +<P> + +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal <I>N</I>, <B>bash</B> uses +the value of 128+<I>N</I> as the exit status. +<P> + +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +<P> + +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +<P> + +Shell builtin commands return a status of 0 (<I>true</I>) if +successful, and non-zero (<I>false</I>) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +<P> + +<B>Bash</B> itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the <B>exit</B> builtin +command below. +<A NAME="lbCC"> </A> +<H3>SIGNALS</H3> + +When <B>bash</B> is interactive, in the absence of any traps, it ignores +<FONT SIZE=-1><B>SIGTERM</B> + +</FONT> +(so that <B>kill 0</B> does not kill an interactive shell), +and +<FONT SIZE=-1><B>SIGINT</B> + +</FONT> +is caught and handled (so that the <B>wait</B> builtin is interruptible). +In all cases, <B>bash</B> ignores +<FONT SIZE=-1><B>SIGQUIT</B>. + +</FONT> +If job control is in effect, +<B>bash</B> + +ignores +<FONT SIZE=-1><B>SIGTTIN</B>, + +</FONT> +<FONT SIZE=-1><B>SIGTTOU</B>, + +</FONT> +and +<FONT SIZE=-1><B>SIGTSTP</B>. + +</FONT> +<P> + +Non-builtin commands run by <B>bash</B> have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +<FONT SIZE=-1><B>SIGINT</B> + +</FONT> +and +<FONT SIZE=-1><B>SIGQUIT</B> + +</FONT> +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +<FONT SIZE=-1><B>SIGTTIN</B>, + +</FONT> +<FONT SIZE=-1><B>SIGTTOU</B>, + +</FONT> +and +<FONT SIZE=-1><B>SIGTSTP</B>. + +</FONT> +<P> + +The shell exits by default upon receipt of a +<FONT SIZE=-1><B>SIGHUP</B>. + +</FONT> +Before exiting, an interactive shell resends the +<FONT SIZE=-1><B>SIGHUP</B> + +</FONT> +to all jobs, running or stopped. +Stopped jobs are sent +<FONT SIZE=-1><B>SIGCONT</B> + +</FONT> +to ensure that they receive the +<FONT SIZE=-1><B>SIGHUP</B>. + +</FONT> +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +<B>disown</B> + +builtin (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below) or marked +to not receive +<FONT SIZE=-1><B>SIGHUP</B> + +</FONT> +using +<B>disown -h</B>. + +<P> + +If the +<B>huponexit</B> + +shell option has been set with +<B>shopt</B>, + +<B>bash</B> + +sends a +<FONT SIZE=-1><B>SIGHUP</B> + +</FONT> +to all jobs when an interactive login shell exits. +<P> + +If <B>bash</B> is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When <B>bash</B> is waiting for an asynchronous command via the <B>wait</B> +builtin, the reception of a signal for which a trap has been set will +cause the <B>wait</B> builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +<A NAME="lbCD"> </A> +<H3>JOB CONTROL</H3> + +<I>Job control</I> + +refers to the ability to selectively stop (<I>suspend</I>) +the execution of processes and continue (<I>resume</I>) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +<B>bash</B>. + +<P> + +The shell associates a +<I>job</I> + +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +<B>jobs</B> + +command. When +<B>bash</B> + +starts a job asynchronously (in the +<I>background</I>), + +it prints a line that looks like: +<DL COMPACT><DT><DD> +<P> + +[1] 25647 +</DL> + +<P> + +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +<B>Bash</B> + +uses the +<I>job</I> + +abstraction as the basis for job control. +<P> + +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a <I>current terminal +process group ID</I>. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +<FONT SIZE=-1><B>SIGINT</B>. + +</FONT> +These processes are said to be in the +<I>foreground</I>. + +<I>Background</I> + +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with <TT>stty tostop</TT>, write to the +terminal. +Background processes which attempt to read from (write to when +<TT>stty tostop</TT> is in effect) the +terminal are sent a +<FONT SIZE=-1><B>SIGTTIN (SIGTTOU)</B> + +</FONT> +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +<P> + +If the operating system on which +<B>bash</B> + +is running supports +job control, +<B>bash</B> + +contains facilities to use it. +Typing the +<I>suspend</I> + +character (typically +<B>^Z</B>, + +Control-Z) while a process is running +causes that process to be stopped and returns control to +<B>bash</B>. + +Typing the +<I>delayed suspend</I> + +character (typically +<B>^Y</B>, + +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +<B>bash</B>. + +The user may then manipulate the state of this job, using the +<B>bg</B> + +command to continue it in the background, the +<B>fg</B> + +command to continue it in the foreground, or +the +<B>kill</B> + +command to kill it. A <B>^Z</B> takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +<P> + +There are a number of ways to refer to a job in the shell. +The character +<B>%</B> + +introduces a job specification (<I>jobspec</I>). Job number +<I>n</I> + +may be referred to as +<B>%n</B>. + +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +<B>%ce</B> + +refers to a stopped +<B>ce</B> + +job. If a prefix matches more than one job, +<B>bash</B> + +reports an error. Using +<B>%?ce</B>, + +on the other hand, refers to any job containing the string +<B>ce</B> + +in its command line. If the substring matches more than one job, +<B>bash</B> + +reports an error. The symbols +<B>%%</B> + +and +<B>%+</B> + +refer to the shell's notion of the +<I>current job</I>, + +which is the last job stopped while it was in +the foreground or started in the background. +The +<I>previous job</I> + +may be referenced using +<B>%-</B>. + +If there is only a single job, <B>%+</B> and <B>%-</B> can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +<B>jobs</B> + +command), the current job is always flagged with a +<B>+</B>, + +and the previous job with a +<B>-</B>. + +A single % (with no accompanying job specification) also refers to the +current job. +<P> + +Simply naming a job can be used to bring it into the +foreground: +<B>%1</B> + +is a synonym for +<B>``fg %1''</B>, +bringing job 1 from the background into the foreground. +Similarly, +<B>``%1 &''</B> + +resumes job 1 in the background, equivalent to +<B>``bg %1''</B>. +<P> + +The shell learns immediately whenever a job changes state. +Normally, +<B>bash</B> + +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 +<B>-b</B> + +option to the +<B>set</B> + +builtin command +is enabled, +<B>bash</B> + +reports such changes immediately. +Any trap on +<FONT SIZE=-1><B>SIGCHLD</B> + +</FONT> +is executed for each child that exits. +<P> + +If an attempt to exit +<B>bash</B> + +is made while jobs are stopped (or, if the <B>checkjobs</B> shell option has +been enabled using the <B>shopt</B> builtin, running), the shell prints a +warning message, and, if the <B>checkjobs</B> option is enabled, lists the +jobs and their statuses. +The +<B>jobs</B> + +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +<A NAME="lbCE"> </A> +<H3>PROMPTING</H3> + +When executing interactively, +<B>bash</B> + +displays the primary prompt +<FONT SIZE=-1><B>PS1</B> + +</FONT> +when it is ready to read a command, and the secondary prompt +<FONT SIZE=-1><B>PS2</B> + +</FONT> +when it needs more input to complete a command. +<B>Bash</B> + +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>\a</B> + +<DD> +an ASCII bell character (07) +<DT><B>\d</B> + +<DD> +the date in "Weekday Month Date" format (e.g., "Tue May 26") +<DT><B>\D{</B><I>format</I>} + +<DD> +the <I>format</I> is passed to <I>strftime</I>(3) and the result is inserted +into the prompt string; an empty <I>format</I> results in a locale-specific +time representation. The braces are required +<DT><B>\e</B> + +<DD> +an ASCII escape character (033) +<DT><B>\h</B> + +<DD> +the hostname up to the first `.' +<DT><B>\H</B> + +<DD> +the hostname +<DT><B>\j</B> + +<DD> +the number of jobs currently managed by the shell +<DT><B>\l</B> + +<DD> +the basename of the shell's terminal device name +<DT><B>\n</B> + +<DD> +newline +<DT><B>\r</B> + +<DD> +carriage return +<DT><B>\s</B> + +<DD> +the name of the shell, the basename of +<B>$0</B> + +(the portion following the final slash) +<DT><B>\t</B> + +<DD> +the current time in 24-hour HH:MM:SS format +<DT><B>\T</B> + +<DD> +the current time in 12-hour HH:MM:SS format +<DT><B>\@</B> + +<DD> +the current time in 12-hour am/pm format +<DT><B>\A</B> + +<DD> +the current time in 24-hour HH:MM format +<DT><B>\u</B> + +<DD> +the username of the current user +<DT><B>\v</B> + +<DD> +the version of <B>bash</B> (e.g., 2.00) +<DT><B>\V</B> + +<DD> +the release of <B>bash</B>, version + patch level (e.g., 2.00.0) +<DT><B>\w</B> + +<DD> +the current working directory, with +<FONT SIZE=-1><B>$HOME</B> + +</FONT> +abbreviated with a tilde +(uses the value of the +<FONT SIZE=-1><B>PROMPT_DIRTRIM</B> + +</FONT> +variable) +<DT><B>\W</B> + +<DD> +the basename of the current working directory, with +<FONT SIZE=-1><B>$HOME</B> + +</FONT> +abbreviated with a tilde +<DT><B>\!</B> + +<DD> +the history number of this command +<DT><B>\#</B> + +<DD> +the command number of this command +<DT><B>\$</B> + +<DD> +if the effective UID is 0, a +<B>#</B>, + +otherwise a +<B>$</B> + +<DT><B>\</B><I>nnn</I> + +<DD> +the character corresponding to the octal number <I>nnn</I> +<DT><B>\\</B> + +<DD> +a backslash +<DT><B>\[</B> + +<DD> +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +<DT><B>\]</B> + +<DD> +end a sequence of non-printing characters + +</DL></DL> + +<P> + +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 +(see +<FONT SIZE=-1><B>HISTORY</B> + +</FONT> +below), 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 +<B>promptvars</B> + +shell option (see the description of the +<B>shopt</B> + +command under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<A NAME="lbCF"> </A> +<H3>READLINE</H3> + +This is the library that handles reading input when using an interactive +shell, unless the +<B>--noediting</B> + +option is given at shell invocation. +Line editing is also used when using the <B>-e</B> option to the +<B>read</B> builtin. +By default, the line editing commands are similar to those of emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +<B>-o emacs</B> + +or +<B>-o vi</B> + +options to the +<B>set</B> + +builtin (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +To turn off line editing after the shell is running, use the +<B>+o emacs</B> + +or +<B>+o vi</B> + +options to the +<B>set</B> + +builtin. +<A NAME="lbCG"> </A> +<H4>Readline Notation</H4> + +<P> + +In this section, the emacs-style notation is used to denote +keystrokes. Control keys are denoted by C-<I>key</I>, e.g., C-n +means Control-N. Similarly, +<I>meta</I> + +keys are denoted by M-<I>key</I>, so M-x means Meta-X. (On keyboards +without a +<I>meta</I> + +key, M-<I>x</I> means ESC <I>x</I>, i.e., press the Escape key +then the +<I>x</I> + +key. This makes ESC the <I>meta prefix</I>. +The combination M-C-<I>x</I> means ESC-Control-<I>x</I>, +or press the Escape key +then hold the Control key while pressing the +<I>x</I> + +key.) +<P> + +Readline commands may be given numeric +<I>arguments</I>, + +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., <B>kill-line</B>) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +<P> + +When a command is described as <I>killing</I> text, the text +deleted is saved for possible future retrieval +(<I>yanking</I>). The killed text is saved in a +<I>kill ring</I>. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +<A NAME="lbCH"> </A> +<H4>Readline Initialization</H4> + +<P> + +Readline is customized by putting commands in an initialization +file (the <I>inputrc</I> file). +The name of this file is taken from the value of the +<FONT SIZE=-1><B>INPUTRC</B> + +</FONT> +variable. If that variable is unset, the default is +<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A>. + +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a <B>#</B> are comments. +Lines beginning with a <B>$</B> indicate conditional constructs. +Other lines denote key bindings and variable settings. +<P> + +The default key-bindings may be changed with an +<I>inputrc </I> + +file. +Other programs that use this library may add their own commands +and bindings. +<P> + +For example, placing +<DL COMPACT><DT><DD> +<P> + +M-Control-u: universal-argument +</DL> + +or +<DL COMPACT><DT><DD> +C-Meta-u: universal-argument +</DL> + +into the +<I>inputrc</I> + +would make M-C-u execute the readline command +<I>universal-argument</I>. + +<P> + +The following symbolic character names are recognized: +<I>RUBOUT</I>, + +<I>DEL</I>, + +<I>ESC</I>, + +<I>LFD</I>, + +<I>NEWLINE</I>, + +<I>RET</I>, + +<I>RETURN</I>, + +<I>SPC</I>, + +<I>SPACE</I>, + +and +<I>TAB</I>. + +<P> + +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a <I>macro</I>). +<A NAME="lbCI"> </A> +<H4>Readline Key Bindings</H4> + +<P> + +The syntax for controlling key bindings in the +<I>inputrc</I> + +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with <I>Meta-</I> or <I>Control-</I> +prefixes, or as a key sequence. +<P> + +When using the form <B>keyname</B>:<I>function-name</I> or <I>macro</I>, +<I>keyname</I> + +is the name of a key spelled out in English. For example: +<P> +<DL COMPACT><DT><DD> +Control-u: universal-argument +<BR> + +Meta-Rubout: backward-kill-word +<BR> + +Control-o: "> output" +</DL> + +<P> + +In the above example, +<I>C-u</I> + +is bound to the function +<B>universal-argument</B>, + +<I>M-DEL</I> + +is bound to the function +<B>backward-kill-word</B>, + +and +<I>C-o</I> + +is bound to run the macro +expressed on the right hand side (that is, to insert the text +<TT>> output</TT> + +into the line). +<P> + +In the second form, <B>"keyseq"</B>:<I>function-name</I> or <I>macro</I>, +<B>keyseq</B> + +differs from +<B>keyname</B> + +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +<P> +<DL COMPACT><DT><DD> +"\C-u": universal-argument +<BR> + +"\C-x\C-r": re-read-init-file +<BR> + +"\e[11~": "Function Key 1" +</DL> + +<P> + +In this example, +<I>C-u</I> + +is again bound to the function +<B>universal-argument</B>. + +<I>C-x C-r</I> + +is bound to the function +<B>re-read-init-file</B>, + +and +<I>ESC [ 1 1 ~</I> + +is bound to insert the text +<TT>Function Key 1</TT>. + +<P> + +The full set of GNU Emacs style escape sequences is +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>\C-</B> + +<DD> +control prefix +<DT><B>\M-</B> + +<DD> +meta prefix +<DT><B>\e</B> + +<DD> +an escape character +<DT><B>\\</B> + +<DD> +backslash +<DT><B>\</B> + +<DD> +literal " +<DT><B>\aq</B> + +<DD> +literal aq +</DL></DL> + + +<P> + +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>\a</B> + +<DD> +alert (bell) +<DT><B>\b</B> + +<DD> +backspace +<DT><B>\d</B> + +<DD> +delete +<DT><B>\f</B> + +<DD> +form feed +<DT><B>\n</B> + +<DD> +newline +<DT><B>\r</B> + +<DD> +carriage return +<DT><B>\t</B> + +<DD> +horizontal tab +<DT><B>\v</B> + +<DD> +vertical tab +<DT><B>\</B><I>nnn</I> + +<DD> +the eight-bit character whose value is the octal value <I>nnn</I> +(one to three digits) +<DT><B>\x</B><I>HH</I> + +<DD> +the eight-bit character whose value is the hexadecimal value <I>HH</I> +(one or two hex digits) +</DL></DL> + + +<P> + +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and aq. +<P> + +<B>Bash</B> + +allows the current readline key bindings to be displayed or modified +with the +<B>bind</B> + +builtin command. The editing mode may be switched during interactive +use by using the +<B>-o</B> + +option to the +<B>set</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). +<A NAME="lbCJ"> </A> +<H4>Readline Variables</H4> + +<P> + +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +<I>inputrc</I> + +file with a statement of the form +<DL COMPACT><DT><DD> +<P> + +<B>set</B> <I>variable-name</I> <I>value</I> +</DL> + +<P> + +Except where noted, readline variables can take the values +<B>On</B> + +or +<B>Off</B> + +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to <B>On</B>. All other values are equivalent to +<B>Off</B>. +The variables and their default values are: +<P> + + +<DL COMPACT> +<DT><B>bell-style (audible)</B> + +<DD> +Controls what happens when readline wants to ring the terminal bell. +If set to <B>none</B>, readline never rings the bell. If set to +<B>visible</B>, readline uses a visible bell if one is available. +If set to <B>audible</B>, readline attempts to ring the terminal's bell. +<DT><B>bind-tty-special-chars (On)</B> + +<DD> +If set to <B>On</B>, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +<DT><B>comment-begin (``#'')</B> + +<DD> +The string that is inserted when the readline +<B>insert-comment</B> + +command is executed. +This command is bound to +<B>M-#</B> + +in emacs mode and to +<B>#</B> + +in vi command mode. +<DT><B>completion-ignore-case (Off)</B> + +<DD> +If set to <B>On</B>, readline performs filename matching and completion +in a case-insensitive fashion. +<DT><B>completion-prefix-display-length (0)</B> + +<DD> +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +<DT><B>completion-query-items (100)</B> + +<DD> +This determines when the user is queried about viewing +the number of possible completions +generated by the <B>possible-completions</B> command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +<DT><B>convert-meta (On)</B> + +<DD> +If set to <B>On</B>, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the <I>meta prefix</I>). +<DT><B>disable-completion (Off)</B> + +<DD> +If set to <B>On</B>, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to <B>self-insert</B>. +<DT><B>editing-mode (emacs)</B> + +<DD> +Controls whether readline begins with a set of key bindings similar +to <I>emacs</I> or <I>vi</I>. +<B>editing-mode</B> + +can be set to either +<B>emacs</B> + +or +<B>vi</B>. + +<DT><B>echo-control-characters (On)</B> + +<DD> +When set to <B>On</B>, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +<DT><B>enable-keypad (Off)</B> + +<DD> +When set to <B>On</B>, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +<DT><B>enable-meta-key (On)</B> + +<DD> +When set to <B>On</B>, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +<DT><B>expand-tilde (Off)</B> + +<DD> +If set to <B>on</B>, tilde expansion is performed when readline +attempts word completion. +<DT><B>history-preserve-point (Off)</B> + +<DD> +If set to <B>on</B>, the history code attempts to place point at the +same location on each history line retrieved with <B>previous-history</B> +or <B>next-history</B>. +<DT><B>history-size (0)</B> + +<DD> +Set the maximum number of history entries saved in the history list. If +set to zero, the number of entries in the history list is not limited. +<DT><B>horizontal-scroll-mode (Off)</B> + +<DD> +When set to <B>On</B>, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +<DT><B>input-meta (Off)</B> + +<DD> +If set to <B>On</B>, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +<B>meta-flag</B> + +is a synonym for this variable. +<DT><B>isearch-terminators (``C-[C-J'')</B> + +<DD> +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +<I>ESC</I> and <I>C-J</I> will terminate an incremental search. +<DT><B>keymap (emacs)</B> + +<DD> +Set the current readline keymap. The set of valid keymap names is +<I>emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, +vi-command</I>, and +<I>vi-insert</I>. + +<I>vi</I> is equivalent to <I>vi-command</I>; <I>emacs</I> is +equivalent to <I>emacs-standard</I>. The default value is +<I>emacs</I>; + +the value of +<B>editing-mode</B> + +also affects the default keymap. +<DT><B>mark-directories (On)</B> + +<DD> +If set to <B>On</B>, completed directory names have a slash +appended. +<DT><B>mark-modified-lines (Off)</B> + +<DD> +If set to <B>On</B>, history lines that have been modified are displayed +with a preceding asterisk (<B>*</B>). +<DT><B>mark-symlinked-directories (Off)</B> + +<DD> +If set to <B>On</B>, completed names which are symbolic links to directories +have a slash appended (subject to the value of +<B>mark-directories</B>). +<DT><B>match-hidden-files (On)</B> + +<DD> +This variable, when set to <B>On</B>, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion, unless the leading `.' is +supplied by the user in the filename to be completed. +<DT><B>output-meta (Off)</B> + +<DD> +If set to <B>On</B>, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +<DT><B>page-completions (On)</B> + +<DD> +If set to <B>On</B>, readline uses an internal <I>more</I>-like pager +to display a screenful of possible completions at a time. +<DT><B>print-completions-horizontally (Off)</B> + +<DD> +If set to <B>On</B>, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +<DT><B>revert-all-at-newline (Off)</B> + +<DD> +If set to <B>on</B>, readline will undo all changes to history lines +before returning when <B>accept-line</B> is executed. By default, +history lines may be modified and retain individual undo lists across +calls to <B>readline</B>. +<DT><B>show-all-if-ambiguous (Off)</B> + +<DD> +This alters the default behavior of the completion functions. If +set to +<B>on</B>, + +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +<DT><B>show-all-if-unmodified (Off)</B> + +<DD> +This alters the default behavior of the completion functions in +a fashion similar to <B>show-all-if-ambiguous</B>. +If set to +<B>on</B>, + +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +<DT><B>skip-completed-text (Off)</B> + +<DD> +If set to <B>On</B>, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +<DT><B>visible-stats (Off)</B> + +<DD> +If set to <B>On</B>, a character denoting a file's type as reported +by <I>stat</I>(2) is appended to the filename when listing possible +completions. + +</DL> +<A NAME="lbCK"> </A> +<H4>Readline Conditional Constructs</H4> + +<P> + +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +<DL COMPACT> +<DT><B>$if</B><DD> +The +<B>$if</B> + +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +<DL COMPACT><DT><DD> +<DL COMPACT> +<DT><B>mode</B><DD> +The <B>mode=</B> form of the <B>$if</B> directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the <B>set keymap</B> command, for instance, to set bindings in +the <I>emacs-standard</I> and <I>emacs-ctlx</I> keymaps only if +readline is starting out in emacs mode. +<DT><B>term</B><DD> +The <B>term=</B> form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +<B>=</B> + +is tested against the both full name of the terminal and the portion +of the terminal name before the first <B>-</B>. This allows +<I>sun</I> + +to match both +<I>sun</I> + +and +<I>sun-cmd</I>, + +for instance. +<DT><B>application</B><DD> +The <B>application</B> construct is used to include +application-specific settings. Each program using the readline +library sets the <I>application name</I>, and an initialization +file can test 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: +<P> +<DL COMPACT><DT><DD> +<PRE> +<B>$if</B> Bash +# Quote the current or previous word +"\C-xq": "\eb\"\ef\"" +<B>$endif</B> +</PRE> + +</DL> + +</DL></DL> + +<DT><B>$endif</B><DD> +This command, as seen in the previous example, terminates an +<B>$if</B> command. +<DT><B>$else</B><DD> +Commands in this branch of the <B>$if</B> directive are executed if +the test fails. +<DT><B>$include</B><DD> +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read <A HREF="file:/etc/inputrc"><I>/etc/inputrc</I></A>: +<P> +<DL COMPACT><DT><DD> +<PRE> +<B>$include</B> <A HREF="file:/etc/inputrc"><I>/etc/inputrc</I></A> +</PRE> + +</DL> + +</DL> +<A NAME="lbCL"> </A> +<H4>Searching</H4> + +<P> + +Readline provides commands for searching through the command history +(see +<FONT SIZE=-1><B>HISTORY</B> + +</FONT> +below) for lines containing a specified string. +There are two search modes: +<I>incremental</I> + +and +<I>non-incremental</I>. + +<P> + +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. +The characters present in the value of the <B>isearch-terminators</B> +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-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. +<P> + +To find other matching entries in the history list, type Control-S or +Control-R 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 <I>newline</I> will terminate the search and accept +the line, thereby executing the command from the history list. +<P> + +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +<P> + +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +<A NAME="lbCM"> </A> +<H4>Readline Command Names</H4> + +<P> + +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, <I>point</I> refers to the current cursor +position, and <I>mark</I> refers to a cursor position saved by the +<B>set-mark</B> command. +The text between the point and mark is referred to as the <I>region</I>. +<A NAME="lbCN"> </A> +<H4>Commands for Moving</H4> + +<P> + + +<DL COMPACT> +<DT><B>beginning-of-line (C-a)</B> + +<DD> +Move to the start of the current line. +<DT><B>end-of-line (C-e)</B> + +<DD> +Move to the end of the line. +<DT><B>forward-char (C-f)</B> + +<DD> +Move forward a character. +<DT><B>backward-char (C-b)</B> + +<DD> +Move back a character. +<DT><B>forward-word (M-f)</B> + +<DD> +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +<DT><B>backward-word (M-b)</B> + +<DD> +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +<DT><B>shell-forward-word</B> + +<DD> +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +<DT><B>shell-backward-word</B> + +<DD> +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +<DT><B>clear-screen (C-l)</B> + +<DD> +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +<DT><B>redraw-current-line</B> + +<DD> +Refresh the current line. + +</DL> +<A NAME="lbCO"> </A> +<H4>Commands for Manipulating the History</H4> + +<P> + + +<DL COMPACT> +<DT><B>accept-line (Newline, Return)</B> + +<DD> +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +<FONT SIZE=-1><B>HISTCONTROL</B> + +</FONT> +variable. If the line is a modified history +line, then restore the history line to its original state. +<DT><B>previous-history (C-p)</B> + +<DD> +Fetch the previous command from the history list, moving back in +the list. +<DT><B>next-history (C-n)</B> + +<DD> +Fetch the next command from the history list, moving forward in the +list. +<DT><B>beginning-of-history (M-<)</B> + +<DD> +Move to the first line in the history. +<DT><B>end-of-history (M->)</B> + +<DD> +Move to the end of the input history, i.e., the line currently being +entered. +<DT><B>reverse-search-history (C-r)</B> + +<DD> +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +<DT><B>forward-search-history (C-s)</B> + +<DD> +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +<DT><B>non-incremental-reverse-search-history (M-p)</B> + +<DD> +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +<DT><B>non-incremental-forward-search-history (M-n)</B> + +<DD> +Search forward through the history using a non-incremental search for +a string supplied by the user. +<DT><B>history-search-forward</B> + +<DD> +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +<DT><B>history-search-backward</B> + +<DD> +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +<DT><B>yank-nth-arg (M-C-y)</B> + +<DD> +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +<I>n</I>, + +insert the <I>n</I>th word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the <I>n</I>th word from the end of the previous command. +Once the argument <I>n</I> is computed, the argument is extracted +as if the "!<I>n</I>" history expansion had been specified. +<DT><B>yank-last-arg (M-., M-_)</B> + +<DD> +Insert the last argument to the previous command (the last word of +the previous history entry). With an argument, +behave exactly like <B>yank-nth-arg</B>. +Successive calls to <B>yank-last-arg</B> move back through the history +list, inserting the last argument of each line in turn. +The history expansion facilities are used to extract the last argument, +as if the "!$" history expansion had been specified. +<DT><B>shell-expand-line (M-C-e)</B> + +<DD> +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +<FONT SIZE=-1><B>HISTORY EXPANSION</B> + +</FONT> +below for a description of history expansion. +<DT><B>history-expand-line (M-^)</B> + +<DD> +Perform history expansion on the current line. +See +<FONT SIZE=-1><B>HISTORY EXPANSION</B> + +</FONT> +below for a description of history expansion. +<DT><B>magic-space</B> + +<DD> +Perform history expansion on the current line and insert a space. +See +<FONT SIZE=-1><B>HISTORY EXPANSION</B> + +</FONT> +below for a description of history expansion. +<DT><B>alias-expand-line</B> + +<DD> +Perform alias expansion on the current line. +See +<FONT SIZE=-1><B>ALIASES</B> + +</FONT> +above for a description of alias expansion. +<DT><B>history-and-alias-expand-line</B> + +<DD> +Perform history and alias expansion on the current line. +<DT><B>insert-last-argument (M-., M-_)</B> + +<DD> +A synonym for <B>yank-last-arg</B>. +<DT><B>operate-and-get-next (C-o)</B> + +<DD> +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +<DT><B>edit-and-execute-command (C-xC-e)</B> + +<DD> +Invoke an editor on the current command line, and execute the result as shell +commands. +<B>Bash</B> attempts to invoke +<FONT SIZE=-1><B>$VISUAL</B>, + +</FONT> +<FONT SIZE=-1><B>$EDITOR</B>, + +</FONT> +and <I>emacs</I> as the editor, in that order. + +</DL> +<A NAME="lbCP"> </A> +<H4>Commands for Changing Text</H4> + +<P> + + +<DL COMPACT> +<DT><B>delete-char (C-d)</B> + +<DD> +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 <B>delete-char</B>, +then return +<FONT SIZE=-1><B>EOF</B>. + +</FONT> +<DT><B>backward-delete-char (Rubout)</B> + +<DD> +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +<DT><B>forward-backward-delete-char</B> + +<DD> +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +<DT><B>quoted-insert (C-q, C-v)</B> + +<DD> +Add the next character typed to the line verbatim. This is +how to insert characters like <B>C-q</B>, for example. +<DT><B>tab-insert (C-v TAB)</B> + +<DD> +Insert a tab character. +<DT><B>self-insert (a, b, A, 1, !, ...)</B> + +<DD> +Insert the character typed. +<DT><B>transpose-chars (C-t)</B> + +<DD> +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +<DT><B>transpose-words (M-t)</B> + +<DD> +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +<DT><B>upcase-word (M-u)</B> + +<DD> +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +<DT><B>downcase-word (M-l)</B> + +<DD> +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +<DT><B>capitalize-word (M-c)</B> + +<DD> +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +<DT><B>overwrite-mode</B> + +<DD> +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +<B>emacs</B> mode; <B>vi</B> mode does overwrite differently. +Each call to <I>readline()</I> starts in insert mode. +In overwrite mode, characters bound to <B>self-insert</B> replace +the text at point rather than pushing the text to the right. +Characters bound to <B>backward-delete-char</B> replace the character +before point with a space. By default, this command is unbound. + +</DL> +<A NAME="lbCQ"> </A> +<H4>Killing and Yanking</H4> + +<P> + + +<DL COMPACT> +<DT><B>kill-line (C-k)</B> + +<DD> +Kill the text from point to the end of the line. +<DT><B>backward-kill-line (C-x Rubout)</B> + +<DD> +Kill backward to the beginning of the line. +<DT><B>unix-line-discard (C-u)</B> + +<DD> +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. + +<DT><B>kill-whole-line</B> + +<DD> +Kill all characters on the current line, no matter where point is. +<DT><B>kill-word (M-d)</B> + +<DD> +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 those used by <B>forward-word</B>. +<DT><B>backward-kill-word (M-Rubout)</B> + +<DD> +Kill the word behind point. +Word boundaries are the same as those used by <B>backward-word</B>. +<DT><B>shell-kill-word (M-d)</B> + +<DD> +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 those used by <B>shell-forward-word</B>. +<DT><B>shell-backward-kill-word (M-Rubout)</B> + +<DD> +Kill the word behind point. +Word boundaries are the same as those used by <B>shell-backward-word</B>. +<DT><B>unix-word-rubout (C-w)</B> + +<DD> +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +<DT><B>unix-filename-rubout</B> + +<DD> +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +<DT><B>delete-horizontal-space (M-\)</B> + +<DD> +Delete all spaces and tabs around point. +<DT><B>kill-region</B> + +<DD> +Kill the text in the current region. +<DT><B>copy-region-as-kill</B> + +<DD> +Copy the text in the region to the kill buffer. +<DT><B>copy-backward-word</B> + +<DD> +Copy the word before point to the kill buffer. +The word boundaries are the same as <B>backward-word</B>. +<DT><B>copy-forward-word</B> + +<DD> +Copy the word following point to the kill buffer. +The word boundaries are the same as <B>forward-word</B>. +<DT><B>yank (C-y)</B> + +<DD> +Yank the top of the kill ring into the buffer at point. +<DT><B>yank-pop (M-y)</B> + +<DD> +Rotate the kill ring, and yank the new top. Only works following +<B>yank</B> + +or +<B>yank-pop</B>. + + +</DL> +<A NAME="lbCR"> </A> +<H4>Numeric Arguments</H4> + +<P> + + +<DL COMPACT> +<DT><B>digit-argument (M-0, M-1, ..., M--)</B> + +<DD> +Add this digit to the argument already accumulating, or start a new +argument. M-- starts a negative argument. +<DT><B>universal-argument</B> + +<DD> +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +<B>universal-argument</B> + +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. + +</DL> +<A NAME="lbCS"> </A> +<H4>Completing</H4> + +<P> + + +<DL COMPACT> +<DT><B>complete (TAB)</B> + +<DD> +Attempt to perform completion on the text before point. +<B>Bash</B> + +attempts completion treating the text as a variable (if the +text begins with <B>$</B>), username (if the text begins with +<B>~</B>), hostname (if the text begins with <B>@</B>), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +<DT><B>possible-completions (M-?)</B> + +<DD> +List the possible completions of the text before point. +<DT><B>insert-completions (M-*)</B> + +<DD> +Insert all completions of the text before point +that would have been generated by +<B>possible-completions</B>. +<DT><B>menu-complete</B> + +<DD> +Similar to <B>complete</B>, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of <B>menu-complete</B> steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of <B>bell-style</B>) +and the original text is restored. +An argument of <I>n</I> moves <I>n</I> 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 <B>TAB</B>, but is unbound +by default. +<DT><B>menu-complete-rd</B> + +<DD> +Identical to <B>menu-complete</B>, but moves backward through the list +of possible completions, as if <B>menu-complete</B> had been given a +negative argument. This command is unbound by default. +<DT><B>delete-char-or-list</B> + +<DD> +Deletes the character under the cursor if not at the beginning or +end of the line (like <B>delete-char</B>). +If at the end of the line, behaves identically to +<B>possible-completions</B>. +This command is unbound by default. +<DT><B>complete-filename (M-/)</B> + +<DD> +Attempt filename completion on the text before point. +<DT><B>possible-filename-completions (C-x /)</B> + +<DD> +List the possible completions of the text before point, +treating it as a filename. +<DT><B>complete-username (M-~)</B> + +<DD> +Attempt completion on the text before point, treating +it as a username. +<DT><B>possible-username-completions (C-x ~)</B> + +<DD> +List the possible completions of the text before point, +treating it as a username. +<DT><B>complete-variable (M-$)</B> + +<DD> +Attempt completion on the text before point, treating +it as a shell variable. +<DT><B>possible-variable-completions (C-x $)</B> + +<DD> +List the possible completions of the text before point, +treating it as a shell variable. +<DT><B>complete-hostname (M-@)</B> + +<DD> +Attempt completion on the text before point, treating +it as a hostname. +<DT><B>possible-hostname-completions (C-x @)</B> + +<DD> +List the possible completions of the text before point, +treating it as a hostname. +<DT><B>complete-command (M-!)</B> + +<DD> +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +<DT><B>possible-command-completions (C-x !)</B> + +<DD> +List the possible completions of the text before point, +treating it as a command name. +<DT><B>dynamic-complete-history (M-TAB)</B> + +<DD> +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +<DT><B>dabbrev-expand</B> + +<DD> +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +<DT><B>complete-into-braces (M-{)</B> + +<DD> +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +<B>Brace Expansion</B> + +above). + +</DL> +<A NAME="lbCT"> </A> +<H4>Keyboard Macros</H4> + +<P> + + +<DL COMPACT> +<DT><B>start-kbd-macro (C-x ()</B> + +<DD> +Begin saving the characters typed into the current keyboard macro. +<DT><B>end-kbd-macro (C-x ))</B> + +<DD> +Stop saving the characters typed into the current keyboard macro +and store the definition. +<DT><B>call-last-kbd-macro (C-x e)</B> + +<DD> +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. + +</DL> +<A NAME="lbCU"> </A> +<H4>Miscellaneous</H4> + +<P> + + +<DL COMPACT> +<DT><B>re-read-init-file (C-x C-r)</B> + +<DD> +Read in the contents of the <I>inputrc</I> file, and incorporate +any bindings or variable assignments found there. +<DT><B>abort (C-g)</B> + +<DD> +Abort the current editing command and +ring the terminal's bell (subject to the setting of +<B>bell-style</B>). + +<DT><B>do-uppercase-version (M-a, M-b, M-</B><I>x</I>, ...) + +<DD> +If the metafied character <I>x</I> is lowercase, run the command +that is bound to the corresponding uppercase character. +<DT><B>prefix-meta (ESC)</B> + +<DD> +Metafy the next character typed. +<FONT SIZE=-1><B>ESC</B> + +</FONT> +<B>f</B> + +is equivalent to +<B>Meta-f</B>. + +<DT><B>undo (C-_, C-x C-u)</B> + +<DD> +Incremental undo, separately remembered for each line. +<DT><B>revert-line (M-r)</B> + +<DD> +Undo all changes made to this line. This is like executing the +<B>undo</B> + +command enough times to return the line to its initial state. +<DT><B>tilde-expand (M-&)</B> + +<DD> +Perform tilde expansion on the current word. +<DT><B>set-mark (C-@, M-<space>)</B> + +<DD> +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +<DT><B>exchange-point-and-mark (C-x C-x)</B> + +<DD> +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +<DT><B>character-search (C-])</B> + +<DD> +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +<DT><B>character-search-backward (M-C-])</B> + +<DD> +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +<DT><B>skip-csi-sequence ()</B> + +<DD> +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC-[. If this sequence is +bound to "\[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC-[. +<DT><B>insert-comment (M-#)</B> + +<DD> +Without a numeric argument, the value of the readline +<B>comment-begin</B> + +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of <B>comment-begin</B>, the value is inserted, otherwise +the characters in <B>comment-begin</B> are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +<B>comment-begin</B> causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +<DT><B>glob-complete-word (M-g)</B> + +<DD> +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching file names for possible completions. +<DT><B>glob-expand-word (C-x *)</B> + +<DD> +The word before point is treated as a pattern for pathname expansion, +and the list of matching file names is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +<DT><B>glob-list-expansions (C-x g)</B> + +<DD> +The list of expansions that would have been generated by +<B>glob-expand-word</B> + +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +<DT><B>dump-functions</B> + +<DD> +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an <I>inputrc</I> file. +<DT><B>dump-variables</B> + +<DD> +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an <I>inputrc</I> file. +<DT><B>dump-macros</B> + +<DD> +Print all of the readline key sequences bound to macros and the +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 <I>inputrc</I> file. +<DT><B>display-shell-version (C-x C-v)</B> + +<DD> +Display version information about the current instance of +<B>bash</B>. + + +</DL> +<A NAME="lbCV"> </A> +<H4>Programmable Completion</H4> + +<P> + +When word completion is attempted for an argument to a command for +which a completion specification (a <I>compspec</I>) has been defined +using the <B>complete</B> builtin (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below), the programmable completion facilities are invoked. +<P> + +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the <B>-E</B> option to <B>complete</B> is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches to not result in a compspec, any compspec defined with +the <B>-D</B> option to <B>complete</B> is used as the default. +<P> + +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default <B>bash</B> completion as +described above under <B>Completing</B> is performed. +<P> + +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +<B>-f</B> + +or +<B>-d</B> + +option is used for filename or directory name completion, the shell +variable +<FONT SIZE=-1><B>FIGNORE</B> + +</FONT> +is used to filter the matches. +<P> + +Any completions specified by a pathname expansion pattern to the +<B>-G</B> option are generated next. +The words generated by the pattern need not match the word +being completed. +The +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +shell variable is not used to filter the matches, but the +<FONT SIZE=-1><B>FIGNORE</B> + +</FONT> +variable is used. +<P> + +Next, the string specified as the argument to the <B>-W</B> option +is considered. +The string is first split using the characters in the +<FONT SIZE=-1><B>IFS</B> + +</FONT> +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +<FONT SIZE=-1><B>EXPANSION</B>. + +</FONT> +The results are split using the rules described above under +<B>Word Splitting</B>. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +<P> + +After these matches have been generated, any shell function or command +specified with the <B>-F</B> and <B>-C</B> options is invoked. +When the command or function is invoked, the +<FONT SIZE=-1><B>COMP_LINE</B>, + +</FONT> +<FONT SIZE=-1><B>COMP_POINT</B>, + +</FONT> +<FONT SIZE=-1><B>COMP_KEY</B>, + +</FONT> +and +<FONT SIZE=-1><B>COMP_TYPE</B> + +</FONT> +variables are assigned values as described above under +<B>Shell Variables</B>. +If a shell function is being invoked, the +<FONT SIZE=-1><B>COMP_WORDS</B> + +</FONT> +and +<FONT SIZE=-1><B>COMP_CWORD</B> + +</FONT> +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 completed, and the third argument +is the word preceding the word being completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +<P> + +Any function specified with <B>-F</B> is invoked first. +The function may use any of the shell facilities, including the +<B>compgen</B> builtin described below, to generate the matches. +It must put the possible completions in the +<FONT SIZE=-1><B>COMPREPLY</B> + +</FONT> +array variable. +<P> + +Next, any command specified with the <B>-C</B> option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +<P> + +After all of the possible completions are generated, any filter +specified with the <B>-X</B> option is applied to the list. +The filter is a pattern as used for pathname expansion; a <B>&</B> +in the pattern is replaced with the text of the word being completed. +A literal <B>&</B> may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading <B>!</B> negates the pattern; in this case any completion +not matching the pattern will be removed. +<P> + +Finally, any prefix and suffix specified with the <B>-P</B> and <B>-S</B> +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. +<P> + +If the previously-applied actions do not generate any matches, and the +<B>-o dirnames</B> option was supplied to <B>complete</B> when the +compspec was defined, directory name completion is attempted. +<P> + +If the <B>-o plusdirs</B> option was supplied to <B>complete</B> when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +<P> + +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 <B>bash</B> completions are not attempted, and the readline +default of filename completion is disabled. +If the <B>-o bashdefault</B> option was supplied to <B>complete</B> when +the compspec was defined, the <B>bash</B> default completions are attempted +if the compspec generates no matches. +If the <B>-o default</B> option was supplied to <B>complete</B> when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default <B>bash</B> completions) +generate no matches. +<P> + +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the <B>mark-directories</B> readline variable, regardless +of the setting of the <B>mark-symlinked-directories</B> readline variable. +<P> + +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with <B>complete -D</B>. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +<P> + +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +<P> + +<TT>_completion_loader() +<BR> + +{ +<BR> + +<TT> </TT>. "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124<BR> +<BR> + +} +<BR> + +complete -D -F _completion_loader +<BR> + +</TT> +<A NAME="lbCW"> </A> +<H3>HISTORY</H3> + +When the +<B>-o history</B> + +option to the +<B>set</B> + +builtin is enabled, the shell provides access to the +<I>command history</I>, +the list of commands previously typed. +The value of the +<FONT SIZE=-1><B>HISTSIZE</B> + +</FONT> +variable is used as the +number of commands to save in a history list. +The text of the last +<FONT SIZE=-1><B>HISTSIZE</B> + +</FONT> +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +<FONT SIZE=-1><B>EXPANSION</B> + +</FONT> +above) but after history expansion is performed, subject to the +values of the shell variables +<FONT SIZE=-1><B>HISTIGNORE</B> + +</FONT> +and +<FONT SIZE=-1><B>HISTCONTROL</B>. + +</FONT> +<P> + +On startup, the history is initialized from the file named by +the variable +<FONT SIZE=-1><B>HISTFILE</B> + +</FONT> +(default <A HREF="file:~/.bash_history"><I>~/.bash_history</I></A>). +The file named by the value of +<FONT SIZE=-1><B>HISTFILE</B> + +</FONT> +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +<FONT SIZE=-1><B>HISTFILESIZE</B>. + +</FONT> +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +<FONT SIZE=-1><B>HISTTIMEFORMAT</B> + +</FONT> +variable. +When an interactive shell exits, the last +<FONT SIZE=-1><B>$HISTSIZE</B> + +</FONT> +lines are copied from the history list to +<FONT SIZE=-1><B>$HISTFILE</B>. + +</FONT> +If the +<B>histappend</B> + +shell option is enabled +(see the description of +<B>shopt</B> + +under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +<FONT SIZE=-1><B>HISTFILE</B> + +</FONT> +is unset, or if the history file is unwritable, the history is +not saved. +If the +<FONT SIZE=-1><B>HISTTIMEFORMAT</B> + +</FONT> +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +<FONT SIZE=-1><B>HISTFILESIZE</B> + +</FONT> +lines. If +<FONT SIZE=-1><B>HISTFILESIZE</B> + +</FONT> +is not set, no truncation is performed. +<P> + +The builtin command +<B>fc</B> + +(see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below) may be used to list or edit and re-execute a portion of +the history list. +The +<B>history</B> + +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. +<P> + +The shell allows control over which commands are saved on the history +list. The +<FONT SIZE=-1><B>HISTCONTROL</B> + +</FONT> +and +<FONT SIZE=-1><B>HISTIGNORE</B> + +</FONT> +variables may be set to cause the shell to save only a subset of the +commands entered. +The +<B>cmdhist</B> + +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +<B>lithist</B> + +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +<B>shopt</B> + +builtin below under +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +for information on setting and unsetting shell options. +<A NAME="lbCX"> </A> +<H3>HISTORY EXPANSION</H3> + +<P> + +The shell supports a history expansion feature that +is similar to the history expansion in +<B>csh.</B> + +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +<B>+H</B> + +option to the +<B>set</B> + +builtin command (see +<FONT SIZE=-1><B>SHELL BUILTIN COMMANDS</B> + +</FONT> +below). Non-interactive shells do not perform history expansion +by default. +<P> + +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +<P> + +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the <I>event</I>, +and the portions of that line that are acted upon are <I>words</I>. +Various <I>modifiers</I> are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several <I>metacharacter</I>-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is <B>!</B> by default. +Only backslash (<B>\</B>) and single quotes can quote +the history expansion character. +<P> + +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and <B>=</B>. +If the <B>extglob</B> shell option is enabled, <B>(</B> will also +inhibit expansion. +<P> + +Several shell options settable with the +<B>shopt</B> + +builtin may be used to tailor the behavior of history expansion. +If the +<B>histverify</B> + +shell option is enabled (see the description of the +<B>shopt</B> + +builtin below), and +<B>readline</B> + +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +<B>readline</B> + +editing buffer for further modification. +If +<B>readline</B> + +is being used, and the +<B>histreedit</B> + +shell option is enabled, a failed history substitution will be reloaded +into the +<B>readline</B> + +editing buffer for correction. +The +<B>-p</B> + +option to the +<B>history</B> + +builtin command may be used to see what a history expansion will +do before using it. +The +<B>-s</B> + +option to the +<B>history</B> + +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +<P> + +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +<B>histchars</B> + +above under +<B>Shell Variables</B>). + +The shell uses +the history comment character to mark history timestamps when +writing the history file. +<A NAME="lbCY"> </A> +<H4>Event Designators</H4> + +<P> + +An event designator is a reference to a command line entry in the +history list. +<P> + + +<DL COMPACT> +<DT><B>!</B> + +<DD> +Start a history substitution, except when followed by a +<B>blank</B>, + +newline, carriage return, = +or ( (when the <B>extglob</B> shell option is enabled using +the <B>shopt</B> builtin). +<DT><B>!</B><I>n</I> + +<DD> +Refer to command line +<I>n</I>. + +<DT><B>!-</B><I>n</I> + +<DD> +Refer to the current command line minus +<I>n</I>. + +<DT><B>!!</B> + +<DD> +Refer to the previous command. This is a synonym for `!-1'. +<DT><B>!</B><I>string</I> + +<DD> +Refer to the most recent command starting with +<I>string</I>. + +<DT><B>!?</B><I>string</I><B>[?]</B> + +<DD> +Refer to the most recent command containing +<I>string</I>. + +The trailing <B>?</B> may be omitted if +<I>string</I> + +is followed immediately by a newline. +<DT><B></B><FONT SIZE=+2><B>^</B></FONT><B></B><I>string1</I><FONT SIZE=+2>^</FONT><I>string2</I><FONT SIZE=+2>^</FONT> + +<DD> +Quick substitution. Repeat the last command, replacing +<I>string1</I> + +with +<I>string2</I>. + +Equivalent to +``!!:s/<I>string1</I>/<I>string2</I>/'' +(see <B>Modifiers</B> below). +<DT><B>!#</B> + +<DD> +The entire command line typed so far. + +</DL> +<A NAME="lbCZ"> </A> +<H4>Word Designators</H4> + +<P> + +Word designators are used to select desired words from the event. +A +<B>:</B> + +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +<B>^</B>, + +<B>$</B>, + +<B>*</B>, + +<B>-</B>, + +or +<B>%</B>. + +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +<P> + + +<DL COMPACT> +<DT><B>0 (zero)</B> + +<DD> +The zeroth word. For the shell, this is the command +word. +<DT><I>n</I> + +<DD> +The <I>n</I>th word. +<DT><B>^</B> + +<DD> +The first argument. That is, word 1. +<DT><B>$</B> + +<DD> +The last argument. +<DT><B>%</B> + +<DD> +The word matched by the most recent `?<I>string</I>?' search. +<DT><I>x</I><B>-</B>y + +<DD> +A range of words; `-<I>y</I>' abbreviates `0-<I>y</I>'. +<DT><B>*</B> + +<DD> +All of the words but the zeroth. This is a synonym +for `<I>1-$</I>'. It is not an error to use +<B>*</B> + +if there is just one +word in the event; the empty string is returned in that case. +<DT><B>x*</B> + +<DD> +Abbreviates <I>x-$</I>. +<DT><B>x-</B> + +<DD> +Abbreviates <I>x-$</I> like <B>x*</B>, but omits the last word. + +</DL> +<P> + +If a word designator is supplied without an event specification, the +previous command is used as the event. +<A NAME="lbDA"> </A> +<H4>Modifiers</H4> + +<P> + +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +<P> + + +<P> + +<DL COMPACT> +<DT><B>h</B> + +<DD> +Remove a trailing file name component, leaving only the head. +<DT><B>t</B> + +<DD> +Remove all leading file name components, leaving the tail. +<DT><B>r</B> + +<DD> +Remove a trailing suffix of the form <I>.xxx</I>, leaving the +basename. +<DT><B>e</B> + +<DD> +Remove all but the trailing suffix. +<DT><B>p</B> + +<DD> +Print the new command but do not execute it. +<DT><B>q</B> + +<DD> +Quote the substituted words, escaping further substitutions. +<DT><B>x</B> + +<DD> +Quote the substituted words as with +<B>q</B>, + +but break into words at +<B>blanks</B> + +and newlines. +<DT><B>s/</B><I>old</I>/<I>new</I>/ + +<DD> +Substitute +<I>new</I> + +for the first occurrence of +<I>old</I> + +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +<I>old</I> + +and +<I>new</I> + +with a single backslash. If & appears in +<I>new</I>, + +it is replaced by +<I>old</I>. + +A single backslash will quote the &. If +<I>old</I> + +is null, it is set to the last +<I>old</I> + +substituted, or, if no previous history substitutions took place, +the last +<I>string</I> + +in a +<B>!?</B><I>string</I><B>[?]</B> + +search. +<DT><B>&</B> + +<DD> +Repeat the previous substitution. +<DT><B>g</B> + +<DD> +Cause changes to be applied over the entire event line. This is +used in conjunction with `<B>:s</B>' (e.g., `<B>:gs/</B><I>old</I>/<I>new</I>/') +or `<B>:&</B>'. If used with +`<B>:s</B>', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An <B>a</B> may be used as a synonym for <B>g</B>. +<DT><B>G</B> + +<DD> +Apply the following `<B>s</B>' modifier once to each word in the event line. + +</DL> +<A NAME="lbDB"> </A> +<H3>SHELL BUILTIN COMMANDS</H3> + + + +<P> + +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +<B>-</B> + +accepts +<B>--</B> + +to signify the end of the options. +The <B>:</B>, <B>true</B>, <B>false</B>, and <B>test</B> builtins +do not accept options and do not treat <B>--</B> specially. +The <B>exit</B>, <B>logout</B>, <B>break</B>, <B>continue</B>, <B>let</B>, +and <B>shift</B> builtins accept and process arguments beginning with +<B>-</B> without requiring <B>--</B>. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with <B>-</B> as invalid options and +require <B>--</B> to prevent this interpretation. +<P> + +<DL COMPACT> +<DT><B>:</B> [<I>arguments</I>]<DD> + +No effect; the command does nothing beyond expanding +<I>arguments</I> + +and performing any specified +redirections. A zero exit code is returned. +<DT><B> . </B> <I>filename</I> [<I>arguments</I>]<DD> + +<DT><B>source</B> <I>filename</I> [<I>arguments</I>]<DD> + +Read and execute commands from +<I>filename</I> + +in the current +shell environment and return the exit status of the last command +executed from +<I>filename</I>. + +If +<I>filename</I> + +does not contain a slash, file names in +<FONT SIZE=-1><B>PATH</B> + +</FONT> +are used to find the directory containing +<I>filename</I>. + +The file searched for in +<FONT SIZE=-1><B>PATH</B> + +</FONT> +need not be executable. +When <B>bash</B> is not in <I>posix mode</I>, the current directory is +searched if no file is found in +<FONT SIZE=-1><B>PATH</B>. + +</FONT> +If the +<B>sourcepath</B> + +option to the +<B>shopt</B> + +builtin command is turned off, the +<FONT SIZE=-1><B>PATH</B> + +</FONT> +is not searched. +If any <I>arguments</I> are supplied, they become the positional +parameters when <I>filename</I> is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +<I>filename</I> + +is not found or cannot be read. +<DT><B>alias</B> [<B>-p</B>] [<I>name</I>[=<I>value</I>] ...]<DD> +<B>Alias</B> with no arguments or with the +<B>-p</B> + +option prints the list of aliases in the form +<B>alias</B> <I>name</I>=<I>value</I> on standard output. +When arguments are supplied, an alias is defined for +each <I>name</I> whose <I>value</I> is given. +A trailing space in <I>value</I> causes the next word to be +checked for alias substitution when the alias is expanded. +For each <I>name</I> in the argument list for which no <I>value</I> +is supplied, the name and value of the alias is printed. +<B>Alias</B> returns true unless a <I>name</I> is given for which +no alias has been defined. +<DT><B>bg</B> [<I>jobspec</I> ...]<DD> +Resume each suspended job <I>jobspec</I> in the background, as if it +had been started with +<B>&</B>. + +If +<I>jobspec</I> + +is not present, the shell's notion of the <I>current job</I> is used. +<B>bg</B> + +<I>jobspec</I> + +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified <I>jobspec</I> was not found +or was started without job control. +<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] [<B>-lpsvPSV</B>]<DD> + +<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] [<B>-q</B> <I>function</I>] [<B>-u</B> <I>function</I>] [<B>-r</B> <I>keyseq</I>]<DD> +<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <B>-f</B> <I>filename</I><DD> +<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <B>-x</B> <I>keyseq</I>:<I>shell-command</I><DD> +<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <I>keyseq</I>:<I>function-name</I><DD> +<DT><B>bind</B> <I>readline-command</I><DD> + +Display current +<B>readline</B> + +key and function bindings, bind a key sequence to a +<B>readline</B> + +function or macro, or set a +<B>readline</B> + +variable. +Each non-option argument is a command as it would appear in +<I>.inputrc</I>, + +but each binding or command must be passed as a separate argument; +e.g., '"\C-x\C-r": re-read-init-file'. +Options, if supplied, have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-m </B><I>keymap</I> + +<DD> +Use +<I>keymap</I> + +as the keymap to be affected by the subsequent bindings. +Acceptable +<I>keymap</I> + +names are +<I>emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, +vi-move, vi-command</I>, and +<I>vi-insert</I>. + +<I>vi</I> is equivalent to <I>vi-command</I>; <I>emacs</I> is +equivalent to <I>emacs-standard</I>. +<DT><B>-l</B> + +<DD> +List the names of all <B>readline</B> functions. +<DT><B>-p</B> + +<DD> +Display <B>readline</B> function names and bindings in such a way +that they can be re-read. +<DT><B>-P</B> + +<DD> +List current <B>readline</B> function names and bindings. +<DT><B>-s</B> + +<DD> +Display <B>readline</B> key sequences bound to macros and the strings +they output in such a way that they can be re-read. +<DT><B>-S</B> + +<DD> +Display <B>readline</B> key sequences bound to macros and the strings +they output. +<DT><B>-v</B> + +<DD> +Display <B>readline</B> variable names and values in such a way that they +can be re-read. +<DT><B>-V</B> + +<DD> +List current <B>readline</B> variable names and values. +<DT><B>-f </B><I>filename</I> + +<DD> +Read key bindings from <I>filename</I>. +<DT><B>-q </B><I>function</I> + +<DD> +Query about which keys invoke the named <I>function</I>. +<DT><B>-u </B><I>function</I> + +<DD> +Unbind all keys bound to the named <I>function</I>. +<DT><B>-r </B><I>keyseq</I> + +<DD> +Remove any current binding for <I>keyseq</I>. +<DT><B>-x </B><I>keyseq</I>:<I>shell-command</I> + +<DD> +Cause <I>shell-command</I> to be executed whenever <I>keyseq</I> is +entered. +When <I>shell-command</I> is executed, the shell sets the +<FONT SIZE=-1><B>READLINE_LINE</B> + +</FONT> +variable to the contents of the <B>readline</B> line buffer and the +<FONT SIZE=-1><B>READLINE_POINT</B> + +</FONT> +variable to the current location of the insertion point. +If the executed command changes the value of +<FONT SIZE=-1><B>READLINE_LINE</B> + +</FONT> +or +<FONT SIZE=-1><B>READLINE_POINT</B>, + +</FONT> +those new values will be reflected in the editing state. + +</DL> +<P> + +The return value is 0 unless an unrecognized option is given or an +error occurred. +</DL> + +<DT><B>break</B> [<I>n</I>]<DD> +Exit from within a +<B>for</B>, + +<B>while</B>, + +<B>until</B>, + +or +<B>select</B> + +loop. If <I>n</I> is specified, break <I>n</I> levels. +<I>n</I> + +must be >= 1. If +<I>n</I> + +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless <I>n</I> is not greater than or equal to 1. +<DT><B>builtin</B> <I>shell-builtin</I> [<I>arguments</I>]<DD> +Execute the specified shell builtin, passing it +<I>arguments</I>, + +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The <B>cd</B> builtin is commonly redefined this way. +The return status is false if +<I>shell-builtin</I> + +is not a shell builtin command. +<DT><B>caller</B> [<I>expr</I>]<DD> +Returns the context of any active subroutine call (a shell function or +a script executed with the <B>.</B> or <B>source</B> builtins. +Without <I>expr</I>, <B>caller</B> displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as <I>expr</I>, <B>caller</B> +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or <I>expr</I> does not correspond to a valid position in the +call stack. +<DT><B>cd</B> [<B>-L|-P</B>] [<I>dir</I>]<DD> +Change the current directory to <I>dir</I>. The variable +<FONT SIZE=-1><B>HOME</B> + +</FONT> +is the +default +<I>dir</I>. + +The variable +<FONT SIZE=-1><B>CDPATH</B> + +</FONT> +defines the search path for the directory containing +<I>dir</I>. + +Alternative directory names in +<FONT SIZE=-1><B>CDPATH</B> + +</FONT> +are separated by a colon (:). A null directory name in +<FONT SIZE=-1><B>CDPATH</B> + +</FONT> +is the same as the current directory, i.e., ``<B>.</B>''. If +<I>dir</I> + +begins with a slash (/), +then +<FONT SIZE=-1><B>CDPATH</B> + +</FONT> +is not used. The +<B>-P</B> + +option says to use the physical directory structure instead of +following symbolic links (see also the +<B>-P</B> + +option to the +<B>set</B> + +builtin command); the +<B>-L</B> + +option forces symbolic links to be followed. An argument of +<B>-</B> + +is equivalent to +<FONT SIZE=-1><B>$OLDPWD</B>. + +</FONT> +If a non-empty directory name from +<FONT SIZE=-1><B>CDPATH</B> + +</FONT> +is used, or if +<B>-</B> is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +<DT><B>command</B> [<B>-pVv</B>] <I>command</I> [<I>arg</I> ...]<DD> +Run +<I>command</I> + +with +<I>args</I> + +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +<FONT SIZE=-1><B>PATH</B> + +</FONT> +are executed. If the +<B>-p</B> + +option is given, the search for +<I>command</I> + +is performed using a default value for +<FONT SIZE=-1><B>PATH</B> + +</FONT> +that is guaranteed to find all of the standard utilities. +If either the +<B>-V</B> + +or +<B>-v</B> + +option is supplied, a description of +<I>command</I> + +is printed. The +<B>-v</B> + +option causes a single word indicating the command or file name +used to invoke +<I>command</I> + +to be displayed; the +<B>-V</B> + +option produces a more verbose description. +If the +<B>-V</B> + +or +<B>-v</B> + +option is supplied, the exit status is 0 if +<I>command</I> + +was found, and 1 if not. If neither option is supplied and +an error occurred or +<I>command</I> + +cannot be found, the exit status is 127. Otherwise, the exit status of the +<B>command</B> + +builtin is the exit status of +<I>command</I>. + +<DT><B>compgen</B> [<I>option</I>] [<I>word</I>]<DD> +Generate possible completion matches for <I>word</I> according to +the <I>option</I>s, which may be any option accepted by the +<B>complete</B> + +builtin with the exception of <B>-p</B> and <B>-r</B>, and write +the matches to the standard output. +When using the <B>-F</B> or <B>-C</B> options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +<P> +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If <I>word</I> is specified, only those completions matching <I>word</I> +will be displayed. +<P> +The return value is true unless an invalid option is supplied, or no +matches were generated. +<DT><B>complete</B> [<B>-abcdefgjksuv</B>] [<B>-o</B> <I>comp-option</I>] [<B>-DE</B>] [<B>-A</B> <I>action</I>] [<B>-G</B> <I>globpat</I>] [<B>-W</B> <I>wordlist</I>] [<B>-F</B> <I>function</I>] [<B>-C</B> <I>command</I>]<DD> +<BR> + +[<B>-X</B> <I>filterpat</I>] [<B>-P</B> <I>prefix</I>] [<B>-S</B> <I>suffix</I>] <I>name</I> [<I>name ...</I>] + +<DT><B>complete</B> <B>-pr</B> [<B>-DE</B>] [<I>name</I> ...]<DD> + +Specify how arguments to each <I>name</I> should be completed. +If the <B>-p</B> option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The <B>-r</B> option removes a completion specification for +each <I>name</I>, or, if no <I>name</I>s are supplied, all +completion specifications. +The <B>-D</B> option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The <B>-E</B> option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +<P> +The process of applying these completion specifications when word completion +is attempted is described above under <B>Programmable Completion</B>. +<P> +Other options, if specified, have the following meanings. +The arguments to the <B>-G</B>, <B>-W</B>, and <B>-X</B> options +(and, if necessary, the <B>-P</B> and <B>-S</B> options) +should be quoted to protect them from expansion before the +<B>complete</B> + +builtin is invoked. +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-o</B> <I>comp-option</I><DD> +The <I>comp-option</I> controls several aspects of the compspec's behavior +beyond the simple generation of completions. +<I>comp-option</I> may be one of: +<DL COMPACT><DT><DD> +<DL COMPACT> +<DT><B>bashdefault</B> + +<DD> +Perform the rest of the default <B>bash</B> completions if the compspec +generates no matches. +<DT><B>default</B> + +<DD> +Use readline's default filename completion if the compspec generates +no matches. +<DT><B>dirnames</B> + +<DD> +Perform directory name completion if the compspec generates no matches. +<DT><B>filenames</B> + +<DD> +Tell readline that the compspec generates filenames, so it can perform any +filename-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +<DT><B>nospace</B> + +<DD> +Tell readline not to append a space (the default) to words completed at +the end of the line. +<DT><B>plusdirs</B> + +<DD> +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +</DL></DL> + +<DT><B>-A</B> <I>action</I><DD> +The <I>action</I> may be one of the following to generate a list of possible +completions: +<DL COMPACT><DT><DD> +<DL COMPACT> +<DT><B>alias</B> + +<DD> +Alias names. May also be specified as <B>-a</B>. +<DT><B>arrayvar</B> + +<DD> +Array variable names. +<DT><B>binding</B> + +<DD> +<B>Readline</B> key binding names. +<DT><B>builtin</B> + +<DD> +Names of shell builtin commands. May also be specified as <B>-b</B>. +<DT><B>command</B> + +<DD> +Command names. May also be specified as <B>-c</B>. +<DT><B>directory</B> + +<DD> +Directory names. May also be specified as <B>-d</B>. +<DT><B>disabled</B> + +<DD> +Names of disabled shell builtins. +<DT><B>enabled</B> + +<DD> +Names of enabled shell builtins. +<DT><B>export</B> + +<DD> +Names of exported shell variables. May also be specified as <B>-e</B>. +<DT><B>file</B> + +<DD> +File names. May also be specified as <B>-f</B>. +<DT><B>function</B> + +<DD> +Names of shell functions. +<DT><B>group</B> + +<DD> +Group names. May also be specified as <B>-g</B>. +<DT><B>helptopic</B> + +<DD> +Help topics as accepted by the <B>help</B> builtin. +<DT><B>hostname</B> + +<DD> +Hostnames, as taken from the file specified by the +<FONT SIZE=-1><B>HOSTFILE</B> + +</FONT> +shell variable. +<DT><B>job</B> + +<DD> +Job names, if job control is active. May also be specified as <B>-j</B>. +<DT><B>keyword</B> + +<DD> +Shell reserved words. May also be specified as <B>-k</B>. +<DT><B>running</B> + +<DD> +Names of running jobs, if job control is active. +<DT><B>service</B> + +<DD> +Service names. May also be specified as <B>-s</B>. +<DT><B>setopt</B> + +<DD> +Valid arguments for the <B>-o</B> option to the <B>set</B> builtin. +<DT><B>shopt</B> + +<DD> +Shell option names as accepted by the <B>shopt</B> builtin. +<DT><B>signal</B> + +<DD> +Signal names. +<DT><B>stopped</B> + +<DD> +Names of stopped jobs, if job control is active. +<DT><B>user</B> + +<DD> +User names. May also be specified as <B>-u</B>. +<DT><B>variable</B> + +<DD> +Names of all shell variables. May also be specified as <B>-v</B>. +</DL></DL> + +<DT><B>-G</B> <I>globpat</I><DD> +The pathname expansion pattern <I>globpat</I> is expanded to generate +the possible completions. +<DT><B>-W</B> <I>wordlist</I><DD> +The <I>wordlist</I> is split using the characters in the +<FONT SIZE=-1><B>IFS</B> + +</FONT> +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +<DT><B>-C</B> <I>command</I><DD> +<I>command</I> is executed in a subshell environment, and its output is +used as the possible completions. +<DT><B>-F</B> <I>function</I><DD> +The shell function <I>function</I> is executed in the current shell +environment. +When it finishes, the possible completions are retrieved from the value +of the +<FONT SIZE=-1><B>COMPREPLY</B> + +</FONT> +array variable. +<DT><B>-X</B> <I>filterpat</I><DD> +<I>filterpat</I> is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +<I>filterpat</I> is removed from the list. +A leading <B>!</B> in <I>filterpat</I> negates the pattern; in this +case, any completion not matching <I>filterpat</I> is removed. +<DT><B>-P</B> <I>prefix</I><DD> +<I>prefix</I> is added at the beginning of each possible completion +after all other options have been applied. +<DT><B>-S</B> <I>suffix</I><DD> +<I>suffix</I> is appended to each possible completion +after all other options have been applied. + +</DL> +<P> + +The return value is true unless an invalid option is supplied, an option +other than <B>-p</B> or <B>-r</B> is supplied without a <I>name</I> +argument, an attempt is made to remove a completion specification for +a <I>name</I> for which no specification exists, or +an error occurs adding a completion specification. +</DL> + +<DT><B>compopt</B> [<B>-o</B> <I>option</I>] [<B>-DE</B>] [<B>+o</B> <I>option</I>] [<I>name</I>]<DD> +Modify completion options for each <I>name</I> according to the +<I>option</I>s, or for the +currently-execution completion if no <I>name</I>s are supplied. +If no <I>option</I>s are given, display the completion options for each +<I>name</I> or the current completion. +The possible values of <I>option</I> are those valid for the <B>complete</B> +builtin described above. +The <B>-D</B> option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The <B>-E</B> option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +</DL> +<P> + +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a <I>name</I> for which no completion +specification exists, or an output error occurs. +<DL COMPACT> +<DT><B>continue</B> [<I>n</I>]<DD> +Resume the next iteration of the enclosing +<B>for</B>, + +<B>while</B>, + +<B>until</B>, + +or +<B>select</B> + +loop. +If +<I>n</I> + +is specified, resume at the <I>n</I>th enclosing loop. +<I>n</I> + +must be >= 1. If +<I>n</I> + +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless <I>n</I> is not greater than or equal to 1. +<DT><B>declare</B> [<B>-aAfFilrtux</B>] [<B>-p</B>] [<I>name</I>[=<I>value</I>] ...]<DD> + +<DT><B>typeset</B> [<B>-aAfFilrtux</B>] [<B>-p</B>] [<I>name</I>[=<I>value</I>] ...]<DD> + +Declare variables and/or give them attributes. +If no <I>name</I>s are given then display the values of variables. +The +<B>-p</B> + +option will display the attributes and values of each +<I>name</I>. + +When +<B>-p</B> + +is used with <I>name</I> arguments, additional options are ignored. +When +<B>-p</B> + +is supplied without <I>name</I> arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with <B>-p</B>, <B>declare</B> will display +the attributes and values of all shell variables. The <B>-f</B> option +will restrict the display to shell functions. +The +<B>-F</B> + +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the <B>extdebug</B> shell option is enabled using <B>shopt</B>, +the source file name and line number where the function is defined +are displayed as well. The +<B>-F</B> + +option implies +<B>-f</B>. + +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-a</B> + +<DD> +Each <I>name</I> is an indexed array variable (see +<B>Arrays</B> + +above). +<DT><B>-A</B> + +<DD> +Each <I>name</I> is an associative array variable (see +<B>Arrays</B> + +above). +<DT><B>-f</B> + +<DD> +Use function names only. +<DT><B>-i</B> + +<DD> +The variable is treated as an integer; arithmetic evaluation (see +<FONT SIZE=-1><B>ARITHMETIC EVALUATION</B> + +</FONT> +above) is performed when the variable is assigned a value. +<DT><B>-l</B> + +<DD> +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +<DT><B>-r</B> + +<DD> +Make <I>name</I>s readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +<DT><B>-t</B> + +<DD> +Give each <I>name</I> the <I>trace</I> attribute. +Traced functions inherit the <B>DEBUG</B> and <B>RETURN</B> traps from +the calling shell. +The trace attribute has no special meaning for variables. +<DT><B>-u</B> + +<DD> +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +<DT><B>-x</B> + +<DD> +Mark <I>name</I>s for export to subsequent commands via the environment. + +</DL> +<P> + +Using `+' instead of `-' +turns off the attribute instead, +with the exceptions that <B>+a</B> +may not be used to destroy an array variable and <B>+r</B> will not +remove the readonly attribute. +When used in a function, +makes each +<I>name</I> local, as with the +<B>local</B> + +command. +If a variable name is followed by =<I>value</I>, the value of +the variable is set to <I>value</I>. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using + +<TT>-f foo=bar</TT>, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +<B>Arrays</B> + +above), one of the <I>names</I> is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with <B>-f</B>. +</DL> + +<DT><B>dirs [+</B><I>n</I>] [-<I>n</I>] [<B>-cplv</B>] + +<DD> +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +<B>pushd</B> + +command; the +<B>popd</B> + +command removes entries from the list. +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>+</B><I>n</I><DD> +Displays the <I>n</I>th entry counting from the left of the list +shown by +<B>dirs</B> + +when invoked without options, starting with zero. +<DT><B>-</B><I>n</I><DD> +Displays the <I>n</I>th entry counting from the right of the list +shown by +<B>dirs</B> + +when invoked without options, starting with zero. +<DT><B>-c</B> + +<DD> +Clears the directory stack by deleting all of the entries. +<DT><B>-l</B> + +<DD> +Produces a longer listing; the default listing format uses a +tilde to denote the home directory. +<DT><B>-p</B> + +<DD> +Print the directory stack with one entry per line. +<DT><B>-v</B> + +<DD> +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. + +</DL> +<P> + +The return value is 0 unless an +invalid option is supplied or <I>n</I> indexes beyond the end +of the directory stack. +</DL> + +<DT><B>disown</B> [<B>-ar</B>] [<B>-h</B>] [<I>jobspec</I> ...]<DD> +Without options, each +<I>jobspec</I> + +is removed from the table of active jobs. +If +<I>jobspec</I> + +is not present, and neither <B>-a</B> nor <B>-r</B> is supplied, +the shell's notion of the <I>current job</I> is used. +If the <B>-h</B> option is given, each +<I>jobspec</I> + +is not removed from the table, but is marked so that +<FONT SIZE=-1><B>SIGHUP</B> + +</FONT> +is not sent to the job if the shell receives a +<FONT SIZE=-1><B>SIGHUP</B>. + +</FONT> +If no +<I>jobspec</I> + +is present, and neither the +<B>-a</B> + +nor the +<B>-r</B> + +option is supplied, the <I>current job</I> is used. +If no +<I>jobspec</I> + +is supplied, the +<B>-a</B> + +option means to remove or mark all jobs; the +<B>-r</B> + +option without a +<I>jobspec</I> + +argument restricts operation to running jobs. +The return value is 0 unless a +<I>jobspec</I> + +does not specify a valid job. +<DT><B>echo</B> [<B>-neE</B>] [<I>arg</I> ...]<DD> +Output the <I>arg</I>s, separated by spaces, followed by a newline. +The return status is always 0. +If <B>-n</B> is specified, the trailing newline is +suppressed. If the <B>-e</B> option is given, interpretation of +the following backslash-escaped characters is enabled. The +<B>-E</B> + +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The <B>xpg_echo</B> shell option may be used to +dynamically determine whether or not <B>echo</B> expands these +escape characters by default. +<B>echo</B> + +does not interpret <B>--</B> to mean the end of options. +<B>echo</B> + +interprets the following escape sequences: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>\a</B> + +<DD> +alert (bell) +<DT><B>\b</B> + +<DD> +backspace +<DT><B>\c</B> + +<DD> +suppress further output +<DT><B>\e</B> + +<DD> +an escape character +<DT><B>\f</B> + +<DD> +form feed +<DT><B>\n</B> + +<DD> +new line +<DT><B>\r</B> + +<DD> +carriage return +<DT><B>\t</B> + +<DD> +horizontal tab +<DT><B>\v</B> + +<DD> +vertical tab +<DT><B>\\</B> + +<DD> +backslash +<DT><B>\0</B><I>nnn</I> + +<DD> +the eight-bit character whose value is the octal value <I>nnn</I> +(zero to three octal digits) +<DT><B>\x</B><I>HH</I> + +<DD> +the eight-bit character whose value is the hexadecimal value <I>HH</I> +(one or two hex digits) + +</DL></DL> + +<DT><B>enable</B> [<B>-a</B>] [<B>-dnps</B>] [<B>-f</B> <I>filename</I>] [<I>name</I> ...]<DD> +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If <B>-n</B> is used, each <I>name</I> +is disabled; otherwise, +<I>names</I> are enabled. For example, to use the +<B>test</B> + +binary found via the +<FONT SIZE=-1><B>PATH</B> + +</FONT> +instead of the shell builtin version, run +<TT>enable -n test</TT>. + +The +<B>-f</B> + +option means to load the new builtin command +<I>name</I> + +from shared object +<I>filename</I>, + +on systems that support dynamic loading. The +<B>-d</B> + +option will delete a builtin previously loaded with +<B>-f</B>. + +If no <I>name</I> arguments are given, or if the +<B>-p</B> + +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If <B>-n</B> is supplied, only disabled builtins are printed. +If <B>-a</B> is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If <B>-s</B> is supplied, the output is restricted to the POSIX +<I>special</I> builtins. +The return value is 0 unless a +<I>name</I> + +is not a shell builtin or there is an error loading a new builtin +from a shared object. +<DT><B>eval</B> [<I>arg</I> ...]<DD> +The <I>arg</I>s are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +<B>eval</B>. + +If there are no +<I>args</I>, + +or only null arguments, +<B>eval</B> + +returns 0. +<DT><B>exec</B> [<B>-cl</B>] [<B>-a</B> <I>name</I>] [<I>command</I> [<I>arguments</I>]]<DD> +If +<I>command</I> + +is specified, it replaces the shell. +No new process is created. The +<I>arguments</I> + +become the arguments to <I>command</I>. +If the +<B>-l</B> + +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +<I>command</I>. + +This is what +<I>login</I>(1) + +does. The +<B>-c</B> + +option causes +<I>command</I> + +to be executed with an empty environment. If +<B>-a</B> + +is supplied, the shell passes +<I>name</I> + +as the zeroth argument to the executed command. If +<I>command</I> + +cannot be executed for some reason, a non-interactive shell exits, +unless the shell option +<B>execfail</B> + +is enabled, in which case it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +<I>command</I> + +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +<DT><B>exit</B> [<I>n</I>]<DD> +Cause the shell to exit +with a status of <I>n</I>. If +<I>n</I> + +is omitted, the exit status +is that of the last command executed. +A trap on +<FONT SIZE=-1><B>EXIT</B> + +</FONT> +is executed before the shell terminates. +<DT><B>export</B> [<B>-fn</B>] [<I>name</I>[=<I>word</I>]] ...<DD> + +<DT><B>export -p</B> + +<DD> + +The supplied +<I>names</I> + +are marked for automatic export to the environment of +subsequently executed commands. If the +<B>-f</B> + +option is given, +the +<I>names</I> + +refer to functions. +If no +<I>names</I> + +are given, or if the +<B>-p</B> + +option is supplied, a list +of all names that are exported in this shell is printed. +The +<B>-n</B> + +option causes the export property to be removed from each +<I>name</I>. +If a variable name is followed by =<I>word</I>, the value of +the variable is set to <I>word</I>. +<B>export</B> + +returns an exit status of 0 unless an invalid option is +encountered, +one of the <I>names</I> is not a valid shell variable name, or +<B>-f</B> + +is supplied with a +<I>name</I> + +that is not a function. +<DT><B>fc</B> [<B>-e</B> <I>ename</I>] [<B>-lnr</B>] [<I>first</I>] [<I>last</I>]<DD> + +<DT><B>fc</B> <B>-s</B> [<I>pat</I>=<I>rep</I>] [<I>cmd</I>]<DD> + +Fix Command. In the first form, a range of commands from +<I>first</I> + +to +<I>last</I> + +is selected from the history list. +<I>First</I> + +and +<I>last</I> + +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +<I>last</I> + +is not specified it is set to +the current command for listing (so that + +<TT>fc -l -10</TT> +prints the last 10 commands) and to +<I>first</I> + +otherwise. +If +<I>first</I> + +is not specified it is set to the previous +command for editing and -16 for listing. +<P> +The +<B>-n</B> + +option suppresses +the command numbers when listing. The +<B>-r</B> + +option reverses the order of +the commands. If the +<B>-l</B> + +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +<I>ename</I> + +is invoked +on a file containing those commands. If +<I>ename</I> + +is not given, the +value of the +<FONT SIZE=-1><B>FCEDIT</B> + +</FONT> +variable is used, and +the value of +<FONT SIZE=-1><B>EDITOR</B> + +</FONT> +if +<FONT SIZE=-1><B>FCEDIT</B> + +</FONT> +is not set. If neither variable is set, + +<I>vi</I> + +is used. When editing is complete, the edited commands are +echoed and executed. +<P> +In the second form, <I>command</I> is re-executed after each instance +of <I>pat</I> is replaced by <I>rep</I>. +A useful alias to use with this is + +<TT>r='fc -s'</TT>, +so that typing + +<TT>r cc</TT> +runs the last command beginning with + +<TT>cc</TT> +and typing + +<TT>r</TT> +re-executes the last command. +<P> +If the first form is used, the return value is 0 unless an invalid +option is encountered or +<I>first</I> + +or +<I>last</I> + +specify history lines out of range. +If the +<B>-e</B> + +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +<I>cmd</I> + +does not specify a valid history line, in which case +<B>fc</B> + +returns failure. +<DT><B>fg</B> [<I>jobspec</I>]<DD> +Resume +<I>jobspec</I> + +in the foreground, and make it the current job. +If +<I>jobspec</I> + +is not present, the shell's notion of the <I>current job</I> is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +<I>jobspec</I> + +does not specify a valid job or +<I>jobspec</I> + +specifies a job that was started without job control. +<DT><B>getopts</B> <I>optstring</I> <I>name</I> [<I>args</I>]<DD> +<B>getopts</B> + +is used by shell procedures to parse positional parameters. +<I>optstring</I> + +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +<B>getopts</B> + +places the next option in the shell variable +<I>name</I>, + +initializing +<I>name</I> + +if it does not exist, +and the index of the next argument to be processed into the +variable +<FONT SIZE=-1><B>OPTIND</B>. + +</FONT> +<FONT SIZE=-1><B>OPTIND</B> + +</FONT> +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +<B>getopts</B> + +places that argument into the variable +<FONT SIZE=-1><B>OPTARG</B>. + +</FONT> +The shell does not reset +<FONT SIZE=-1><B>OPTIND</B> + +</FONT> +automatically; it must be manually reset between multiple +calls to +<B>getopts</B> + +within the same shell invocation if a new set of parameters +is to be used. +<P> +When the end of options is encountered, <B>getopts</B> exits with a +return value greater than zero. +<FONT SIZE=-1><B>OPTIND</B> + +</FONT> +is set to the index of the first non-option argument, +and <B>name</B> is set to ?. +<P> +<B>getopts</B> + +normally parses the positional parameters, but if more arguments are +given in +<I>args</I>, + +<B>getopts</B> + +parses those instead. +<P> +<B>getopts</B> + +can report errors in two ways. If the first character of +<I>optstring</I> + +is a colon, +<I>silent</I> + +error reporting is used. In normal operation diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +<FONT SIZE=-1><B>OPTERR</B> + +</FONT> +is set to 0, no error messages will be displayed, even if the first +character of +<I>optstring</I> + +is not a colon. +<P> +If an invalid option is seen, +<B>getopts</B> + +places ? into +<I>name</I> + +and, if not silent, +prints an error message and unsets +<FONT SIZE=-1><B>OPTARG</B>. + +</FONT> +If +<B>getopts</B> + +is silent, +the option character found is placed in +<FONT SIZE=-1><B>OPTARG</B> + +</FONT> +and no diagnostic message is printed. +<P> +If a required argument is not found, and +<B>getopts</B> + +is not silent, +a question mark (<B>?</B>) is placed in +<I>name</I>, + +<FONT SIZE=-1><B>OPTARG</B> + +</FONT> +is unset, and a diagnostic message is printed. +If +<B>getopts</B> + +is silent, then a colon (<B>:</B>) is placed in +<I>name</I> + +and +<FONT SIZE=-1><B>OPTARG</B> + +</FONT> +is set to the option character found. +<P> +<B>getopts</B> + +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +<DT><B>hash</B> [<B>-lr</B>] [<B>-p</B> <I>filename</I>] [<B>-dt</B>] [<I>name</I>]<DD> +For each +<I>name</I>, + +the full file name of the command is determined by searching +the directories in +<B>$PATH</B> + +and remembered. +If the +<B>-p</B> + +option is supplied, no path search is performed, and +<I>filename</I> + +is used as the full file name of the command. +The +<B>-r</B> + +option causes the shell to forget all +remembered locations. +The +<B>-d</B> + +option causes the shell to forget the remembered location of each <I>name</I>. +If the +<B>-t</B> + +option is supplied, the full pathname to which each <I>name</I> corresponds +is printed. If multiple <I>name</I> arguments are supplied with <B>-t</B>, +the <I>name</I> is printed before the hashed full pathname. +The +<B>-l</B> + +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only <B>-l</B> is supplied, +information about remembered commands is printed. +The return status is true unless a +<I>name</I> + +is not found or an invalid option is supplied. +<DT><B>help</B> [<B>-dms</B>] [<I>pattern</I>]<DD> +Display helpful information about builtin commands. If +<I>pattern</I> + +is specified, +<B>help</B> + +gives detailed help on all commands matching +<I>pattern</I>; + +otherwise help for all the builtins and shell control structures +is printed. +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-d</B> + +<DD> +Display a short description of each <I>pattern</I> +<DT><B>-m</B> + +<DD> +Display the description of each <I>pattern</I> in a manpage-like format +<DT><B>-s</B> + +<DD> +Display only a short usage synopsis for each <I>pattern</I> + +</DL></DL> + +The return status is 0 unless no command matches +<I>pattern</I>. + +<DT><B>history [</B><I>n</I>]<DD> + +<DT><B>history</B> <B>-c</B><DD> +<DT><B>history -d</B> <I>offset</I><DD> +<DT><B>history</B> <B>-anrw</B> [<I>filename</I>]<DD> +<DT><B>history</B> <B>-p</B> <I>arg</I> [<I>arg ...</I>]<DD> +<DT><B>history</B> <B>-s</B> <I>arg</I> [<I>arg ...</I>]<DD> + +With no options, display the command +history list with line numbers. Lines listed +with a +<B>*</B> + +have been modified. An argument of +<I>n</I> + +lists only the last +<I>n</I> + +lines. +If the shell variable +<FONT SIZE=-1><B>HISTTIMEFORMAT</B> + +</FONT> +is set and not null, +it is used as a format string for <I>strftime</I>(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If <I>filename</I> is supplied, it is used as the +name of the history file; if not, the value of +<FONT SIZE=-1><B>HISTFILE</B> + +</FONT> +is used. Options, if supplied, have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-c</B> + +<DD> +Clear the history list by deleting all the entries. +<DT><B>-d</B> <I>offset</I><DD> +Delete the history entry at position <I>offset</I>. +<DT><B>-a</B> + +<DD> +Append the ``new'' history lines (history lines entered since the +beginning of the current <B>bash</B> session) to the history file. +<DT><B>-n</B> + +<DD> +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current <B>bash</B> session. +<DT><B>-r</B> + +<DD> +Read the contents of the history file +and use them as the current history. +<DT><B>-w</B> + +<DD> +Write the current history to the history file, overwriting the +history file's contents. +<DT><B>-p</B> + +<DD> +Perform history substitution on the following <I>args</I> and display +the result on the standard output. +Does not store the results in the history list. +Each <I>arg</I> must be quoted to disable normal history expansion. +<DT><B>-s</B> + +<DD> +Store the +<I>args</I> + +in the history list as a single entry. The last command in the +history list is removed before the +<I>args</I> + +are added. + +</DL> +<P> + +If the +<FONT SIZE=-1><B>HISTTIMEFORMAT</B> + +</FONT> +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +<I>offset</I> is supplied as an argument to <B>-d</B>, or the +history expansion supplied as an argument to <B>-p</B> fails. +</DL> + +<DT><B>jobs</B> [<B>-lnprs</B>] [ <I>jobspec</I> ... ]<DD> + +<DT><B>jobs</B> <B>-x</B> <I>command</I> [ <I>args</I> ... ]<DD> + +The first form lists the active jobs. The options have the following +meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-l</B> + +<DD> +List process IDs +in addition to the normal information. +<DT><B>-p</B> + +<DD> +List only the process ID of the job's process group +leader. +<DT><B>-n</B> + +<DD> +Display information only about jobs that have changed status since +the user was last notified of their status. +<DT><B>-r</B> + +<DD> +Restrict output to running jobs. +<DT><B>-s</B> + +<DD> +Restrict output to stopped jobs. + +</DL> +<P> + +If +<I>jobspec</I> + +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +<I>jobspec</I> + +is supplied. +<P> + +If the +<B>-x</B> + +option is supplied, +<B>jobs</B> + +replaces any +<I>jobspec</I> + +found in +<I>command</I> + +or +<I>args</I> + +with the corresponding process group ID, and executes +<I>command</I> + +passing it +<I>args</I>, + +returning its exit status. +</DL> + +<DT><B>kill</B> [<B>-s</B> <I>sigspec</I> | <B>-n</B> <I>signum</I> | <B>-</B><I>sigspec</I>] [<I>pid</I> | <I>jobspec</I>] ...<DD> + +<DT><B>kill</B> <B>-l</B> [<I>sigspec</I> | <I>exit_status</I>]<DD> + +Send the signal named by +<I>sigspec</I> + +or +<I>signum</I> + +to the processes named by +<I>pid</I> + +or +<I>jobspec</I>. + +<I>sigspec</I> + +is either a case-insensitive signal name such as +<FONT SIZE=-1><B>SIGKILL</B> + +</FONT> +(with or without the +<FONT SIZE=-1><B>SIG</B> + +</FONT> +prefix) or a signal number; +<I>signum</I> + +is a signal number. +If +<I>sigspec</I> + +is not present, then +<FONT SIZE=-1><B>SIGTERM</B> + +</FONT> +is assumed. +An argument of +<B>-l</B> + +lists the signal names. +If any arguments are supplied when +<B>-l</B> + +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The <I>exit_status</I> argument to +<B>-l</B> + +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +<B>kill</B> + +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +<DT><B>let</B> <I>arg</I> [<I>arg</I> ...]<DD> +Each +<I>arg</I> + +is an arithmetic expression to be evaluated (see +<FONT SIZE=-1><B>ARITHMETIC EVALUATION</B> + +</FONT> +above). +If the last +<I>arg</I> + +evaluates to 0, +<B>let</B> + +returns 1; 0 is returned otherwise. +<DT><B>local</B> [<I>option</I>] [<I>name</I>[=<I>value</I>] ...]<DD> +For each argument, a local variable named +<I>name </I> + +is created, and assigned +<I>value</I>. + +The <I>option</I> can be any of the options accepted by <B>declare</B>. +When +<B>local</B> + +is used within a function, it causes the variable +<I>name</I> + +to have a visible scope restricted to that function and its children. +With no operands, +<B>local</B> + +writes a list of local variables to the standard output. It is +an error to use +<B>local</B> + +when not within a function. The return status is 0 unless +<B>local</B> + +is used outside a function, an invalid +<I>name</I> + +is supplied, or +<I>name</I> is a readonly variable. +<DT><B>logout</B> + +<DD> +Exit a login shell. +<DT><B>mapfile</B> [<B>-n</B> <I>count</I>] [<B>-O</B> <I>origin</I>] [<B>-s</B> <I>count</I>] [<B>-t</B>] [<B>-u</B> <I>fd</I>] [<B>-C</B> <I>callback</I>] [<B>-c</B> <I>quantum</I>] [<I>array</I>]<DD> + +<DT><B>readarray</B> [<B>-n</B> <I>count</I>] [<B>-O</B> <I>origin</I>] [<B>-s</B> <I>count</I>] [<B>-t</B>] [<B>-u</B> <I>fd</I>] [<B>-C</B> <I>callback</I>] [<B>-c</B> <I>quantum</I>] [<I>array</I>]<DD> + +Read lines from the standard input into the indexed array variable +<I>array</I>, + +or from file descriptor +<I>fd</I> + +if the +<B>-u</B> + +option is supplied. +The variable +<FONT SIZE=-1><B>MAPFILE</B> + +</FONT> +is the default <I>array</I>. +Options, if supplied, have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-n</B> + +<DD> +Copy at most +<I>count</I> + +lines. If <I>count</I> is 0, all lines are copied. +<DT><B>-O</B> + +<DD> +Begin assigning to +<I>array</I> + +at index +<I>origin</I>. + +The default index is 0. +<DT><B>-s</B> + +<DD> +Discard the first <I>count</I> lines read. +<DT><B>-t</B> + +<DD> +Remove a trailing newline from each line read. +<DT><B>-u</B> + +<DD> +Read lines from file descriptor <I>fd</I> instead of the standard input. +<DT><B>-C</B> + +<DD> +Evaluate +<I>callback</I> + +each time <I>quantum</I> lines are read. The <B>-c</B> option specifies +<I>quantum</I>. + +<DT><B>-c</B> + +<DD> +Specify the number of lines read between each call to +<I>callback</I>. + + +</DL> +<P> + +If +<B>-C</B> + +is specified without +<B>-c</B>, + +the default quantum is 5000. +When <I>callback</I> is evaluated, it is supplied the index of the next +array element to be assigned as an additional argument. +<I>callback</I> is evaluated after the line is read but before the +array element is assigned. +<P> + +If not supplied with an explicit origin, <B>mapfile</B> will clear <I>array</I> +before assigning to it. +<P> + +<B>mapfile</B> returns successfully unless an invalid option or option +argument is supplied, <I>array</I> is invalid or unassignable, or if +<I>array</I> is not an indexed array. +</DL> + +<DT><B>popd</B> [-<B>n</B>] [+<I>n</I>] [-<I>n</I>]<DD> +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +<B>cd</B> + +to the new top directory. +Arguments, if supplied, have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-n</B> + +<DD> +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +<DT><B>+</B><I>n</I><DD> +Removes the <I>n</I>th entry counting from the left of the list +shown by +<B>dirs</B>, + +starting with zero. For example: + +<TT>popd +0</TT> +removes the first directory, + +<TT>popd +1</TT> +the second. +<DT><B>-</B><I>n</I><DD> +Removes the <I>n</I>th entry counting from the right of the list +shown by +<B>dirs</B>, + +starting with zero. For example: + +<TT>popd -0</TT> +removes the last directory, + +<TT>popd -1</TT> +the next to last. + +</DL> +<P> + +If the +<B>popd</B> + +command is successful, a +<B>dirs</B> + +is performed as well, and the return status is 0. +<B>popd</B> + +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +</DL> + +<DT><B>printf</B> [<B>-v</B> <I>var</I>] <I>format</I> [<I>arguments</I>]<DD> +Write the formatted <I>arguments</I> to the standard output under the +control of the <I>format</I>. +The <I>format</I> is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +<I>argument</I>. +In addition to the standard <I>printf</I>(1) formats, <B>%b</B> causes +<B>printf</B> to expand backslash escape sequences in the corresponding +<I>argument</I> (except that <B>\c</B> terminates output, backslashes in +<B>\aq</B>, <B>\"</B>, and <B>\?</B> are not removed, and octal escapes +beginning with <B>\0</B> may contain up to four digits), +and <B>%q</B> causes <B>printf</B> to output the corresponding +<I>argument</I> in a format that can be reused as shell input. +<P> +The <B>-v</B> option causes the output to be assigned to the variable +<I>var</I> rather than being printed to the standard output. +<P> +The <I>format</I> is reused as necessary to consume all of the <I>arguments</I>. +If the <I>format</I> requires more <I>arguments</I> than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. The return value is zero on success, +non-zero on failure. +<DT><B>pushd</B> [<B>-n</B>] [+<I>n</I>] [-<I>n</I>]<DD> + +<DT><B>pushd</B> [<B>-n</B>] [<I>dir</I>]<DD> + +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-n</B> + +<DD> +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +<DT><B>+</B><I>n</I><DD> +Rotates the stack so that the <I>n</I>th directory +(counting from the left of the list shown by +<B>dirs</B>, + +starting with zero) +is at the top. +<DT><B>-</B><I>n</I><DD> +Rotates the stack so that the <I>n</I>th directory +(counting from the right of the list shown by +<B>dirs</B>, + +starting with zero) is at the top. +<DT><I>dir</I> + +<DD> +Adds +<I>dir</I> + +to the directory stack at the top, making it the +new current working directory. + +</DL> +<P> + +If the +<B>pushd</B> + +command is successful, a +<B>dirs</B> + +is performed as well. +If the first form is used, +<B>pushd</B> + +returns 0 unless the cd to +<I>dir</I> + +fails. With the second form, +<B>pushd</B> + +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +</DL> + +<DT><B>pwd</B> [<B>-LP</B>]<DD> +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +<B>-P</B> + +option is supplied or the +<B>-o physical</B> + +option to the +<B>set</B> + +builtin command is enabled. +If the +<B>-L</B> + +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +<DT><B>read</B> [<B>-ers</B>] [<B>-a</B> <I>aname</I>] [<B>-d</B> <I>delim</I>] [<B>-i</B> <I>text</I>] [<B>-n</B> <I>nchars</I>] [<B>-N</B> <I>nchars</I>] [<B>-p</B> <I>prompt</I>] [<B>-t</B> <I>timeout</I>] [<B>-u</B> <I>fd</I>] [<I>name</I> ...]<DD> +One line is read from the standard input, or from the file descriptor +<I>fd</I> supplied as an argument to the <B>-u</B> option, and the first word +is assigned to the first +<I>name</I>, + +the second word to the second +<I>name</I>, + +and so on, with leftover words and their intervening separators assigned +to the last +<I>name</I>. + +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +<FONT SIZE=-1><B>IFS</B> + +</FONT> +are used to split the line into words. +The backslash character (<B>\</B>) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-a </B><I>aname</I> + +<DD> +The words are assigned to sequential indices +of the array variable +<I>aname</I>, + +starting at 0. +<I>aname</I> + +is unset before any new values are assigned. +Other <I>name</I> arguments are ignored. +<DT><B>-d </B><I>delim</I> + +<DD> +The first character of <I>delim</I> is used to terminate the input line, +rather than newline. +<DT><B>-e</B> + +<DD> +If the standard input +is coming from a terminal, +<B>readline</B> + +(see +<FONT SIZE=-1><B>READLINE</B> + +</FONT> +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +<DT><B>-i </B><I>text</I> + +<DD> +If +<B>readline</B> + +is being used to read the line, <I>text</I> is placed into the editing +buffer before editing begins. +<DT><B>-n </B><I>nchars</I> + +<DD> +<B>read</B> returns after reading <I>nchars</I> characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than <I>nchars</I> characters are read before the delimiter. +<DT><B>-N </B><I>nchars</I> + +<DD> +<B>read</B> returns after reading exactly <I>nchars</I> characters rather +than waiting for a complete line of input, unless EOF is encountered or +<B>read</B> times out. +Delimiter characters encountered in the input are +not treated specially and do not cause <B>read</B> to return until +<I>nchars</I> characters are read. +<DT><B>-p </B><I>prompt</I> + +<DD> +Display <I>prompt</I> on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +<DT><B>-r</B> + +<DD> +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +<DT><B>-s</B> + +<DD> +Silent mode. If input is coming from a terminal, characters are +not echoed. +<DT><B>-t </B><I>timeout</I> + +<DD> +Cause <B>read</B> to time out and return failure if a complete line of +input is not read within <I>timeout</I> seconds. +<I>timeout</I> may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if <B>read</B> is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If <I>timeout</I> is 0, <B>read</B> returns success if input is available on +the specified file descriptor, failure otherwise. +The exit status is greater than 128 if the timeout is exceeded. +<DT><B>-u </B><I>fd</I> + +<DD> +Read input from file descriptor <I>fd</I>. + +</DL> +<P> + +If no +<I>names</I> + +are supplied, the line read is assigned to the variable +<FONT SIZE=-1><B>REPLY</B>. + +</FONT> +The return code is zero, unless end-of-file is encountered, <B>read</B> +times out (in which case the return code is greater than 128), or an +invalid file descriptor is supplied as the argument to <B>-u</B>. +</DL> + +<DT><B>readonly</B> [<B>-aApf</B>] [<I>name</I>[=<I>word</I>] ...]<DD> + +The given +<I>names</I> are marked readonly; the values of these +<I>names</I> + +may not be changed by subsequent assignment. +If the +<B>-f</B> + +option is supplied, the functions corresponding to the +<I>names</I> are so +marked. +The +<B>-a</B> + +option restricts the variables to indexed arrays; the +<B>-A</B> + +option restricts the variables to associative arrays. +If no +<I>name</I> + +arguments are given, or if the +<B>-p</B> + +option is supplied, a list of all readonly names is printed. +The +<B>-p</B> + +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =<I>word</I>, the value of +the variable is set to <I>word</I>. +The return status is 0 unless an invalid option is encountered, +one of the +<I>names</I> + +is not a valid shell variable name, or +<B>-f</B> + +is supplied with a +<I>name</I> + +that is not a function. +<DT><B>return</B> [<I>n</I>]<DD> +Causes a function to exit with the return value specified by +<I>n</I>. + +If +<I>n</I> + +is omitted, the return status is that of the last command +executed in the function body. If used outside a function, +but during execution of a script by the +<B>.</B> + +(<B>source</B>) command, it causes the shell to stop executing +that script and return either +<I>n</I> + +or the exit status of the last command executed within the +script as the exit status of the script. If used outside a +function and not during execution of a script by <B>.</B>, +the return status is false. +Any command associated with the <B>RETURN</B> trap is executed +before execution resumes after the function or script. +<DT><B>set</B> [<B>--abefhkmnptuvxBCEHPT</B>] [<B>-o</B> <I>option</I>] [<I>arg</I> ...]<DD> + +<DT><B>set</B> [<B>+abefhkmnptuvxBCEHPT</B>] [<B>+o</B> <I>option</I>] [<I>arg</I> ...]<DD> + +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In <I>posix mode</I>, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +<B>$1</B>, + +<B>$2</B>, + +<B>...</B> + +<B>$</B><I>n</I>. + +Options, if specified, have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-a</B> + +<DD> +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +<DT><B>-b</B> + +<DD> +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +<DT><B>-e</B> + +<DD> +Exit immediately if a <I>pipeline</I> (which may consist of a single +<I>simple command</I>), a <I>subshell</I> command enclosed in parentheses, +or one of the commands executed as part of a command list enclosed +by braces (see +<FONT SIZE=-1><B>SHELL GRAMMAR</B> + +</FONT> +above) exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +<B>while</B> + +or +<B>until</B> + +keyword, +part of the test following the +<B>if</B> + +or +<B>elif</B> + +reserved words, part of any command executed in a +<B>&&</B> + +or +<B>||</B> + +list except the command following the final <B>&&</B> or <B>||</B>, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +<B>!</B>. + +A trap on <B>ERR</B>, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +<FONT SIZE=-1><B>COMMAND EXECUTION ENVIRONMENT</B> + +</FONT> +above), and may cause +subshells to exit before executing all the commands in the subshell. +<DT><B>-f</B> + +<DD> +Disable pathname expansion. +<DT><B>-h</B> + +<DD> +Remember the location of commands as they are looked up for execution. +This is enabled by default. +<DT><B>-k</B> + +<DD> +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +<DT><B>-m</B> + +<DD> +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +<FONT SIZE=-1><B>JOB CONTROL</B> + +</FONT> +above). Background processes run in a separate process +group and a line containing their exit status is printed +upon their completion. +<DT><B>-n</B> + +<DD> +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +<DT><B>-o </B><I>option-name</I> + +<DD> +The <I>option-name</I> can be one of the following: +<DL COMPACT><DT><DD> +<DL COMPACT> +<DT><B>allexport</B> + +<DD> +Same as +<B>-a</B>. + +<DT><B>braceexpand</B> + +<DD> +Same as +<B>-B</B>. + +<DT><B>emacs</B> + +<DD> +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +<B>--noediting</B> + +option. +This also affects the editing interface used for <B>read -e</B>. +<DT><B>errexit</B> + +<DD> +Same as +<B>-e</B>. + +<DT><B>errtrace</B> + +<DD> +Same as +<B>-E</B>. + +<DT><B>functrace</B> + +<DD> +Same as +<B>-T</B>. + +<DT><B>hashall</B> + +<DD> +Same as +<B>-h</B>. + +<DT><B>histexpand</B> + +<DD> +Same as +<B>-H</B>. + +<DT><B>history</B> + +<DD> +Enable command history, as described above under +<FONT SIZE=-1><B>HISTORY</B>. + +</FONT> +This option is on by default in interactive shells. +<DT><B>ignoreeof</B> + +<DD> +The effect is as if the shell command +<TT>IGNOREEOF=10</TT> + +had been executed +(see +<B>Shell Variables</B> + +above). +<DT><B>keyword</B> + +<DD> +Same as +<B>-k</B>. + +<DT><B>monitor</B> + +<DD> +Same as +<B>-m</B>. + +<DT><B>noclobber</B> + +<DD> +Same as +<B>-C</B>. + +<DT><B>noexec</B> + +<DD> +Same as +<B>-n</B>. + +<DT><B>noglob</B> + +<DD> +Same as +<B>-f</B>. + +<DT><B>nolog</B> + +<DD> +Currently ignored. +<DT><B>notify</B> + +<DD> +Same as +<B>-b</B>. + +<DT><B>nounset</B> + +<DD> +Same as +<B>-u</B>. + +<DT><B>onecmd</B> + +<DD> +Same as +<B>-t</B>. + +<DT><B>physical</B> + +<DD> +Same as +<B>-P</B>. + +<DT><B>pipefail</B> + +<DD> +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +<DT><B>posix</B> + +<DD> +Change the behavior of +<B>bash</B> + +where the default operation differs +from the POSIX standard to match the standard (<I>posix mode</I>). +<DT><B>privileged</B> + +<DD> +Same as +<B>-p</B>. + +<DT><B>verbose</B> + +<DD> +Same as +<B>-v</B>. + +<DT><B>vi</B> + +<DD> +Use a vi-style command line editing interface. +This also affects the editing interface used for <B>read -e</B>. +<DT><B>xtrace</B> + +<DD> +Same as +<B>-x</B>. + +<P> +</DL> +<P> + +If +<B>-o</B> + +is supplied with no <I>option-name</I>, the values of the current options are +printed. +If +<B>+o</B> + +is supplied with no <I>option-name</I>, a series of +<B>set</B> + +commands to recreate the current option settings is displayed on +the standard output. +</DL> + +<DT><B>-p</B> + +<DD> +Turn on +<I>privileged</I> + +mode. In this mode, the +<FONT SIZE=-1><B>$ENV</B> + +</FONT> +and +<FONT SIZE=-1><B>$BASH_ENV</B> + +</FONT> +files are not processed, shell functions are not inherited from the +environment, and the +<FONT SIZE=-1><B>SHELLOPTS</B>, + +</FONT> +<FONT SIZE=-1><B>BASHOPTS</B>, + +</FONT> +<FONT SIZE=-1><B>CDPATH</B>, + +</FONT> +and +<FONT SIZE=-1><B>GLOBIGNORE</B> + +</FONT> +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the <B>-p</B> option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the <B>-p</B> option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +<DT><B>-t</B> + +<DD> +Exit after reading and executing one command. +<DT><B>-u</B> + +<DD> +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +<DT><B>-v</B> + +<DD> +Print shell input lines as they are read. +<DT><B>-x</B> + +<DD> +After expanding each <I>simple command</I>, +<B>for</B> command, <B>case</B> command, <B>select</B> command, or +arithmetic <B>for</B> command, display the expanded value of +<FONT SIZE=-1><B>PS4</B>, + +</FONT> +followed by the command and its expanded arguments +or associated word list. +<DT><B>-B</B> + +<DD> +The shell performs brace expansion (see +<B>Brace Expansion</B> + +above). This is on by default. +<DT><B>-C</B> + +<DD> +If set, +<B>bash</B> + +does not overwrite an existing file with the +<B>></B>, + +<B>>&</B>, + +and +<B><></B> + +redirection operators. This may be overridden when +creating output files by using the redirection operator +<B>>|</B> + +instead of +<B>></B>. + +<DT><B>-E</B> + +<DD> +If set, any trap on <B>ERR</B> is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The <B>ERR</B> trap is normally not inherited in such cases. +<DT><B>-H</B> + +<DD> +Enable +<B>!</B> + +style history substitution. This option is on by +default when the shell is interactive. +<DT><B>-P</B> + +<DD> +If set, the shell does not follow symbolic links when executing +commands such as +<B>cd</B> + +that change the current working directory. It uses the +physical directory structure instead. By default, +<B>bash</B> + +follows the logical chain of directories when performing commands +which change the current directory. +<DT><B>-T</B> + +<DD> +If set, any traps on <B>DEBUG</B> and <B>RETURN</B> are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The <B>DEBUG</B> and <B>RETURN</B> traps are normally not inherited +in such cases. +<DT><B>--</B> + +<DD> +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +<I>arg</I>s, even if some of them begin with a +<B>-</B>. + +<DT><B>-</B> + +<DD> +Signal the end of options, cause all remaining <I>arg</I>s to be +assigned to the positional parameters. The +<B>-x</B> + +and +<B>-v</B> + +options are turned off. +If there are no <I>arg</I>s, +the positional parameters remain unchanged. + +</DL> +<P> + +The options are off by default unless otherwise noted. +Using + rather than - causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +<B>$-</B>. + +The return status is always true unless an invalid option is encountered. +</DL> + +<DT><B>shift</B> [<I>n</I>]<DD> +The positional parameters from <I>n</I>+1 ... are renamed to +<B>$1</B> + +<B>....</B> + +Parameters represented by the numbers <B>$#</B> +down to <B>$#</B>-<I>n</I>+1 are unset. +<I>n</I> + +must be a non-negative number less than or equal to <B>$#</B>. +If +<I>n</I> + +is 0, no parameters are changed. +If +<I>n </I> + +is not given, it is assumed to be 1. +If +<I>n</I> + +is greater than <B>$#</B>, the positional parameters are not changed. +The return status is greater than zero if +<I>n</I> + +is greater than +<B>$#</B> + +or less than zero; otherwise 0. +<DT><B>shopt</B> [<B>-pqsu</B>] [<B>-o</B>] [<I>optname</I> ...]<DD> +Toggle the values of variables controlling optional shell behavior. +With no options, or with the +<B>-p</B> + +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The <B>-p</B> option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-s</B> + +<DD> +Enable (set) each <I>optname</I>. +<DT><B>-u</B> + +<DD> +Disable (unset) each <I>optname</I>. +<DT><B>-q</B> + +<DD> +Suppresses normal output (quiet mode); the return status indicates +whether the <I>optname</I> is set or unset. +If multiple <I>optname</I> arguments are given with +<B>-q</B>, + +the return status is zero if all <I>optnames</I> are enabled; non-zero +otherwise. +<DT><B>-o</B> + +<DD> +Restricts the values of <I>optname</I> to be those defined for the +<B>-o</B> + +option to the +<B>set</B> + +builtin. + +</DL> +<P> + +If either +<B>-s</B> + +or +<B>-u</B> + +is used with no <I>optname</I> arguments, the display is limited to +those options which are set or unset, respectively. +Unless otherwise noted, the <B>shopt</B> options are disabled (unset) +by default. +<P> + +The return status when listing options is zero if all <I>optnames</I> +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an <I>optname</I> is not a valid shell +option. +<P> + +The list of <B>shopt</B> options is: +<P> + + + +<DL COMPACT> +<DT><B>autocd</B> + +<DD> +If set, a command name that is the name of a directory is executed as if +it were the argument to the <B>cd</B> command. +This option is only used by interactive shells. +<DT><B>cdable_vars</B> + +<DD> +If set, an argument to the +<B>cd</B> + +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +<DT><B>cdspell</B> + +<DD> +If set, minor errors in the spelling of a directory component in a +<B>cd</B> + +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected file name is printed, +and the command proceeds. +This option is only used by interactive shells. +<DT><B>checkhash</B> + +<DD> +If set, <B>bash</B> checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +<DT><B>checkjobs</B> + +<DD> +If set, <B>bash</B> lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +<FONT SIZE=-1><B>JOB CONTROL</B> + +</FONT> +above). The shell always +postpones exiting if any jobs are stopped. +<DT><B>checkwinsize</B> + +<DD> +If set, <B>bash</B> checks the window size after each command +and, if necessary, updates the values of +<FONT SIZE=-1><B>LINES</B> + +</FONT> +and +<FONT SIZE=-1><B>COLUMNS</B>. + +</FONT> +<DT><B>cmdhist</B> + +<DD> +If set, +<B>bash</B> + +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +<DT><B>compat31</B> + +<DD> +If set, +<B>bash</B> + +changes its behavior to that of version 3.1 with respect to quoted +arguments to the conditional command's =~ operator. +<DT><B>compat32</B> + +<DD> +If set, +<B>bash</B> + +changes its behavior to that of version 3.2 with respect to locale-specific +string comparison when using the conditional command's < and > operators. +<DT><B>compat40</B> + +<DD> +If set, +<B>bash</B> + +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the conditional command's < and > operators +and the effect of interrupting a command list. +<DT><B>dirspell</B> + +<DD> +If set, +<B>bash</B> + +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +<DT><B>dotglob</B> + +<DD> +If set, +<B>bash</B> + +includes filenames beginning with a `.' in the results of pathname +expansion. +<DT><B>execfail</B> + +<DD> +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +<B>exec</B> + +builtin command. An interactive shell does not exit if +<B>exec</B> + +fails. +<DT><B>expand_aliases</B> + +<DD> +If set, aliases are expanded as described above under +<FONT SIZE=-1><B>ALIASES</B>. + +</FONT> +This option is enabled by default for interactive shells. +<DT><B>extdebug</B> + +<DD> +If set, behavior intended for use by debuggers is enabled: +<DL COMPACT><DT><DD> +<DL COMPACT> +<DT><B>1.</B> + +<DD> +The <B>-F</B> option to the <B>declare</B> builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +<DT><B>2.</B> + +<DD> +If the command run by the <B>DEBUG</B> trap returns a non-zero value, the +next command is skipped and not executed. +<DT><B>3.</B> + +<DD> +If the command run by the <B>DEBUG</B> trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the <B>.</B> or <B>source</B> builtins), a call to +<B>return</B> is simulated. +<DT><B>4.</B> + +<DD> +<FONT SIZE=-1><B>BASH_ARGC</B> + +</FONT> +and +<FONT SIZE=-1><B>BASH_ARGV</B> + +</FONT> +are updated as described in their descriptions above. +<DT><B>5.</B> + +<DD> +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with <B>(</B> <I>command</I> <B>)</B> inherit the +<B>DEBUG</B> and <B>RETURN</B> traps. +<DT><B>6.</B> + +<DD> +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with <B>(</B> <I>command</I> <B>)</B> inherit the +<B>ERROR</B> trap. +</DL></DL> + +<DT><B>extglob</B> + +<DD> +If set, the extended pattern matching features described above under +<B>Pathname Expansion</B> are enabled. +<DT><B>extquote</B> + +<DD> +If set, <B>$</B>aq<I>string</I>aq and <B>$</B>"<I>string</I>" quoting is +performed within <B>${</B><I>parameter</I><B>}</B> expansions +enclosed in double quotes. This option is enabled by default. +<DT><B>failglob</B> + +<DD> +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +<DT><B>force_fignore</B> + +<DD> +If set, the suffixes specified by the +<FONT SIZE=-1><B>FIGNORE</B> + +</FONT> +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +<FONT SIZE=-1><B>SHELL VARIABLES</B></FONT> +above for a description of +<FONT SIZE=-1><B>FIGNORE</B>. + +</FONT> +This option is enabled by default. +<DT><B>globstar</B> + +<DD> +If set, the pattern <B>**</B> used in a pathname expansion context will +match a files and zero or more directories and subdirectories. +If the pattern is followed by a <B>/</B>, only directories and +subdirectories match. +<DT><B>gnu_errfmt</B> + +<DD> +If set, shell error messages are written in the standard GNU error +message format. +<DT><B>histappend</B> + +<DD> +If set, the history list is appended to the file named by the value +of the +<FONT SIZE=-1><B>HISTFILE</B> + +</FONT> +variable when the shell exits, rather than overwriting the file. +<DT><B>histreedit</B> + +<DD> +If set, and +<B>readline</B> + +is being used, a user is given the opportunity to re-edit a +failed history substitution. +<DT><B>histverify</B> + +<DD> +If set, and +<B>readline</B> + +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the <B>readline</B> editing buffer, allowing further modification. +<DT><B>hostcomplete</B> + +<DD> +If set, and +<B>readline</B> + +is being used, <B>bash</B> will attempt to perform hostname completion when a +word containing a <B>@</B> is being completed (see +<B>Completing</B> + +under +<FONT SIZE=-1><B>READLINE</B> + +</FONT> +above). +This is enabled by default. +<DT><B>huponexit</B> + +<DD> +If set, <B>bash</B> will send +<FONT SIZE=-1><B>SIGHUP</B> + +</FONT> +to all jobs when an interactive login shell exits. +<DT><B>interactive_comments</B> + +<DD> +If set, allow a word beginning with +<B>#</B> + +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +<FONT SIZE=-1><B>COMMENTS</B> + +</FONT> +above). This option is enabled by default. +<DT><B>lithist</B> + +<DD> +If set, and the +<B>cmdhist</B> + +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +<DT><B>login_shell</B> + +<DD> +The shell sets this option if it is started as a login shell (see +<FONT SIZE=-1><B>INVOCATION</B> + +</FONT> +above). +The value may not be changed. +<DT><B>mailwarn</B> + +<DD> +If set, and a file that <B>bash</B> is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +<I>mailfile</I> has been read'' is displayed. +<DT><B>no_empty_cmd_completion</B> + +<DD> +If set, and +<B>readline</B> + +is being used, +<B>bash</B> + +will not attempt to search the +<FONT SIZE=-1><B>PATH</B> + +</FONT> +for possible completions when +completion is attempted on an empty line. +<DT><B>nocaseglob</B> + +<DD> +If set, +<B>bash</B> + +matches filenames in a case-insensitive fashion when performing pathname +expansion (see +<B>Pathname Expansion</B> + +above). +<DT><B>nocasematch</B> + +<DD> +If set, +<B>bash</B> + +matches patterns in a case-insensitive fashion when performing matching +while executing <B>case</B> or <B>[[</B> conditional commands. +<DT><B>nullglob</B> + +<DD> +If set, +<B>bash</B> + +allows patterns which match no +files (see +<B>Pathname Expansion</B> + +above) +to expand to a null string, rather than themselves. +<DT><B>progcomp</B> + +<DD> +If set, the programmable completion facilities (see +<B>Programmable Completion</B> above) are enabled. +This option is enabled by default. +<DT><B>promptvars</B> + +<DD> +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +<FONT SIZE=-1><B>PROMPTING</B> + +</FONT> +above. This option is enabled by default. +<DT><B>restricted_shell</B> + +<DD> +The shell sets this option if it is started in restricted mode (see +<FONT SIZE=-1><B>RESTRICTED SHELL</B> + +</FONT> +below). +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. +<DT><B>shift_verbose</B> + +<DD> +If set, the +<B>shift</B> + +builtin prints an error message when the shift count exceeds the +number of positional parameters. +<DT><B>sourcepath</B> + +<DD> +If set, the +<B>source</B> (<B>.</B>) builtin uses the value of +<FONT SIZE=-1><B>PATH</B> + +</FONT> +to find the directory containing the file supplied as an argument. +This option is enabled by default. +<DT><B>xpg_echo</B> + +<DD> +If set, the <B>echo</B> builtin expands backslash-escape sequences +by default. +</DL></DL> + +<DT><B>suspend</B> [<B>-f</B>]<DD> +Suspend the execution of this shell until it receives a +<FONT SIZE=-1><B>SIGCONT</B> + +</FONT> +signal. A login shell cannot be suspended; the +<B>-f</B> + +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +<B>-f</B> + +is not supplied, or if job control is not enabled. +<DT><B>test</B> <I>expr</I><DD> + +<DT><B>[</B> <I>expr</I> <B>]</B><DD> +Return a status of 0 or 1 depending on +the evaluation of the conditional expression +<I>expr</I>. + +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +<FONT SIZE=-1><B>CONDITIONAL EXPRESSIONS</B>. + +</FONT> +<B>test</B> does not accept any options, nor does it accept and ignore +an argument of <B>--</B> as signifying the end of options. +<P> + + +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>! </B><I>expr</I> + +<DD> +True if +<I>expr</I> + +is false. +<DT><B>( </B><I>expr</I> ) + +<DD> +Returns the value of <I>expr</I>. +This may be used to override the normal precedence of operators. +<DT><I>expr1</I> -<B>a</B> <I>expr2</I><DD> +True if both +<I>expr1</I> + +and +<I>expr2</I> + +are true. +<DT><I>expr1</I> -<B>o</B> <I>expr2</I><DD> +True if either +<I>expr1</I> + +or +<I>expr2</I> + +is true. + +</DL> +<P> + +<B>test</B> and <B>[</B> evaluate conditional +expressions using a set of rules based on the number of arguments. +<P> + + + +<DL COMPACT> +<DT>0 arguments<DD> +The expression is false. +<DT>1 argument<DD> +The expression is true if and only if the argument is not null. +<DT>2 arguments<DD> +If the first argument is <B>!</B>, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +<FONT SIZE=-1><B>CONDITIONAL EXPRESSIONS</B>, + +</FONT> +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +<DT>3 arguments<DD> +If the second argument is one of the binary conditional operators listed above +under +<FONT SIZE=-1><B>CONDITIONAL EXPRESSIONS</B>, + +</FONT> +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The <B>-a</B> and <B>-o</B> operators are considered binary operators +when there are three arguments. +If the first argument is <B>!</B>, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly <B>(</B> and the third argument is +exactly <B>)</B>, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +<DT>4 arguments<DD> +If the first argument is <B>!</B>, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +<DT>5 or more arguments<DD> +The expression is parsed and evaluated according to precedence +using the rules listed above. +</DL></DL> + + +<DT><B>times</B> + +<DD> +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +<DT><B>trap</B> [<B>-lp</B>] [[<I>arg</I>] <I>sigspec</I> ...]<DD> +The command +<I>arg</I> + +is to be read and executed when the shell receives +signal(s) +<I>sigspec</I>. + +If +<I>arg</I> + +is absent (and there is a single <I>sigspec</I>) or +<B>-</B>, + +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +<I>arg</I> + +is the null string the signal specified by each +<I>sigspec</I> + +is ignored by the shell and by the commands it invokes. +If +<I>arg</I> + +is not present and +<B>-p</B> + +has been supplied, then the trap commands associated with each +<I>sigspec</I> + +are displayed. +If no arguments are supplied or if only +<B>-p</B> + +is given, +<B>trap</B> + +prints the list of commands associated with each signal. +The +<B>-l</B> + +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +<I>sigspec</I> + +is either +a signal name defined in <<I>signal.h</I>>, or a signal number. +Signal names are case insensitive and the SIG prefix is optional. +<P> + + +If a +<I>sigspec</I> + +is +<FONT SIZE=-1><B>EXIT</B> + +</FONT> +(0) the command +<I>arg</I> + +is executed on exit from the shell. +If a +<I>sigspec</I> + +is +<FONT SIZE=-1><B>DEBUG</B>, + +</FONT> +the command +<I>arg</I> + +is executed before every <I>simple command</I>, <I>for</I> command, +<I>case</I> command, <I>select</I> command, every arithmetic <I>for</I> +command, and before the first command executes in a shell function (see +<FONT SIZE=-1><B>SHELL GRAMMAR</B> + +</FONT> +above). +Refer to the description of the <B>extdebug</B> option to the +<B>shopt</B> builtin for details of its effect on the <B>DEBUG</B> trap. +If a +<I>sigspec</I> + +is +<FONT SIZE=-1><B>RETURN</B>, + +</FONT> +the command +<I>arg</I> + +is executed each time a shell function or a script executed with the +<B>.</B> or <B>source</B> builtins finishes executing. +<P> + + +If a +<I>sigspec</I> + +is +<FONT SIZE=-1><B>ERR</B>, + +</FONT> +the command +<I>arg</I> + +is executed whenever a simple command has a non-zero exit status, +subject to the following conditions. +The +<FONT SIZE=-1><B>ERR</B> + +</FONT> +trap is not executed if the failed +command is part of the command list immediately following a +<B>while</B> + +or +<B>until</B> + +keyword, +part of the test in an +<I>if</I> + +statement, part of a command executed in a +<B>&&</B> + +or +<B>||</B> + +list, or if the command's return value is +being inverted via +<B>!</B>. + +These are the same conditions obeyed by the <B>errexit</B> option. +<P> + + +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +<I>sigspec</I> + +is invalid; otherwise +<B>trap</B> + +returns true. +<DT><B>type</B> [<B>-aftpP</B>] <I>name</I> [<I>name</I> ...]<DD> +With no options, +indicate how each +<I>name</I> + +would be interpreted if used as a command name. +If the +<B>-t</B> + +option is used, +<B>type</B> + +prints a string which is one of +<I>alias</I>, + +<I>keyword</I>, + +<I>function</I>, + +<I>builtin</I>, + +or +<I>file </I> + +if +<I>name</I> + +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +<I>name</I> + +is not found, then nothing is printed, and an exit status of false +is returned. +If the +<B>-p</B> + +option is used, +<B>type</B> + +either returns the name of the disk file +that would be executed if +<I>name</I> + +were specified as a command name, +or nothing if +<TT>type -t name</TT> + +would not return +<I>file</I>. + +The +<B>-P</B> + +option forces a +<FONT SIZE=-1><B>PATH</B> + +</FONT> +search for each <I>name</I>, even if +<TT>type -t name</TT> + +would not return +<I>file</I>. + +If a command is hashed, +<B>-p</B> + +and +<B>-P</B> + +print the hashed value, not necessarily the file that appears +first in +<FONT SIZE=-1><B>PATH</B>. + +</FONT> +If the +<B>-a</B> + +option is used, +<B>type</B> + +prints all of the places that contain +an executable named +<I>name</I>. + +This includes aliases and functions, +if and only if the +<B>-p</B> + +option is not also used. +The table of hashed commands is not consulted +when using +<B>-a</B>. + +The +<B>-f</B> + +option suppresses shell function lookup, as with the <B>command</B> builtin. +<B>type</B> + +returns true if all of the arguments are found, false if +any are not found. +<DT><B>ulimit</B> [<B>-HSTabcdefilmnpqrstuvx</B> [<I>limit</I>]]<DD> +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The <B>-H</B> and <B>-S</B> options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither <B>-H</B> nor <B>-S</B> is specified, both the soft and hard +limits are set. +The value of +<I>limit</I> + +can be a number in the unit specified for the resource +or one of the special values +<B>hard</B>, + +<B>soft</B>, + +or +<B>unlimited</B>, + +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +<I>limit</I> + +is omitted, the current value of the soft limit of the resource is +printed, unless the <B>-H</B> option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +<DL COMPACT><DT><DD> + +<DL COMPACT> +<DT><B>-a</B> + +<DD> +All current limits are reported +<DT><B>-b</B> + +<DD> +The maximum socket buffer size +<DT><B>-c</B> + +<DD> +The maximum size of core files created +<DT><B>-d</B> + +<DD> +The maximum size of a process's data segment +<DT><B>-e</B> + +<DD> +The maximum scheduling priority ("nice") +<DT><B>-f</B> + +<DD> +The maximum size of files written by the shell and its children +<DT><B>-i</B> + +<DD> +The maximum number of pending signals +<DT><B>-l</B> + +<DD> +The maximum size that may be locked into memory +<DT><B>-m</B> + +<DD> +The maximum resident set size (many systems do not honor this limit) +<DT><B>-n</B> + +<DD> +The maximum number of open file descriptors (most systems do not +allow this value to be set) +<DT><B>-p</B> + +<DD> +The pipe size in 512-byte blocks (this may not be set) +<DT><B>-q</B> + +<DD> +The maximum number of bytes in POSIX message queues +<DT><B>-r</B> + +<DD> +The maximum real-time scheduling priority +<DT><B>-s</B> + +<DD> +The maximum stack size +<DT><B>-t</B> + +<DD> +The maximum amount of cpu time in seconds +<DT><B>-u</B> + +<DD> +The maximum number of processes available to a single user +<DT><B>-v</B> + +<DD> +The maximum amount of virtual memory available to the shell +<DT><B>-x</B> + +<DD> +The maximum number of file locks +<DT><B>-T</B> + +<DD> +The maximum number of threads + +</DL> +<P> + +If +<I>limit</I> + +is given, it is the new value of the specified resource (the +<B>-a</B> + +option is display only). +If no option is given, then +<B>-f</B> + +is assumed. Values are in 1024-byte increments, except for +<B>-t</B>, + +which is in seconds, +<B>-p</B>, + +which is in units of 512-byte blocks, +and +<B>-T</B>, + +<B>-b</B>, + +<B>-n</B>, + +and +<B>-u</B>, + +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +</DL> + +<DT><B>umask</B> [<B>-p</B>] [<B>-S</B>] [<I>mode</I>]<DD> +The user file-creation mask is set to +<I>mode</I>. + +If +<I>mode</I> + +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +<I>chmod</I>(1). + +If +<I>mode</I> + +is omitted, the current value of the mask is printed. +The +<B>-S</B> + +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +<B>-p</B> + +option is supplied, and +<I>mode</I> + +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no <I>mode</I> argument was supplied, and false otherwise. +<DT><B>unalias</B> [-<B>a</B>] [<I>name</I> ...]<DD> +Remove each <I>name</I> from the list of defined aliases. If +<B>-a</B> + +is supplied, all alias definitions are removed. The return +value is true unless a supplied +<I>name</I> + +is not a defined alias. +<DT><B>unset</B> [-<B>fv</B>] [<I>name</I> ...]<DD> +For each +<I>name</I>, + +remove the corresponding variable or function. +If no options are supplied, or the +<B>-v</B> + +option is given, each +<I>name</I> + +refers to a shell variable. +Read-only variables may not be unset. +If +<B>-f</B> + +is specified, each +<I>name</I> + +refers to a shell function, and the function definition +is removed. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +<FONT SIZE=-1><B>COMP_WORDBREAKS</B>, + +</FONT> +<FONT SIZE=-1><B>RANDOM</B>, + +</FONT> +<FONT SIZE=-1><B>SECONDS</B>, + +</FONT> +<FONT SIZE=-1><B>LINENO</B>, + +</FONT> +<FONT SIZE=-1><B>HISTCMD</B>, + +</FONT> +<FONT SIZE=-1><B>FUNCNAME</B>, + +</FONT> +<FONT SIZE=-1><B>GROUPS</B>, + +</FONT> +or +<FONT SIZE=-1><B>DIRSTACK</B> + +</FONT> +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +<I>name</I> + +is readonly. +<DT><B>wait</B> [<I>n ...</I>]<DD> +Wait for each specified process and return its termination status. +Each +<I>n</I> + +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +<I>n</I> + +is not given, all currently active child processes +are waited for, and the return status is zero. If +<I>n</I> + +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. + + +</DL> +<A NAME="lbDC"> </A> +<H3>RESTRICTED SHELL</H3> + + + +<P> + +If +<B>bash</B> + +is started with the name +<B>rbash</B>, + +or the +<B>-r</B> + +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +<B>bash</B> + +with the exception that the following are disallowed or not performed: +<DL COMPACT> +<DT>*<DD> +changing directories with <B>cd</B> +<DT>*<DD> +setting or unsetting the values of +<FONT SIZE=-1><B>SHELL</B>, + +</FONT> +<FONT SIZE=-1><B>PATH</B>, + +</FONT> +<FONT SIZE=-1><B>ENV</B>, + +</FONT> +or +<FONT SIZE=-1><B>BASH_ENV</B> + +</FONT> +<DT>*<DD> +specifying command names containing +<B>/</B> + +<DT>*<DD> +specifying a file name containing a +<B>/</B> + +as an argument to the +<B>.</B> + +builtin command +<DT>*<DD> +Specifying a filename containing a slash as an argument to the +<B>-p</B> + +option to the +<B>hash</B> + +builtin command +<DT>*<DD> +importing function definitions from the shell environment at startup +<DT>*<DD> +parsing the value of +<FONT SIZE=-1><B>SHELLOPTS</B> + +</FONT> +from the shell environment at startup +<DT>*<DD> +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +<DT>*<DD> +using the +<B>exec</B> + +builtin command to replace the shell with another command +<DT>*<DD> +adding or deleting builtin commands with the +<B>-f</B> + +and +<B>-d</B> + +options to the +<B>enable</B> + +builtin command +<DT>*<DD> +Using the <B>enable</B> builtin command to enable disabled shell builtins +<DT>*<DD> +specifying the +<B>-p</B> + +option to the +<B>command</B> + +builtin command +<DT>*<DD> +turning off restricted mode with +<B>set +r</B> or <B>set +o restricted</B>. +</DL> +<P> + +These restrictions are enforced after any startup files are read. +<P> + + + When a command that is found to be a shell script is executed +(see +<FONT SIZE=-1><B>COMMAND EXECUTION</B> + +</FONT> + +above), + +<B>rbash</B> + +turns off any restrictions in the shell spawned to execute the +script. + + +<A NAME="lbDD"> </A> +<H3>SEE ALSO</H3> + + +<DL COMPACT> +<DT><I>Bash Reference Manual</I>, Brian Fox and Chet Ramey<DD> +<DT><I>The Gnu Readline Library</I>, Brian Fox and Chet Ramey<DD> +<DT><I>The Gnu History Library</I>, Brian Fox and Chet Ramey<DD> +<DT><I>Portable Operating System Interface (POSIX) Part 2: Shell and Utilities</I>, IEEE<DD> +<DT><I>sh</I>(1), <I>ksh</I>(1), <I>csh</I>(1)<DD> +<DT><I>emacs</I>(1), <I>vi</I>(1)<DD> +<DT><I>readline</I>(3)<DD> + +</DL> +<A NAME="lbDE"> </A> +<H3>FILES</H3> + + +<DL COMPACT> +<DT> +<A HREF="file:/bin/bash"><I>/bin/bash</I></A> + +<DD> +The <B>bash</B> executable +<DT> +<A HREF="file:/etc/profile"><I>/etc/profile</I></A> + +<DD> +The systemwide initialization file, executed for login shells +<DT> +<A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A> + +<DD> +The personal initialization file, executed for login shells +<DT> +<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A> + +<DD> +The individual per-interactive-shell startup file +<DT> +<A HREF="file:~/.bash_logout"><I>~/.bash_logout</I></A> + +<DD> +The individual login shell cleanup file, executed when a login shell exits +<DT> +<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A> + +<DD> +Individual <I>readline</I> initialization file + +</DL> +<A NAME="lbDF"> </A> +<H3>AUTHORS</H3> + +Brian Fox, Free Software Foundation +<BR> + +<A HREF="mailto:bfox@gnu.org">bfox@gnu.org</A> +<P> + +Chet Ramey, Case Western Reserve University +<BR> + +<A HREF="mailto:chet.ramey@case.edu">chet.ramey@case.edu</A> +<A NAME="lbDG"> </A> +<H3>BUG REPORTS</H3> + +If you find a bug in +<B>bash,</B> + +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +<B>bash</B>. + +The latest version is always available from +<I><A HREF="ftp://ftp.gnu.org/pub/bash/">ftp://ftp.gnu.org/pub/bash/</A></I>. +<P> + +Once you have determined that a bug actually exists, use the +<I>bashbug</I> + +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to <I><A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A></I> or posted to the Usenet +newsgroup +<A HREF="news:gnu.bash.bug">gnu.bash.bug</A>. + +<P> + +ALL bug reports should include: +<P> + + +<DL COMPACT> +<DT>The version number of <B>bash</B><DD> +<DT>The hardware and operating system<DD> +<DT>The compiler used to compile<DD> +<DT>A description of the bug behaviour<DD> +<DT>A short script or `recipe' which exercises the bug<DD> + +</DL> +<P> + +<I>bashbug</I> + +inserts the first three items automatically into the template +it provides for filing a bug report. +<P> + +Comments and bug reports concerning +this manual page should be directed to +<I><A HREF="mailto:chet@po.cwru.edu">chet@po.cwru.edu</A></I>. + +<A NAME="lbDH"> </A> +<H3>BUGS</H3> + +<P> + +It's too big and too slow. +<P> + +There are some subtle differences between +<B>bash</B> + +and traditional versions of +<B>sh</B>, + +mostly because of the +<FONT SIZE=-1><B>POSIX</B> + +</FONT> +specification. +<P> + +Aliases are confusing in some uses. +<P> + +Shell builtin commands and functions are not stoppable/restartable. +<P> + +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +<P> + +Array variables may not (yet) be exported. +<P> + +There may be only one active coprocess at a time. + + + +<HR> +<TABLE WIDTH=100%> +<TR> +<TH ALIGN=LEFT width=33%>GNU Bash-4.1<TH ALIGN=CENTER width=33%>2009 December 29<TH ALIGN=RIGHT width=33%>BASH(1) +</TR> +</TABLE> +<HR> +<A NAME="index"> </A><H2>Index</H2> +<DL> +<DT><A HREF="#lbAB">NAME</A><DD> +<DT><A HREF="#lbAC">SYNOPSIS</A><DD> +<DT><A HREF="#lbAD">COPYRIGHT</A><DD> +<DT><A HREF="#lbAE">DESCRIPTION</A><DD> +<DT><A HREF="#lbAF">OPTIONS</A><DD> +<DT><A HREF="#lbAG">ARGUMENTS</A><DD> +<DT><A HREF="#lbAH">INVOCATION</A><DD> +<DT><A HREF="#lbAI">DEFINITIONS</A><DD> +<DT><A HREF="#lbAJ">RESERVED WORDS</A><DD> +<DT><A HREF="#lbAK">SHELL GRAMMAR</A><DD> +<DL> +<DT><A HREF="#lbAL">Simple Commands</A><DD> +<DT><A HREF="#lbAM">Pipelines</A><DD> +<DT><A HREF="#lbAN">Lists</A><DD> +<DT><A HREF="#lbAO">Compound Commands</A><DD> +<DT><A HREF="#lbAP">Coprocesses</A><DD> +<DT><A HREF="#lbAQ">Shell Function Definitions</A><DD> +</DL> +<DT><A HREF="#lbAR">COMMENTS</A><DD> +<DT><A HREF="#lbAS">QUOTING</A><DD> +<DT><A HREF="#lbAT">PARAMETERS</A><DD> +<DL> +<DT><A HREF="#lbAU">Positional Parameters</A><DD> +<DT><A HREF="#lbAV">Special Parameters</A><DD> +<DT><A HREF="#lbAW">Shell Variables</A><DD> +<DT><A HREF="#lbAX">Arrays</A><DD> +</DL> +<DT><A HREF="#lbAY">EXPANSION</A><DD> +<DL> +<DT><A HREF="#lbAZ">Brace Expansion</A><DD> +<DT><A HREF="#lbBA">Tilde Expansion</A><DD> +<DT><A HREF="#lbBB">Parameter Expansion</A><DD> +<DT><A HREF="#lbBC">Command Substitution</A><DD> +<DT><A HREF="#lbBD">Arithmetic Expansion</A><DD> +<DT><A HREF="#lbBE">Process Substitution</A><DD> +<DT><A HREF="#lbBF">Word Splitting</A><DD> +<DT><A HREF="#lbBG">Pathname Expansion</A><DD> +<DT><A HREF="#lbBH">Quote Removal</A><DD> +</DL> +<DT><A HREF="#lbBI">REDIRECTION</A><DD> +<DL> +<DT><A HREF="#lbBJ">Redirecting Input</A><DD> +<DT><A HREF="#lbBK">Redirecting Output</A><DD> +<DT><A HREF="#lbBL">Appending Redirected Output</A><DD> +<DT><A HREF="#lbBM">Redirecting Standard Output and Standard Error</A><DD> +<DT><A HREF="#lbBN">Appending Standard Output and Standard Error</A><DD> +<DT><A HREF="#lbBO">Here Documents</A><DD> +<DT><A HREF="#lbBP">Here Strings</A><DD> +<DT><A HREF="#lbBQ">Duplicating File Descriptors</A><DD> +<DT><A HREF="#lbBR">Moving File Descriptors</A><DD> +<DT><A HREF="#lbBS">Opening File Descriptors for Reading and Writing</A><DD> +</DL> +<DT><A HREF="#lbBT">ALIASES</A><DD> +<DT><A HREF="#lbBU">FUNCTIONS</A><DD> +<DT><A HREF="#lbBV">ARITHMETIC EVALUATION</A><DD> +<DT><A HREF="#lbBW">CONDITIONAL EXPRESSIONS</A><DD> +<DT><A HREF="#lbBX">SIMPLE COMMAND EXPANSION</A><DD> +<DT><A HREF="#lbBY">COMMAND EXECUTION</A><DD> +<DT><A HREF="#lbBZ">COMMAND EXECUTION ENVIRONMENT</A><DD> +<DT><A HREF="#lbCA">ENVIRONMENT</A><DD> +<DT><A HREF="#lbCB">EXIT STATUS</A><DD> +<DT><A HREF="#lbCC">SIGNALS</A><DD> +<DT><A HREF="#lbCD">JOB CONTROL</A><DD> +<DT><A HREF="#lbCE">PROMPTING</A><DD> +<DT><A HREF="#lbCF">READLINE</A><DD> +<DL> +<DT><A HREF="#lbCG">Readline Notation</A><DD> +<DT><A HREF="#lbCH">Readline Initialization</A><DD> +<DT><A HREF="#lbCI">Readline Key Bindings</A><DD> +<DT><A HREF="#lbCJ">Readline Variables</A><DD> +<DT><A HREF="#lbCK">Readline Conditional Constructs</A><DD> +<DT><A HREF="#lbCL">Searching</A><DD> +<DT><A HREF="#lbCM">Readline Command Names</A><DD> +<DT><A HREF="#lbCN">Commands for Moving</A><DD> +<DT><A HREF="#lbCO">Commands for Manipulating the History</A><DD> +<DT><A HREF="#lbCP">Commands for Changing Text</A><DD> +<DT><A HREF="#lbCQ">Killing and Yanking</A><DD> +<DT><A HREF="#lbCR">Numeric Arguments</A><DD> +<DT><A HREF="#lbCS">Completing</A><DD> +<DT><A HREF="#lbCT">Keyboard Macros</A><DD> +<DT><A HREF="#lbCU">Miscellaneous</A><DD> +<DT><A HREF="#lbCV">Programmable Completion</A><DD> +</DL> +<DT><A HREF="#lbCW">HISTORY</A><DD> +<DT><A HREF="#lbCX">HISTORY EXPANSION</A><DD> +<DL> +<DT><A HREF="#lbCY">Event Designators</A><DD> +<DT><A HREF="#lbCZ">Word Designators</A><DD> +<DT><A HREF="#lbDA">Modifiers</A><DD> +</DL> +<DT><A HREF="#lbDB">SHELL BUILTIN COMMANDS</A><DD> +<DT><A HREF="#lbDC">RESTRICTED SHELL</A><DD> +<DT><A HREF="#lbDD">SEE ALSO</A><DD> +<DT><A HREF="#lbDE">FILES</A><DD> +<DT><A HREF="#lbDF">AUTHORS</A><DD> +<DT><A HREF="#lbDG">BUG REPORTS</A><DD> +<DT><A HREF="#lbDH">BUGS</A><DD> +</DL> +<HR> +This document was created by man2html from bash.1.<BR> +Time: 30 December 2009 13:07:38 EST +</BODY> +</HTML> diff --git a/doc/bash.pdf b/doc/bash.pdf Binary files differnew file mode 100644 index 0000000..cb36c5e --- /dev/null +++ b/doc/bash.pdf diff --git a/doc/bash.ps b/doc/bash.ps new file mode 100644 index 0000000..8b4d573 --- /dev/null +++ b/doc/bash.ps @@ -0,0 +1,8202 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Wed Dec 30 13:07:37 2009 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%+ font Courier +%%+ font Symbol +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 70 +%%PageOrder: Ascend +%%DocumentMedia: Default 595 842 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +%%IncludeResource: font Courier +%%IncludeResource: font Symbol +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron +/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O +/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y +/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Courier@0 ENC0/Courier RE/Times-Italic@0 ENC0/Times-Italic RE +/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0 +(bash \255 GNU Bourne-Ag)108 96 Q(ain SHell)-.05 E F1(SYNOPSIS)72 112.8 +Q/F2 10/Times-Bold@0 SF(bash)108 124.8 Q F0([options] [\214le])2.5 E F1 +(COPYRIGHT)72 141.6 Q F0(Bash is Cop)108 153.6 Q +(yright \251 1989-2009 by the Free Softw)-.1 E(are F)-.1 E +(oundation, Inc.)-.15 E F1(DESCRIPTION)72 170.4 Q F2(Bash)108 182.4 Q F0 +.973(is an)3.474 F F2(sh)3.473 E F0 .973 +(-compatible command language interpreter that e)B -.15(xe)-.15 G .973 +(cutes commands read from the standard).15 F(input or from a \214le.)108 +194.4 Q F2(Bash)5 E F0(also incorporates useful features from the)2.5 E +/F3 10/Times-Italic@0 SF -.4(Ko)2.5 G(rn).4 E F0(and)2.5 E F3(C)2.5 E F0 +(shells \()2.5 E F2(ksh)A F0(and)2.5 E F2(csh)2.5 E F0(\).)A F2(Bash)108 +211.2 Q F0 .527(is intended to be a conformant implementation of the Sh\ +ell and Utilities portion of the IEEE POSIX)3.027 F +(speci\214cation \(IEEE Standard 1003.1\).)108 223.2 Q F2(Bash)5 E F0 +(can be con\214gured to be POSIX-conformant by def)2.5 E(ault.)-.1 E F1 +(OPTIONS)72 240 Q F0 .52(In addition to the single-character shell opti\ +ons documented in the description of the)108 252 R F2(set)3.02 E F0 -.2 +(bu)3.02 G .52(iltin command,).2 F F2(bash)108 264 Q F0 +(interprets the follo)2.5 E(wing options when it is in)-.25 E -.2(vo)-.4 +G -.1(ke).2 G(d:).1 E F2<ad63>108 280.8 Q F3(string)4.166 E F0 .796 +(If the)12.354 F F2<ad63>3.296 E F0 .796 +(option is present, then commands are read from)3.296 F F3(string)3.296 +E F0 5.796(.I).22 G 3.297(ft)-5.796 G .797(here are ar)-3.297 F .797 +(guments after)-.18 F(the)158 292.8 Q F3(string)2.5 E F0 2.5(,t).22 G +(he)-2.5 E 2.5(ya)-.15 G +(re assigned to the positional parameters, starting with)-2.5 E F2($0) +2.5 E F0(.)A F2<ad69>108 304.8 Q F0(If the)41.52 E F2<ad69>2.5 E F0 +(option is present, the shell is)2.5 E F3(inter)2.5 E(active)-.15 E F0 +(.).18 E F2<ad6c>108 316.8 Q F0(Mak)41.52 E(e)-.1 E F2(bash)2.5 E F0 +(act as if it had been in)2.5 E -.2(vo)-.4 G -.1(ke).2 G 2.5(da).1 G 2.5 +(sal)-2.5 G(ogin shell \(see)-2.5 E/F4 9/Times-Bold@0 SF(INV)2.5 E(OCA) +-.405 E(TION)-.855 E F0(belo)2.25 E(w\).)-.25 E F2<ad72>108 328.8 Q F0 +(If the)39.86 E F2<ad72>2.5 E F0(option is present, the shell becomes) +2.5 E F3 -.37(re)2.5 G(stricted).37 E F0(\(see)3.27 E F4 +(RESTRICTED SHELL)2.5 E F0(belo)2.25 E(w\).)-.25 E F2<ad73>108 340.8 Q +F0 .602(If the)40.41 F F2<ad73>3.102 E F0 .602 +(option is present, or if no ar)3.102 F .602 +(guments remain after option processing, then commands)-.18 F .616 +(are read from the standard input.)158 352.8 R .617(This option allo) +5.617 F .617(ws the positional parameters to be set when)-.25 F(in)158 +364.8 Q -.2(vo)-.4 G(king an interacti).2 E .3 -.15(ve s)-.25 H(hell.) +.15 E F2<ad44>108 376.8 Q F0 3.184(Al)37.08 G .684 +(ist of all double-quoted strings preceded by)-3.184 F F2($)3.184 E F0 +.684(is printed on the standard output.)3.184 F .683(These are)5.683 F +.458(the strings that are subject to language translation when the curr\ +ent locale is not)158 388.8 R F2(C)2.958 E F0(or)2.959 E F2(POSIX)2.959 +E F0(.)A(This implies the)158 400.8 Q F2<ad6e>2.5 E F0 +(option; no commands will be e)2.5 E -.15(xe)-.15 G(cuted.).15 E F2 +([\255+]O [)108 412.8 Q F3(shopt_option)A F2(])A F3(shopt_option)158 +424.8 Q F0 1.097(is one of the shell options accepted by the)3.597 F F2 +(shopt)3.597 E F0 -.2(bu)3.597 G 1.097(iltin \(see).2 F F4 1.096 +(SHELL B)3.596 F(UIL)-.09 E(TIN)-.828 E(COMMANDS)158 436.8 Q F0(belo) +3.002 E 3.252(w\). If)-.25 F F3(shopt_option)3.253 E F0 .753 +(is present,)3.253 F F2<ad4f>3.253 E F0 .753(sets the v)3.253 F .753 +(alue of that option;)-.25 F F2(+O)3.253 E F0(unsets)3.253 E 2.625 +(it. If)158 448.8 R F3(shopt_option)2.625 E F0 .125 +(is not supplied, the names and v)2.625 F .124 +(alues of the shell options accepted by)-.25 F F2(shopt)2.624 E F0 .505 +(are printed on the standard output.)158 460.8 R .505(If the in)5.505 F +-.2(vo)-.4 G .505(cation option is).2 F F2(+O)3.005 E F0 3.005(,t)C .506 +(he output is displayed in a)-3.005 F +(format that may be reused as input.)158 472.8 Q F2<adad>108 484.8 Q F0 +(A)38.6 E F2<adad>3.364 E F0 .864 +(signals the end of options and disables further option processing.) +3.364 F(An)5.863 E 3.363(ya)-.15 G -.18(rg)-3.363 G .863(uments after) +.18 F(the)158 496.8 Q F2<adad>2.5 E F0 +(are treated as \214lenames and ar)2.5 E 2.5(guments. An)-.18 F(ar)2.5 E +(gument of)-.18 E F2<ad>2.5 E F0(is equi)2.5 E -.25(va)-.25 G(lent to) +.25 E F2<adad>2.5 E F0(.)A F2(Bash)108 513.6 Q F0 .303 +(also interprets a number of multi-character options.)2.803 F .304 +(These options must appear on the command line)5.303 F +(before the single-character options to be recognized.)108 525.6 Q F2 +<adad646562>108 542.4 Q(ugger)-.2 E F0 .475(Arrange for the deb)144 +554.4 R .475(ugger pro\214le to be e)-.2 F -.15(xe)-.15 G .475 +(cuted before the shell starts.).15 F -.45(Tu)5.474 G .474(rns on e).45 +F .474(xtended deb)-.15 F(ug-)-.2 E .452 +(ging mode \(see the description of the)144 566.4 R F2(extdeb)2.952 E +(ug)-.2 E F0 .452(option to the)2.952 F F2(shopt)2.952 E F0 -.2(bu)2.952 +G .452(iltin belo).2 F .452(w\) and shell func-)-.25 F +(tion tracing \(see the description of the)144 578.4 Q F2 +(\255o functrace)2.5 E F0(option to the)2.5 E F2(set)2.5 E F0 -.2(bu)2.5 +G(iltin belo).2 E(w\).)-.25 E F2(\255\255dump\255po\255strings)108 590.4 +Q F0(Equi)144 602.4 Q -.25(va)-.25 G(lent to).25 E F2<ad44>2.5 E F0 2.5 +(,b)C(ut the output is in the GNU)-2.7 E F3 -.1(ge)2.5 G(tte).1 E(xt)-.2 +E F2(po)2.5 E F0(\(portable object\) \214le format.)2.5 E F2 +(\255\255dump\255strings)108 614.4 Q F0(Equi)144 626.4 Q -.25(va)-.25 G +(lent to).25 E F2<ad44>2.5 E F0(.)A F2(\255\255help)108 638.4 Q F0 +(Display a usage message on standard output and e)6.26 E +(xit successfully)-.15 E(.)-.65 E F2<adad696e6974ad8c6c65>108 650.4 Q F3 +(\214le)2.5 E F2<adad72>108 662.4 Q(c\214le)-.18 E F3(\214le)2.5 E F0 +(Ex)144 674.4 Q 1.599(ecute commands from)-.15 F F3(\214le)6.009 E F0 +1.598(instead of the standard personal initialization \214le)4.279 F F3 +(~/.bashr)3.598 E(c)-.37 E F0 1.598(if the)4.408 F(shell is interacti) +144 686.4 Q .3 -.15(ve \()-.25 H(see).15 E F4(INV)2.5 E(OCA)-.405 E +(TION)-.855 E F0(belo)2.25 E(w\).)-.25 E F2(\255\255login)108 703.2 Q F0 +(Equi)144 715.2 Q -.25(va)-.25 G(lent to).25 E F2<ad6c>2.5 E F0(.)A +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(1)190.955 E 0 Cg EP +%%Page: 2 2 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(\255\255noediting)108 84 Q F0 +(Do not use the GNU)144 96 Q F1 -.18(re)2.5 G(adline).18 E F0 +(library to read command lines when the shell is interacti)2.5 E -.15 +(ve)-.25 G(.).15 E F1(\255\255nopr)108 112.8 Q(o\214le)-.18 E F0 .017 +(Do not read either the system-wide startup \214le)144 124.8 R/F2 10 +/Times-Italic@0 SF(/etc/pr)4.183 E(o\214le)-.45 E F0 .017(or an)4.183 F +2.517(yo)-.15 G 2.517(ft)-2.517 G .018 +(he personal initialization \214les)-2.517 F F2(~/.bash_pr)144 136.8 Q +(o\214le)-.45 E F0(,).18 E F2(~/.bash_lo)2.698 E(gin)-.1 E F0 2.698(,o) +.24 G(r)-2.698 E F2(~/.pr)2.698 E(o\214le)-.45 E F0 5.198(.B).18 G 2.698 +(yd)-5.198 G(ef)-2.698 E(ault,)-.1 E F1(bash)2.698 E F0 .198 +(reads these \214les when it is in)2.698 F -.2(vo)-.4 G -.1(ke).2 G +2.697(da).1 G(s)-2.697 E 2.5(al)144 148.8 S(ogin shell \(see)-2.5 E/F3 9 +/Times-Bold@0 SF(INV)2.5 E(OCA)-.405 E(TION)-.855 E F0(belo)2.25 E(w\).) +-.25 E F1<adad6e6f72>108 165.6 Q(c)-.18 E F0 1.228(Do not read and e) +5.34 F -.15(xe)-.15 G 1.228(cute the personal initialization \214le).15 +F F2(~/.bashr)3.228 E(c)-.37 E F0 1.228(if the shell is interacti)4.038 +F -.15(ve)-.25 G 6.228(.T).15 G(his)-6.228 E(option is on by def)144 +177.6 Q(ault if the shell is in)-.1 E -.2(vo)-.4 G -.1(ke).2 G 2.5(da).1 +G(s)-2.5 E F1(sh)2.5 E F0(.)A F1(\255\255posix)108 194.4 Q F0 1.783 +(Change the beha)144 206.4 R 1.782(vior of)-.2 F F1(bash)4.282 E F0 +1.782(where the def)4.282 F 1.782(ault operation dif)-.1 F 1.782 +(fers from the POSIX standard to)-.25 F(match the standard \()144 218.4 +Q F2(posix mode)A F0(\).)A F1<adad72>108 235.2 Q(estricted)-.18 E F0 +(The shell becomes restricted \(see)144 247.2 Q F3(RESTRICTED SHELL)2.5 +E F0(belo)2.25 E(w\).)-.25 E F1<adad76>108 264 Q(erbose)-.1 E F0(Equi) +144 276 Q -.25(va)-.25 G(lent to).25 E F1<ad76>5 E F0(.)A F1<adad76>108 +292.8 Q(ersion)-.1 E F0(Sho)144 304.8 Q 2.5(wv)-.25 G +(ersion information for this instance of)-2.65 E F1(bash)2.5 E F0 +(on the standard output and e)2.5 E(xit successfully)-.15 E(.)-.65 E/F4 +10.95/Times-Bold@0 SF(ARGUMENTS)72 321.6 Q F0 .016(If ar)108 333.6 R +.016(guments remain after option processing, and neither the)-.18 F F1 +<ad63>2.516 E F0 .016(nor the)2.516 F F1<ad73>2.516 E F0 .016 +(option has been supplied, the \214rst)2.516 F(ar)108 345.6 Q .041(gume\ +nt is assumed to be the name of a \214le containing shell commands.)-.18 +F(If)5.041 E F1(bash)2.541 E F0 .041(is in)2.541 F -.2(vo)-.4 G -.1(ke) +.2 G 2.541(di).1 G 2.541(nt)-2.541 G .041(his f)-2.541 F(ashion,)-.1 E +F1($0)108 357.6 Q F0 .936(is set to the name of the \214le, and the pos\ +itional parameters are set to the remaining ar)3.435 F(guments.)-.18 E +F1(Bash)5.936 E F0 .234(reads and e)108 369.6 R -.15(xe)-.15 G .234 +(cutes commands from this \214le, then e).15 F(xits.)-.15 E F1(Bash) +5.234 E F0 1.334 -.55('s e)D .234(xit status is the e).4 F .233 +(xit status of the last com-)-.15 F .348(mand e)108 381.6 R -.15(xe)-.15 +G .348(cuted in the script.).15 F .348(If no commands are e)5.348 F -.15 +(xe)-.15 G .348(cuted, the e).15 F .349(xit status is 0.)-.15 F .349 +(An attempt is \214rst made to)5.349 F .254 +(open the \214le in the current directory)108 393.6 R 2.754(,a)-.65 G +.253 +(nd, if no \214le is found, then the shell searches the directories in) +-2.754 F F3 -.666(PA)2.753 G(TH)-.189 E F0(for the script.)108 405.6 Q +F4(INV)72 422.4 Q(OCA)-.493 E(TION)-1.04 E F0(A)108 434.4 Q F2(lo)2.5 E +(gin shell)-.1 E F0(is one whose \214rst character of ar)2.5 E +(gument zero is a)-.18 E F1<ad>2.5 E F0 2.5(,o)C 2.5(ro)-2.5 G +(ne started with the)-2.5 E F1(\255\255login)2.5 E F0(option.)2.5 E(An) +108 451.2 Q F2(inter)2.814 E(active)-.15 E F0 .314 +(shell is one started without non-option ar)2.814 F .315 +(guments and without the)-.18 F F1<ad63>2.815 E F0 .315 +(option whose standard)2.815 F 1.5 +(input and error are both connected to terminals \(as determined by)108 +463.2 R F2(isatty)4 E F0 1.5(\(3\)\), or one started with the).32 F F1 +<ad69>4 E F0(option.)108 475.2 Q F3(PS1)5.289 E F0 .289(is set and)2.539 +F F1<24ad>2.789 E F0(includes)2.789 E F1(i)2.789 E F0(if)2.789 E F1 +(bash)2.789 E F0 .289(is interacti)2.789 F -.15(ve)-.25 G 2.789(,a).15 G +(llo)-2.789 E .29(wing a shell script or a startup \214le to test this) +-.25 F(state.)108 487.2 Q .033(The follo)108 504 R .033 +(wing paragraphs describe ho)-.25 F(w)-.25 E F1(bash)2.532 E F0 -.15 +(exe)2.532 G .032(cutes its startup \214les.).15 F .032(If an)5.032 F +2.532(yo)-.15 G 2.532(ft)-2.532 G .032(he \214les e)-2.532 F .032 +(xist b)-.15 F .032(ut cannot be)-.2 F(read,)108 516 Q F1(bash)3.085 E +F0 .585(reports an error)3.085 F 5.585(.T)-.55 G .585(ildes are e)-5.935 +F .586(xpanded in \214le names as described belo)-.15 F 3.086(wu)-.25 G +(nder)-3.086 E F1 -.18(Ti)3.086 G .586(lde Expansion).18 F F0(in the)108 +528 Q F3(EXP)2.5 E(ANSION)-.666 E F0(section.)2.25 E(When)108 544.8 Q F1 +(bash)2.896 E F0 .396(is in)2.896 F -.2(vo)-.4 G -.1(ke).2 G 2.896(da).1 +G 2.896(sa)-2.896 G 2.896(ni)-2.896 G(nteracti)-2.896 E .696 -.15(ve l) +-.25 H .396(ogin shell, or as a non-interacti).15 F .695 -.15(ve s)-.25 +H .395(hell with the).15 F F1(\255\255login)2.895 E F0 .395(option, it) +2.895 F 1.333(\214rst reads and e)108 556.8 R -.15(xe)-.15 G 1.333 +(cutes commands from the \214le).15 F F2(/etc/pr)3.833 E(o\214le)-.45 E +F0 3.834(,i)C 3.834(ft)-3.834 G 1.334(hat \214le e)-3.834 F 3.834 +(xists. After)-.15 F 1.334(reading that \214le, it)3.834 F .249 +(looks for)108 568.8 R F2(~/.bash_pr)2.749 E(o\214le)-.45 E F0(,)A F2 +(~/.bash_lo)2.749 E(gin)-.1 E F0 2.749(,a)C(nd)-2.749 E F2(~/.pr)2.749 E +(o\214le)-.45 E F0 2.749(,i)C 2.749(nt)-2.749 G .249(hat order)-2.749 F +2.748(,a)-.4 G .248(nd reads and e)-2.748 F -.15(xe)-.15 G .248 +(cutes commands from).15 F .796(the \214rst one that e)108 580.8 R .796 +(xists and is readable.)-.15 F(The)5.796 E F1(\255\255nopr)3.296 E +(o\214le)-.18 E F0 .797(option may be used when the shell is started to) +3.296 F(inhibit this beha)108 592.8 Q(vior)-.2 E(.)-.55 E +(When a login shell e)108 609.6 Q(xits,)-.15 E F1(bash)2.5 E F0 +(reads and e)2.5 E -.15(xe)-.15 G(cutes commands from the \214le).15 E +F2(~/.bash_lo)2.5 E(gout)-.1 E F0 2.5(,i)C 2.5(fi)-2.5 G 2.5(te)-2.5 G +(xists.)-2.65 E 1.698(When an interacti)108 626.4 R 1.998 -.15(ve s)-.25 +H 1.698(hell that is not a login shell is started,).15 F F1(bash)4.197 E +F0 1.697(reads and e)4.197 F -.15(xe)-.15 G 1.697(cutes commands from) +.15 F F2(~/.bashr)108 638.4 Q(c)-.37 E F0 2.535(,i)C 2.535(ft)-2.535 G +.035(hat \214le e)-2.535 F 2.535(xists. This)-.15 F .036 +(may be inhibited by using the)2.535 F F1<adad6e6f72>2.536 E(c)-.18 E F0 +2.536(option. The)2.536 F F1<adad72>2.536 E(c\214le)-.18 E F2(\214le) +2.536 E F0 .036(option will)2.536 F(force)108 650.4 Q F1(bash)2.5 E F0 +(to read and e)2.5 E -.15(xe)-.15 G(cute commands from).15 E F2(\214le) +2.5 E F0(instead of)2.5 E F2(~/.bashr)2.5 E(c)-.37 E F0(.)A(When)108 +667.2 Q F1(bash)5.306 E F0 2.806(is started non-interacti)5.306 F -.15 +(ve)-.25 G(ly).15 E 5.306(,t)-.65 G 5.306(or)-5.306 G 2.806 +(un a shell script, for e)-5.306 F 2.805(xample, it looks for the v)-.15 +F(ariable)-.25 E F3 -.27(BA)108 679.2 S(SH_ENV).27 E F0 1.01(in the en) +3.26 F 1.01(vironment, e)-.4 F 1.01(xpands its v)-.15 F 1.01 +(alue if it appears there, and uses the e)-.25 F 1.011(xpanded v)-.15 F +1.011(alue as the)-.25 F(name of a \214le to read and e)108 691.2 Q -.15 +(xe)-.15 G(cute.).15 E F1(Bash)5 E F0(beha)2.5 E -.15(ve)-.2 G 2.5(sa) +.15 G 2.5(si)-2.5 G 2.5(ft)-2.5 G(he follo)-2.5 E(wing command were e) +-.25 E -.15(xe)-.15 G(cuted:).15 E/F5 10/Courier@0 SF +(if [ \255n "$BASH_ENV" ]; then . "$BASH_ENV"; fi)144 709.2 Q F0 -.2(bu) +108 727.2 S 2.5(tt).2 G(he v)-2.5 E(alue of the)-.25 E F3 -.666(PA)2.5 G +(TH)-.189 E F0 -.25(va)2.25 G +(riable is not used to search for the \214le name.).25 E(GNU Bash-4.1)72 +768 Q(2009 December 29)135.965 E(2)190.955 E 0 Cg EP +%%Page: 3 3 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(If)108 84 Q/F1 10/Times-Bold@0 SF(bash)3.417 E F0 .917(is in) +3.417 F -.2(vo)-.4 G -.1(ke).2 G 3.417(dw).1 G .917(ith the name)-3.417 +F F1(sh)3.417 E F0 3.417(,i)C 3.417(tt)-3.417 G .917 +(ries to mimic the startup beha)-3.417 F .917(vior of historical v)-.2 F +.917(ersions of)-.15 F F1(sh)3.417 E F0(as)3.417 E .145 +(closely as possible, while conforming to the POSIX standard as well.) +108 96 R .145(When in)5.145 F -.2(vo)-.4 G -.1(ke).2 G 2.645(da).1 G +2.645(sa)-2.645 G 2.645(ni)-2.645 G(nteracti)-2.645 E .445 -.15(ve l) +-.25 H(ogin).15 E 1.264(shell, or a non-interacti)108 108 R 1.564 -.15 +(ve s)-.25 H 1.264(hell with the).15 F F1(\255\255login)3.764 E F0 1.264 +(option, it \214rst attempts to read and e)3.764 F -.15(xe)-.15 G 1.263 +(cute commands).15 F(from)108 120 Q/F2 10/Times-Italic@0 SF(/etc/pr) +4.142 E(o\214le)-.45 E F0(and)3.172 E F2(~/.pr)2.992 E(o\214le)-.45 E F0 +2.992(,i).18 G 2.992(nt)-2.992 G .492(hat order)-2.992 F 5.492(.T)-.55 G +(he)-5.492 E F1(\255\255nopr)2.992 E(o\214le)-.18 E F0 .493 +(option may be used to inhibit this beha)2.993 F(vior)-.2 E(.)-.55 E +.418(When in)108 132 R -.2(vo)-.4 G -.1(ke).2 G 2.918(da).1 G 2.918(sa) +-2.918 G 2.918(ni)-2.918 G(nteracti)-2.918 E .718 -.15(ve s)-.25 H .418 +(hell with the name).15 F F1(sh)2.918 E F0(,)A F1(bash)2.918 E F0 .418 +(looks for the v)2.918 F(ariable)-.25 E/F3 9/Times-Bold@0 SF(ENV)2.918 E +/F4 9/Times-Roman@0 SF(,)A F0 -.15(ex)2.667 G .417(pands its v).15 F +(alue)-.25 E .171(if it is de\214ned, and uses the e)108 144 R .171 +(xpanded v)-.15 F .171(alue as the name of a \214le to read and e)-.25 F +-.15(xe)-.15 G 2.671(cute. Since).15 F 2.671(as)2.671 G .171(hell in) +-2.671 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E(as)108 156 Q F1(sh)3.081 E F0 +.581(does not attempt to read and e)3.081 F -.15(xe)-.15 G .581 +(cute commands from an).15 F 3.08(yo)-.15 G .58 +(ther startup \214les, the)-3.08 F F1<adad72>3.08 E(c\214le)-.18 E F0 +.58(option has)3.08 F .182(no ef)108 168 R 2.682(fect. A)-.25 F +(non-interacti)2.682 E .482 -.15(ve s)-.25 H .182(hell in).15 F -.2(vo) +-.4 G -.1(ke).2 G 2.682(dw).1 G .182(ith the name)-2.682 F F1(sh)2.682 E +F0 .182(does not attempt to read an)2.682 F 2.683(yo)-.15 G .183 +(ther startup \214les.)-2.683 F(When in)108 180 Q -.2(vo)-.4 G -.1(ke).2 +G 2.5(da).1 G(s)-2.5 E F1(sh)2.5 E F0(,)A F1(bash)2.5 E F0(enters)2.5 E +F2(posix)3.75 E F0(mode after the startup \214les are read.)3.03 E(When) +108 196.8 Q F1(bash)2.727 E F0 .226(is started in)2.727 F F2(posix)3.976 +E F0 .226(mode, as with the)3.256 F F1(\255\255posix)2.726 E F0 .226 +(command line option, it follo)2.726 F .226(ws the POSIX stan-)-.25 F +.341(dard for startup \214les.)108 208.8 R .341(In this mode, interacti) +5.341 F .641 -.15(ve s)-.25 H .341(hells e).15 F .341(xpand the)-.15 F +F3(ENV)2.841 E F0 -.25(va)2.591 G .342(riable and commands are read and) +.25 F -.15(exe)108 220.8 S(cuted from the \214le whose name is the e).15 +E(xpanded v)-.15 E 2.5(alue. No)-.25 F(other startup \214les are read.) +2.5 E F1(Bash)108 237.6 Q F0 .644(attempts to determine when it is bein\ +g run with its standard input connected to a a netw)3.144 F .643 +(ork connec-)-.1 F .229(tion, as if by the remote shell daemon, usually) +108 249.6 R F2 -.1(rs)2.729 G(hd).1 E F0 2.729(,o)C 2.73(rt)-2.729 G .23 +(he secure shell daemon)-2.73 F F2(sshd)2.73 E F0 5.23(.I)C(f)-5.23 E F1 +(bash)2.73 E F0 .23(determines it)2.73 F .741(is being run in this f)108 +261.6 R .741(ashion, it reads and e)-.1 F -.15(xe)-.15 G .741 +(cutes commands from).15 F F2(~/.bashr)3.241 E(c)-.37 E F0 3.241(,i)C +3.241(ft)-3.241 G .741(hat \214le e)-3.241 F .741(xists and is read-) +-.15 F 2.97(able. It)108 273.6 R .47(will not do this if in)2.97 F -.2 +(vo)-.4 G -.1(ke).2 G 2.97(da).1 G(s)-2.97 E F1(sh)2.97 E F0 5.47(.T)C +(he)-5.47 E F1<adad6e6f72>2.97 E(c)-.18 E F0 .47 +(option may be used to inhibit this beha)2.97 F(vior)-.2 E 2.97(,a)-.4 G +.47(nd the)-2.97 F F1<adad72>108 285.6 Q(c\214le)-.18 E F0 .886 +(option may be used to force another \214le to be read, b)3.387 F(ut)-.2 +E F2 -.1(rs)3.386 G(hd).1 E F0 .886(does not generally in)3.386 F -.2 +(vo)-.4 G 1.086 -.1(ke t).2 H .886(he shell).1 F +(with those options or allo)108 297.6 Q 2.5(wt)-.25 G +(hem to be speci\214ed.)-2.5 E 1.207 +(If the shell is started with the ef)108 314.4 R(fecti)-.25 E 1.507 -.15 +(ve u)-.25 H 1.208 +(ser \(group\) id not equal to the real user \(group\) id, and the).15 F +F1<ad70>3.708 E F0 .536(option is not supplied, no startup \214les are \ +read, shell functions are not inherited from the en)108 326.4 R .535 +(vironment, the)-.4 F F3(SHELLOPTS)108 338.4 Q F4(,)A F3 -.27(BA)2.959 G +(SHOPTS).27 E F4(,)A F3(CDP)2.959 E -.855(AT)-.666 G(H).855 E F4(,)A F0 +(and)2.959 E F3(GLOBIGNORE)3.209 E F0 -.25(va)2.959 G .709 +(riables, if the).25 F 3.209(ya)-.15 G .71(ppear in the en)-3.209 F .71 +(vironment, are)-.4 F .905(ignored, and the ef)108 350.4 R(fecti)-.25 E +1.205 -.15(ve u)-.25 H .904(ser id is set to the real user id.).15 F +.904(If the)5.904 F F1<ad70>3.404 E F0 .904(option is supplied at in) +3.404 F -.2(vo)-.4 G .904(cation, the).2 F(startup beha)108 362.4 Q +(vior is the same, b)-.2 E(ut the ef)-.2 E(fecti)-.25 E .3 -.15(ve u) +-.25 H(ser id is not reset.).15 E/F5 10.95/Times-Bold@0 SF(DEFINITIONS) +72 379.2 Q F0(The follo)108 391.2 Q +(wing de\214nitions are used throughout the rest of this document.)-.25 +E F1(blank)108 403.2 Q F0 2.5(As)11.54 G(pace or tab)-2.5 E(.)-.4 E F1 +-.1(wo)108 415.2 S(rd).1 E F0 2.5(As)13.88 G +(equence of characters considered as a single unit by the shell.)-2.5 E +(Also kno)5 E(wn as a)-.25 E F1(tok)2.5 E(en)-.1 E F0(.)A F1(name)108 +427.2 Q F0(A)12.67 E F2(wor)3.005 E(d)-.37 E F0 .165 +(consisting only of alphanumeric characters and underscores, and be) +3.435 F .166(ginning with an alpha-)-.15 F +(betic character or an underscore.)144 439.2 Q(Also referred to as an)5 +E F1(identi\214er)2.5 E F0(.)A F1(metacharacter)108 451.2 Q F0 2.5(Ac) +144 463.2 S(haracter that, when unquoted, separates w)-2.5 E 2.5 +(ords. One)-.1 F(of the follo)2.5 E(wing:)-.25 E F1 5(|&;\(\)<>s)144 +475.2 S 2.5(pace tab)-5 F(contr)108 487.2 Q(ol operator)-.18 E F0(A)144 +499.2 Q F2(tok)2.5 E(en)-.1 E F0(that performs a control function.)2.5 E +(It is one of the follo)5 E(wing symbols:)-.25 E/F6 10/Symbol SF<efef> +144 511.2 Q F1 5(&&)5 G 5(&;;)-5 G 5(;\(\)||)-5 G 10(&<)-5 G(newline>) +-10 E F5(RESER)72 528 Q(VED W)-.602 E(ORDS)-.11 E F2 .307(Reserved wor) +108 540 R(ds)-.37 E F0 .307(are w)2.807 F .307(ords that ha)-.1 F .607 +-.15(ve a s)-.2 H .306(pecial meaning to the shell.).15 F .306 +(The follo)5.306 F .306(wing w)-.25 F .306(ords are recognized as)-.1 F +(reserv)108 552 Q .227(ed when unquoted and either the \214rst w)-.15 F +.227(ord of a simple command \(see)-.1 F F3 .227(SHELL GRAMMAR)2.727 F +F0(belo)2.477 E .227(w\) or)-.25 F(the third w)108 564 Q(ord of a)-.1 E +F1(case)2.5 E F0(or)2.5 E F1 -.25(fo)2.5 G(r).25 E F0(command:)2.5 E F1 +11.916(!c)144 580.8 S 9.416(ase do done elif else esac \214 f)-11.916 F +9.415(or function if in select then until)-.25 F 7.5 +(while { } time [[ ]])144 592.8 R F5(SHELL GRAMMAR)72 609.6 Q F1 +(Simple Commands)87 621.6 Q F0(A)108 633.6 Q F2 .388(simple command) +2.888 F F0 .388(is a sequence of optional v)2.888 F .389 +(ariable assignments follo)-.25 F .389(wed by)-.25 F F1(blank)2.889 E F0 +.389(-separated w)B .389(ords and)-.1 F .816 +(redirections, and terminated by a)108 645.6 R F2(contr)3.316 E .815 +(ol oper)-.45 F(ator)-.15 E F0 5.815(.T)C .815(he \214rst w)-5.815 F +.815(ord speci\214es the command to be e)-.1 F -.15(xe)-.15 G(cuted,).15 +E(and is passed as ar)108 657.6 Q(gument zero.)-.18 E(The remaining w)5 +E(ords are passed as ar)-.1 E(guments to the in)-.18 E -.2(vo)-.4 G -.1 +(ke).2 G 2.5(dc).1 G(ommand.)-2.5 E .175(The return v)108 674.4 R .175 +(alue of a)-.25 F F2 .175(simple command)2.675 F F0 .175(is its e)2.675 +F .175(xit status, or 128+)-.15 F F2(n)A F0 .176 +(if the command is terminated by signal)3.508 F F2(n)2.676 E F0(.).24 E +F1(Pipelines)87 691.2 Q F0(A)108 703.2 Q F2(pipeline)2.996 E F0 .496(is\ + a sequence of one or more commands separated by one of the control ope\ +rators)2.996 F F1(|)2.996 E F0(or)2.996 E F1(|&)2.996 E F0 5.496(.T)C +(he)-5.496 E(format for a pipeline is:)108 715.2 Q(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(3)190.955 E 0 Cg EP +%%Page: 4 4 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E([)144 84 Q/F1 10/Times-Bold@0 SF(time)A F0([)2.5 E F1<ad70>A F0 +(]] [ ! ])A/F2 10/Times-Italic@0 SF(command)2.5 E F0 2.5([[)2.5 G F1(|) +-2.5 E/F3 10/Symbol SF<ef>A F1(|&)A F0(])A F2(command2)2.5 E F0(... ]) +2.5 E .243(The standard output of)108 100.8 R F2(command)2.943 E F0 .244 +(is connected via a pipe to the standard input of)3.513 F F2(command2) +2.744 E F0 5.244(.T).02 G .244(his connec-)-5.244 F .643 +(tion is performed before an)108 112.8 R 3.143(yr)-.15 G .642 +(edirections speci\214ed by the command \(see)-3.143 F/F4 9/Times-Bold@0 +SF(REDIRECTION)3.142 E F0(belo)2.892 E 3.142(w\). If)-.25 F F1(|&)3.142 +E F0(is)3.142 E 1.43(used, the standard error of)108 124.8 R F2(command) +3.93 E F0 1.431(is connected to)3.93 F F2(command2)3.931 E F0 2.531 -.55 +('s s)D 1.431(tandard input through the pipe; it is).55 F 1.197 +(shorthand for)108 136.8 R F1 1.197(2>&1 |)3.697 F F0 6.197(.T)C 1.197 +(his implicit redirection of the standard error is performed after an) +-6.197 F 3.696(yr)-.15 G(edirections)-3.696 E +(speci\214ed by the command.)108 148.8 Q .48 +(The return status of a pipeline is the e)108 165.6 R .48 +(xit status of the last command, unless the)-.15 F F1(pipefail)2.98 E F0 +.48(option is enabled.)2.98 F(If)108 177.6 Q F1(pipefail)2.687 E F0 .187 +(is enabled, the pipeline')2.687 F 2.687(sr)-.55 G .186 +(eturn status is the v)-2.687 F .186 +(alue of the last \(rightmost\) command to e)-.25 F .186(xit with a)-.15 +F .61(non-zero status, or zero if all commands e)108 189.6 R .611 +(xit successfully)-.15 F 5.611(.I)-.65 G 3.111(ft)-5.611 G .611 +(he reserv)-3.111 F .611(ed w)-.15 F(ord)-.1 E F1(!)3.111 E F0 .611 +(precedes a pipeline, the)5.611 F -.15(ex)108 201.6 S .55 +(it status of that pipeline is the logical ne).15 F -.05(ga)-.15 G .55 +(tion of the e).05 F .55(xit status as described abo)-.15 F -.15(ve)-.15 +G 5.55(.T).15 G .55(he shell w)-5.55 F .55(aits for)-.1 F +(all commands in the pipeline to terminate before returning a v)108 +213.6 Q(alue.)-.25 E .298(If the)108 230.4 R F1(time)2.799 E F0(reserv) +2.799 E .299(ed w)-.15 F .299(ord precedes a pipeline, the elapsed as w\ +ell as user and system time consumed by its)-.1 F -.15(exe)108 242.4 S +.14(cution are reported when the pipeline terminates.).15 F(The)5.139 E +F1<ad70>2.639 E F0 .139(option changes the output format to that spec-) +2.639 F .779(i\214ed by POSIX.)108 254.4 R(The)5.779 E F4(TIMEFORMA) +3.279 E(T)-.855 E F0 -.25(va)3.029 G .779 +(riable may be set to a format string that speci\214es ho).25 F 3.28(wt) +-.25 G .78(he timing)-3.28 F +(information should be displayed; see the description of)108 266.4 Q F4 +(TIMEFORMA)2.5 E(T)-.855 E F0(under)2.25 E F1(Shell V)2.5 E(ariables) +-.92 E F0(belo)2.5 E -.65(w.)-.25 G(Each command in a pipeline is e)108 +283.2 Q -.15(xe)-.15 G +(cuted as a separate process \(i.e., in a subshell\).).15 E F1(Lists)87 +300 Q F0(A)108 312 Q F2(list)2.601 E F0 .101(is a sequence of one or mo\ +re pipelines separated by one of the operators)2.601 F F1(;)2.6 E F0(,)A +F1(&)2.6 E F0(,)A F1(&&)2.6 E F0 2.6(,o)C(r)-2.6 E F3<efef>2.6 E F0 2.6 +(,a)C .1(nd option-)-2.6 F(ally terminated by one of)108 324 Q F1(;)2.5 +E F0(,)A F1(&)2.5 E F0 2.5(,o)C(r)-2.5 E F1(<newline>)2.5 E F0(.)A .656 +(Of these list operators,)108 340.8 R F1(&&)3.156 E F0(and)3.156 E F3 +<efef>3.156 E F0(ha)3.156 E .956 -.15(ve e)-.2 H .656 +(qual precedence, follo).15 F .656(wed by)-.25 F F1(;)3.156 E F0(and) +3.156 E F1(&)3.156 E F0 3.156(,w)C .656(hich ha)-3.156 F .957 -.15(ve e) +-.2 H .657(qual prece-).15 F(dence.)108 352.8 Q 2.5(As)108 369.6 S +(equence of one or more ne)-2.5 E(wlines may appear in a)-.25 E F2(list) +2.5 E F0(instead of a semicolon to delimit commands.)2.5 E .029 +(If a command is terminated by the control operator)108 386.4 R F1(&) +2.529 E F0 2.529(,t)C .029(he shell e)-2.529 F -.15(xe)-.15 G .029 +(cutes the command in the).15 F F2(bac)2.528 E(kgr)-.2 E(ound)-.45 E F0 +(in)2.528 E 2.875(as)108 398.4 S 2.875(ubshell. The)-2.875 F .375 +(shell does not w)2.875 F .375 +(ait for the command to \214nish, and the return status is 0.)-.1 F .376 +(Commands sepa-)5.376 F .849(rated by a)108 410.4 R F1(;)3.349 E F0 .849 +(are e)3.349 F -.15(xe)-.15 G .848(cuted sequentially; the shell w).15 F +.848(aits for each command to terminate in turn.)-.1 F .848(The return) +5.848 F(status is the e)108 422.4 Q(xit status of the last command e) +-.15 E -.15(xe)-.15 G(cuted.).15 E .632(AND and OR lists are sequences \ +of one of more pipelines separated by the)108 439.2 R F1(&&)3.132 E F0 +(and)3.133 E F3<efef>3.133 E F0 .633(control operators,)3.133 F +(respecti)108 451.2 Q -.15(ve)-.25 G(ly).15 E 5(.A)-.65 G +(ND and OR lists are e)-5 E -.15(xe)-.15 G(cuted with left associati).15 +E(vity)-.25 E 5(.A)-.65 G 2.5(nA)-5 G(ND list has the form)-2.5 E F2 +(command1)144 468 Q F1(&&)2.5 E F2(command2)2.5 E(command2)108.2 484.8 Q +F0(is e)2.52 E -.15(xe)-.15 G(cuted if, and only if,).15 E F2(command1) +2.7 E F0(returns an e)2.5 E(xit status of zero.)-.15 E +(An OR list has the form)108 501.6 Q F2(command1)144 518.4 Q F3<efef>2.5 +E F2(command2)2.5 E(command2)108.2 540 Q F0 .729(is e)3.249 F -.15(xe) +-.15 G .729(cuted if and only if).15 F F2(command1)3.429 E F0 .729 +(returns a non-zero e)3.229 F .729(xit status.)-.15 F .728 +(The return status of AND)5.729 F(and OR lists is the e)108 552 Q +(xit status of the last command e)-.15 E -.15(xe)-.15 G +(cuted in the list.).15 E F1(Compound Commands)87 568.8 Q F0(A)108 580.8 +Q F2(compound command)2.5 E F0(is one of the follo)2.5 E(wing:)-.25 E +(\()108 597.6 Q F2(list)A F0(\))A F2(list)17.11 E F0 .011(is e)2.511 F +-.15(xe)-.15 G .011(cuted in a subshell en).15 F .011(vironment \(see) +-.4 F F4 .011(COMMAND EXECUTION ENVIR)2.511 F(ONMENT)-.27 E F0(belo) +2.262 E(w\).)-.25 E -1.11(Va)144 609.6 S 1.064(riable assignments and b) +1.11 F 1.064(uiltin commands that af)-.2 F 1.064(fect the shell')-.25 F +3.564(se)-.55 G -.4(nv)-3.564 G 1.064(ironment do not remain in).4 F(ef) +144 621.6 Q(fect after the command completes.)-.25 E +(The return status is the e)5 E(xit status of)-.15 E F2(list)2.5 E F0(.) +A({)108 638.4 Q F2(list)2.5 E F0 2.5(;})C F2(list)3.89 E F0 .401 +(is simply e)2.901 F -.15(xe)-.15 G .401(cuted in the current shell en) +.15 F(vironment.)-.4 E F2(list)5.401 E F0 .402 +(must be terminated with a ne)2.901 F .402(wline or)-.25 F 3.215 +(semicolon. This)144 650.4 R .715(is kno)3.215 F .715(wn as a)-.25 F F2 +(gr)3.215 E .715(oup command)-.45 F F0 5.715(.T)C .715 +(he return status is the e)-5.715 F .714(xit status of)-.15 F F2(list) +3.214 E F0 5.714(.N)C(ote)-5.714 E .219(that unlik)144 662.4 R 2.719(et) +-.1 G .219(he metacharacters)-2.719 F F1(\()2.719 E F0(and)2.719 E F1 +(\))2.719 E F0(,)A F1({)2.719 E F0(and)2.719 E F1(})2.719 E F0(are)2.719 +E F2 -.37(re)2.72 G .22(served wor).37 F(ds)-.37 E F0 .22 +(and must occur where a reserv)2.72 F(ed)-.15 E -.1(wo)144 674.4 S .257 +(rd is permitted to be recognized.).1 F .257(Since the)5.257 F 2.757(yd) +-.15 G 2.756(on)-2.757 G .256(ot cause a w)-2.756 F .256(ord break, the) +-.1 F 2.756(ym)-.15 G .256(ust be separated)-2.756 F(from)144 686.4 Q F2 +(list)2.5 E F0(by whitespace or another shell metacharacter)2.5 E(.)-.55 +E(\(\()108 703.2 Q F2 -.2(ex)C(pr).2 E(ession)-.37 E F0(\)\))A(The)144 +715.2 Q F2 -.2(ex)2.551 G(pr).2 E(ession)-.37 E F0 .051(is e)2.551 F +-.25(va)-.25 G .051(luated according to the rules described belo).25 F +2.552(wu)-.25 G(nder)-2.552 E F4 .052(ARITHMETIC EV)2.552 F(ALU)-1.215 E +(A-)-.54 E(TION)144 727.2 Q/F5 9/Times-Roman@0 SF(.)A F0 .411(If the v) +4.911 F .411(alue of the e)-.25 F .411(xpression is non-zero, the retur\ +n status is 0; otherwise the return status)-.15 F(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(4)190.955 E 0 Cg EP +%%Page: 5 5 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(is 1.)144 84 Q(This is e)5 E(xactly equi)-.15 E -.25(va)-.25 G +(lent to).25 E/F1 10/Times-Bold@0 SF(let ")2.5 E/F2 10/Times-Italic@0 SF +-.2(ex)C(pr).2 E(ession)-.37 E F1(")A F0(.)A F1([[)108 100.8 Q F2 -.2 +(ex)2.5 G(pr).2 E(ession)-.37 E F1(]])2.5 E F0 1.299 +(Return a status of 0 or 1 depending on the e)144 112.8 R -.25(va)-.25 G +1.3(luation of the conditional e).25 F(xpression)-.15 E F2 -.2(ex)3.8 G +(pr).2 E(ession)-.37 E F0(.)A 2.274 +(Expressions are composed of the primaries described belo)144 124.8 R +4.773(wu)-.25 G(nder)-4.773 E/F3 9/Times-Bold@0 SF(CONDITION)4.773 E +2.273(AL EXPRES-)-.18 F(SIONS)144 136.8 Q/F4 9/Times-Roman@0 SF(.)A F0 +-.8(Wo)5.632 G 1.133(rd splitting and pathname e).8 F 1.133 +(xpansion are not performed on the w)-.15 F 1.133(ords between the)-.1 F +F1([[)3.633 E F0(and)144 148.8 Q F1(]])2.964 E F0 2.964(;t)C .464 +(ilde e)-2.964 F .464(xpansion, parameter and v)-.15 F .464(ariable e) +-.25 F .463(xpansion, arithmetic e)-.15 F .463 +(xpansion, command substi-)-.15 F 1.081 +(tution, process substitution, and quote remo)144 160.8 R -.25(va)-.15 G +3.581(la).25 G 1.081(re performed.)-3.581 F 1.081 +(Conditional operators such as)6.081 F F1<ad66>3.581 E F0 +(must be unquoted to be recognized as primaries.)144 172.8 Q +(When used with)144 190.8 Q F1([[)2.5 E F0 2.5(,T)C(he)-2.5 E F1(<)2.5 E +F0(and)2.5 E F1(>)2.5 E F0(operators sort le)2.5 E +(xicographically using the current locale.)-.15 E .503(When the)144 +208.8 R F1(==)3.003 E F0(and)3.002 E F1(!=)3.002 E F0 .502(operators ar\ +e used, the string to the right of the operator is considered a pat-) +3.002 F 1.224(tern and matched according to the rules described belo)144 +220.8 R 3.724(wu)-.25 G(nder)-3.724 E F1 -.1(Pa)3.724 G(tter).1 E 3.725 +(nM)-.15 G(atching)-3.725 E F0 6.225(.I)C 3.725(ft)-6.225 G 1.225 +(he shell)-3.725 F(option)144 232.8 Q F1(nocasematch)3.405 E F0 .904 +(is enabled, the match is performed without re)3.405 F -.05(ga)-.15 G +.904(rd to the case of alphabetic).05 F 2.751(characters. The)144 244.8 +R .251(return v)2.751 F .251(alue is 0 if the string matches \()-.25 F +F1(==)A F0 2.751(\)o)C 2.751(rd)-2.751 G .251(oes not match \()-2.751 F +F1(!=)A F0 2.751(\)t)C .252(he pattern, and)-2.751 F 2.5(1o)144 256.8 S +2.5(therwise. An)-2.5 F 2.5(yp)-.15 G(art of the pattern may be quoted \ +to force it to be matched as a string.)-2.5 E .243 +(An additional binary operator)144 274.8 R(,)-.4 E F1(=~)2.743 E F0 +2.743(,i)C 2.743(sa)-2.743 G -.25(va)-2.943 G .243 +(ilable, with the same precedence as).25 F F1(==)2.743 E F0(and)2.743 E +F1(!=)2.743 E F0 5.243(.W)C .243(hen it is)-5.243 F 1.953 +(used, the string to the right of the operator is considered an e)144 +286.8 R 1.954(xtended re)-.15 F 1.954(gular e)-.15 F 1.954 +(xpression and)-.15 F .207(matched accordingly \(as in)144 298.8 R F2 +-.37(re)2.707 G -.1(ge)-.03 G(x)-.1 E F0 2.707(\(3\)\). The)B .207 +(return v)2.707 F .207 +(alue is 0 if the string matches the pattern, and 1)-.25 F 3.345 +(otherwise. If)144 310.8 R .845(the re)3.345 F .845(gular e)-.15 F .846 +(xpression is syntactically incorrect, the conditional e)-.15 F +(xpression')-.15 E 3.346(sr)-.55 G(eturn)-3.346 E -.25(va)144 322.8 S +.667(lue is 2.).25 F .667(If the shell option)5.667 F F1(nocasematch) +3.167 E F0 .667(is enabled, the match is performed without re)3.167 F +-.05(ga)-.15 G .666(rd to).05 F .378(the case of alphabetic characters.) +144 334.8 R(An)5.378 E 2.878(yp)-.15 G .378 +(art of the pattern may be quoted to force it to be matched)-2.878 F +.265(as a string.)144 346.8 R .265 +(Substrings matched by parenthesized sube)5.265 F .265 +(xpressions within the re)-.15 F .265(gular e)-.15 F .265(xpression are) +-.15 F(sa)144 358.8 Q -.15(ve)-.2 G 3.096(di).15 G 3.097(nt)-3.096 G +.597(he array v)-3.097 F(ariable)-.25 E F3 -.27(BA)3.097 G(SH_REMA).27 E +(TCH)-.855 E F4(.)A F0 .597(The element of)5.097 F F3 -.27(BA)3.097 G +(SH_REMA).27 E(TCH)-.855 E F0 .597(with inde)2.847 F 3.097(x0i)-.15 G(s) +-3.097 E .049(the portion of the string matching the entire re)144 370.8 +R .049(gular e)-.15 F 2.549(xpression. The)-.15 F .049(element of)2.549 +F F3 -.27(BA)2.549 G(SH_REMA).27 E(TCH)-.855 E F0(with inde)144 382.8 Q +(x)-.15 E F2(n)2.5 E F0(is the portion of the string matching the)2.5 E +F2(n)2.5 E F0(th parenthesized sube)A(xpression.)-.15 E .785 +(Expressions may be combined using the follo)144 400.8 R .786 +(wing operators, listed in decreasing order of prece-)-.25 F(dence:)144 +412.8 Q F1(\()144 430.8 Q F2 -.2(ex)2.5 G(pr).2 E(ession)-.37 E F1(\)) +2.5 E F0 .523(Returns the v)180 442.8 R .522(alue of)-.25 F F2 -.2(ex) +3.022 G(pr).2 E(ession)-.37 E F0 5.522(.T)C .522(his may be used to o) +-5.522 F -.15(ve)-.15 G .522(rride the normal precedence of).15 F +(operators.)180 454.8 Q F1(!)144 466.8 Q F2 -.2(ex)2.5 G(pr).2 E(ession) +-.37 E F0 -.35(Tr)180 478.8 S(ue if).35 E F2 -.2(ex)2.5 G(pr).2 E +(ession)-.37 E F0(is f)2.74 E(alse.)-.1 E F2 -.2(ex)144 490.8 S(pr).2 E +(ession1)-.37 E F1(&&)2.5 E F2 -.2(ex)2.5 G(pr).2 E(ession2)-.37 E F0 +-.35(Tr)180 502.8 S(ue if both).35 E F2 -.2(ex)2.5 G(pr).2 E(ession1) +-.37 E F0(and)2.5 E F2 -.2(ex)2.5 G(pr).2 E(ession2)-.37 E F0(are true.) +2.52 E F2 -.2(ex)144 514.8 S(pr).2 E(ession1)-.37 E/F5 10/Symbol SF +<efef>2.5 E F2 -.2(ex)2.5 G(pr).2 E(ession2)-.37 E F0 -.35(Tr)180 526.8 +S(ue if either).35 E F2 -.2(ex)2.5 G(pr).2 E(ession1)-.37 E F0(or)2.5 E +F2 -.2(ex)2.5 G(pr).2 E(ession2)-.37 E F0(is true.)2.52 E(The)144 543.6 +Q F1(&&)3.298 E F0(and)3.298 E F5<efef>3.298 E F0 .798 +(operators do not e)3.298 F -.25(va)-.25 G(luate).25 E F2 -.2(ex)3.298 G +(pr).2 E(ession2)-.37 E F0 .798(if the v)3.298 F .798(alue of)-.25 F F2 +-.2(ex)3.298 G(pr).2 E(ession1)-.37 E F0 .799(is suf)3.298 F .799 +(\214cient to)-.25 F(determine the return v)144 555.6 Q +(alue of the entire conditional e)-.25 E(xpression.)-.15 E F1 -.25(fo) +108 572.4 S(r).25 E F2(name)2.5 E F0 2.5([[)2.5 G F1(in)A F0([)2.5 E F2 +(wor)2.5 E 2.5(d.)-.37 G(..)-2.5 E F0 2.5(]];])2.5 G F1(do)A F2(list)2.5 +E F0(;)2.5 E F1(done)2.5 E F0 .424(The list of w)144 584.4 R .424 +(ords follo)-.1 F(wing)-.25 E F1(in)2.924 E F0 .423(is e)2.924 F .423 +(xpanded, generating a list of items.)-.15 F .423(The v)5.423 F(ariable) +-.25 E F2(name)2.923 E F0 .423(is set to)2.923 F .653 +(each element of this list in turn, and)144 596.4 R F2(list)3.153 E F0 +.653(is e)3.153 F -.15(xe)-.15 G .653(cuted each time.).15 F .653 +(If the)5.653 F F1(in)3.153 E F2(wor)3.153 E(d)-.37 E F0 .653 +(is omitted, the)3.153 F F1 -.25(fo)3.153 G(r).25 E F0 .649(command e) +144 608.4 R -.15(xe)-.15 G(cutes).15 E F2(list)3.149 E F0 .648 +(once for each positional parameter that is set \(see)3.148 F F3 -.666 +(PA)3.148 G(RAMETERS).666 E F0(belo)2.898 E(w\).)-.25 E .153 +(The return status is the e)144 620.4 R .153 +(xit status of the last command that e)-.15 F -.15(xe)-.15 G 2.654 +(cutes. If).15 F .154(the e)2.654 F .154(xpansion of the items)-.15 F +(follo)144 632.4 Q(wing)-.25 E F1(in)2.5 E F0 +(results in an empty list, no commands are e)2.5 E -.15(xe)-.15 G +(cuted, and the return status is 0.).15 E F1 -.25(fo)108 649.2 S(r).25 E +F0(\(\()2.5 E F2 -.2(ex)2.5 G(pr1).2 E F0(;)2.5 E F2 -.2(ex)2.5 G(pr2).2 +E F0(;)2.5 E F2 -.2(ex)2.5 G(pr3).2 E F0(\)\) ;)2.5 E F1(do)2.5 E F2 +(list)2.5 E F0(;)2.5 E F1(done)2.5 E F0 1.236(First, the arithmetic e) +144 661.2 R(xpression)-.15 E F2 -.2(ex)3.736 G(pr1).2 E F0 1.235(is e) +3.736 F -.25(va)-.25 G 1.235 +(luated according to the rules described belo).25 F 3.735(wu)-.25 G +(nder)-3.735 E F3 .561(ARITHMETIC EV)144 673.2 R(ALU)-1.215 E -.855(AT) +-.54 G(ION).855 E F4(.)A F0 .561(The arithmetic e)5.061 F(xpression)-.15 +E F2 -.2(ex)3.061 G(pr2).2 E F0 .562(is then e)3.062 F -.25(va)-.25 G +.562(luated repeatedly until).25 F .592(it e)144 685.2 R -.25(va)-.25 G +.592(luates to zero.).25 F .592(Each time)5.592 F F2 -.2(ex)3.092 G(pr2) +.2 E F0 -.25(eva)3.092 G .592(luates to a non-zero v).25 F(alue,)-.25 E +F2(list)3.092 E F0 .591(is e)3.092 F -.15(xe)-.15 G .591 +(cuted and the arith-).15 F .228(metic e)144 697.2 R(xpression)-.15 E F2 +-.2(ex)2.728 G(pr3).2 E F0 .229(is e)2.728 F -.25(va)-.25 G 2.729 +(luated. If).25 F(an)2.729 E 2.729(ye)-.15 G .229 +(xpression is omitted, it beha)-2.879 F -.15(ve)-.2 G 2.729(sa).15 G +2.729(si)-2.729 G 2.729(fi)-2.729 G 2.729(te)-2.729 G -.25(va)-2.979 G +.229(luates to 1.).25 F .228(The return v)144 709.2 R .228 +(alue is the e)-.25 F .228(xit status of the last command in)-.15 F F2 +(list)2.728 E F0 .227(that is e)2.728 F -.15(xe)-.15 G .227(cuted, or f) +.15 F .227(alse if an)-.1 F 2.727(yo)-.15 G 2.727(ft)-2.727 G(he)-2.727 +E -.15(ex)144 721.2 S(pressions is in).15 E -.25(va)-.4 G(lid.).25 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(5)190.955 E 0 Cg EP +%%Page: 6 6 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(select)108 84 Q/F2 10/Times-Italic@0 SF +(name)2.5 E F0([)2.5 E F1(in)2.5 E F2(wor)2.5 E(d)-.37 E F0 2.5(];)2.5 G +F1(do)A F2(list)2.5 E F0(;)2.5 E F1(done)2.5 E F0 .432(The list of w)144 +96 R .432(ords follo)-.1 F(wing)-.25 E F1(in)2.932 E F0 .432(is e)2.932 +F .432(xpanded, generating a list of items.)-.15 F .433(The set of e) +5.433 F .433(xpanded w)-.15 F(ords)-.1 E .843 +(is printed on the standard error)144 108 R 3.342(,e)-.4 G .842 +(ach preceded by a number)-3.342 F 5.842(.I)-.55 G 3.342(ft)-5.842 G(he) +-3.342 E F1(in)3.342 E F2(wor)3.342 E(d)-.37 E F0 .842 +(is omitted, the posi-)3.342 F .201(tional parameters are printed \(see) +144 120 R/F3 9/Times-Bold@0 SF -.666(PA)2.701 G(RAMETERS).666 E F0(belo) +2.451 E 2.701(w\). The)-.25 F F3(PS3)2.701 E F0 .201 +(prompt is then displayed and a)2.451 F .214 +(line read from the standard input.)144 132 R .213 +(If the line consists of a number corresponding to one of the dis-)5.214 +F 1.537(played w)144 144 R 1.537(ords, then the v)-.1 F 1.537(alue of) +-.25 F F2(name)4.397 E F0 1.537(is set to that w)4.217 F 4.037(ord. If) +-.1 F 1.538(the line is empty)4.038 F 4.038(,t)-.65 G 1.538(he w)-4.038 +F 1.538(ords and)-.1 F .066(prompt are displayed ag)144 156 R 2.566 +(ain. If)-.05 F .065(EOF is read, the command completes.)2.566 F(An) +5.065 E 2.565(yo)-.15 G .065(ther v)-2.565 F .065(alue read causes)-.25 +F F2(name)144 168 Q F0 .972(to be set to null.)3.652 F .972 +(The line read is sa)5.972 F -.15(ve)-.2 G 3.473(di).15 G 3.473(nt) +-3.473 G .973(he v)-3.473 F(ariable)-.25 E F3(REPL)3.473 E(Y)-.828 E/F4 +9/Times-Roman@0 SF(.)A F0(The)5.473 E F2(list)3.563 E F0 .973(is e)4.153 +F -.15(xe)-.15 G .973(cuted after).15 F .072(each selection until a)144 +180 R F1(br)2.571 E(eak)-.18 E F0 .071(command is e)2.571 F -.15(xe)-.15 +G 2.571(cuted. The).15 F -.15(ex)2.571 G .071(it status of).15 F F1 +(select)2.571 E F0 .071(is the e)2.571 F .071(xit status of the)-.15 F +(last command e)144 192 Q -.15(xe)-.15 G(cuted in).15 E F2(list)2.5 E F0 +2.5(,o).68 G 2.5(rz)-2.5 G(ero if no commands were e)-2.5 E -.15(xe)-.15 +G(cuted.).15 E F1(case)108 208.8 Q F2(wor)2.5 E(d)-.37 E F1(in)2.5 E F0 +2.5([[)2.5 G(\(])-2.5 E F2(pattern)2.5 E F0([)2.5 E F1(|)2.5 E F2 +(pattern)2.5 E F0 2.5(].)2.5 G(.. \))-2.5 E F2(list)2.5 E F0(;; ] ...) +2.5 E F1(esac)2.5 E F0(A)144 220.8 Q F1(case)3.264 E F0 .764 +(command \214rst e)3.264 F(xpands)-.15 E F2(wor)3.264 E(d)-.37 E F0 +3.264(,a)C .764(nd tries to match it ag)-3.264 F .764(ainst each)-.05 F +F2(pattern)3.264 E F0 .765(in turn, using the)3.264 F .596 +(same matching rules as for pathname e)144 232.8 R .595(xpansion \(see) +-.15 F F1 -.1(Pa)3.095 G .595(thname Expansion).1 F F0(belo)3.095 E +3.095(w\). The)-.25 F F2(wor)3.095 E(d)-.37 E F0(is)3.095 E -.15(ex)144 +244.8 S 1.092(panded using tilde e).15 F 1.092 +(xpansion, parameter and v)-.15 F 1.092(ariable e)-.25 F 1.092 +(xpansion, arithmetic substitution, com-)-.15 F 1.268 +(mand substitution, process substitution and quote remo)144 256.8 R -.25 +(va)-.15 G 3.768(l. Each).25 F F2(pattern)3.768 E F0 -.15(ex)3.768 G +1.268(amined is e).15 F(xpanded)-.15 E .353(using tilde e)144 268.8 R +.353(xpansion, parameter and v)-.15 F .353(ariable e)-.25 F .353 +(xpansion, arithmetic substitution, command substi-)-.15 F 1.517 +(tution, and process substitution.)144 280.8 R 1.517 +(If the shell option)6.517 F F1(nocasematch)4.016 E F0 1.516 +(is enabled, the match is per)4.016 F(-)-.2 E 1.346(formed without re) +144 292.8 R -.05(ga)-.15 G 1.346 +(rd to the case of alphabetic characters.).05 F 1.347 +(When a match is found, the corre-)6.347 F(sponding)144 304.8 Q F2(list) +2.777 E F0 .277(is e)2.777 F -.15(xe)-.15 G 2.777(cuted. If).15 F(the) +2.777 E F1(;;)2.777 E F0 .277 +(operator is used, no subsequent matches are attempted after the)2.777 F +.848(\214rst pattern match.)144 316.8 R(Using)5.848 E F1(;&)3.348 E F0 +.849(in place of)3.349 F F1(;;)3.349 E F0 .849(causes e)3.349 F -.15(xe) +-.15 G .849(cution to continue with the).15 F F2(list)3.349 E F0 +(associated)3.349 E .078(with the ne)144 328.8 R .078 +(xt set of patterns.)-.15 F(Using)5.078 E F1(;;&)2.578 E F0 .078 +(in place of)2.578 F F1(;;)2.578 E F0 .077 +(causes the shell to test the ne)2.578 F .077(xt pattern list in)-.15 F +.227(the statement, if an)144 340.8 R 1.527 -.65(y, a)-.15 H .227(nd e) +.65 F -.15(xe)-.15 G .227(cute an).15 F 2.727(ya)-.15 G(ssociated)-2.727 +E F2(list)2.727 E F0 .227(on a successful match.)2.727 F .227(The e) +5.227 F .227(xit status is zero)-.15 F(if no pattern matches.)144 352.8 +Q(Otherwise, it is the e)5 E(xit status of the last command e)-.15 E +-.15(xe)-.15 G(cuted in).15 E F2(list)2.5 E F0(.)A F1(if)108 369.6 Q F2 +(list)2.5 E F0(;)A F1(then)2.5 E F2(list;)2.5 E F0([)2.5 E F1(elif)2.5 E +F2(list)2.5 E F0(;)A F1(then)2.5 E F2(list)2.5 E F0 2.5(;].)C(.. [)-2.5 +E F1(else)2.5 E F2(list)2.5 E F0 2.5(;])C F1<8c>A F0(The)144 381.6 Q F1 +(if)2.978 E F2(list)3.068 E F0 .478(is e)3.658 F -.15(xe)-.15 G 2.978 +(cuted. If).15 F .478(its e)2.978 F .478(xit status is zero, the)-.15 F +F1(then)2.978 E F2(list)2.978 E F0 .478(is e)2.978 F -.15(xe)-.15 G +2.978(cuted. Otherwise,).15 F(each)2.978 E F1(elif)2.977 E F2(list)2.977 +E F0 1.087(is e)144 393.6 R -.15(xe)-.15 G 1.087 +(cuted in turn, and if its e).15 F 1.087 +(xit status is zero, the corresponding)-.15 F F1(then)3.587 E F2(list) +3.587 E F0 1.088(is e)3.588 F -.15(xe)-.15 G 1.088(cuted and the).15 F +.104(command completes.)144 405.6 R .103(Otherwise, the)5.104 F F1(else) +2.603 E F2(list)2.603 E F0 .103(is e)2.603 F -.15(xe)-.15 G .103 +(cuted, if present.).15 F .103(The e)5.103 F .103(xit status is the e) +-.15 F .103(xit sta-)-.15 F(tus of the last command e)144 417.6 Q -.15 +(xe)-.15 G(cuted, or zero if no condition tested true.).15 E F1(while) +108 434.4 Q F2(list)2.5 E F0(;)A F1(do)2.5 E F2(list)2.5 E F0(;)A F1 +(done)2.5 E(until)108 446.4 Q F2(list)2.5 E F0(;)A F1(do)2.5 E F2(list) +2.5 E F0(;)A F1(done)2.5 E F0(The)144 458.4 Q F1(while)3.103 E F0 .603 +(command continuously e)3.103 F -.15(xe)-.15 G .603(cutes the).15 F F1 +(do)3.103 E F2(list)3.103 E F0 .603(as long as the last command in)3.103 +F F2(list)3.104 E F0(returns)3.104 E .471(an e)144 470.4 R .471 +(xit status of zero.)-.15 F(The)5.471 E F1(until)2.971 E F0 .471 +(command is identical to the)2.971 F F1(while)2.97 E F0 .47(command, e) +2.97 F .47(xcept that the test)-.15 F .095(is ne)144 482.4 R -.05(ga) +-.15 G .095(ted; the).05 F F1(do)2.595 E F2(list)2.685 E F0 .095(is e) +3.275 F -.15(xe)-.15 G .095(cuted as long as the last command in).15 F +F2(list)2.685 E F0 .096(returns a non-zero e)3.276 F .096(xit status.) +-.15 F 1.307(The e)144 494.4 R 1.307(xit status of the)-.15 F F1(while) +3.807 E F0(and)3.807 E F1(until)3.807 E F0 1.307(commands is the e)3.807 +F 1.306(xit status of the last)-.15 F F1(do)3.806 E F2(list)3.806 E F0 +(command)3.806 E -.15(exe)144 506.4 S(cuted, or zero if none w).15 E +(as e)-.1 E -.15(xe)-.15 G(cuted.).15 E F1(Copr)87 523.2 Q(ocesses)-.18 +E F0(A)108 535.2 Q F2(copr)3.712 E(ocess)-.45 E F0 1.212 +(is a shell command preceded by the)3.712 F F1(copr)3.713 E(oc)-.18 E F0 +(reserv)3.713 E 1.213(ed w)-.15 F 3.713(ord. A)-.1 F 1.213 +(coprocess is e)3.713 F -.15(xe)-.15 G 1.213(cuted asyn-).15 F .575(chr\ +onously in a subshell, as if the command had been terminated with the) +108 547.2 R F1(&)3.074 E F0 .574(control operator)3.074 F 3.074(,w)-.4 G +.574(ith a tw)-3.074 F(o-)-.1 E -.1(wa)108 559.2 S 2.5(yp).1 G +(ipe established between the e)-2.5 E -.15(xe)-.15 G +(cuting shell and the coprocess.).15 E(The format for a coprocess is:) +108 576 Q F1(copr)144 592.8 Q(oc)-.18 E F0([)2.5 E F2 -.27(NA)C(ME).27 E +F0(])A F2(command)2.5 E F0([)2.5 E F2 -.37(re)C(dir).37 E(ections)-.37 E +F0(])A .922(This creates a coprocess named)108 609.6 R F2 -.27(NA)3.422 +G(ME).27 E F0 5.922(.I)C(f)-5.922 E F2 -.27(NA)3.422 G(ME).27 E F0 .923 +(is not supplied, the def)3.422 F .923(ault name is)-.1 F F2(COPR)3.423 +E(OC)-.4 E F0(.)A F2 -.27(NA)5.923 G(ME).27 E F0 .64 +(must not be supplied if)108 621.6 R F2(command)3.14 E F0 .64(is a)3.14 +F F2 .64(simple command)3.14 F F0 .64(\(see abo)3.14 F -.15(ve)-.15 G +.64(\); otherwise, it is interpreted as the \214rst).15 F -.1(wo)108 +633.6 S .163(rd of the simple command.).1 F .163(When the coproc is e) +5.163 F -.15(xe)-.15 G .163(cuted, the shell creates an array v).15 F +.163(ariable \(see)-.25 F F1(Arrays)2.663 E F0(belo)108 645.6 Q .512 +(w\) named)-.25 F F2 -.27(NA)3.012 G(ME).27 E F0 .512(in the conte)3.012 +F .511(xt of the e)-.15 F -.15(xe)-.15 G .511(cuting shell.).15 F .511 +(The standard output of)5.511 F F2(command)3.211 E F0 .511(is connected) +3.781 F .81(via a pipe to a \214le descriptor in the e)108 657.6 R -.15 +(xe)-.15 G .811(cuting shell, and that \214le descriptor is assigned to) +.15 F F2 -.27(NA)3.311 G(ME).27 E F0 3.311([0]. The)B .717 +(standard input of)108 669.6 R F2(command)3.417 E F0 .716 +(is connected via a pipe to a \214le descriptor in the e)3.987 F -.15 +(xe)-.15 G .716(cuting shell, and that \214le).15 F .702 +(descriptor is assigned to)108 681.6 R F2 -.27(NA)3.202 G(ME).27 E F0 +3.202([1]. This)B .703(pipe is established before an)3.203 F 3.203(yr) +-.15 G .703(edirections speci\214ed by the com-)-3.203 F 1.184 +(mand \(see)108 693.6 R F3(REDIRECTION)3.684 E F0(belo)3.434 E 3.684 +(w\). The)-.25 F 1.183(\214le descriptors can be utilized as ar)3.684 F +1.183(guments to shell commands)-.18 F .07 +(and redirections using standard w)108 705.6 R .07(ord e)-.1 F 2.57 +(xpansions. The)-.15 F .07(process id of the shell spa)2.57 F .07 +(wned to e)-.15 F -.15(xe)-.15 G .07(cute the copro-).15 F .632 +(cess is a)108 717.6 R -.25(va)-.2 G .631(ilable as the v).25 F .631 +(alue of the v)-.25 F(ariable)-.25 E F2 -.27(NA)3.131 G(ME).27 E F0 +3.131(_PID. The)B F1(wait)3.131 E F0 -.2(bu)3.131 G .631 +(iltin command may be used to w).2 F(ait)-.1 E +(for the coprocess to terminate.)108 729.6 Q(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(6)190.955 E 0 Cg EP +%%Page: 7 7 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(The return status of a coprocess is the e)108 84 Q(xit status of) +-.15 E/F1 10/Times-Italic@0 SF(command)2.5 E F0(.)A/F2 10/Times-Bold@0 +SF(Shell Function De\214nitions)87 100.8 Q F0 2.697(As)108 112.8 S .198 +(hell function is an object that is called lik)-2.697 F 2.698(eas)-.1 G +.198(imple command and e)-2.698 F -.15(xe)-.15 G .198 +(cutes a compound command with).15 F 2.5(an)108 124.8 S .5 -.25(ew s) +-2.5 H(et of positional parameters.).25 E +(Shell functions are declared as follo)5 E(ws:)-.25 E([)108 141.6 Q F2 +(function)2.5 E F0(])2.5 E F1(name)2.5 E F0(\(\))2.5 E F1 +(compound\255command)2.5 E F0([)2.5 E F1 -.37(re)C(dir).37 E(ection)-.37 +E F0(])A 1.403(This de\214nes a function named)144 153.6 R F1(name)3.902 +E F0 6.402(.T)C 1.402(he reserv)-6.402 F 1.402(ed w)-.15 F(ord)-.1 E F2 +(function)3.902 E F0 1.402(is optional.)3.902 F 1.402(If the)6.402 F F2 +(function)3.902 E F0(reserv)144 165.6 Q .162(ed w)-.15 F .162 +(ord is supplied, the parentheses are optional.)-.1 F(The)5.162 E F1 +(body)2.662 E F0 .162(of the function is the compound)2.662 F(command) +144 177.6 Q F1(compound\255command)2.784 E F0(\(see)3.354 E F2 .084 +(Compound Commands)2.584 F F0(abo)2.584 E -.15(ve)-.15 G 2.584(\). That) +.15 F .084(command is usually a)2.584 F F1(list)144 189.6 Q F0 .044 +(of commands between { and }, b)2.544 F .044(ut may be an)-.2 F 2.544 +(yc)-.15 G .044(ommand listed under)-2.544 F F2 .044(Compound Commands) +2.544 F F0(abo)144 201.6 Q -.15(ve)-.15 G(.).15 E F1 +(compound\255command)6.671 E F0 1.671(is e)4.171 F -.15(xe)-.15 G 1.671 +(cuted whene).15 F -.15(ve)-.25 G(r).15 E F1(name)4.171 E F0 1.671 +(is speci\214ed as the name of a simple)4.171 F 3.008(command. An)144 +213.6 R 3.009(yr)-.15 G .509(edirections \(see)-3.009 F/F3 9 +/Times-Bold@0 SF(REDIRECTION)3.009 E F0(belo)2.759 E .509 +(w\) speci\214ed when a function is de\214ned are)-.25 F .581 +(performed when the function is e)144 225.6 R -.15(xe)-.15 G 3.081 +(cuted. The).15 F -.15(ex)3.081 G .58 +(it status of a function de\214nition is zero unless a).15 F .177(synta\ +x error occurs or a readonly function with the same name already e)144 +237.6 R 2.678(xists. When)-.15 F -.15(exe)2.678 G .178(cuted, the).15 F +-.15(ex)144 249.6 S .64(it status of a function is the e).15 F .64 +(xit status of the last command e)-.15 F -.15(xe)-.15 G .64 +(cuted in the body).15 F 5.64(.\()-.65 G(See)-5.64 E F3(FUNC-)3.14 E +(TIONS)144 261.6 Q F0(belo)2.25 E -.65(w.)-.25 G(\)).65 E/F4 10.95 +/Times-Bold@0 SF(COMMENTS)72 278.4 Q F0 .982(In a non-interacti)108 +290.4 R 1.282 -.15(ve s)-.25 H .982(hell, or an interacti).15 F 1.282 +-.15(ve s)-.25 H .982(hell in which the).15 F F2(interacti)3.482 E -.1 +(ve)-.1 G(_comments).1 E F0 .982(option to the)3.482 F F2(shopt)3.482 E +F0 -.2(bu)108 302.4 S .952(iltin is enabled \(see).2 F F3 .952(SHELL B) +3.452 F(UIL)-.09 E .952(TIN COMMANDS)-.828 F F0(belo)3.202 E .952 +(w\), a w)-.25 F .952(ord be)-.1 F .952(ginning with)-.15 F F2(#)3.451 E +F0 .951(causes that w)3.451 F(ord)-.1 E .604 +(and all remaining characters on that line to be ignored.)108 314.4 R +.605(An interacti)5.605 F .905 -.15(ve s)-.25 H .605(hell without the) +.15 F F2(interacti)3.105 E -.1(ve)-.1 G(_com-).1 E(ments)108 326.4 Q F0 +1.337(option enabled does not allo)3.837 F 3.837(wc)-.25 G 3.836 +(omments. The)-3.837 F F2(interacti)3.836 E -.1(ve)-.1 G(_comments).1 E +F0 1.336(option is on by def)3.836 F 1.336(ault in)-.1 F(interacti)108 +338.4 Q .3 -.15(ve s)-.25 H(hells.).15 E F4 -.11(QU)72 355.2 S -.438(OT) +.11 G(ING).438 E F1(Quoting)108 367.2 Q F0 .477(is used to remo)2.977 F +.777 -.15(ve t)-.15 H .477 +(he special meaning of certain characters or w).15 F .477 +(ords to the shell.)-.1 F .478(Quoting can be)5.478 F .185 +(used to disable special treatment for special characters, to pre)108 +379.2 R -.15(ve)-.25 G .185(nt reserv).15 F .184(ed w)-.15 F .184 +(ords from being recognized as)-.1 F(such, and to pre)108 391.2 Q -.15 +(ve)-.25 G(nt parameter e).15 E(xpansion.)-.15 E .288(Each of the)108 +408 R F1(metac)2.788 E(har)-.15 E(acter)-.15 E(s)-.1 E F0 .288 +(listed abo)2.788 F .588 -.15(ve u)-.15 H(nder).15 E F3(DEFINITIONS) +2.788 E F0 .288(has special meaning to the shell and must be)2.538 F +(quoted if it is to represent itself.)108 420 Q 1.345 +(When the command history e)108 436.8 R 1.344(xpansion f)-.15 F 1.344 +(acilities are being used \(see)-.1 F F3(HIST)3.844 E(OR)-.162 E 3.594 +(YE)-.315 G(XP)-3.594 E(ANSION)-.666 E F0(belo)3.594 E 1.344(w\), the) +-.25 F F1(history e)108 448.8 Q(xpansion)-.2 E F0(character)2.5 E 2.5 +(,u)-.4 G(sually)-2.5 E F2(!)2.5 E F0 2.5(,m)C(ust be quoted to pre)-2.5 +E -.15(ve)-.25 G(nt history e).15 E(xpansion.)-.15 E +(There are three quoting mechanisms: the)108 465.6 Q F1(escape c)2.5 E +(har)-.15 E(acter)-.15 E F0 2.5(,s).73 G +(ingle quotes, and double quotes.)-2.5 E 2.974(An)108 482.4 S .474 +(on-quoted backslash \()-2.974 F F2(\\)A F0 2.974(\)i)C 2.974(st)-2.974 +G(he)-2.974 E F1 .474(escape c)2.974 F(har)-.15 E(acter)-.15 E F0 5.474 +(.I).73 G 2.974(tp)-5.474 G(reserv)-2.974 E .474(es the literal v)-.15 F +.474(alue of the ne)-.25 F .475(xt character that)-.15 F(follo)108 494.4 +Q 1.554(ws, with the e)-.25 F 1.553(xception of <ne)-.15 F 4.053 +(wline>. If)-.25 F(a)4.053 E F2(\\)4.053 E F0(<ne)A 1.553 +(wline> pair appears, and the backslash is not itself)-.25 F 1.122 +(quoted, the)108 506.4 R F2(\\)3.622 E F0(<ne)A 1.122 +(wline> is treated as a line continuation \(that is, it is remo)-.25 F +-.15(ve)-.15 G 3.622(df).15 G 1.123(rom the input stream and)-3.622 F +(ef)108 518.4 Q(fecti)-.25 E -.15(ve)-.25 G(ly ignored\).).15 E .295 +(Enclosing characters in single quotes preserv)108 535.2 R .295 +(es the literal v)-.15 F .295(alue of each character within the quotes.) +-.25 F 2.795(As)5.295 G(in-)-2.795 E +(gle quote may not occur between single quotes, e)108 547.2 Q -.15(ve) +-.25 G 2.5(nw).15 G(hen preceded by a backslash.)-2.5 E .033 +(Enclosing characters in double quotes preserv)108 564 R .034 +(es the literal v)-.15 F .034 +(alue of all characters within the quotes, with the)-.25 F -.15(ex)108 +576 S .828(ception of).15 F F2($)3.328 E F0(,)A F2<92>3.328 E F0(,)A F2 +(\\)3.328 E F0 3.328(,a)C .828(nd, when history e)-3.328 F .828 +(xpansion is enabled,)-.15 F F2(!)3.328 E F0 5.828(.T)C .828 +(he characters)-5.828 F F2($)3.328 E F0(and)3.328 E F2<92>3.328 E F0 +.827(retain their special)3.328 F .074(meaning within double quotes.)108 +588 R .074(The backslash retains its special meaning only when follo) +5.074 F .075(wed by one of the)-.25 F(follo)108 600 Q .205 +(wing characters:)-.25 F F2($)2.705 E F0(,)A F2<92>2.705 E F0(,)A F2(") +3.538 E F0(,).833 E F2(\\)2.705 E F0 2.705(,o)C(r)-2.705 E F2(<newline>) +2.705 E F0 5.205(.A)C .204 +(double quote may be quoted within double quotes by pre-)-2.5 F .081 +(ceding it with a backslash.)108 612 R .082(If enabled, history e)5.082 +F .082(xpansion will be performed unless an)-.15 F F2(!)2.582 E F0 .082 +(appearing in double)5.082 F(quotes is escaped using a backslash.)108 +624 Q(The backslash preceding the)5 E F2(!)2.5 E F0(is not remo)5 E -.15 +(ve)-.15 G(d.).15 E(The special parameters)108 640.8 Q F2(*)2.5 E F0 +(and)2.5 E F2(@)2.5 E F0(ha)2.5 E .3 -.15(ve s)-.2 H +(pecial meaning when in double quotes \(see).15 E F3 -.666(PA)2.5 G +(RAMETERS).666 E F0(belo)2.25 E(w\).)-.25 E -.8(Wo)108 657.6 S .212 +(rds of the form).8 F F2($)2.712 E F0<08>A F1(string)A F0 2.712<0861>C +.211(re treated specially)-2.712 F 5.211(.T)-.65 G .211(he w)-5.211 F +.211(ord e)-.1 F .211(xpands to)-.15 F F1(string)2.711 E F0 2.711(,w)C +.211(ith backslash-escaped char)-2.711 F(-)-.2 E .604 +(acters replaced as speci\214ed by the ANSI C standard.)108 669.6 R .605 +(Backslash escape sequences, if present, are decoded)5.605 F(as follo) +108 681.6 Q(ws:)-.25 E F2(\\a)144 693.6 Q F0(alert \(bell\))28.22 E F2 +(\\b)144 705.6 Q F0(backspace)27.66 E F2(\\e)144 717.6 Q F0 +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(7)190.955 E 0 Cg EP +%%Page: 8 8 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(\\E)144 84 Q F0(an escape character)26.55 E +F1(\\f)144 96 Q F0(form feed)29.89 E F1(\\n)144 108 Q F0(ne)27.66 E 2.5 +(wl)-.25 G(ine)-2.5 E F1(\\r)144 120 Q F0(carriage return)28.78 E F1 +(\\t)144 132 Q F0(horizontal tab)29.89 E F1(\\v)144 144 Q F0 -.15(ve) +28.22 G(rtical tab).15 E F1(\\\\)144 156 Q F0(backslash)30.44 E F1<5c08> +144 168 Q F0(single quote)30.44 E F1(\\")144 180 Q F0(double quote)27.67 +E F1(\\)144 192 Q/F2 10/Times-Italic@0 SF(nnn)A F0 +(the eight-bit character whose v)18.22 E(alue is the octal v)-.25 E +(alue)-.25 E F2(nnn)2.5 E F0(\(one to three digits\))2.5 E F1(\\x)144 +204 Q F2(HH)A F0(the eight-bit character whose v)13.78 E(alue is the he) +-.25 E(xadecimal v)-.15 E(alue)-.25 E F2(HH)2.5 E F0(\(one or tw)2.5 E +2.5(oh)-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E F1(\\c)144 216 Q F2(x)A +F0 2.5(ac)24.34 G(ontrol-)-2.5 E F2(x)A F0(character)2.5 E(The e)108 +232.8 Q(xpanded result is single-quoted, as if the dollar sign had not \ +been present.)-.15 E 2.64(Ad)108 249.6 S .14 +(ouble-quoted string preceded by a dollar sign \()-2.64 F F1($)A F0(")A +F2(string)A F0 .14("\) will cause the string to be translated according) +B .495(to the current locale.)108 261.6 R .495(If the current locale is) +5.495 F F1(C)2.995 E F0(or)2.995 E F1(POSIX)2.995 E F0 2.995(,t)C .495 +(he dollar sign is ignored.)-2.995 F .496(If the string is trans-)5.496 +F(lated and replaced, the replacement is double-quoted.)108 273.6 Q/F3 +10.95/Times-Bold@0 SF -.81(PA)72 290.4 S(RAMETERS).81 E F0(A)108 302.4 Q +F2(par)4.593 E(ameter)-.15 E F0 .843(is an entity that stores v)4.073 F +3.343(alues. It)-.25 F .843(can be a)3.343 F F2(name)3.342 E F0 3.342 +(,an).18 G(umber)-3.342 E 3.342(,o)-.4 G 3.342(ro)-3.342 G .842 +(ne of the special characters)-3.342 F .822(listed belo)108 314.4 R +3.323(wu)-.25 G(nder)-3.323 E F1 .823(Special P)3.323 F(arameters)-.1 E +F0 5.823(.A)C F2(variable)-2.21 E F0 .823(is a parameter denoted by a) +3.503 F F2(name)3.323 E F0 5.823(.A).18 G -.25(va)-2.5 G .823 +(riable has a).25 F F2(value)108 326.4 Q F0 .369(and zero or more)2.869 +F F2(attrib)2.869 E(utes)-.2 E F0 5.369(.A)C(ttrib)-5.369 E .369 +(utes are assigned using the)-.2 F F1(declar)2.868 E(e)-.18 E F0 -.2(bu) +2.868 G .368(iltin command \(see).2 F F1(declar)2.868 E(e)-.18 E F0 +(belo)108 338.4 Q 2.5(wi)-.25 G(n)-2.5 E/F4 9/Times-Bold@0 SF(SHELL B) +2.5 E(UIL)-.09 E(TIN COMMANDS)-.828 E/F5 9/Times-Roman@0 SF(\).)A F0 +2.754(Ap)108 355.2 S .254(arameter is set if it has been assigned a v) +-2.754 F 2.754(alue. The)-.25 F .254(null string is a v)2.754 F .255 +(alid v)-.25 F 2.755(alue. Once)-.25 F 2.755(av)2.755 G .255 +(ariable is set, it)-3.005 F(may be unset only by using the)108 367.2 Q +F1(unset)2.5 E F0 -.2(bu)2.5 G(iltin command \(see).2 E F4(SHELL B)2.5 E +(UIL)-.09 E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 E(A)108 384 Q +F2(variable)2.79 E F0(may be assigned to by a statement of the form)2.68 +E F2(name)144 400.8 Q F0(=[)A F2(value)A F0(])A(If)108 417.6 Q F2(value) +3.023 E F0 .233(is not gi)2.913 F -.15(ve)-.25 G .233(n, the v).15 F +.232(ariable is assigned the null string.)-.25 F(All)5.232 E F2(values) +3.022 E F0(under)3.002 E .232(go tilde e)-.18 F .232 +(xpansion, parameter)-.15 F .515(and v)108 429.6 R .515(ariable e)-.25 F +.515(xpansion, command substitution, arithmetic e)-.15 F .515 +(xpansion, and quote remo)-.15 F -.25(va)-.15 G 3.015(l\().25 G(see) +-3.015 E F4(EXP)3.015 E(ANSION)-.666 E F0(belo)108 441.6 Q 2.699 +(w\). If)-.25 F .199(the v)2.699 F .199(ariable has its)-.25 F F1 +(integer)2.698 E F0(attrib)2.698 E .198(ute set, then)-.2 F F2(value) +2.988 E F0 .198(is e)2.878 F -.25(va)-.25 G .198 +(luated as an arithmetic e).25 F .198(xpression e)-.15 F -.15(ve)-.25 G +(n).15 E .901(if the $\(\(...\)\) e)108 453.6 R .901 +(xpansion is not used \(see)-.15 F F1 .901(Arithmetic Expansion)3.401 F +F0(belo)3.401 E 3.402(w\). W)-.25 F .902 +(ord splitting is not performed,)-.8 F 1.179(with the e)108 465.6 R +1.179(xception of)-.15 F F1("$@")3.679 E F0 1.179(as e)3.679 F 1.179 +(xplained belo)-.15 F 3.679(wu)-.25 G(nder)-3.679 E F1 1.178(Special P) +3.678 F(arameters)-.1 E F0 6.178(.P)C 1.178(athname e)-6.328 F 1.178 +(xpansion is not)-.15 F 3.648(performed. Assignment)108 477.6 R 1.148 +(statements may also appear as ar)3.648 F 1.149(guments to the)-.18 F F1 +(alias)3.649 E F0(,)A F1(declar)3.649 E(e)-.18 E F0(,)A F1(typeset)3.649 +E F0(,)A F1(export)3.649 E F0(,)A F1 -.18(re)108 489.6 S(adonly).18 E F0 +2.5(,a)C(nd)-2.5 E F1(local)2.5 E F0 -.2(bu)2.5 G(iltin commands.).2 E +.377(In the conte)108 506.4 R .377 +(xt where an assignment statement is assigning a v)-.15 F .376 +(alue to a shell v)-.25 F .376(ariable or array inde)-.25 F .376 +(x, the +=)-.15 F .257 +(operator can be used to append to or add to the v)108 518.4 R(ariable') +-.25 E 2.757(sp)-.55 G(re)-2.757 E .257(vious v)-.25 F 2.757(alue. When) +-.25 F .257(+= is applied to a v)2.757 F(ariable)-.25 E .373 +(for which the inte)108 530.4 R .373(ger attrib)-.15 F .372 +(ute has been set,)-.2 F F2(value)2.872 E F0 .372(is e)2.872 F -.25(va) +-.25 G .372(luated as an arithmetic e).25 F .372 +(xpression and added to the)-.15 F -.25(va)108 542.4 S(riable').25 E +2.888(sc)-.55 G .388(urrent v)-2.888 F .388(alue, which is also e)-.25 F +-.25(va)-.25 G 2.889(luated. When).25 F .389 +(+= is applied to an array v)2.889 F .389(ariable using compound)-.25 F +.186(assignment \(see)108 554.4 R F1(Arrays)2.686 E F0(belo)2.686 E .186 +(w\), the v)-.25 F(ariable')-.25 E 2.685(sv)-.55 G .185 +(alue is not unset \(as it is when using =\), and ne)-2.935 F 2.685(wv) +-.25 G .185(alues are)-2.935 F 1.384(appended to the array be)108 566.4 +R 1.384(ginning at one greater than the array')-.15 F 3.885(sm)-.55 G +1.385(aximum inde)-3.885 F 3.885(x\()-.15 G 1.385(for inde)-3.885 F -.15 +(xe)-.15 G 3.885(da).15 G 1.385(rrays\) or)-3.885 F .123 +(added as additional k)108 578.4 R -.15(ey)-.1 G<ad76>.15 E .123 +(alue pairs in an associati)-.25 F .423 -.15(ve a)-.25 H(rray).15 E +5.123(.W)-.65 G .122(hen applied to a string-v)-5.123 F .122(alued v) +-.25 F(ariable,)-.25 E F2(value)2.622 E F0(is e)108 590.4 Q +(xpanded and appended to the v)-.15 E(ariable')-.25 E 2.5(sv)-.55 G +(alue.)-2.75 E F1 -.2(Po)87 607.2 S(sitional P).2 E(arameters)-.1 E F0 +(A)108 619.2 Q F2 .705(positional par)4.455 F(ameter)-.15 E F0 .706(is \ +a parameter denoted by one or more digits, other than the single digit \ +0.)3.935 F(Posi-)5.706 E .445 +(tional parameters are assigned from the shell')108 631.2 R 2.944(sa) +-.55 G -.18(rg)-2.944 G .444(uments when it is in).18 F -.2(vo)-.4 G -.1 +(ke).2 G .444(d, and may be reassigned using).1 F(the)108 643.2 Q F1 +(set)3.333 E F0 -.2(bu)3.333 G .833(iltin command.).2 F .834(Positional\ + parameters may not be assigned to with assignment statements.)5.833 F +(The)5.834 E .334(positional parameters are temporarily replaced when a\ + shell function is e)108 655.2 R -.15(xe)-.15 G .333(cuted \(see).15 F +F4(FUNCTIONS)2.833 E F0(belo)2.583 E(w\).)-.25 E 1.403(When a positiona\ +l parameter consisting of more than a single digit is e)108 672 R 1.404 +(xpanded, it must be enclosed in)-.15 F(braces \(see)108 684 Q F4(EXP) +2.5 E(ANSION)-.666 E F0(belo)2.25 E(w\).)-.25 E F1(Special P)87 700.8 Q +(arameters)-.1 E F0 1.675(The shell treats se)108 712.8 R -.15(ve)-.25 G +1.675(ral parameters specially).15 F 6.675(.T)-.65 G 1.674 +(hese parameters may only be referenced; assignment to)-6.675 F +(them is not allo)108 724.8 Q(wed.)-.25 E(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(8)190.955 E 0 Cg EP +%%Page: 9 9 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(*)108 84 Q F0 .605 +(Expands to the positional parameters, starting from one.)31 F .606 +(When the e)5.605 F .606(xpansion occurs within dou-)-.15 F .084 +(ble quotes, it e)144 96 R .084(xpands to a single w)-.15 F .084 +(ord with the v)-.1 F .084 +(alue of each parameter separated by the \214rst char)-.25 F(-)-.2 E +.003(acter of the)144 108 R/F2 9/Times-Bold@0 SF(IFS)2.503 E F0 .003 +(special v)2.253 F 2.503(ariable. That)-.25 F .003(is, ")2.503 F F1($*)A +F0 2.503("i)C 2.503(se)-2.503 G(qui)-2.503 E -.25(va)-.25 G .003 +(lent to ").25 F F1($1)A/F3 10/Times-Italic@0 SF(c)A F1($2)A F3(c)A F1 +(...)A F0 .003(", where)B F3(c)2.703 E F0 .004(is the \214rst char)2.813 +F(-)-.2 E .769(acter of the v)144 120 R .769(alue of the)-.25 F F2(IFS) +3.269 E F0 -.25(va)3.019 G 3.269(riable. If).25 F F2(IFS)3.268 E F0 .768 +(is unset, the parameters are separated by spaces.)3.018 F(If)5.768 E F2 +(IFS)144 132 Q F0(is null, the parameters are joined without interv)2.25 +E(ening separators.)-.15 E F1(@)108 144 Q F0 .605 +(Expands to the positional parameters, starting from one.)26.7 F .606 +(When the e)5.605 F .606(xpansion occurs within dou-)-.15 F .114 +(ble quotes, each parameter e)144 156 R .114(xpands to a separate w)-.15 +F 2.614(ord. That)-.1 F .113(is, ")2.613 F F1($@)A F0 2.613("i)C 2.613 +(se)-2.613 G(qui)-2.613 E -.25(va)-.25 G .113(lent to ").25 F F1($1)A F0 +2.613("")C F1($2)-2.613 E F0 2.613(".)C(..)-2.613 E .134 +(If the double-quoted e)144 168 R .134(xpansion occurs within a w)-.15 F +.135(ord, the e)-.1 F .135(xpansion of the \214rst parameter is joined) +-.15 F .151(with the be)144 180 R .151(ginning part of the original w) +-.15 F .151(ord, and the e)-.1 F .15 +(xpansion of the last parameter is joined with)-.15 F .337 +(the last part of the original w)144 192 R 2.837(ord. When)-.1 F .338 +(there are no positional parameters, ")2.837 F F1($@)A F0 2.838("a)C(nd) +-2.838 E F1($@)2.838 E F0 -.15(ex)2.838 G(pand).15 E +(to nothing \(i.e., the)144 204 Q 2.5(ya)-.15 G(re remo)-2.5 E -.15(ve) +-.15 G(d\).).15 E F1(#)108 216 Q F0 +(Expands to the number of positional parameters in decimal.)31 E F1(?) +108 228 Q F0(Expands to the e)31 E(xit status of the most recently e) +-.15 E -.15(xe)-.15 G(cuted fore).15 E(ground pipeline.)-.15 E F1<ad>108 +240 Q F0 .882 +(Expands to the current option \215ags as speci\214ed upon in)30.3 F -.2 +(vo)-.4 G .881(cation, by the).2 F F1(set)3.381 E F0 -.2(bu)3.381 G .881 +(iltin command, or).2 F(those set by the shell itself \(such as the)144 +252 Q F1<ad69>2.5 E F0(option\).)2.5 E F1($)108 264 Q F0 .214 +(Expands to the process ID of the shell.)31 F .214 +(In a \(\) subshell, it e)5.214 F .214 +(xpands to the process ID of the current)-.15 F +(shell, not the subshell.)144 276 Q F1(!)108 288 Q F0 +(Expands to the process ID of the most recently e)32.67 E -.15(xe)-.15 G +(cuted background \(asynchronous\) command.).15 E F1(0)108 300 Q F0 +1.692(Expands to the name of the shell or shell script.)31 F 1.691 +(This is set at shell initialization.)6.692 F(If)6.691 E F1(bash)4.191 E +F0(is)4.191 E(in)144 312 Q -.2(vo)-.4 G -.1(ke).2 G 3.077(dw).1 G .577 +(ith a \214le of commands,)-3.077 F F1($0)3.077 E F0 .578 +(is set to the name of that \214le.)3.077 F(If)5.578 E F1(bash)3.078 E +F0 .578(is started with the)3.078 F F1<ad63>3.078 E F0 .369 +(option, then)144 324 R F1($0)2.869 E F0 .369(is set to the \214rst ar) +2.869 F .369(gument after the string to be e)-.18 F -.15(xe)-.15 G .369 +(cuted, if one is present.).15 F(Other)5.368 E(-)-.2 E +(wise, it is set to the \214le name used to in)144 336 Q -.2(vo)-.4 G +-.1(ke).2 G F1(bash)2.6 E F0 2.5(,a)C 2.5(sg)-2.5 G -2.15 -.25(iv e)-2.5 +H 2.5(nb).25 G 2.5(ya)-2.5 G -.18(rg)-2.5 G(ument zero.).18 E F1(_)108 +348 Q F0 .054(At shell startup, set to the absolute pathname used to in) +31 F -.2(vo)-.4 G .255 -.1(ke t).2 H .055 +(he shell or shell script being e).1 F -.15(xe)-.15 G(cuted).15 E .692 +(as passed in the en)144 360 R .692(vironment or ar)-.4 F .691 +(gument list.)-.18 F(Subsequently)5.691 E 3.191(,e)-.65 G .691 +(xpands to the last ar)-3.341 F .691(gument to the)-.18 F(pre)144 372 Q +.57(vious command, after e)-.25 F 3.07(xpansion. Also)-.15 F .571 +(set to the full pathname used to in)3.071 F -.2(vo)-.4 G .771 -.1(ke e) +.2 H .571(ach command).1 F -.15(exe)144 384 S 1.6 +(cuted and placed in the en).15 F 1.6(vironment e)-.4 F 1.6 +(xported to that command.)-.15 F 1.6(When checking mail, this)6.6 F +(parameter holds the name of the mail \214le currently being check)144 +396 Q(ed.)-.1 E F1(Shell V)87 412.8 Q(ariables)-.92 E F0(The follo)108 +424.8 Q(wing v)-.25 E(ariables are set by the shell:)-.25 E F1 -.3(BA) +108 441.6 S(SH).3 E F0(Expands to the full \214le name used to in)9.07 E +-.2(vo)-.4 G .2 -.1(ke t).2 H(his instance of).1 E F1(bash)2.5 E F0(.)A +F1 -.3(BA)108 453.6 S(SHOPTS).3 E F0 2.548(Ac)144 465.6 S .049 +(olon-separated list of enabled shell options.)-2.548 F .049(Each w) +5.049 F .049(ord in the list is a v)-.1 F .049(alid ar)-.25 F .049 +(gument for the)-.18 F F1<ad73>2.549 E F0 1.398(option to the)144 477.6 +R F1(shopt)3.898 E F0 -.2(bu)3.898 G 1.398(iltin command \(see).2 F F2 +1.398(SHELL B)3.898 F(UIL)-.09 E 1.398(TIN COMMANDS)-.828 F F0(belo) +3.648 E 3.898(w\). The)-.25 F(options)3.898 E .476(appearing in)144 +489.6 R F2 -.27(BA)2.976 G(SHOPTS).27 E F0 .476(are those reported as) +2.726 F F3(on)3.206 E F0(by)3.217 E F1(shopt)2.977 E F0 5.477(.I)C 2.977 +(ft)-5.477 G .477(his v)-2.977 F .477(ariable is in the en)-.25 F +(vironment)-.4 E(when)144 501.6 Q F1(bash)3.142 E F0 .642(starts up, ea\ +ch shell option in the list will be enabled before reading an)3.142 F +3.141(ys)-.15 G .641(tartup \214les.)-3.141 F(This v)144 513.6 Q +(ariable is read-only)-.25 E(.)-.65 E F1 -.3(BA)108 525.6 S(SHPID).3 E +F0 .36(Expands to the process id of the current)144 537.6 R F1(bash) +2.861 E F0 2.861(process. This)2.861 F(dif)2.861 E .361(fers from)-.25 F +F1($$)2.861 E F0 .361(under certain circum-)2.861 F +(stances, such as subshells that do not require)144 549.6 Q F1(bash)2.5 +E F0(to be re-initialized.)2.5 E F1 -.3(BA)108 561.6 S(SH_ALIASES).3 E +F0 1.195(An associati)144 573.6 R 1.495 -.15(ve a)-.25 H 1.195(rray v) +.15 F 1.195(ariable whose members correspond to the internal list of al\ +iases as main-)-.25 F .318(tained by the)144 585.6 R F1(alias)2.818 E F0 +-.2(bu)2.818 G .318(iltin Elements added to this array appear in the al\ +ias list; unsetting array ele-).2 F(ments cause aliases to be remo)144 +597.6 Q -.15(ve)-.15 G 2.5(df).15 G(rom the alias list.)-2.5 E F1 -.3 +(BA)108 609.6 S(SH_ARGC).3 E F0 .935(An array v)144 621.6 R .935 +(ariable whose v)-.25 F .934 +(alues are the number of parameters in each frame of the current)-.25 F +F1(bash)3.434 E F0 -.15(exe)144 633.6 S .535(cution call stack.).15 F +.535(The number of parameters to the current subroutine \(shell functio\ +n or script)5.535 F -.15(exe)144 645.6 S .142(cuted with).15 F F1(.) +2.642 E F0(or)2.642 E F1(sour)2.642 E(ce)-.18 E F0 2.642(\)i)C 2.642(sa) +-2.642 G 2.642(tt)-2.642 G .142(he top of the stack.)-2.642 F .141 +(When a subroutine is e)5.141 F -.15(xe)-.15 G .141 +(cuted, the number of).15 F 2.63(parameters passed is pushed onto)144 +657.6 R F2 -.27(BA)5.13 G(SH_ARGC).27 E/F4 9/Times-Roman@0 SF(.)A F0 +2.63(The shell sets)7.13 F F2 -.27(BA)5.131 G(SH_ARGC).27 E F0 2.631 +(only when in)4.881 F -.15(ex)144 669.6 S(tended deb).15 E +(ugging mode \(see the description of the)-.2 E F1(extdeb)2.5 E(ug)-.2 E +F0(option to the)2.5 E F1(shopt)2.5 E F0 -.2(bu)2.5 G(iltin belo).2 E +(w\))-.25 E F1 -.3(BA)108 681.6 S(SH_ARGV).3 E F0 .98(An array v)144 +693.6 R .979(ariable containing all of the parameters in the current) +-.25 F F1(bash)3.479 E F0 -.15(exe)3.479 G .979(cution call stack.).15 F +(The)5.979 E .275(\214nal parameter of the last subroutine call is at t\ +he top of the stack; the \214rst parameter of the initial)144 705.6 R +1.424(call is at the bottom.)144 717.6 R 1.424(When a subroutine is e) +6.424 F -.15(xe)-.15 G 1.424 +(cuted, the parameters supplied are pushed onto).15 F F2 -.27(BA)144 +729.6 S(SH_ARGV).27 E F4(.)A F0 2.197(The shell sets)6.697 F F2 -.27(BA) +4.697 G(SH_ARGV).27 E F0 2.197(only when in e)4.447 F 2.197(xtended deb) +-.15 F 2.197(ugging mode \(see the)-.2 F(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(9)190.955 E 0 Cg EP +%%Page: 10 10 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(description of the)144 84 Q/F1 10/Times-Bold@0 SF(extdeb)2.5 E +(ug)-.2 E F0(option to the)2.5 E F1(shopt)2.5 E F0 -.2(bu)2.5 G +(iltin belo).2 E(w\))-.25 E F1 -.3(BA)108 96 S(SH_CMDS).3 E F0 .668 +(An associati)144 108 R .968 -.15(ve a)-.25 H .668(rray v).15 F .668(ar\ +iable whose members correspond to the internal hash table of commands) +-.25 F .146(as maintained by the)144 120 R F1(hash)2.646 E F0 -.2(bu) +2.646 G 2.646(iltin. Elements).2 F .146 +(added to this array appear in the hash table; unsetting)2.646 F +(array elements cause commands to be remo)144 132 Q -.15(ve)-.15 G 2.5 +(df).15 G(rom the hash table.)-2.5 E F1 -.3(BA)108 144 S(SH_COMMAND).3 E +F0 1.243(The command currently being e)144 156 R -.15(xe)-.15 G 1.243 +(cuted or about to be e).15 F -.15(xe)-.15 G 1.242 +(cuted, unless the shell is e).15 F -.15(xe)-.15 G 1.242(cuting a).15 F +(command as the result of a trap, in which case it is the command e)144 +168 Q -.15(xe)-.15 G(cuting at the time of the trap.).15 E F1 -.3(BA)108 +180 S(SH_EXECUTION_STRING).3 E F0(The command ar)144 192 Q +(gument to the)-.18 E F1<ad63>2.5 E F0(in)2.5 E -.2(vo)-.4 G +(cation option.).2 E F1 -.3(BA)108 204 S(SH_LINENO).3 E F0 .034 +(An array v)144 216 R .034(ariable whose members are the line numbers i\ +n source \214les corresponding to each mem-)-.25 F 3.491(ber of)144 228 +R/F2 9/Times-Bold@0 SF(FUNCN)5.991 E(AME)-.18 E/F3 9/Times-Roman@0 SF(.) +A F1(${B)7.991 E(ASH_LINENO[)-.3 E/F4 10/Times-Italic@0 SF($i)A F1(]})A +F0 3.491(is the line number in the source \214le where)5.991 F F1 +(${FUNCN)144 240 Q(AME[)-.2 E F4($i)A F1(]})A F0 -.1(wa)3.311 G 3.311 +(sc).1 G .811(alled \(or)-3.311 F F1(${B)3.311 E(ASH_LINENO[)-.3 E F4 +($i-1)A F1(]})A F0 .811(if referenced within another shell)3.311 F 4.987 +(function\). The)144 252 R 2.487(corresponding source \214le name is) +4.987 F F1(${B)4.986 E(ASH_SOURCE[)-.3 E F4($i)A F1(]})A F0 7.486(.U)C +(se)-7.486 E F2(LINENO)4.986 E F0(to)4.736 E +(obtain the current line number)144 264 Q(.)-.55 E F1 -.3(BA)108 276 S +(SH_REMA).3 E(TCH)-.95 E F0 .005(An array v)144 288 R .005 +(ariable whose members are assigned by the)-.25 F F1(=~)2.506 E F0 .006 +(binary operator to the)2.506 F F1([[)2.506 E F0 .006(conditional com-) +2.506 F 2.507(mand. The)144 300 R .007(element with inde)2.507 F 2.507 +(x0i)-.15 G 2.507(st)-2.507 G .007 +(he portion of the string matching the entire re)-2.507 F .006(gular e) +-.15 F(xpression.)-.15 E .997(The element with inde)144 312 R(x)-.15 E +F4(n)3.497 E F0 .997(is the portion of the string matching the)3.497 F +F4(n)3.498 E F0 .998(th parenthesized sube)B(xpres-)-.15 E 2.5 +(sion. This)144 324 R -.25(va)2.5 G(riable is read-only).25 E(.)-.65 E +F1 -.3(BA)108 336 S(SH_SOURCE).3 E F0 .89(An array v)144 348 R .889(ari\ +able whose members are the source \214lenames corresponding to the elem\ +ents in the)-.25 F F2(FUNCN)144 360 Q(AME)-.18 E F0(array v)2.25 E +(ariable.)-.25 E F1 -.3(BA)108 372 S(SH_SUBSHELL).3 E F0 .401 +(Incremented by one each time a subshell or subshell en)144 384 R .401 +(vironment is spa)-.4 F 2.902(wned. The)-.15 F .402(initial v)2.902 F +.402(alue is)-.25 F(0.)144 396 Q F1 -.3(BA)108 408 S(SH_VERSINFO).3 E F0 +2.645(Ar)144 420 S .145(eadonly array v)-2.645 F .144 +(ariable whose members hold v)-.25 F .144 +(ersion information for this instance of)-.15 F F1(bash)2.644 E F0 5.144 +(.T)C(he)-5.144 E -.25(va)144 432 S +(lues assigned to the array members are as follo).25 E(ws:)-.25 E F1 -.3 +(BA)144 450 S(SH_VERSINFO[).3 E F0(0)A F1(])A F0(The major v)24.74 E +(ersion number \(the)-.15 E F4 -.37(re)2.5 G(lease).37 E F0(\).)A F1 -.3 +(BA)144 462 S(SH_VERSINFO[).3 E F0(1)A F1(])A F0(The minor v)24.74 E +(ersion number \(the)-.15 E F4(ver)2.5 E(sion)-.1 E F0(\).)A F1 -.3(BA) +144 474 S(SH_VERSINFO[).3 E F0(2)A F1(])A F0(The patch le)24.74 E -.15 +(ve)-.25 G(l.).15 E F1 -.3(BA)144 486 S(SH_VERSINFO[).3 E F0(3)A F1(])A +F0(The b)24.74 E(uild v)-.2 E(ersion.)-.15 E F1 -.3(BA)144 498 S +(SH_VERSINFO[).3 E F0(4)A F1(])A F0(The release status \(e.g.,)24.74 E +F4(beta1)2.5 E F0(\).)A F1 -.3(BA)144 510 S(SH_VERSINFO[).3 E F0(5)A F1 +(])A F0(The v)24.74 E(alue of)-.25 E F2(MA)2.5 E(CHTYPE)-.495 E F3(.)A +F1 -.3(BA)108 526.8 S(SH_VERSION).3 E F0 +(Expands to a string describing the v)144 538.8 Q +(ersion of this instance of)-.15 E F1(bash)2.5 E F0(.)A F1(COMP_CW)108 +555.6 Q(ORD)-.1 E F0 .396(An inde)144 567.6 R 2.896(xi)-.15 G(nto)-2.896 +E F1(${COMP_W)2.896 E(ORDS})-.1 E F0 .396(of the w)2.896 F .396 +(ord containing the current cursor position.)-.1 F .397(This v)5.397 F +(ari-)-.25 E 1.181(able is a)144 579.6 R -.25(va)-.2 G 1.181 +(ilable only in shell functions in).25 F -.2(vo)-.4 G -.1(ke).2 G 3.681 +(db).1 G 3.681(yt)-3.681 G 1.18(he programmable completion f)-3.681 F +1.18(acilities \(see)-.1 F F1(Pr)144 591.6 Q(ogrammable Completion)-.18 +E F0(belo)2.5 E(w\).)-.25 E F1(COMP_KEY)108 608.4 Q F0(The k)144 620.4 Q +.3 -.15(ey \()-.1 H(or \214nal k).15 E .3 -.15(ey o)-.1 H 2.5(fak).15 G +.3 -.15(ey s)-2.6 H(equence\) used to in).15 E -.2(vo)-.4 G .2 -.1(ke t) +.2 H(he current completion function.).1 E F1(COMP_LINE)108 637.2 Q F0 +1.207(The current command line.)144 649.2 R 1.208(This v)6.208 F 1.208 +(ariable is a)-.25 F -.25(va)-.2 G 1.208 +(ilable only in shell functions and e).25 F 1.208(xternal com-)-.15 F +2.849(mands in)144 661.2 R -.2(vo)-.4 G -.1(ke).2 G 5.349(db).1 G 5.349 +(yt)-5.349 G 2.849(he programmable completion f)-5.349 F 2.849 +(acilities \(see)-.1 F F1(Pr)5.349 E 2.848(ogrammable Completion)-.18 F +F0(belo)144 673.2 Q(w\).)-.25 E F1(COMP_POINT)108 690 Q F0 .666 +(The inde)144 702 R 3.166(xo)-.15 G 3.166(ft)-3.166 G .666 +(he current cursor position relati)-3.166 F .966 -.15(ve t)-.25 H 3.166 +(ot).15 G .666(he be)-3.166 F .666(ginning of the current command.)-.15 +F .667(If the)5.667 F .535 +(current cursor position is at the end of the current command, the v)144 +714 R .534(alue of this v)-.25 F .534(ariable is equal to)-.25 F F1 +(${#COMP_LINE})144 726 Q F0 7.005(.T)C 2.005(his v)-7.005 F 2.005 +(ariable is a)-.25 F -.25(va)-.2 G 2.006 +(ilable only in shell functions and e).25 F 2.006(xternal commands)-.15 +F(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(10)185.955 E 0 Cg EP +%%Page: 11 11 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(in)144 84 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(db).1 G 2.5(yt)-2.5 G +(he programmable completion f)-2.5 E(acilities \(see)-.1 E/F1 10 +/Times-Bold@0 SF(Pr)2.5 E(ogrammable Completion)-.18 E F0(belo)2.5 E +(w\).)-.25 E F1(COMP_TYPE)108 100.8 Q F0 .042(Set to an inte)144 112.8 R +.042(ger v)-.15 F .041(alue corresponding to the type of completion att\ +empted that caused a completion)-.25 F .337(function to be called:)144 +124.8 R/F2 10/Times-Italic@0 SF -.5(TA)2.837 G(B).5 E F0 2.837(,f)C .337 +(or normal completion,)-2.837 F F2(?)2.837 E F0 2.837(,f)C .337 +(or listing completions after successi)-2.837 F .638 -.15(ve t)-.25 H +(abs,).15 E F2(!)144 136.8 Q F0 4.092(,f)C 1.592(or listing alternati) +-4.092 F -.15(ve)-.25 G 4.092(so).15 G 4.092(np)-4.092 G 1.592(artial w) +-4.092 F 1.592(ord completion,)-.1 F F2(@)4.092 E F0 4.092(,t)C 4.092 +(ol)-4.092 G 1.592(ist completions if the w)-4.092 F 1.591(ord is not) +-.1 F 1.552(unmodi\214ed, or)144 148.8 R F2(%)4.052 E F0 4.052(,f)C +1.552(or menu completion.)-4.052 F 1.552(This v)6.552 F 1.552 +(ariable is a)-.25 F -.25(va)-.2 G 1.552 +(ilable only in shell functions and).25 F -.15(ex)144 160.8 S 2.929 +(ternal commands in).15 F -.2(vo)-.4 G -.1(ke).2 G 5.429(db).1 G 5.429 +(yt)-5.429 G 2.929(he programmable completion f)-5.429 F 2.929 +(acilities \(see)-.1 F F1(Pr)5.428 E(ogrammable)-.18 E(Completion)144 +172.8 Q F0(belo)2.5 E(w\).)-.25 E F1(COMP_W)108 189.6 Q(ORDBREAKS)-.1 E +F0 1.335(The set of characters that the)144 201.6 R F1 -.18(re)3.836 G +(adline).18 E F0 1.336(library treats as w)3.836 F 1.336 +(ord separators when performing w)-.1 F(ord)-.1 E 3.126(completion. If) +144 213.6 R/F3 9/Times-Bold@0 SF(COMP_W)3.126 E(ORDBREAKS)-.09 E F0 .626 +(is unset, it loses its special properties, e)2.876 F -.15(ve)-.25 G +3.125(ni).15 G 3.125(fi)-3.125 G 3.125(ti)-3.125 G 3.125(ss)-3.125 G +(ubse-)-3.125 E(quently reset.)144 225.6 Q F1(COMP_W)108 242.4 Q(ORDS) +-.1 E F0 .653(An array v)144 254.4 R .653(ariable \(see)-.25 F F1 +(Arrays)3.153 E F0(belo)3.153 E .654(w\) consisting of the indi)-.25 F +.654(vidual w)-.25 F .654(ords in the current command)-.1 F 4.333 +(line. The)144 266.4 R 1.832(line is split into w)4.332 F 1.832(ords as) +-.1 F F1 -.18(re)4.332 G(adline).18 E F0 -.1(wo)4.332 G 1.832 +(uld split it, using).1 F F3(COMP_W)4.332 E(ORDBREAKS)-.09 E F0(as)4.082 +E .831(described abo)144 278.4 R -.15(ve)-.15 G 5.831(.T).15 G .831 +(his v)-5.831 F .831(ariable is a)-.25 F -.25(va)-.2 G .832 +(ilable only in shell functions in).25 F -.2(vo)-.4 G -.1(ke).2 G 3.332 +(db).1 G 3.332(yt)-3.332 G .832(he programmable)-3.332 F(completion f) +144 290.4 Q(acilities \(see)-.1 E F1(Pr)2.5 E(ogrammable Completion)-.18 +E F0(belo)2.5 E(w\).)-.25 E F1(DIRST)108 307.2 Q -.55(AC)-.9 G(K).55 E +F0 2.26(An array v)144 319.2 R 2.26(ariable \(see)-.25 F F1(Arrays)4.76 +E F0(belo)4.76 E 2.26 +(w\) containing the current contents of the directory stack.)-.25 F +1.094(Directories appear in the stack in the order the)144 331.2 R 3.594 +(ya)-.15 G 1.095(re displayed by the)-3.594 F F1(dirs)3.595 E F0 -.2(bu) +3.595 G 3.595(iltin. Assigning).2 F(to)3.595 E 1.432 +(members of this array v)144 343.2 R 1.432 +(ariable may be used to modify directories already in the stack, b)-.25 +F 1.431(ut the)-.2 F F1(pushd)144 355.2 Q F0(and)2.746 E F1(popd)2.746 E +F0 -.2(bu)2.746 G .246(iltins must be used to add and remo).2 F .546 +-.15(ve d)-.15 H 2.746(irectories. Assignment).15 F .246(to this v)2.746 +F(ariable)-.25 E .351(will not change the current directory)144 367.2 R +5.35(.I)-.65 G(f)-5.35 E F3(DIRST)2.85 E -.495(AC)-.81 G(K).495 E F0 .35 +(is unset, it loses its special properties, e)2.6 F -.15(ve)-.25 G 2.85 +(ni).15 G(f)-2.85 E(it is subsequently reset.)144 379.2 Q F1(EUID)108 +396 Q F0 1.103(Expands to the ef)11 F(fecti)-.25 E 1.403 -.15(ve u)-.25 +H 1.103(ser ID of the current user).15 F 3.603(,i)-.4 G 1.103 +(nitialized at shell startup.)-3.603 F 1.104(This v)6.103 F 1.104 +(ariable is)-.25 F(readonly)144 408 Q(.)-.65 E F1(FUNCN)108 424.8 Q(AME) +-.2 E F0 .479(An array v)144 436.8 R .479 +(ariable containing the names of all shell functions currently in the e) +-.25 F -.15(xe)-.15 G .478(cution call stack.).15 F .276 +(The element with inde)144 448.8 R 2.776(x0i)-.15 G 2.776(st)-2.776 G +.276(he name of an)-2.776 F 2.777(yc)-.15 G(urrently-e)-2.777 E -.15(xe) +-.15 G .277(cuting shell function.).15 F .277(The bottom-most)5.277 F +.25(element is)144 460.8 R/F4 10/Courier@0 SF("main")2.75 E F0 5.25(.T)C +.25(his v)-5.25 F .25(ariable e)-.25 F .25 +(xists only when a shell function is e)-.15 F -.15(xe)-.15 G 2.75 +(cuting. Assignments).15 F(to)2.75 E F3(FUNCN)144 472.8 Q(AME)-.18 E F0 +(ha)2.634 E .684 -.15(ve n)-.2 H 2.884(oe).15 G -.25(ff)-2.884 G .384 +(ect and return an error status.).25 F(If)5.385 E F3(FUNCN)2.885 E(AME) +-.18 E F0 .385(is unset, it loses its special)2.635 F(properties, e)144 +484.8 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss) +-2.5 G(ubsequently reset.)-2.5 E F1(GR)108 501.6 Q(OUPS)-.3 E F0 1.229 +(An array v)144 513.6 R 1.228(ariable containing the list of groups of \ +which the current user is a member)-.25 F 6.228(.A)-.55 G(ssign-)-6.228 +E .596(ments to)144 525.6 R F3(GR)3.096 E(OUPS)-.27 E F0(ha)2.847 E .897 +-.15(ve n)-.2 H 3.097(oe).15 G -.25(ff)-3.097 G .597 +(ect and return an error status.).25 F(If)5.597 E F3(GR)3.097 E(OUPS) +-.27 E F0 .597(is unset, it loses its spe-)2.847 F(cial properties, e) +144 537.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5 +(ss)-2.5 G(ubsequently reset.)-2.5 E F1(HISTCMD)108 554.4 Q F0 .356 +(The history number)144 566.4 R 2.856(,o)-.4 G 2.856(ri)-2.856 G(nde) +-2.856 E 2.856(xi)-.15 G 2.856(nt)-2.856 G .356 +(he history list, of the current command.)-2.856 F(If)5.356 E F3 +(HISTCMD)2.855 E F0 .355(is unset, it)2.605 F +(loses its special properties, e)144 578.4 Q -.15(ve)-.25 G 2.5(ni).15 G +2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G(ubsequently reset.)-2.5 E F1 +(HOSTN)108 595.2 Q(AME)-.2 E F0 +(Automatically set to the name of the current host.)144 607.2 Q F1 +(HOSTTYPE)108 624 Q F0 .222(Automatically set to a string that uniquely\ + describes the type of machine on which)144 636 R F1(bash)2.723 E F0 +.223(is e)2.723 F -.15(xe)-.15 G(cut-).15 E 2.5(ing. The)144 648 R(def) +2.5 E(ault is system-dependent.)-.1 E F1(LINENO)108 664.8 Q F0 1.408(Ea\ +ch time this parameter is referenced, the shell substitutes a decimal n\ +umber representing the)144 676.8 R .078(current sequential line number \ +\(starting with 1\) within a script or function.)144 688.8 R .079 +(When not in a script or)5.078 F .307(function, the v)144 700.8 R .307 +(alue substituted is not guaranteed to be meaningful.)-.25 F(If)5.306 E +F3(LINENO)2.806 E F0 .306(is unset, it loses its)2.556 F +(special properties, e)144 712.8 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(fi) +-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G(ubsequently reset.)-2.5 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(11)185.955 E 0 Cg EP +%%Page: 12 12 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(MA)108 84 Q(CHTYPE)-.55 E F0 .898(Automati\ +cally set to a string that fully describes the system type on which)144 +96 R F1(bash)3.398 E F0 .899(is e)3.398 F -.15(xe)-.15 G .899 +(cuting, in).15 F(the standard GNU)144 108 Q/F2 10/Times-Italic@0 SF +(cpu-company-system)2.5 E F0 2.5(format. The)2.5 F(def)2.5 E +(ault is system-dependent.)-.1 E F1(OLDPWD)108 124.8 Q F0(The pre)144 +136.8 Q(vious w)-.25 E(orking directory as set by the)-.1 E F1(cd)2.5 E +F0(command.)2.5 E F1(OPT)108 153.6 Q(ARG)-.9 E F0 1.627(The v)144 165.6 +R 1.627(alue of the last option ar)-.25 F 1.627(gument processed by the) +-.18 F F1(getopts)4.127 E F0 -.2(bu)4.127 G 1.626(iltin command \(see).2 +F/F3 9/Times-Bold@0 SF(SHELL)4.126 E -.09(BU)144 177.6 S(IL).09 E +(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 E F1(OPTIND)108 194.4 Q +F0 1.651(The inde)144 206.4 R 4.151(xo)-.15 G 4.151(ft)-4.151 G 1.651 +(he ne)-4.151 F 1.651(xt ar)-.15 F 1.652(gument to be processed by the) +-.18 F F1(getopts)4.152 E F0 -.2(bu)4.152 G 1.652(iltin command \(see).2 +F F3(SHELL)4.152 E -.09(BU)144 218.4 S(IL).09 E(TIN COMMANDS)-.828 E F0 +(belo)2.25 E(w\).)-.25 E F1(OSTYPE)108 235.2 Q F0 .329(Automatically se\ +t to a string that describes the operating system on which)144 247.2 R +F1(bash)2.829 E F0 .329(is e)2.829 F -.15(xe)-.15 G 2.829(cuting. The) +.15 F(def)144 259.2 Q(ault is system-dependent.)-.1 E F1(PIPEST)108 276 +Q -.95(AT)-.9 G(US).95 E F0 .61(An array v)144 288 R .61(ariable \(see) +-.25 F F1(Arrays)3.11 E F0(belo)3.11 E .61(w\) containing a list of e) +-.25 F .61(xit status v)-.15 F .61(alues from the processes in)-.25 F +(the most-recently-e)144 300 Q -.15(xe)-.15 G(cuted fore).15 E +(ground pipeline \(which may contain only a single command\).)-.15 E F1 +(PPID)108 316.8 Q F0(The process ID of the shell')12.67 E 2.5(sp)-.55 G +2.5(arent. This)-2.5 F -.25(va)2.5 G(riable is readonly).25 E(.)-.65 E +F1(PWD)108 333.6 Q F0(The current w)12.67 E +(orking directory as set by the)-.1 E F1(cd)2.5 E F0(command.)2.5 E F1 +(RANDOM)108 350.4 Q F0 .566 +(Each time this parameter is referenced, a random inte)144 362.4 R .565 +(ger between 0 and 32767 is generated.)-.15 F(The)5.565 E .01 +(sequence of random numbers may be initialized by assigning a v)144 +374.4 R .01(alue to)-.25 F F3(RANDOM)2.51 E/F4 9/Times-Roman@0 SF(.)A F0 +(If)4.51 E F3(RANDOM)2.51 E F0(is)2.26 E +(unset, it loses its special properties, e)144 386.4 Q -.15(ve)-.25 G +2.5(ni).15 G 2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G +(ubsequently reset.)-2.5 E F1(REPL)108 403.2 Q(Y)-.92 E F0 +(Set to the line of input read by the)144 415.2 Q F1 -.18(re)2.5 G(ad) +.18 E F0 -.2(bu)2.5 G(iltin command when no ar).2 E +(guments are supplied.)-.18 E F1(SECONDS)108 432 Q F0 .795(Each time th\ +is parameter is referenced, the number of seconds since shell in)144 444 +R -.2(vo)-.4 G .795(cation is returned.).2 F .712(If a v)144 456 R .712 +(alue is assigned to)-.25 F F3(SECONDS)3.212 E F4(,)A F0 .712(the v) +2.962 F .712(alue returned upon subsequent references is the number)-.25 +F .408(of seconds since the assignment plus the v)144 468 R .408 +(alue assigned.)-.25 F(If)5.408 E F3(SECONDS)2.908 E F0 .407 +(is unset, it loses its special)2.658 F(properties, e)144 480 Q -.15(ve) +-.25 G 2.5(ni).15 G 2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G +(ubsequently reset.)-2.5 E F1(SHELLOPTS)108 496.8 Q F0 3.262(Ac)144 +508.8 S .763(olon-separated list of enabled shell options.)-3.262 F .763 +(Each w)5.763 F .763(ord in the list is a v)-.1 F .763(alid ar)-.25 F +.763(gument for the)-.18 F F1<ad6f>144 520.8 Q F0 1.174(option to the) +3.674 F F1(set)3.674 E F0 -.2(bu)3.674 G 1.174(iltin command \(see).2 F +F3 1.173(SHELL B)3.673 F(UIL)-.09 E 1.173(TIN COMMANDS)-.828 F F0(belo) +3.423 E 3.673(w\). The)-.25 F(options)3.673 E .019(appearing in)144 +532.8 R F3(SHELLOPTS)2.519 E F0 .019(are those reported as)2.269 F F2 +(on)2.749 E F0(by)2.759 E F1 .019(set \255o)2.519 F F0 5.019(.I)C 2.519 +(ft)-5.019 G .019(his v)-2.519 F .02(ariable is in the en)-.25 F +(vironment)-.4 E(when)144 544.8 Q F1(bash)3.142 E F0 .642(starts up, ea\ +ch shell option in the list will be enabled before reading an)3.142 F +3.141(ys)-.15 G .641(tartup \214les.)-3.141 F(This v)144 556.8 Q +(ariable is read-only)-.25 E(.)-.65 E F1(SHL)108 573.6 Q(VL)-.92 E F0 +(Incremented by one each time an instance of)144 585.6 Q F1(bash)2.5 E +F0(is started.)2.5 E F1(UID)108 602.4 Q F0 +(Expands to the user ID of the current user)17.67 E 2.5(,i)-.4 G +(nitialized at shell startup.)-2.5 E(This v)5 E(ariable is readonly)-.25 +E(.)-.65 E .993(The follo)108 619.2 R .993(wing v)-.25 F .994 +(ariables are used by the shell.)-.25 F .994(In some cases,)5.994 F F1 +(bash)3.494 E F0 .994(assigns a def)3.494 F .994(ault v)-.1 F .994 +(alue to a v)-.25 F(ariable;)-.25 E(these cases are noted belo)108 631.2 +Q -.65(w.)-.25 G F1 -.3(BA)108 648 S(SH_ENV).3 E F0 .506 +(If this parameter is set when)144 660 R F1(bash)3.006 E F0 .506(is e) +3.006 F -.15(xe)-.15 G .505(cuting a shell script, its v).15 F .505 +(alue is interpreted as a \214lename)-.25 F .354 +(containing commands to initialize the shell, as in)144 672 R F2 +(~/.bashr)2.855 E(c)-.37 E F0 5.355(.T).31 G .355(he v)-5.355 F .355 +(alue of)-.25 F F3 -.27(BA)2.855 G(SH_ENV).27 E F0 .355(is subjected) +2.605 F .525(to parameter e)144 684 R .525 +(xpansion, command substitution, and arithmetic e)-.15 F .525 +(xpansion before being interpreted)-.15 F(as a \214le name.)144 696 Q F3 +-.666(PA)5 G(TH)-.189 E F0 +(is not used to search for the resultant \214le name.)2.25 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(12)185.955 E 0 Cg EP +%%Page: 13 13 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(CDP)108 84 Q -.95(AT)-.74 G(H).95 E F0 +1.247(The search path for the)144 96 R F1(cd)3.747 E F0 3.747 +(command. This)3.747 F 1.248 +(is a colon-separated list of directories in which the)3.747 F 3.796 +(shell looks for destination directories speci\214ed by the)144 108 R F1 +(cd)6.295 E F0 6.295(command. A)6.295 F 3.795(sample v)6.295 F 3.795 +(alue is)-.25 F/F2 10/Courier@0 SF(".:~:/usr")144 120 Q F0(.)A F1 -.3 +(BA)108 132 S(SH_XTRA).3 E(CEFD)-.55 E F0 .48(If set to an inte)144 144 +R .48(ger corresponding to a v)-.15 F .481(alid \214le descriptor)-.25 F +(,)-.4 E F1(bash)2.981 E F0 .481(will write the trace output gener)2.981 +F(-)-.2 E 3.114(ated when)144 156 R F2 3.114(set -x)5.614 F F0 3.114 +(is enabled to that \214le descriptor)5.614 F 8.114(.T)-.55 G 3.114 +(he \214le descriptor is closed when)-8.114 F/F3 9/Times-Bold@0 SF -.27 +(BA)144 168 S(SH_XTRA).27 E(CEFD)-.495 E F0 .138 +(is unset or assigned a ne)2.388 F 2.638(wv)-.25 G 2.638 +(alue. Unsetting)-2.888 F F3 -.27(BA)2.638 G(SH_XTRA).27 E(CEFD)-.495 E +F0 .138(or assigning it)2.388 F 2.531(the empty string causes the trace\ + output to be sent to the standard error)144 180 R 7.53(.N)-.55 G 2.53 +(ote that setting)-7.53 F F3 -.27(BA)144 192 S(SH_XTRA).27 E(CEFD)-.495 +E F0 .74(to 2 \(the standard error \214le descriptor\) and then unsetti\ +ng it will result in the)2.99 F(standard error being closed.)144 204 Q +F1(COLUMNS)108 216 Q F0 .425(Used by the)144 228 R F1(select)2.925 E F0 +-.2(bu)2.925 G .425(iltin command to determine the terminal width when \ +printing selection lists.).2 F +(Automatically set upon receipt of a SIGWINCH.)144 240 Q F1(COMPREPL)108 +252 Q(Y)-.92 E F0 .847(An array v)144 264 R .848(ariable from which)-.25 +F F1(bash)3.348 E F0 .848 +(reads the possible completions generated by a shell function)3.348 F +(in)144 276 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(db).1 G 2.5(yt)-2.5 G +(he programmable completion f)-2.5 E(acility \(see)-.1 E F1(Pr)2.5 E +(ogrammable Completion)-.18 E F0(belo)2.5 E(w\).)-.25 E F1(EMA)108 288 Q +(CS)-.55 E F0(If)144 300 Q F1(bash)2.536 E F0 .036(\214nds this v)2.536 +F .036(ariable in the en)-.25 F .036 +(vironment when the shell starts with v)-.4 F(alue)-.25 E F2(t)2.535 E +F0 2.535(,i)C 2.535(ta)-2.535 G .035(ssumes that the)-2.535 F +(shell is running in an emacs shell b)144 312 Q(uf)-.2 E +(fer and disables line editing.)-.25 E F1(FCEDIT)108 324 Q F0(The def) +144 336 Q(ault editor for the)-.1 E F1(fc)2.5 E F0 -.2(bu)2.5 G +(iltin command.).2 E F1(FIGNORE)108 348 Q F0 2.598(Ac)144 360 S .098 +(olon-separated list of suf)-2.598 F<8c78>-.25 E .098 +(es to ignore when performing \214lename completion \(see)-.15 F F3 +(READLINE)2.599 E F0(belo)144 372 Q 2.705(w\). A)-.25 F .205 +(\214lename whose suf)2.705 F .205(\214x matches one of the entries in) +-.25 F F3(FIGNORE)2.705 E F0 .205(is e)2.455 F .204 +(xcluded from the list)-.15 F(of matched \214lenames.)144 384 Q 2.5(As)5 +G(ample v)-2.5 E(alue is)-.25 E F2(".o:~")2.5 E F0(.)A F1(GLOBIGNORE)108 +396 Q F0 3.118(Ac)144 408 S .618(olon-separated list of patterns de\214\ +ning the set of \214lenames to be ignored by pathname e)-3.118 F(xpan-) +-.15 E 3.132(sion. If)144 420 R 3.132<618c>3.132 G .632 +(lename matched by a pathname e)-3.132 F .632 +(xpansion pattern also matches one of the patterns in)-.15 F F3 +(GLOBIGNORE)144 432 Q/F4 9/Times-Roman@0 SF(,)A F0(it is remo)2.25 E +-.15(ve)-.15 G 2.5(df).15 G(rom the list of matches.)-2.5 E F1 +(HISTCONTR)108 444 Q(OL)-.3 E F0 2.653(Ac)144 456 S .153 +(olon-separated list of v)-2.653 F .153(alues controlling ho)-.25 F +2.653(wc)-.25 G .153(ommands are sa)-2.653 F -.15(ve)-.2 G 2.653(do).15 +G 2.653(nt)-2.653 G .153(he history list.)-2.653 F .154(If the list) +5.153 F .491(of v)144 468 R .491(alues includes)-.25 F/F5 10 +/Times-Italic@0 SF(ignor)2.991 E(espace)-.37 E F0 2.991(,l).18 G .491 +(ines which be)-2.991 F .491(gin with a)-.15 F F1(space)2.991 E F0 .49 +(character are not sa)2.991 F -.15(ve)-.2 G 2.99(di).15 G 2.99(nt)-2.99 +G .49(he his-)-2.99 F .557(tory list.)144 480 R 3.057(Av)5.557 G .557 +(alue of)-3.307 F F5(ignor)3.067 E(edups)-.37 E F0 .557 +(causes lines matching the pre)3.327 F .558 +(vious history entry to not be sa)-.25 F -.15(ve)-.2 G(d.).15 E 2.959 +(Av)144 492 S .459(alue of)-3.209 F F5(ignor)2.969 E(eboth)-.37 E F0 +.459(is shorthand for)3.239 F F5(ignor)2.959 E(espace)-.37 E F0(and) +2.959 E F5(ignor)2.958 E(edups)-.37 E F0 5.458(.A)C -.25(va)-2.5 G .458 +(lue of).25 F F5(er)2.958 E(asedups)-.15 E F0(causes)2.958 E .698 +(all pre)144 504 R .698 +(vious lines matching the current line to be remo)-.25 F -.15(ve)-.15 G +3.198(df).15 G .699(rom the history list before that line is)-3.198 F +(sa)144 516 Q -.15(ve)-.2 G 2.764(d. An).15 F 2.764(yv)-.15 G .264 +(alue not in the abo)-3.014 F .563 -.15(ve l)-.15 H .263 +(ist is ignored.).15 F(If)5.263 E F3(HISTCONTR)2.763 E(OL)-.27 E F0 .263 +(is unset, or does not include)2.513 F 2.941(av)144 528 S .441(alid v) +-3.191 F .441(alue, all lines read by the shell parser are sa)-.25 F +-.15(ve)-.2 G 2.942(do).15 G 2.942(nt)-2.942 G .442 +(he history list, subject to the v)-2.942 F .442(alue of)-.25 F F3 +(HISTIGNORE)144 540 Q F4(.)A F0 1.981(The second and subsequent lines o\ +f a multi-line compound command are not)6.482 F +(tested, and are added to the history re)144 552 Q -.05(ga)-.15 G +(rdless of the v).05 E(alue of)-.25 E F3(HISTCONTR)2.5 E(OL)-.27 E F4(.) +A F1(HISTFILE)108 564 Q F0 .181 +(The name of the \214le in which command history is sa)144 576 R -.15 +(ve)-.2 G 2.681(d\().15 G(see)-2.681 E F3(HIST)2.681 E(OR)-.162 E(Y) +-.315 E F0(belo)2.431 E 2.682(w\). The)-.25 F(def)2.682 E .182(ault v) +-.1 F(alue)-.25 E(is)144 588 Q F5(~/.bash_history)2.5 E F0 5(.I)C 2.5 +(fu)-5 G(nset, the command history is not sa)-2.5 E -.15(ve)-.2 G 2.5 +(dw).15 G(hen an interacti)-2.5 E .3 -.15(ve s)-.25 H(hell e).15 E +(xits.)-.15 E F1(HISTFILESIZE)108 600 Q F0 1.623 +(The maximum number of lines contained in the history \214le.)144 612 R +1.622(When this v)6.623 F 1.622(ariable is assigned a)-.25 F -.25(va)144 +624 S .305(lue, the history \214le is truncated, if necessary).25 F +2.805(,b)-.65 G 2.805(yr)-2.805 G(emo)-2.805 E .305 +(ving the oldest entries, to contain no more)-.15 F .602 +(than that number of lines.)144 636 R .602(The def)5.602 F .602(ault v) +-.1 F .602(alue is 500.)-.25 F .601 +(The history \214le is also truncated to this size)5.602 F +(after writing it when an interacti)144 648 Q .3 -.15(ve s)-.25 H +(hell e).15 E(xits.)-.15 E F1(HISTIGNORE)108 660 Q F0 2.657(Ac)144 672 S +.157(olon-separated list of patterns used to decide which command lines\ + should be sa)-2.657 F -.15(ve)-.2 G 2.658(do).15 G 2.658(nt)-2.658 G +.158(he his-)-2.658 F .708(tory list.)144 684 R .708 +(Each pattern is anchored at the be)5.708 F .707 +(ginning of the line and must match the complete line)-.15 F .625 +(\(no implicit `)144 696 R F1(*)A F0 3.125('i)C 3.125(sa)-3.125 G 3.125 +(ppended\). Each)-3.125 F .626(pattern is tested ag)3.125 F .626 +(ainst the line after the checks speci\214ed by)-.05 F F3(HISTCONTR)144 +708 Q(OL)-.27 E F0 1.793(are applied.)4.043 F 1.793 +(In addition to the normal shell pattern matching characters, `)6.793 F +F1(&)A F0(')A 2.514(matches the pre)144 720 R 2.514(vious history line.) +-.25 F(`)7.514 E F1(&)A F0 5.014('m)C 2.514 +(ay be escaped using a backslash; the backslash is)-5.014 F +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(13)185.955 E 0 Cg EP +%%Page: 14 14 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(remo)144 84 Q -.15(ve)-.15 G 3.353(db).15 G .853 +(efore attempting a match.)-3.353 F .852 +(The second and subsequent lines of a multi-line compound)5.852 F +(command are not tested, and are added to the history re)144 96 Q -.05 +(ga)-.15 G(rdless of the v).05 E(alue of)-.25 E/F1 9/Times-Bold@0 SF +(HISTIGNORE)2.5 E/F2 9/Times-Roman@0 SF(.)A/F3 10/Times-Bold@0 SF +(HISTSIZE)108 108 Q F0 1.942 +(The number of commands to remember in the command history \(see)144 120 +R F1(HIST)4.443 E(OR)-.162 E(Y)-.315 E F0(belo)4.193 E 4.443(w\). The) +-.25 F(def)144 132 Q(ault v)-.1 E(alue is 500.)-.25 E F3(HISTTIMEFORMA) +108 144 Q(T)-.95 E F0 .952(If this v)144 156 R .952 +(ariable is set and not null, its v)-.25 F .951 +(alue is used as a format string for)-.25 F/F4 10/Times-Italic@0 SF +(strftime)3.451 E F0 .951(\(3\) to print the)B .672 +(time stamp associated with each history entry displayed by the)144 168 +R F3(history)3.173 E F0 -.2(bu)3.173 G 3.173(iltin. If).2 F .673(this v) +3.173 F .673(ariable is)-.25 F .144 +(set, time stamps are written to the history \214le so the)144 180 R +2.644(ym)-.15 G .144(ay be preserv)-2.644 F .144 +(ed across shell sessions.)-.15 F(This)5.144 E(uses the history comment\ + character to distinguish timestamps from other history lines.)144 192 Q +F3(HOME)108 204 Q F0 1.27 +(The home directory of the current user; the def)144 216 R 1.27(ault ar) +-.1 F 1.27(gument for the)-.18 F F3(cd)3.77 E F0 -.2(bu)3.77 G 1.27 +(iltin command.).2 F(The)6.27 E -.25(va)144 228 S(lue of this v).25 E +(ariable is also used when performing tilde e)-.25 E(xpansion.)-.15 E F3 +(HOSTFILE)108 240 Q F0 1.015 +(Contains the name of a \214le in the same format as)144 252 R F4 +(/etc/hosts)5.181 E F0 1.015(that should be read when the shell)5.181 F +.55(needs to complete a hostname.)144 264 R .551 +(The list of possible hostname completions may be changed while)5.551 F +1.059(the shell is running; the ne)144 276 R 1.059 +(xt time hostname completion is attempted after the v)-.15 F 1.058 +(alue is changed,)-.25 F F3(bash)144 288 Q F0 .138 +(adds the contents of the ne)2.638 F 2.638<778c>-.25 G .138(le to the e) +-2.638 F .138(xisting list.)-.15 F(If)5.138 E F1(HOSTFILE)2.638 E F0 +.138(is set, b)2.388 F .139(ut has no v)-.2 F .139(alue, or)-.25 F .518 +(does not name a readable \214le,)144 300 R F3(bash)3.018 E F0 .518 +(attempts to read)3.018 F F4(/etc/hosts)4.683 E F0 .517 +(to obtain the list of possible host-)4.683 F(name completions.)144 312 +Q(When)5 E F1(HOSTFILE)2.5 E F0(is unset, the hostname list is cleared.) +2.25 E F3(IFS)108 324 Q F0(The)20.44 E F4 .555(Internal F)3.635 F .555 +(ield Separ)-.45 F(ator)-.15 E F0 .555(that is used for w)3.785 F .556 +(ord splitting after e)-.1 F .556(xpansion and to split lines into)-.15 +F -.1(wo)144 336 S(rds with the).1 E F3 -.18(re)2.5 G(ad).18 E F0 -.2 +(bu)2.5 G(iltin command.).2 E(The def)5 E(ault v)-.1 E(alue is `)-.25 E +(`<space><tab><ne)-.74 E(wline>')-.25 E('.)-.74 E F3(IGNOREEOF)108 348 Q +F0 .503(Controls the action of an interacti)144 360 R .803 -.15(ve s) +-.25 H .503(hell on receipt of an).15 F F1(EOF)3.003 E F0 .503 +(character as the sole input.)2.753 F .503(If set,)5.503 F .426(the v) +144 372 R .426(alue is the number of consecuti)-.25 F -.15(ve)-.25 G F1 +(EOF)3.076 E F0 .426 +(characters which must be typed as the \214rst characters)2.676 F .303 +(on an input line before)144 384 R F3(bash)2.802 E F0 -.15(ex)2.802 G +2.802(its. If).15 F .302(the v)2.802 F .302(ariable e)-.25 F .302 +(xists b)-.15 F .302(ut does not ha)-.2 F .602 -.15(ve a n)-.2 H .302 +(umeric v).15 F .302(alue, or has)-.25 F(no v)144 396 Q(alue, the def) +-.25 E(ault v)-.1 E(alue is 10.)-.25 E(If it does not e)5 E(xist,)-.15 E +F1(EOF)2.5 E F0(signi\214es the end of input to the shell.)2.25 E F3 +(INPUTRC)108 408 Q F0 1.435(The \214lename for the)144 420 R F3 -.18(re) +3.936 G(adline).18 E F0 1.436(startup \214le, o)3.936 F -.15(ve)-.15 G +1.436(rriding the def).15 F 1.436(ault of)-.1 F F4(~/.inputr)5.602 E(c) +-.37 E F0(\(see)5.602 E F1(READLINE)3.936 E F0(belo)144 432 Q(w\).)-.25 +E F3(LANG)108 444 Q F0 1.24(Used to determine the locale cate)7.11 F +1.239(gory for an)-.15 F 3.739(yc)-.15 G(ate)-3.739 E 1.239 +(gory not speci\214cally selected with a v)-.15 F(ariable)-.25 E +(starting with)144 456 Q F3(LC_)2.5 E F0(.)A F3(LC_ALL)108 468 Q F0 .973 +(This v)144 480 R .973(ariable o)-.25 F -.15(ve)-.15 G .973 +(rrides the v).15 F .973(alue of)-.25 F F1(LANG)3.473 E F0 .973(and an) +3.223 F 3.473(yo)-.15 G(ther)-3.473 E F3(LC_)3.473 E F0 -.25(va)3.473 G +.974(riable specifying a locale cate-).25 F(gory)144 492 Q(.)-.65 E F3 +(LC_COLLA)108 504 Q(TE)-.95 E F0 .412(This v)144 516 R .412(ariable det\ +ermines the collation order used when sorting the results of pathname e) +-.25 F(xpansion,)-.15 E 1.464(and determines the beha)144 528 R 1.464 +(vior of range e)-.2 F 1.465(xpressions, equi)-.15 F -.25(va)-.25 G +1.465(lence classes, and collating sequences).25 F(within pathname e)144 +540 Q(xpansion and pattern matching.)-.15 E F3(LC_CTYPE)108 552 Q F0 +1.936(This v)144 564 R 1.936 +(ariable determines the interpretation of characters and the beha)-.25 F +1.935(vior of character classes)-.2 F(within pathname e)144 576 Q +(xpansion and pattern matching.)-.15 E F3(LC_MESSA)108 588 Q(GES)-.55 E +F0(This v)144 600 Q(ariable determines the locale used to translate dou\ +ble-quoted strings preceded by a)-.25 E F3($)2.5 E F0(.)A F3(LC_NUMERIC) +108 612 Q F0(This v)144 624 Q(ariable determines the locale cate)-.25 E +(gory used for number formatting.)-.15 E F3(LINES)108 636 Q F0 1.218 +(Used by the)5.99 F F3(select)3.718 E F0 -.2(bu)3.718 G 1.219(iltin com\ +mand to determine the column length for printing selection lists.).2 F +(Automatically set upon receipt of a)144 648 Q F1(SIGWINCH)2.5 E F2(.)A +F3(MAIL)108 660 Q F0 .188 +(If this parameter is set to a \214le name and the)8.78 F F1(MAILP)2.687 +E -.855(AT)-.666 G(H).855 E F0 -.25(va)2.437 G .187(riable is not set,) +.25 F F3(bash)2.687 E F0 .187(informs the user)2.687 F(of the arri)144 +672 Q -.25(va)-.25 G 2.5(lo).25 G 2.5(fm)-2.5 G +(ail in the speci\214ed \214le.)-2.5 E F3(MAILCHECK)108 684 Q F0 .098 +(Speci\214es ho)144 696 R 2.598(wo)-.25 G .098(ften \(in seconds\)) +-2.598 F F3(bash)2.598 E F0 .098(checks for mail.)2.598 F .098(The def) +5.098 F .098(ault is 60 seconds.)-.1 F .099(When it is time)5.099 F .224 +(to check for mail, the shell does so before displaying the primary pro\ +mpt.)144 708 R .223(If this v)5.223 F .223(ariable is unset,)-.25 F .066 +(or set to a v)144 720 R .066(alue that is not a number greater than or\ + equal to zero, the shell disables mail checking.)-.25 F(GNU Bash-4.1)72 +768 Q(2009 December 29)135.965 E(14)185.955 E 0 Cg EP +%%Page: 15 15 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(MAILP)108 84 Q -.95(AT)-.74 G(H).95 E F0 +2.815(Ac)144 96 S .314(olon-separated list of \214le names to be check) +-2.815 F .314(ed for mail.)-.1 F .314 +(The message to be printed when mail)5.314 F(arri)144 108 Q -.15(ve)-.25 +G 3.42(si).15 G 3.42(nap)-3.42 G .92(articular \214le may be speci\214e\ +d by separating the \214le name from the message with a)-3.42 F 2.808 +(`?'. When)144 120 R .308(used in the te)2.808 F .308 +(xt of the message,)-.15 F F1($_)2.808 E F0 -.15(ex)2.808 G .308 +(pands to the name of the current mail\214le.).15 F(Exam-)5.307 E(ple:) +144 132 Q F1(MAILP)144 144 Q -.95(AT)-.74 G(H).95 E F0(=\010/v)A +(ar/mail/bfox?"Y)-.25 E(ou ha)-1.1 E .3 -.15(ve m)-.2 H +(ail":~/shell\255mail?"$_ has mail!"\010).15 E F1(Bash)144 156 Q F0 .388 +(supplies a def)2.888 F .388(ault v)-.1 F .388(alue for this v)-.25 F +.388(ariable, b)-.25 F .389 +(ut the location of the user mail \214les that it uses is)-.2 F +(system dependent \(e.g., /v)144 168 Q(ar/mail/)-.25 E F1($USER)A F0 +(\).)A F1(OPTERR)108 180 Q F0 .39(If set to the v)144 192 R .39(alue 1,) +-.25 F F1(bash)2.89 E F0 .389(displays error messages generated by the) +2.889 F F1(getopts)2.889 E F0 -.2(bu)2.889 G .389(iltin command \(see).2 +F/F2 9/Times-Bold@0 SF .359(SHELL B)144 204 R(UIL)-.09 E .359 +(TIN COMMANDS)-.828 F F0(belo)2.609 E(w\).)-.25 E F2(OPTERR)5.359 E F0 +.36(is initialized to 1 each time the shell is in)2.609 F -.2(vo)-.4 G +-.1(ke).2 G(d).1 E(or a shell script is e)144 216 Q -.15(xe)-.15 G +(cuted.).15 E F1 -.74(PA)108 228 S(TH)-.21 E F0 .588 +(The search path for commands.)9.91 F .587 +(It is a colon-separated list of directories in which the shell looks) +5.588 F .471(for commands \(see)144 240 R F2 .471(COMMAND EXECUTION) +2.971 F F0(belo)2.722 E 2.972(w\). A)-.25 F .472 +(zero-length \(null\) directory name in the)2.972 F -.25(va)144 252 S +.536(lue of).25 F F2 -.666(PA)3.036 G(TH)-.189 E F0 .535 +(indicates the current directory)2.786 F 5.535(.A)-.65 G .535 +(null directory name may appear as tw)-2.5 F 3.035(oa)-.1 G(djacent) +-3.035 E .867(colons, or as an initial or trailing colon.)144 264 R .868 +(The def)5.868 F .868(ault path is system-dependent, and is set by the) +-.1 F 26.329(administrator who installs)144 276 R F1(bash)28.829 E F0 +31.329(.A)C 26.328(common v)-2.501 F 26.328(alue is)-.25 F/F3 10 +/Courier@0 SF(/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin)144 288 +Q F0(.)A F1(POSIXL)108 300 Q(Y_CORRECT)-.92 E F0 .471(If this v)144 312 +R .471(ariable is in the en)-.25 F .471(vironment when)-.4 F F1(bash) +2.971 E F0 .471(starts, the shell enters)2.971 F/F4 10/Times-Italic@0 SF +.472(posix mode)2.972 F F0 .472(before reading)2.972 F .011 +(the startup \214les, as if the)144 324 R F1(\255\255posix)2.511 E F0 +(in)2.511 E -.2(vo)-.4 G .011(cation option had been supplied.).2 F .011 +(If it is set while the shell is)5.011 F(running,)144 336 Q F1(bash)2.5 +E F0(enables)2.5 E F4(posix mode)2.5 E F0 2.5(,a)C 2.5(si)-2.5 G 2.5(ft) +-2.5 G(he command)-2.5 E F3(set -o posix)2.5 E F0(had been e)2.5 E -.15 +(xe)-.15 G(cuted.).15 E F1(PR)108 348 Q(OMPT_COMMAND)-.3 E F0 +(If set, the v)144 360 Q(alue is e)-.25 E -.15(xe)-.15 G +(cuted as a command prior to issuing each primary prompt.).15 E F1(PR) +108 372 Q(OMPT_DIR)-.3 E(TRIM)-.4 E F0 .676 +(If set to a number greater than zero, the v)144 384 R .676 +(alue is used as the number of trailing directory compo-)-.25 F .923 +(nents to retain when e)144 396 R .923(xpanding the)-.15 F F1(\\w)3.423 +E F0(and)3.423 E F1(\\W)3.423 E F0 .923(prompt string escapes \(see) +3.423 F F2(PR)3.423 E(OMPTING)-.27 E F0(belo)3.173 E(w\).)-.25 E +(Characters remo)144 408 Q -.15(ve)-.15 G 2.5(da).15 G +(re replaced with an ellipsis.)-2.5 E F1(PS1)108 420 Q F0 .064(The v) +19.33 F .065(alue of this parameter is e)-.25 F .065(xpanded \(see)-.15 +F F2(PR)2.565 E(OMPTING)-.27 E F0(belo)2.315 E .065 +(w\) and used as the primary prompt)-.25 F 2.5(string. The)144 432 R +(def)2.5 E(ault v)-.1 E(alue is `)-.25 E(`)-.74 E F1(\\s\255\\v\\$)A F0 +-.74('')2.5 G(.).74 E F1(PS2)108 444 Q F0 .118(The v)19.33 F .118 +(alue of this parameter is e)-.25 F .118(xpanded as with)-.15 F F2(PS1) +2.617 E F0 .117(and used as the secondary prompt string.)2.367 F(The) +5.117 E(def)144 456 Q(ault is `)-.1 E(`)-.74 E F1(>)A F0 -.74('')2.5 G +(.).74 E F1(PS3)108 468 Q F0 1.115(The v)19.33 F 1.115 +(alue of this parameter is used as the prompt for the)-.25 F F1(select) +3.615 E F0 1.116(command \(see)3.616 F F2 1.116(SHELL GRAM-)3.616 F(MAR) +144 480 Q F0(abo)2.25 E -.15(ve)-.15 G(\).).15 E F1(PS4)108 492 Q F0 +.101(The v)19.33 F .101(alue of this parameter is e)-.25 F .101 +(xpanded as with)-.15 F F2(PS1)2.6 E F0 .1(and the v)2.35 F .1 +(alue is printed before each command)-.25 F F1(bash)144 504 Q F0 .291 +(displays during an e)2.791 F -.15(xe)-.15 G .292(cution trace.).15 F +.292(The \214rst character of)5.292 F F2(PS4)2.792 E F0 .292 +(is replicated multiple times, as)2.542 F(necessary)144 516 Q 2.5(,t) +-.65 G 2.5(oi)-2.5 G(ndicate multiple le)-2.5 E -.15(ve)-.25 G +(ls of indirection.).15 E(The def)5 E(ault is `)-.1 E(`)-.74 E F1(+)A F0 +-.74('')2.5 G(.).74 E F1(SHELL)108 528 Q F0 .664 +(The full pathname to the shell is k)144 540 R .664(ept in this en)-.1 F +.664(vironment v)-.4 F 3.164(ariable. If)-.25 F .663 +(it is not set when the shell)3.164 F(starts,)144 552 Q F1(bash)2.5 E F0 +(assigns to it the full pathname of the current user')2.5 E 2.5(sl)-.55 +G(ogin shell.)-2.5 E F1(TIMEFORMA)108 564 Q(T)-.95 E F0 .826(The v)144 +576 R .826 +(alue of this parameter is used as a format string specifying ho)-.25 F +3.327(wt)-.25 G .827(he timing information for)-3.327 F .649 +(pipelines pre\214x)144 588 R .649(ed with the)-.15 F F1(time)3.149 E F0 +(reserv)3.149 E .649(ed w)-.15 F .648(ord should be displayed.)-.1 F +(The)5.648 E F1(%)3.148 E F0 .648(character introduces)3.148 F .711 +(an escape sequence that is e)144 600 R .711(xpanded to a time v)-.15 F +.712(alue or other information.)-.25 F .712(The escape sequences)5.712 F +(and their meanings are as follo)144 612 Q +(ws; the braces denote optional portions.)-.25 E F1(%%)144 630 Q F0 2.5 +(Al)30 G(iteral)-2.5 E F1(%)2.5 E F0(.)A F1(%[)144 642 Q F4(p)A F1 +(][l]R)A F0(The elapsed time in seconds.)11.68 E F1(%[)144 654 Q F4(p)A +F1(][l]U)A F0(The number of CPU seconds spent in user mode.)11.68 E F1 +(%[)144 666 Q F4(p)A F1(][l]S)A F0 +(The number of CPU seconds spent in system mode.)13.34 E F1(%P)144 678 Q +F0(The CPU percentage, computed as \(%U + %S\) / %R.)33.89 E .87 +(The optional)144 694.8 R F4(p)3.37 E F0 .87(is a digit specifying the) +3.37 F F4(pr)3.37 E(ecision)-.37 E F0 3.37(,t)C .87 +(he number of fractional digits after a decimal)-3.37 F 2.525(point. A) +144 706.8 R -.25(va)2.525 G .025 +(lue of 0 causes no decimal point or fraction to be output.).25 F .026 +(At most three places after the)5.025 F .538 +(decimal point may be speci\214ed; v)144 718.8 R .538(alues of)-.25 F F4 +(p)3.038 E F0 .537(greater than 3 are changed to 3.)3.037 F(If)5.537 E +F4(p)3.037 E F0 .537(is not speci\214ed,)3.037 F(the v)144 730.8 Q +(alue 3 is used.)-.25 E(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E +(15)185.955 E 0 Cg EP +%%Page: 16 16 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .667(The optional)144 84 R/F1 10/Times-Bold@0 SF(l)3.167 E F0 +.668(speci\214es a longer format, including minutes, of the form)3.168 F +/F2 10/Times-Italic@0 SF(MM)3.168 E F0(m)A F2(SS)A F0(.)A F2(FF)A F0 +3.168(s. The)B -.25(va)3.168 G(lue).25 E(of)144 96 Q F2(p)2.5 E F0 +(determines whether or not the fraction is included.)2.5 E .001 +(If this v)144 112.8 R .001(ariable is not set,)-.25 F F1(bash)2.501 E +F0 .001(acts as if it had the v)2.501 F(alue)-.25 E F1($\010\\nr)2.5 E +(eal\\t%3lR\\nuser\\t%3lU\\nsys%3lS\010)-.18 E F0(.)A .494(If the v)144 +124.8 R .494(alue is null, no timing information is displayed.)-.25 F +2.994(At)5.494 G .494(railing ne)-2.994 F .494 +(wline is added when the for)-.25 F(-)-.2 E(mat string is displayed.)144 +136.8 Q F1(TMOUT)108 153.6 Q F0 .941(If set to a v)144 165.6 R .941 +(alue greater than zero,)-.25 F/F3 9/Times-Bold@0 SF(TMOUT)3.441 E F0 +.941(is treated as the def)3.191 F .941(ault timeout for the)-.1 F F1 +-.18(re)3.441 G(ad).18 E F0 -.2(bu)3.441 G(iltin.).2 E(The)144 177.6 Q +F1(select)2.81 E F0 .31(command terminates if input does not arri)2.81 F +.611 -.15(ve a)-.25 H(fter).15 E F3(TMOUT)2.811 E F0 .311 +(seconds when input is com-)2.561 F .886(ing from a terminal.)144 189.6 +R .886(In an interacti)5.886 F 1.185 -.15(ve s)-.25 H .885(hell, the v) +.15 F .885(alue is interpreted as the number of seconds to)-.25 F -.1 +(wa)144 201.6 S .546(it for input after issuing the primary prompt.).1 F +F1(Bash)5.546 E F0 .546(terminates after w)3.046 F .546 +(aiting for that number of)-.1 F(seconds if input does not arri)144 +213.6 Q -.15(ve)-.25 G(.).15 E F1(TMPDIR)108 230.4 Q F0 .274(If set,)144 +242.4 R F1(Bash)2.774 E F0 .274(uses its v)2.774 F .274 +(alue as the name of a directory in which)-.25 F F1(Bash)2.773 E F0 .273 +(creates temporary \214les for the)2.773 F(shell')144 254.4 Q 2.5(su) +-.55 G(se.)-2.5 E F1(auto_r)108 271.2 Q(esume)-.18 E F0 .53(This v)144 +283.2 R .53(ariable controls ho)-.25 F 3.03(wt)-.25 G .531 +(he shell interacts with the user and job control.)-3.03 F .531 +(If this v)5.531 F .531(ariable is set,)-.25 F .539(single w)144 295.2 R +.538(ord simple commands without redirections are treated as candidates\ + for resumption of an)-.1 F -.15(ex)144 307.2 S .366(isting stopped job) +.15 F 5.366(.T)-.4 G .366(here is no ambiguity allo)-5.366 F .366 +(wed; if there is more than one job be)-.25 F .367(ginning with)-.15 F +1.125(the string typed, the job most recently accessed is selected.)144 +319.2 R(The)6.125 E F2(name)3.985 E F0 1.124(of a stopped job, in this) +3.805 F(conte)144 331.2 Q 1.132 +(xt, is the command line used to start it.)-.15 F 1.133(If set to the v) +6.133 F(alue)-.25 E F2 -.2(ex)3.633 G(act).2 E F0 3.633(,t).68 G 1.133 +(he string supplied must)-3.633 F .625 +(match the name of a stopped job e)144 343.2 R .624(xactly; if set to) +-.15 F F2(substring)3.124 E F0 3.124(,t).22 G .624 +(he string supplied needs to match a)-3.124 F .884 +(substring of the name of a stopped job)144 355.2 R 5.884(.T)-.4 G(he) +-5.884 E F2(substring)3.724 E F0 -.25(va)3.604 G .885(lue pro).25 F .885 +(vides functionality analogous to)-.15 F(the)144 367.2 Q F1(%?)3.334 E +F0 .834(job identi\214er \(see)5.834 F F3 .834(JOB CONTR)3.334 F(OL)-.27 +E F0(belo)3.084 E 3.334(w\). If)-.25 F .834(set to an)3.334 F 3.334(yo) +-.15 G .834(ther v)-3.334 F .833(alue, the supplied string)-.25 F .315 +(must be a pre\214x of a stopped job')144 379.2 R 2.816(sn)-.55 G .316 +(ame; this pro)-2.816 F .316(vides functionality analogous to the)-.15 F +F1(%)2.816 E F2(string)A F0(job)2.816 E(identi\214er)144 391.2 Q(.)-.55 +E F1(histchars)108 408 Q F0 2.07(The tw)144 420 R 4.57(oo)-.1 G 4.57(rt) +-4.57 G 2.07(hree characters which control history e)-4.57 F 2.07 +(xpansion and tok)-.15 F 2.07(enization \(see)-.1 F F3(HIST)4.569 E(OR) +-.162 E(Y)-.315 E(EXP)144 432 Q(ANSION)-.666 E F0(belo)3.465 E 3.715 +(w\). The)-.25 F 1.215(\214rst character is the)3.715 F F2 1.216 +(history e)3.715 F(xpansion)-.2 E F0(character)3.716 E 3.716(,t)-.4 G +1.216(he character which)-3.716 F .798(signals the start of a history e) +144 444 R .798(xpansion, normally `)-.15 F F1(!)A F0 3.298('. The)B .798 +(second character is the)3.298 F F2(quic)3.298 E 3.298(ks)-.2 G +(ubstitu-)-3.298 E(tion)144 456 Q F0(character)2.739 E 2.739(,w)-.4 G +.239(hich is used as shorthand for re-running the pre)-2.739 F .24 +(vious command entered, substitut-)-.25 F .576 +(ing one string for another in the command.)144 468 R .575(The def)5.575 +F .575(ault is `)-.1 F F1(^)A F0 3.075('. The)B .575 +(optional third character is the)3.075 F .223(character which indicates\ + that the remainder of the line is a comment when found as the \214rst \ +char)144 480 R(-)-.2 E 1.294(acter of a w)144 492 R 1.294 +(ord, normally `)-.1 F F1(#)A F0 3.794('. The)B 1.293 +(history comment character causes history substitution to be)3.794 F +.379(skipped for the remaining w)144 504 R .379(ords on the line.)-.1 F +.38(It does not necessarily cause the shell parser to treat)5.379 F +(the rest of the line as a comment.)144 516 Q F1(Arrays)87 532.8 Q(Bash) +108 544.8 Q F0(pro)3.391 E .891(vides one-dimensional inde)-.15 F -.15 +(xe)-.15 G 3.391(da).15 G .891(nd associati)-3.391 F 1.191 -.15(ve a) +-.25 H .891(rray v).15 F 3.391(ariables. An)-.25 F 3.391(yv)-.15 G .89 +(ariable may be used as an)-3.641 F(inde)108 556.8 Q -.15(xe)-.15 G +2.573(da).15 G .073(rray; the)-2.573 F F1(declar)2.573 E(e)-.18 E F0 -.2 +(bu)2.573 G .073(iltin will e).2 F .073(xplicitly declare an array)-.15 +F 5.073(.T)-.65 G .074(here is no maximum limit on the size of)-5.073 F +.329(an array)108 568.8 R 2.829(,n)-.65 G .329(or an)-2.829 F 2.829(yr) +-.15 G .329(equirement that members be inde)-2.829 F -.15(xe)-.15 G +2.829(do).15 G 2.829(ra)-2.829 G .328(ssigned contiguously)-2.829 F +5.328(.I)-.65 G(nde)-5.328 E -.15(xe)-.15 G 2.828(da).15 G .328 +(rrays are refer)-2.828 F(-)-.2 E 1.386(enced using inte)108 580.8 R +1.386(gers \(including arithmetic e)-.15 F 3.887(xpressions\) and)-.15 F +1.387(are zero-based; associati)3.887 F 1.687 -.15(ve a)-.25 H 1.387 +(rrays are refer).15 F(-)-.2 E(enced using arbitrary strings.)108 592.8 +Q 2.463(An inde)108 609.6 R -.15(xe)-.15 G 4.963(da).15 G 2.463 +(rray is created automatically if an)-4.963 F 4.963(yv)-.15 G 2.462 +(ariable is assigned to using the syntax)-5.213 F F2(name)4.962 E F0([)A +F2(sub-)A(script)108 621.6 Q F0(]=)A F2(value)A F0 5.682(.T)C(he)-5.682 +E F2(subscript)3.522 E F0 .682(is treated as an arithmetic e)3.862 F +.682(xpression that must e)-.15 F -.25(va)-.25 G .682 +(luate to a number greater).25 F .75(than or equal to zero.)108 633.6 R +2.349 -.8(To e)5.749 H .749(xplicitly declare an inde).65 F -.15(xe)-.15 +G 3.249(da).15 G(rray)-3.249 E 3.249(,u)-.65 G(se)-3.249 E F1(declar) +3.249 E 3.249<65ad>-.18 G(a)-3.249 E F2(name)3.249 E F0(\(see)3.249 E F3 +.749(SHELL B)3.249 F(UIL)-.09 E(TIN)-.828 E(COMMANDS)108 645.6 Q F0 +(belo)2.25 E(w\).)-.25 E F1(declar)5 E 2.5<65ad>-.18 G(a)-2.5 E F2(name) +2.5 E F1([)A F2(subscript)A F1(])A F0(is also accepted; the)2.5 E F2 +(subscript)2.5 E F0(is ignored.)2.5 E(Associati)108 662.4 Q .3 -.15 +(ve a)-.25 H(rrays are created using).15 E F1(declar)2.5 E 2.5<65ad>-.18 +G(A)-2.5 E F2(name)2.5 E F0(.)A(Attrib)108 679.2 Q .94 +(utes may be speci\214ed for an array v)-.2 F .941(ariable using the) +-.25 F F1(declar)3.441 E(e)-.18 E F0(and)3.441 E F1 -.18(re)3.441 G +(adonly).18 E F0 -.2(bu)3.441 G 3.441(iltins. Each).2 F(attrib)3.441 E +(ute)-.2 E(applies to all members of an array)108 691.2 Q(.)-.65 E 1.647 +(Arrays are assigned to using compound assignments of the form)108 708 R +F2(name)4.147 E F0(=)A F1(\()A F0 -.25(va)C(lue).25 E F2(1)A F0 1.647 +(... v)4.147 F(alue)-.25 E F2(n)A F1(\))A F0 4.147(,w)C 1.647(here each) +-4.147 F F2(value)108 720 Q F0 .122(is of the form [)2.622 F F2 +(subscript)A F0(]=)A F2(string)A F0 5.122(.I)C(nde)-5.122 E -.15(xe)-.15 +G 2.622(da).15 G .122(rray assignments do not require the brack)-2.622 F +.122(et and subscript.)-.1 F(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(16)185.955 E 0 Cg EP +%%Page: 17 17 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .164(When assigning to inde)108 84 R -.15(xe)-.15 G 2.663(da).15 +G .163(rrays, if the optional brack)-2.663 F .163 +(ets and subscript are supplied, that inde)-.1 F 2.663(xi)-.15 G 2.663 +(sa)-2.663 G(ssigned)-2.663 E 1.41(to; otherwise the inde)108 96 R 3.91 +(xo)-.15 G 3.91(ft)-3.91 G 1.41(he element assigned is the last inde) +-3.91 F 3.911(xa)-.15 G 1.411(ssigned to by the statement plus one.) +-3.911 F(Inde)108 108 Q(xing starts at zero.)-.15 E +(When assigning to an associati)108 124.8 Q .3 -.15(ve a)-.25 H(rray).15 +E 2.5(,t)-.65 G(he subscript is required.)-2.5 E .24 +(This syntax is also accepted by the)108 141.6 R/F1 10/Times-Bold@0 SF +(declar)2.74 E(e)-.18 E F0 -.2(bu)2.739 G 2.739(iltin. Indi).2 F .239 +(vidual array elements may be assigned to using the)-.25 F/F2 10 +/Times-Italic@0 SF(name)108 153.6 Q F0([)A F2(subscript)A F0(]=)A F2 +(value)A F0(syntax introduced abo)2.5 E -.15(ve)-.15 G(.).15 E(An)108 +170.4 Q 3.575(ye)-.15 G 1.075 +(lement of an array may be referenced using ${)-3.575 F F2(name)A F0([)A +F2(subscript)A F0 3.575(]}. The)B 1.076(braces are required to a)3.576 F +-.2(vo)-.2 G(id).2 E 1.542(con\215icts with pathname e)108 182.4 R 4.041 +(xpansion. If)-.15 F F2(subscript)4.041 E F0(is)4.041 E F1(@)4.041 E F0 +(or)4.041 E F1(*)4.041 E F0 4.041(,t)C 1.541(he w)-4.041 F 1.541(ord e) +-.1 F 1.541(xpands to all members of)-.15 F F2(name)4.041 E F0(.)A 1.056 +(These subscripts dif)108 194.4 R 1.056(fer only when the w)-.25 F 1.057 +(ord appears within double quotes.)-.1 F 1.057(If the w)6.057 F 1.057 +(ord is double-quoted,)-.1 F(${)108 206.4 Q F2(name)A F0 .521([*]} e)B +.521(xpands to a single w)-.15 F .521(ord with the v)-.1 F .52 +(alue of each array member separated by the \214rst character)-.25 F +1.374(of the)108 218.4 R/F3 9/Times-Bold@0 SF(IFS)3.874 E F0 1.374 +(special v)3.624 F 1.375(ariable, and ${)-.25 F F2(name)A F0 1.375 +([@]} e)B 1.375(xpands each element of)-.15 F F2(name)3.875 E F0 1.375 +(to a separate w)3.875 F 3.875(ord. When)-.1 F 2.028 +(there are no array members, ${)108 230.4 R F2(name)A F0 2.028([@]} e)B +2.028(xpands to nothing.)-.15 F 2.027(If the double-quoted e)7.028 F +2.027(xpansion occurs)-.15 F .758(within a w)108 242.4 R .759 +(ord, the e)-.1 F .759 +(xpansion of the \214rst parameter is joined with the be)-.15 F .759 +(ginning part of the original w)-.15 F(ord,)-.1 E .516(and the e)108 +254.4 R .516(xpansion of the last parameter is joined with the last par\ +t of the original w)-.15 F 3.015(ord. This)-.1 F .515(is analogous)3.015 +F .227(to the e)108 266.4 R .228(xpansion of the special parameters)-.15 +F F1(*)2.728 E F0(and)2.728 E F1(@)2.728 E F0(\(see)2.728 E F1 .228 +(Special P)2.728 F(arameters)-.1 E F0(abo)2.728 E -.15(ve)-.15 G 2.728 +(\). ${#).15 F F2(name)A F0([)A F2(subscript)A F0(]})A -.15(ex)108 278.4 +S .886(pands to the length of ${).15 F F2(name)A F0([)A F2(subscript)A +F0 3.386(]}. If)B F2(subscript)3.386 E F0(is)3.386 E F1(*)3.386 E F0(or) +3.386 E F1(@)3.386 E F0 3.386(,t)C .886(he e)-3.386 F .886 +(xpansion is the number of ele-)-.15 F .462(ments in the array)108 290.4 +R 5.462(.R)-.65 G .462(eferencing an array v)-5.462 F .463 +(ariable without a subscript is equi)-.25 F -.25(va)-.25 G .463 +(lent to referencing the array).25 F(with a subscript of 0.)108 302.4 Q +.168(An array v)108 319.2 R .168 +(ariable is considered set if a subscript has been assigned a v)-.25 F +2.668(alue. The)-.25 F .168(null string is a v)2.668 F .168(alid v)-.25 +F(alue.)-.25 E(The)108 336 Q F1(unset)2.766 E F0 -.2(bu)2.766 G .267 +(iltin is used to destro).2 F 2.767(ya)-.1 G(rrays.)-2.767 E F1(unset) +5.267 E F2(name)2.767 E F0([)A F2(subscript)A F0 2.767(]d)C(estro)-2.767 +E .267(ys the array element at inde)-.1 F(x)-.15 E F2(sub-)2.767 E +(script)108 348 Q F0 6.205(.C)C 1.205(are must be tak)-6.205 F 1.205 +(en to a)-.1 F -.2(vo)-.2 G 1.205(id unw).2 F 1.205(anted side ef)-.1 F +1.204(fects caused by pathname e)-.25 F(xpansion.)-.15 E F1(unset)6.204 +E F2(name)3.704 E F0(,)A(where)108 360 Q F2(name)2.5 E F0(is an array) +2.5 E 2.5(,o)-.65 G(r)-2.5 E F1(unset)2.5 E F2(name)2.5 E F0([)A F2 +(subscript)A F0(], where)A F2(subscript)2.5 E F0(is)2.5 E F1(*)2.5 E F0 +(or)2.5 E F1(@)2.5 E F0 2.5(,r)C(emo)-2.5 E -.15(ve)-.15 G 2.5(st).15 G +(he entire array)-2.5 E(.)-.65 E(The)108 376.8 Q F1(declar)3.573 E(e) +-.18 E F0(,)A F1(local)3.573 E F0 3.573(,a)C(nd)-3.573 E F1 -.18(re) +3.573 G(adonly).18 E F0 -.2(bu)3.573 G 1.073(iltins each accept a).2 F +F1<ad61>3.573 E F0 1.073(option to specify an inde)3.573 F -.15(xe)-.15 +G 3.574(da).15 G 1.074(rray and a)-3.574 F F1<ad41>3.574 E F0 .752 +(option to specify an associati)108 388.8 R 1.052 -.15(ve a)-.25 H(rray) +.15 E 5.752(.T)-.65 G(he)-5.752 E F1 -.18(re)3.252 G(ad).18 E F0 -.2(bu) +3.252 G .752(iltin accepts a).2 F F1<ad61>3.252 E F0 .751 +(option to assign a list of w)3.251 F .751(ords read)-.1 F .502 +(from the standard input to an array)108 400.8 R 5.502(.T)-.65 G(he) +-5.502 E F1(set)3.002 E F0(and)3.002 E F1(declar)3.002 E(e)-.18 E F0 -.2 +(bu)3.002 G .502(iltins display array v).2 F .502(alues in a w)-.25 F +.503(ay that allo)-.1 F(ws)-.25 E(them to be reused as assignments.)108 +412.8 Q/F4 10.95/Times-Bold@0 SF(EXP)72 429.6 Q(ANSION)-.81 E F0 .76(Ex\ +pansion is performed on the command line after it has been split into w) +108 441.6 R 3.26(ords. There)-.1 F .76(are se)3.26 F -.15(ve)-.25 G 3.26 +(nk).15 G .76(inds of)-3.26 F -.15(ex)108 453.6 S .369 +(pansion performed:).15 F F2(br)2.869 E .369(ace e)-.15 F(xpansion)-.2 E +F0(,).24 E F2 .369(tilde e)2.869 F(xpansion)-.2 E F0(,).24 E F2(par) +2.869 E .369(ameter and variable e)-.15 F(xpansion)-.2 E F0(,).24 E F2 +.37(command sub-)2.869 F(stitution)108 465.6 Q F0(,).24 E F2 +(arithmetic e)2.5 E(xpansion)-.2 E F0(,).24 E F2(wor)2.5 E 2.5(ds)-.37 G +(plitting)-2.5 E F0 2.5(,a).22 G(nd)-2.5 E F2(pathname e)2.5 E(xpansion) +-.2 E F0(.).24 E .471(The order of e)108 482.4 R .471 +(xpansions is: brace e)-.15 F .471(xpansion, tilde e)-.15 F .471 +(xpansion, parameter)-.15 F 2.971(,v)-.4 G .47(ariable and arithmetic e) +-3.221 F(xpansion)-.15 E +(and command substitution \(done in a left-to-right f)108 494.4 Q +(ashion\), w)-.1 E(ord splitting, and pathname e)-.1 E(xpansion.)-.15 E +(On systems that can support it, there is an additional e)108 511.2 Q +(xpansion a)-.15 E -.25(va)-.2 G(ilable:).25 E F2(pr)2.5 E +(ocess substitution)-.45 E F0(.)A 1.486(Only brace e)108 528 R 1.486 +(xpansion, w)-.15 F 1.486(ord splitting, and pathname e)-.1 F 1.487 +(xpansion can change the number of w)-.15 F 1.487(ords of the)-.1 F -.15 +(ex)108 540 S 1.165(pansion; other e).15 F 1.165(xpansions e)-.15 F +1.165(xpand a single w)-.15 F 1.165(ord to a single w)-.1 F 3.665 +(ord. The)-.1 F 1.164(only e)3.665 F 1.164(xceptions to this are the) +-.15 F -.15(ex)108 552 S(pansions of ").15 E F1($@)A F0 2.5("a)C(nd ") +-2.5 E F1(${)A F2(name)A F1([@]})A F0 2.5("a)C 2.5(se)-2.5 G +(xplained abo)-2.65 E .3 -.15(ve \()-.15 H(see).15 E F3 -.666(PA)2.5 G +(RAMETERS).666 E/F5 9/Times-Roman@0 SF(\).)A F1(Brace Expansion)87 568.8 +Q F2(Br)108.58 580.8 Q .606(ace e)-.15 F(xpansion)-.2 E F0 .606 +(is a mechanism by which arbitrary strings may be generated.)3.346 F +.606(This mechanism is similar)5.606 F(to)108 592.8 Q F2 .415 +(pathname e)2.915 F(xpansion)-.2 E F0 2.915(,b)C .415 +(ut the \214lenames generated need not e)-3.115 F 2.915(xist. P)-.15 F +.415(atterns to be brace e)-.15 F .415(xpanded tak)-.15 F 2.915(et)-.1 G +(he)-2.915 E .151(form of an optional)108 604.8 R F2(pr)2.651 E(eamble) +-.37 E F0 2.651(,f).18 G(ollo)-2.651 E .151 +(wed by either a series of comma-separated strings or a sequence e)-.25 +F(xpres-)-.15 E .563(sion between a pair of braces, follo)108 616.8 R +.563(wed by an optional)-.25 F F2(postscript)3.063 E F0 5.563(.T).68 G +.563(he preamble is pre\214x)-5.563 F .563(ed to each string)-.15 F .659 +(contained within the braces, and the postscript is then appended to ea\ +ch resulting string, e)108 628.8 R .659(xpanding left to)-.15 F(right.) +108 640.8 Q .719(Brace e)108 657.6 R .719(xpansions may be nested.)-.15 +F .719(The results of each e)5.719 F .719 +(xpanded string are not sorted; left to right order is)-.15 F(preserv) +108 669.6 Q 2.5(ed. F)-.15 F(or e)-.15 E(xample, a)-.15 E F1({)A F0 +(d,c,b)A F1(})A F0 2.5(ee)C(xpands into `ade ace abe'.)-2.65 E 3.242(As) +108 686.4 S .742(equence e)-3.242 F .742(xpression tak)-.15 F .742 +(es the form)-.1 F F1({)3.242 E F2(x)A F1(..)A F2(y)A F1([..)A F2(incr)A +F1(]})A F0 3.242(,w)C(here)-3.242 E F2(x)3.242 E F0(and)3.243 E F2(y) +3.243 E F0 .743(are either inte)3.243 F .743(gers or single characters,) +-.15 F(and)108 698.4 Q F2(incr)3.032 E F0 3.032(,a)C 3.032(no)-3.032 G +.532(ptional increment, is an inte)-3.032 F(ger)-.15 E 5.532(.W)-.55 G +.532(hen inte)-5.532 F .532(gers are supplied, the e)-.15 F .532 +(xpression e)-.15 F .531(xpands to each)-.15 F .077(number between)108 +710.4 R F2(x)2.577 E F0(and)2.577 E F2(y)2.577 E F0 2.577(,i)C(nclusi) +-2.577 E -.15(ve)-.25 G 5.077(.S).15 G .077(upplied inte)-5.077 F .077 +(gers may be pre\214x)-.15 F .077(ed with)-.15 F F2(0)2.577 E F0 .078 +(to force each term to ha)2.578 F .378 -.15(ve t)-.2 H(he).15 E .015 +(same width.)108 722.4 R .015(When either)5.015 F F2(x)2.515 E F0(or) +2.515 E F2(y)2.515 E F0(be)2.515 E .014(gins with a zero, the shell att\ +empts to force all generated terms to contain)-.15 F(GNU Bash-4.1)72 768 +Q(2009 December 29)135.965 E(17)185.955 E 0 Cg EP +%%Page: 18 18 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 1.143(the same number of digits, zero-padding where necessary)108 +84 R 6.143(.W)-.65 G 1.143(hen characters are supplied, the e)-6.143 F +(xpression)-.15 E -.15(ex)108 96 S .542(pands to each character le).15 F +.542(xicographically between)-.15 F/F1 10/Times-Italic@0 SF(x)3.042 E F0 +(and)3.042 E F1(y)3.042 E F0 3.042(,i)C(nclusi)-3.042 E -.15(ve)-.25 G +5.542(.N).15 G .542(ote that both)-5.542 F F1(x)3.041 E F0(and)3.041 E +F1(y)3.041 E F0 .541(must be of)3.041 F .182(the same type.)108 108 R +.182(When the increment is supplied, it is used as the dif)5.182 F .183 +(ference between each term.)-.25 F .183(The def)5.183 F(ault)-.1 E +(increment is 1 or -1 as appropriate.)108 120 Q .582(Brace e)108 136.8 R +.582(xpansion is performed before an)-.15 F 3.082(yo)-.15 G .581(ther e) +-3.082 F .581(xpansions, and an)-.15 F 3.081(yc)-.15 G .581 +(haracters special to other e)-3.081 F(xpansions)-.15 E .015 +(are preserv)108 148.8 R .015(ed in the result.)-.15 F .015 +(It is strictly te)5.015 F(xtual.)-.15 E/F2 10/Times-Bold@0 SF(Bash) +5.016 E F0 .016(does not apply an)2.516 F 2.516(ys)-.15 G .016 +(yntactic interpretation to the con-)-2.516 F(te)108 160.8 Q +(xt of the e)-.15 E(xpansion or the te)-.15 E(xt between the braces.) +-.15 E 3.633(Ac)108 177.6 S 1.133(orrectly-formed brace e)-3.633 F 1.132 +(xpansion must contain unquoted opening and closing braces, and at leas\ +t one)-.15 F 3.44(unquoted comma or a v)108 189.6 R 3.441 +(alid sequence e)-.25 F 5.941(xpression. An)-.15 F 5.941(yi)-.15 G 3.441 +(ncorrectly formed brace e)-5.941 F 3.441(xpansion is left)-.15 F 2.755 +(unchanged. A)108 201.6 R F2({)2.755 E F0(or)2.755 E F2(,)2.755 E F0 +.255(may be quoted with a backslash to pre)2.755 F -.15(ve)-.25 G .255 +(nt its being considered part of a brace e).15 F(xpres-)-.15 E 2.91 +(sion. T)108 213.6 R 2.91(oa)-.8 G -.2(vo)-3.11 G .41 +(id con\215icts with parameter e).2 F .411(xpansion, the string)-.15 F +F2(${)2.911 E F0 .411(is not considered eligible for brace e)2.911 F +(xpan-)-.15 E(sion.)108 225.6 Q 1.476(This construct is typically used \ +as shorthand when the common pre\214x of the strings to be generated is) +108 242.4 R(longer than in the abo)108 254.4 Q .3 -.15(ve ex)-.15 H +(ample:).15 E(mkdir /usr/local/src/bash/{old,ne)144 271.2 Q -.65(w,)-.25 +G(dist,b).65 E(ugs})-.2 E(or)108 283.2 Q(cho)144 295.2 Q +(wn root /usr/{ucb/{e)-.25 E(x,edit},lib/{e)-.15 E(x?.?*,ho)-.15 E(w_e) +-.25 E(x}})-.15 E .618(Brace e)108 312 R .618 +(xpansion introduces a slight incompatibility with historical v)-.15 F +.618(ersions of)-.15 F F2(sh)3.118 E F0(.)A F2(sh)5.618 E F0 .618 +(does not treat open-)3.118 F .248 +(ing or closing braces specially when the)108 324 R 2.748(ya)-.15 G .247 +(ppear as part of a w)-2.748 F .247(ord, and preserv)-.1 F .247 +(es them in the output.)-.15 F F2(Bash)5.247 E F0(remo)108 336 Q -.15 +(ve)-.15 G 3.53(sb).15 G 1.03(races from w)-3.53 F 1.03 +(ords as a consequence of brace e)-.1 F 3.53(xpansion. F)-.15 F 1.03 +(or e)-.15 F 1.03(xample, a w)-.15 F 1.03(ord entered to)-.1 F F2(sh) +3.53 E F0(as)3.53 E F1(\214le{1,2})108 348 Q F0 .515 +(appears identically in the output.)3.015 F .515(The same w)5.515 F .515 +(ord is output as)-.1 F F1 .514(\214le1 \214le2)4.925 F F0 .514(after e) +3.034 F .514(xpansion by)-.15 F F2(bash)3.014 E F0(.)A .436 +(If strict compatibility with)108 360 R F2(sh)2.936 E F0 .436 +(is desired, start)2.936 F F2(bash)2.936 E F0 .436(with the)2.936 F F2 +(+B)2.936 E F0 .436(option or disable brace e)2.936 F .437 +(xpansion with the)-.15 F F2(+B)108 372 Q F0(option to the)2.5 E F2(set) +2.5 E F0(command \(see)2.5 E/F3 9/Times-Bold@0 SF(SHELL B)2.5 E(UIL)-.09 +E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 E F2 -.18(Ti)87 388.8 S +(lde Expansion).18 E F0 1.087(If a w)108 400.8 R 1.087(ord be)-.1 F +1.087(gins with an unquoted tilde character \(`)-.15 F F2(~)A F0 1.086 +('\), all of the characters preceding the \214rst unquoted)B .185(slash\ + \(or all characters, if there is no unquoted slash\) are considered a) +108 412.8 R F1(tilde-pr)2.685 E(e\214x)-.37 E F0 5.185(.I)C 2.685(fn) +-5.185 G .185(one of the characters)-2.685 F .726(in the tilde-pre\214x\ + are quoted, the characters in the tilde-pre\214x follo)108 424.8 R .725 +(wing the tilde are treated as a possible)-.25 F F1(lo)108 436.8 Q .522 +(gin name)-.1 F F0 5.522(.I)C 3.022(ft)-5.522 G .522 +(his login name is the null string, the tilde is replaced with the v) +-3.022 F .523(alue of the shell parameter)-.25 F F3(HOME)108 448.8 Q/F4 +9/Times-Roman@0 SF(.)A F0(If)4.787 E F3(HOME)2.787 E F0 .287 +(is unset, the home directory of the user e)2.537 F -.15(xe)-.15 G .286 +(cuting the shell is substituted instead.).15 F(Other)5.286 E(-)-.2 E(w\ +ise, the tilde-pre\214x is replaced with the home directory associated \ +with the speci\214ed login name.)108 460.8 Q .092 +(If the tilde-pre\214x is a `~+', the v)108 477.6 R .092 +(alue of the shell v)-.25 F(ariable)-.25 E F3(PWD)2.592 E F0 .092 +(replaces the tilde-pre\214x.)2.342 F .093(If the tilde-pre\214x is) +5.093 F 3.404(a`)108 489.6 S .904(~\255', the v)-3.404 F .904 +(alue of the shell v)-.25 F(ariable)-.25 E F3(OLDPWD)3.404 E F4(,)A F0 +.904(if it is set, is substituted.)3.154 F .903(If the characters follo) +5.903 F .903(wing the)-.25 F 1.641 +(tilde in the tilde-pre\214x consist of a number)108 501.6 R F1(N)4.141 +E F0 4.142(,o)C 1.642(ptionally pre\214x)-4.142 F 1.642 +(ed by a `+' or a `\255', the tilde-pre\214x is)-.15 F 1.438(replaced w\ +ith the corresponding element from the directory stack, as it w)108 +513.6 R 1.437(ould be displayed by the)-.1 F F2(dirs)3.937 E F0 -.2(bu) +108 525.6 S .454(iltin in).2 F -.2(vo)-.4 G -.1(ke).2 G 2.954(dw).1 G +.454(ith the tilde-pre\214x as an ar)-2.954 F 2.954(gument. If)-.18 F +.454(the characters follo)2.954 F .455 +(wing the tilde in the tilde-pre\214x)-.25 F +(consist of a number without a leading `+' or `\255', `+' is assumed.) +108 537.6 Q(If the login name is in)108 554.4 Q -.25(va)-.4 G +(lid, or the tilde e).25 E(xpansion f)-.15 E(ails, the w)-.1 E +(ord is unchanged.)-.1 E .167(Each v)108 571.2 R .167 +(ariable assignment is check)-.25 F .167(ed for unquoted tilde-pre\214x) +-.1 F .167(es immediately follo)-.15 F .167(wing a)-.25 F F2(:)2.667 E +F0 .167(or the \214rst)2.667 F F2(=)2.666 E F0 5.166(.I)C(n)-5.166 E +.281(these cases, tilde e)108 583.2 R .282(xpansion is also performed.) +-.15 F(Consequently)5.282 E 2.782(,o)-.65 G .282 +(ne may use \214le names with tildes in assign-)-2.782 F(ments to)108 +595.2 Q F3 -.666(PA)2.5 G(TH)-.189 E F4(,)A F3(MAILP)2.25 E -.855(AT) +-.666 G(H).855 E F4(,)A F0(and)2.25 E F3(CDP)2.5 E -.855(AT)-.666 G(H) +.855 E F4(,)A F0(and the shell assigns the e)2.25 E(xpanded v)-.15 E +(alue.)-.25 E F2 -.1(Pa)87 612 S(rameter Expansion).1 E F0 1.606(The `) +108 624 R F2($)A F0 4.106('c)C 1.606(haracter introduces parameter e) +-4.106 F 1.605(xpansion, command substitution, or arithmetic e)-.15 F +4.105(xpansion. The)-.15 F .406(parameter name or symbol to be e)108 636 +R .407(xpanded may be enclosed in braces, which are optional b)-.15 F +.407(ut serv)-.2 F 2.907(et)-.15 G 2.907(op)-2.907 G(ro-)-2.907 E .033 +(tect the v)108 648 R .033(ariable to be e)-.25 F .033 +(xpanded from characters immediately follo)-.15 F .032 +(wing it which could be interpreted as part)-.25 F(of the name.)108 660 +Q 1.189 +(When braces are used, the matching ending brace is the \214rst `)108 +676.8 R F2(})A F0 3.69('n)C 1.19(ot escaped by a backslash or within a) +-3.69 F 2.15(quoted string, and not within an embedded arithmetic e)108 +688.8 R 2.15(xpansion, command substitution, or parameter)-.15 F -.15 +(ex)108 700.8 S(pansion.).15 E(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(18)185.955 E 0 Cg EP +%%Page: 19 19 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(${)108 84 Q/F1 10/Times-Italic@0 SF(par)A(ameter)-.15 E F0(})A +1.204(The v)144 96 R 1.204(alue of)-.25 F F1(par)3.704 E(ameter)-.15 E +F0 1.204(is substituted.)3.704 F 1.204(The braces are required when) +6.204 F F1(par)4.955 E(ameter)-.15 E F0 1.205(is a positional)4.435 F +.264(parameter with more than one digit, or when)144 108 R F1(par)4.014 +E(ameter)-.15 E F0 .264(is follo)3.494 F .264 +(wed by a character which is not to)-.25 F +(be interpreted as part of its name.)144 120 Q .685 +(If the \214rst character of)108 136.8 R F1(par)3.185 E(ameter)-.15 E F0 +.685(is an e)3.185 F .685(xclamation point \()-.15 F/F2 10/Times-Bold@0 +SF(!)A F0 .685(\), a le)B -.15(ve)-.25 G 3.186(lo).15 G 3.186(fv)-3.186 +G .686(ariable indirection is introduced.)-3.436 F F2(Bash)108 148.8 Q +F0 .106(uses the v)2.606 F .106(alue of the v)-.25 F .106 +(ariable formed from the rest of)-.25 F F1(par)2.606 E(ameter)-.15 E F0 +.106(as the name of the v)2.606 F .106(ariable; this v)-.25 F(ari-)-.25 +E .351(able is then e)108 160.8 R .351(xpanded and that v)-.15 F .352 +(alue is used in the rest of the substitution, rather than the v)-.25 F +.352(alue of)-.25 F F1(par)2.852 E(ame-)-.15 E(ter)108 172.8 Q F0 2.52 +(itself. This)2.52 F .02(is kno)2.52 F .02(wn as)-.25 F F1(indir)2.52 E +.02(ect e)-.37 F(xpansion)-.2 E F0 5.019(.T)C .019(he e)-5.019 F .019 +(xceptions to this are the e)-.15 F .019(xpansions of ${!)-.15 F F1(pr)A +(e\214x)-.37 E F0 .019(*} and)B(${)108 184.8 Q F2(!)A F1(name)A F0([)A +F1(@)A F0 .762(]} described belo)B 4.563 -.65(w. T)-.25 H .763(he e).65 +F .763(xclamation point must immediately follo)-.15 F 3.263(wt)-.25 G +.763(he left brace in order to)-3.263 F(introduce indirection.)108 196.8 +Q .334(In each of the cases belo)108 213.6 R -.65(w,)-.25 G F1(wor)3.484 +E(d)-.37 E F0 .334(is subject to tilde e)2.834 F .334 +(xpansion, parameter e)-.15 F .334(xpansion, command substitution,)-.15 +F(and arithmetic e)108 225.6 Q(xpansion.)-.15 E .697 +(When not performing substring e)108 242.4 R .698 +(xpansion, using the forms documented belo)-.15 F -.65(w,)-.25 G F2 +(bash)3.848 E F0 .698(tests for a parameter)3.198 F +(that is unset or null.)108 254.4 Q(Omitting the colon results in a tes\ +t only for a parameter that is unset.)5 E(${)108 271.2 Q F1(par)A +(ameter)-.15 E F2<3aad>A F1(wor)A(d)-.37 E F0(})A F2 .723(Use Default V) +144 283.2 R(alues)-.92 E F0 5.723(.I)C(f)-5.723 E F1(par)4.473 E(ameter) +-.15 E F0 .723(is unset or null, the e)3.953 F .722(xpansion of)-.15 F +F1(wor)3.562 E(d)-.37 E F0 .722(is substituted.)3.992 F(Other)5.722 E(-) +-.2 E(wise, the v)144 295.2 Q(alue of)-.25 E F1(par)3.75 E(ameter)-.15 E +F0(is substituted.)3.23 E(${)108 307.2 Q F1(par)A(ameter)-.15 E F2(:=)A +F1(wor)A(d)-.37 E F0(})A F2 2.004(Assign Default V)144 319.2 R(alues) +-.92 E F0 7.004(.I)C(f)-7.004 E F1(par)5.754 E(ameter)-.15 E F0 2.005 +(is unset or null, the e)5.234 F 2.005(xpansion of)-.15 F F1(wor)4.845 E +(d)-.37 E F0 2.005(is assigned to)5.275 F F1(par)144 331.2 Q(ameter)-.15 +E F0 5.279(.T).73 G .279(he v)-5.279 F .279(alue of)-.25 F F1(par)4.029 +E(ameter)-.15 E F0 .278(is then substituted.)3.508 F .278 +(Positional parameters and special param-)5.278 F +(eters may not be assigned to in this w)144 343.2 Q(ay)-.1 E(.)-.65 E +(${)108 355.2 Q F1(par)A(ameter)-.15 E F2(:?)A F1(wor)A(d)-.37 E F0(})A +F2 .535(Display Err)144 367.2 R .535(or if Null or Unset)-.18 F F0 5.535 +(.I)C(f)-5.535 E F1(par)4.285 E(ameter)-.15 E F0 .535 +(is null or unset, the e)3.765 F .535(xpansion of)-.15 F F1(wor)3.035 E +(d)-.37 E F0 .535(\(or a mes-)3.035 F .662(sage to that ef)144 379.2 R +.662(fect if)-.25 F F1(wor)3.502 E(d)-.37 E F0 .661(is not present\) is\ + written to the standard error and the shell, if it is not)3.932 F +(interacti)144 391.2 Q -.15(ve)-.25 G 2.5(,e).15 G 2.5(xits. Otherwise,) +-2.65 F(the v)2.5 E(alue of)-.25 E F1(par)2.5 E(ameter)-.15 E F0 +(is substituted.)2.5 E(${)108 403.2 Q F1(par)A(ameter)-.15 E F2(:+)A F1 +(wor)A(d)-.37 E F0(})A F2 .745(Use Alter)144 415.2 R .745(nate V)-.15 F +(alue)-.92 E F0 5.745(.I)C(f)-5.745 E F1(par)4.495 E(ameter)-.15 E F0 +.745(is null or unset, nothing is substituted, otherwise the e)3.975 F +(xpan-)-.15 E(sion of)144 427.2 Q F1(wor)2.84 E(d)-.37 E F0 +(is substituted.)3.27 E(${)108 439.2 Q F1(par)A(ameter)-.15 E F2(:)A F1 +(of)A(fset)-.18 E F0(})A(${)108 451.2 Q F1(par)A(ameter)-.15 E F2(:)A F1 +(of)A(fset)-.18 E F2(:)A F1(length)A F0(})A F2 .797 +(Substring Expansion.)144 463.2 R F0 .796(Expands to up to)5.797 F F1 +(length)3.296 E F0 .796(characters of)3.296 F F1(par)3.296 E(ameter)-.15 +E F0 .796(starting at the character)3.296 F .228(speci\214ed by)144 +475.2 R F1(of)2.728 E(fset)-.18 E F0 5.228(.I)C(f)-5.228 E F1(length) +2.728 E F0 .229(is omitted, e)2.729 F .229(xpands to the substring of) +-.15 F F1(par)2.729 E(ameter)-.15 E F0 .229(starting at the char)2.729 F +(-)-.2 E .433(acter speci\214ed by)144 487.2 R F1(of)2.933 E(fset)-.18 E +F0(.)A F1(length)5.433 E F0(and)2.933 E F1(of)2.933 E(fset)-.18 E F0 +.433(are arithmetic e)2.933 F .433(xpressions \(see)-.15 F/F3 9 +/Times-Bold@0 SF .432(ARITHMETIC EV)2.933 F(ALU-)-1.215 E -.855(AT)144 +499.2 S(ION).855 E F0(belo)2.576 E(w\).)-.25 E F1(length)5.326 E F0 .326 +(must e)2.826 F -.25(va)-.25 G .326 +(luate to a number greater than or equal to zero.).25 F(If)5.327 E F1 +(of)2.827 E(fset)-.18 E F0 -.25(eva)2.827 G(luates).25 E .016 +(to a number less than zero, the v)144 511.2 R .015 +(alue is used as an of)-.25 F .015(fset from the end of the v)-.25 F +.015(alue of)-.25 F F1(par)2.515 E(ameter)-.15 E F0 5.015(.I)C(f)-5.015 +E F1(par)144 523.2 Q(ameter)-.15 E F0(is)3.25 E F2(@)3.25 E F0 3.25(,t)C +.75(he result is)-3.25 F F1(length)3.25 E F0 .75 +(positional parameters be)3.25 F .75(ginning at)-.15 F F1(of)3.25 E +(fset)-.18 E F0 5.75(.I)C(f)-5.75 E F1(par)3.25 E(ameter)-.15 E F0 .75 +(is an)3.25 F(inde)144 535.2 Q -.15(xe)-.15 G 2.702(da).15 G .201 +(rray name subscripted by @ or *, the result is the)-2.702 F F1(length) +2.701 E F0 .201(members of the array be)2.701 F(ginning)-.15 E 1.282 +(with ${)144 547.2 R F1(par)A(ameter)-.15 E F0([)A F1(of)A(fset)-.18 E +F0 3.782(]}. A)B(ne)3.782 E -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G F1 +(of)3.932 E(fset)-.18 E F0 1.282(is tak)3.782 F 1.282(en relati)-.1 F +1.582 -.15(ve t)-.25 H 3.782(oo).15 G 1.283(ne greater than the maximum) +-3.782 F(inde)144 559.2 Q 3.435(xo)-.15 G 3.435(ft)-3.435 G .935 +(he speci\214ed array)-3.435 F 5.935(.S)-.65 G .935(ubstring e)-5.935 F +.935(xpansion applied to an associati)-.15 F 1.234 -.15(ve a)-.25 H .934 +(rray produces unde-).15 F .261(\214ned results.)144 571.2 R .261 +(Note that a ne)5.261 F -.05(ga)-.15 G(ti).05 E .561 -.15(ve o)-.25 H +-.25(ff).15 G .261 +(set must be separated from the colon by at least one space to).25 F -.2 +(avo)144 583.2 S .155(id being confused with the :- e).2 F 2.655 +(xpansion. Substring)-.15 F(inde)2.655 E .154 +(xing is zero-based unless the positional)-.15 F .532 +(parameters are used, in which case the inde)144 595.2 R .532 +(xing starts at 1 by def)-.15 F 3.032(ault. If)-.1 F F1(of)3.032 E(fset) +-.18 E F0 .532(is 0, and the posi-)3.032 F(tional parameters are used,) +144 607.2 Q F2($0)2.5 E F0(is pre\214x)2.5 E(ed to the list.)-.15 E(${) +108 624 Q F2(!)A F1(pr)A(e\214x)-.37 E F2(*)A F0(})A(${)108 636 Q F2(!)A +F1(pr)A(e\214x)-.37 E F2(@)A F0(})A F2 .085(Names matching pr)144 648 R +(e\214x.)-.18 E F0 .084(Expands to the names of v)5.085 F .084 +(ariables whose names be)-.25 F .084(gin with)-.15 F F1(pr)2.584 E +(e\214x)-.37 E F0 2.584(,s)C(epa-)-2.584 E .257 +(rated by the \214rst character of the)144 660 R F3(IFS)2.757 E F0 .257 +(special v)2.507 F 2.757(ariable. When)-.25 F F1(@)2.758 E F0 .258 +(is used and the e)2.758 F .258(xpansion appears)-.15 F +(within double quotes, each v)144 672 Q(ariable name e)-.25 E +(xpands to a separate w)-.15 E(ord.)-.1 E(${)108 688.8 Q F2(!)A F1(name) +A F0([)A F1(@)A F0(]})A(${)108 700.8 Q F2(!)A F1(name)A F0([)A F1(*)A F0 +(]})A F2 2.036(List of array k)144 712.8 R(eys.)-.1 E F0(If)7.036 E F1 +(name)4.536 E F0 2.036(is an array v)4.536 F 2.036(ariable, e)-.25 F +2.036(xpands to the list of array indices \(k)-.15 F -.15(ey)-.1 G(s\)) +.15 E .595(assigned in)144 724.8 R F1(name)3.095 E F0 5.595(.I)C(f) +-5.595 E F1(name)3.095 E F0 .595(is not an array)3.095 F 3.095(,e)-.65 G +.595(xpands to 0 if)-3.245 F F1(name)3.095 E F0 .596 +(is set and null otherwise.)3.095 F(When)5.596 E(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(19)185.955 E 0 Cg EP +%%Page: 20 20 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Italic@0 SF(@)144 84 Q F0(is used and the e)2.5 E +(xpansion appears within double quotes, each k)-.15 E .3 -.15(ey ex)-.1 +H(pands to a separate w).15 E(ord.)-.1 E(${)108 100.8 Q/F2 10 +/Times-Bold@0 SF(#)A F1(par)A(ameter)-.15 E F0(})A F2 -.1(Pa)144 112.8 S +.471(rameter length.).1 F F0 .471(The length in characters of the v) +5.471 F .471(alue of)-.25 F F1(par)2.971 E(ameter)-.15 E F0 .47 +(is substituted.)2.97 F(If)5.47 E F1(par)4.22 E(ame-)-.15 E(ter)144 +124.8 Q F0(is)4.438 E F2(*)3.708 E F0(or)3.708 E F2(@)3.708 E F0 3.708 +(,t)C 1.208(he v)-3.708 F 1.208 +(alue substituted is the number of positional parameters.)-.25 F(If) +6.209 E F1(par)4.959 E(ameter)-.15 E F0 1.209(is an)4.439 F +(array name subscripted by)144 136.8 Q F2(*)2.5 E F0(or)2.5 E F2(@)2.5 E +F0 2.5(,t)C(he v)-2.5 E +(alue substituted is the number of elements in the array)-.25 E(.)-.65 E +(${)108 153.6 Q F1(par)A(ameter)-.15 E F2(#)A F1(wor)A(d)-.37 E F0(})A +(${)108 165.6 Q F1(par)A(ameter)-.15 E F2(##)A F1(wor)A(d)-.37 E F0(})A +F2(Remo)144 177.6 Q 1.396 -.1(ve m)-.1 H 1.196(atching pr).1 F 1.196 +(e\214x patter)-.18 F(n.)-.15 E F0(The)6.196 E F1(wor)4.036 E(d)-.37 E +F0 1.196(is e)4.466 F 1.196 +(xpanded to produce a pattern just as in path-)-.15 F .151(name e)144 +189.6 R 2.651(xpansion. If)-.15 F .152(the pattern matches the be)2.652 +F .152(ginning of the v)-.15 F .152(alue of)-.25 F F1(par)2.652 E +(ameter)-.15 E F0 2.652(,t).73 G .152(hen the result of)-2.652 F 1.4 +(the e)144 201.6 R 1.4(xpansion is the e)-.15 F 1.4(xpanded v)-.15 F 1.4 +(alue of)-.25 F F1(par)5.15 E(ameter)-.15 E F0 1.4 +(with the shortest matching pattern \(the `)4.63 F(`)-.74 E F2(#)A F0 +-.74('')C .281(case\) or the longest matching pattern \(the `)144 213.6 +R(`)-.74 E F2(##)A F0 1.761 -.74('' c)D .281(ase\) deleted.).74 F(If) +5.281 E F1(par)4.031 E(ameter)-.15 E F0(is)3.511 E F2(@)2.781 E F0(or) +2.781 E F2(*)2.782 E F0 2.782(,t)C .282(he pattern)-2.782 F(remo)144 +225.6 Q -.25(va)-.15 G 3.274(lo).25 G .774 +(peration is applied to each positional parameter in turn, and the e) +-3.274 F .774(xpansion is the resul-)-.15 F .401(tant list.)144 237.6 R +(If)5.401 E F1(par)4.151 E(ameter)-.15 E F0 .401(is an array v)3.631 F +.401(ariable subscripted with)-.25 F F2(@)2.901 E F0(or)2.901 E F2(*) +2.901 E F0 2.902(,t)C .402(he pattern remo)-2.902 F -.25(va)-.15 G 2.902 +(lo).25 G(peration)-2.902 E +(is applied to each member of the array in turn, and the e)144 249.6 Q +(xpansion is the resultant list.)-.15 E(${)108 266.4 Q F1(par)A(ameter) +-.15 E F2(%)A F1(wor)A(d)-.37 E F0(})A(${)108 278.4 Q F1(par)A(ameter) +-.15 E F2(%%)A F1(wor)A(d)-.37 E F0(})A F2(Remo)144 290.4 Q .347 -.1 +(ve m)-.1 H .147(atching suf\214x patter).1 F(n.)-.15 E F0(The)5.147 E +F1(wor)2.647 E(d)-.37 E F0 .147(is e)2.647 F .146 +(xpanded to produce a pattern just as in pathname)-.15 F -.15(ex)144 +302.4 S 3.088(pansion. If).15 F .588 +(the pattern matches a trailing portion of the e)3.088 F .588(xpanded v) +-.15 F .588(alue of)-.25 F F1(par)3.088 E(ameter)-.15 E F0 3.088(,t).73 +G .588(hen the)-3.088 F .226(result of the e)144 314.4 R .226 +(xpansion is the e)-.15 F .226(xpanded v)-.15 F .226(alue of)-.25 F F1 +(par)3.976 E(ameter)-.15 E F0 .226 +(with the shortest matching pattern \(the)3.456 F -.74(``)144 326.4 S F2 +(%).74 E F0 1.521 -.74('' c)D .042 +(ase\) or the longest matching pattern \(the `).74 F(`)-.74 E F2(%%)A F0 +1.522 -.74('' c)D .042(ase\) deleted.).74 F(If)5.042 E F1(par)3.792 E +(ameter)-.15 E F0(is)3.272 E F2(@)2.542 E F0(or)2.542 E F2(*)2.542 E F0 +2.542(,t)C(he)-2.542 E .441(pattern remo)144 338.4 R -.25(va)-.15 G +2.941(lo).25 G .441 +(peration is applied to each positional parameter in turn, and the e) +-2.941 F .44(xpansion is the)-.15 F .24(resultant list.)144 350.4 R(If) +5.24 E F1(par)3.99 E(ameter)-.15 E F0 .24(is an array v)3.47 F .241 +(ariable subscripted with)-.25 F F2(@)2.741 E F0(or)2.741 E F2(*)2.741 E +F0 2.741(,t)C .241(he pattern remo)-2.741 F -.25(va)-.15 G 2.741(lo).25 +G(per)-2.741 E(-)-.2 E +(ation is applied to each member of the array in turn, and the e)144 +362.4 Q(xpansion is the resultant list.)-.15 E(${)108 379.2 Q F1(par)A +(ameter)-.15 E F2(/)A F1(pattern)A F2(/)A F1(string)A F0(})A F2 -.1(Pa) +144 391.2 S(tter).1 E 3.607(ns)-.15 G(ubstitution.)-3.607 E F0(The)6.107 +E F1(pattern)3.607 E F0 1.107(is e)3.607 F 1.106 +(xpanded to produce a pattern just as in pathname e)-.15 F(xpan-)-.15 E +(sion.)144 403.2 Q F1 -.8(Pa)6.033 G -.15(ra).8 G(meter).15 E F0 1.033 +(is e)3.533 F 1.033(xpanded and the longest match of)-.15 F F1(pattern) +3.533 E F0(ag)3.533 E 1.034(ainst its v)-.05 F 1.034 +(alue is replaced with)-.25 F F1(string)144 415.2 Q F0 5.161(.I)C(f) +-5.161 E F1(pattern)2.661 E F0(be)2.661 E .161(gins with)-.15 F F2(/) +2.661 E F0 2.661(,a)C .161(ll matches of)-2.661 F F1(pattern)2.661 E F0 +.16(are replaced with)2.661 F F1(string)2.66 E F0 5.16(.N)C .16 +(ormally only the)-5.16 F .806(\214rst match is replaced.)144 427.2 R +(If)5.806 E F1(pattern)3.306 E F0(be)3.306 E .806(gins with)-.15 F F2(#) +3.306 E F0 3.306(,i)C 3.307(tm)-3.306 G .807(ust match at the be)-3.307 +F .807(ginning of the e)-.15 F(xpanded)-.15 E -.25(va)144 439.2 S .621 +(lue of).25 F F1(par)3.121 E(ameter)-.15 E F0 5.621(.I)C(f)-5.621 E F1 +(pattern)3.121 E F0(be)3.121 E .621(gins with)-.15 F F2(%)3.121 E F0 +3.121(,i)C 3.121(tm)-3.121 G .62(ust match at the end of the e)-3.121 F +.62(xpanded v)-.15 F .62(alue of)-.25 F F1(par)144 451.2 Q(ameter)-.15 E +F0 6.253(.I)C(f)-6.253 E F1(string)3.753 E F0 1.253(is null, matches of) +3.753 F F1(pattern)3.753 E F0 1.253(are deleted and the)3.753 F F2(/) +3.753 E F0(follo)3.753 E(wing)-.25 E F1(pattern)3.753 E F0 1.254(may be) +3.754 F 2.679(omitted. If)144 463.2 R F1(par)3.929 E(ameter)-.15 E F0 +(is)3.409 E F2(@)2.679 E F0(or)2.679 E F2(*)2.679 E F0 2.679(,t)C .178 +(he substitution operation is applied to each positional parameter) +-2.679 F .618(in turn, and the e)144 475.2 R .619 +(xpansion is the resultant list.)-.15 F(If)5.619 E F1(par)4.369 E +(ameter)-.15 E F0 .619(is an array v)3.849 F .619 +(ariable subscripted with)-.25 F F2(@)144 487.2 Q F0(or)3.224 E F2(*) +3.224 E F0 3.224(,t)C .723(he substitution operation is applied to each\ + member of the array in turn, and the e)-3.224 F(xpan-)-.15 E +(sion is the resultant list.)144 499.2 Q(${)108 516 Q F1(par)A(ameter) +-.15 E F2(^)A F1(pattern)A F0(})A(${)108 528 Q F1(par)A(ameter)-.15 E F2 +(^^)A F1(pattern)A F0(})A(${)108 540 Q F1(par)A(ameter)-.15 E F2(,)A F1 +(pattern)A F0(})A(${)108 552 Q F1(par)A(ameter)-.15 E F2(,,)A F1 +(pattern)A F0(})A F2 .437(Case modi\214cation.)144 564 R F0 .437(This e) +5.437 F .438(xpansion modi\214es the case of alphabetic characters in) +-.15 F F1(par)2.938 E(ameter)-.15 E F0 5.438(.T)C(he)-5.438 E F1 +(pattern)144 576 Q F0 .814(is e)3.314 F .813 +(xpanded to produce a pattern just as in pathname e)-.15 F 3.313 +(xpansion. The)-.15 F F2(^)3.313 E F0 .813(operator con)3.313 F -.15(ve) +-.4 G(rts).15 E(lo)144 588 Q .18(wercase letters matching)-.25 F F1 +(pattern)2.681 E F0 .181(to uppercase; the)2.681 F F2(,)2.681 E F0 .181 +(operator con)2.681 F -.15(ve)-.4 G .181(rts matching uppercase letters) +.15 F .085(to lo)144 600 R 2.585(wercase. The)-.25 F F2(^^)2.585 E F0 +(and)2.585 E F2(,,)2.585 E F0 -.15(ex)2.585 G .085(pansions con).15 F +-.15(ve)-.4 G .085(rt each matched character in the e).15 F .085 +(xpanded v)-.15 F .085(alue; the)-.25 F F2(^)2.585 E F0(and)144 612 Q F2 +(,)3.434 E F0 -.15(ex)3.434 G .934(pansions match and con).15 F -.15(ve) +-.4 G .934(rt only the \214rst character in the e).15 F .935(xpanded v) +-.15 F 3.435(alue.. If)-.25 F F1(pattern)3.435 E F0(is)3.435 E 1.121 +(omitted, it is treated lik)144 624 R 3.621(ea)-.1 G F2(?)A F0 3.621(,w) +C 1.121(hich matches e)-3.621 F -.15(ve)-.25 G 1.121(ry character).15 F +6.12(.I)-.55 G(f)-6.12 E F1(par)4.87 E(ameter)-.15 E F0(is)4.35 E F2(@) +3.62 E F0(or)3.62 E F2(*)3.62 E F0 3.62(,t)C 1.12(he case)-3.62 F 1.335 +(modi\214cation operation is applied to each positional parameter in tu\ +rn, and the e)144 636 R 1.335(xpansion is the)-.15 F 1.308 +(resultant list.)144 648 R(If)6.308 E F1(par)5.058 E(ameter)-.15 E F0 +1.308(is an array v)4.538 F 1.308(ariable subscripted with)-.25 F F2(@) +3.808 E F0(or)3.808 E F2(*)3.808 E F0 3.808(,t)C 1.308 +(he case modi\214cation)-3.808 F +(operation is applied to each member of the array in turn, and the e)144 +660 Q(xpansion is the resultant list.)-.15 E F2(Command Substitution)87 +676.8 Q F1 1.697(Command substitution)108 688.8 R F0(allo)4.197 E 1.697 +(ws the output of a command to replace the command name.)-.25 F 1.698 +(There are tw)6.698 F(o)-.1 E(forms:)108 700.8 Q F2($\()144 722.4 Q F1 +(command)A F2(\))1.666 E F0(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(20)185.955 E 0 Cg EP +%%Page: 21 21 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(or)108 84 Q/F1 10/Times-Bold@0 SF<92>144 96 Q/F2 10 +/Times-Italic@0 SF(command)A F1<92>A(Bash)108 112.8 Q F0 .02 +(performs the e)2.52 F .02(xpansion by e)-.15 F -.15(xe)-.15 G(cuting) +.15 E F2(command)2.519 E F0 .019 +(and replacing the command substitution with the stan-)2.519 F .768 +(dard output of the command, with an)108 124.8 R 3.268(yt)-.15 G .768 +(railing ne)-3.268 F .768(wlines deleted.)-.25 F .768(Embedded ne)5.768 +F .768(wlines are not deleted, b)-.25 F(ut)-.2 E(the)108 136.8 Q 3.219 +(ym)-.15 G .719(ay be remo)-3.219 F -.15(ve)-.15 G 3.219(dd).15 G .719 +(uring w)-3.219 F .719(ord splitting.)-.1 F .719 +(The command substitution)5.719 F F1($\(cat)3.219 E F2(\214le)3.219 E F1 +(\))A F0 .718(can be replaced by the)3.219 F(equi)108 148.8 Q -.25(va) +-.25 G(lent b).25 E(ut f)-.2 E(aster)-.1 E F1($\(<)2.5 E F2(\214le)2.5 E +F1(\))A F0(.)A 1.724(When the old-style backquote form of substitution \ +is used, backslash retains its literal meaning e)108 165.6 R(xcept)-.15 +E .315(when follo)108 177.6 R .315(wed by)-.25 F F1($)2.815 E F0(,)A F1 +<92>2.815 E F0 2.815(,o)C(r)-2.815 E F1(\\)2.815 E F0 5.315(.T)C .314(h\ +e \214rst backquote not preceded by a backslash terminates the command \ +sub-)-5.315 F 3.886(stitution. When)108 189.6 R 1.386(using the $\() +3.886 F F2(command).833 E F0 3.886(\)f)1.666 G 1.387 +(orm, all characters between the parentheses mak)-3.886 F 3.887(eu)-.1 G +3.887(pt)-3.887 G 1.387(he com-)-3.887 F +(mand; none are treated specially)108 201.6 Q(.)-.65 E .894 +(Command substitutions may be nested.)108 218.4 R 2.494 -.8(To n)5.894 H +.894(est when using the backquoted form, escape the inner back-).8 F +(quotes with backslashes.)108 230.4 Q .422 +(If the substitution appears within double quotes, w)108 247.2 R .422 +(ord splitting and pathname e)-.1 F .423(xpansion are not performed)-.15 +F(on the results.)108 259.2 Q F1(Arithmetic Expansion)87 276 Q F0 1.035 +(Arithmetic e)108 288 R 1.035(xpansion allo)-.15 F 1.035(ws the e)-.25 F +-.25(va)-.25 G 1.034(luation of an arithmetic e).25 F 1.034 +(xpression and the substitution of the result.)-.15 F +(The format for arithmetic e)108 300 Q(xpansion is:)-.15 E F1($\(\()144 +316.8 Q F2 -.2(ex)C(pr).2 E(ession)-.37 E F1(\)\))A F0(The)108 333.6 Q +F2 -.2(ex)2.665 G(pr).2 E(ession)-.37 E F0 .165 +(is treated as if it were within double quotes, b)2.905 F .166 +(ut a double quote inside the parentheses is not)-.2 F 1.075 +(treated specially)108 345.6 R 6.075(.A)-.65 G 1.074(ll tok)-6.075 F +1.074(ens in the e)-.1 F 1.074(xpression under)-.15 F 1.074 +(go parameter e)-.18 F 1.074(xpansion, string e)-.15 F 1.074 +(xpansion, command)-.15 F(substitution, and quote remo)108 357.6 Q -.25 +(va)-.15 G 2.5(l. Arithmetic).25 F -.15(ex)2.5 G +(pansions may be nested.).15 E 1.378(The e)108 374.4 R -.25(va)-.25 G +1.378(luation is performed according to the rules listed belo).25 F +3.878(wu)-.25 G(nder)-3.878 E/F3 9/Times-Bold@0 SF 1.378(ARITHMETIC EV) +3.878 F(ALU)-1.215 E -.855(AT)-.54 G(ION).855 E/F4 9/Times-Roman@0 SF(.) +A F0(If)5.879 E F2 -.2(ex)108 386.4 S(pr).2 E(ession)-.37 E F0(is in) +2.74 E -.25(va)-.4 G(lid,).25 E F1(bash)2.5 E F0 +(prints a message indicating f)2.5 E(ailure and no substitution occurs.) +-.1 E F1(Pr)87 403.2 Q(ocess Substitution)-.18 E F2(Pr)108 415.2 Q .971 +(ocess substitution)-.45 F F0 .971 +(is supported on systems that support named pipes \()3.471 F F2(FIFOs)A +F0 3.47(\)o)C 3.47(rt)-3.47 G(he)-3.47 E F1(/de)3.47 E(v/fd)-.15 E F0 +.97(method of)3.47 F .021(naming open \214les.)108 427.2 R .021(It tak) +5.021 F .021(es the form of)-.1 F F1(<\()2.521 E F2(list)A F1(\)).833 E +F0(or)2.521 E F1(>\()2.521 E F2(list)A F1(\)).833 E F0 5.021(.T)C .021 +(he process)-5.021 F F2(list)2.521 E F0 .021 +(is run with its input or output con-)2.521 F .059(nected to a)108 439.2 +R F2(FIFO)2.559 E F0 .058(or some \214le in)2.559 F F1(/de)2.558 E(v/fd) +-.15 E F0 5.058(.T)C .058(he name of this \214le is passed as an ar) +-5.058 F .058(gument to the current com-)-.18 F .13 +(mand as the result of the e)108 451.2 R 2.63(xpansion. If)-.15 F(the) +2.63 E F1(>\()2.63 E F2(list)A F1(\)).833 E F0 .13 +(form is used, writing to the \214le will pro)2.63 F .131 +(vide input for)-.15 F F2(list)2.631 E F0(.)A(If the)108 463.2 Q F1(<\() +2.5 E F2(list)A F1(\)).833 E F0 +(form is used, the \214le passed as an ar)2.5 E +(gument should be read to obtain the output of)-.18 E F2(list)2.5 E F0 +(.)A .897(When a)108 480 R -.25(va)-.2 G .896(ilable, process substitut\ +ion is performed simultaneously with parameter and v).25 F .896 +(ariable e)-.25 F(xpansion,)-.15 E +(command substitution, and arithmetic e)108 492 Q(xpansion.)-.15 E F1 +-.75(Wo)87 508.8 S(rd Splitting).75 E F0 1.142 +(The shell scans the results of parameter e)108 520.8 R 1.143 +(xpansion, command substitution, and arithmetic e)-.15 F 1.143 +(xpansion that)-.15 F(did not occur within double quotes for)108 532.8 Q +F2(wor)2.5 E 2.5(ds)-.37 G(plitting)-2.5 E F0(.).22 E .063 +(The shell treats each character of)108 549.6 R F3(IFS)2.563 E F0 .063 +(as a delimiter)2.313 F 2.563(,a)-.4 G .063 +(nd splits the results of the other e)-2.563 F .063(xpansions into w) +-.15 F(ords)-.1 E 1.788(on these characters.)108 561.6 R(If)6.788 E F3 +(IFS)4.288 E F0 1.788(is unset, or its v)4.038 F 1.789(alue is e)-.25 F +(xactly)-.15 E F1(<space><tab><newline>)4.289 E F0 4.289(,t)C 1.789 +(he def)-4.289 F 1.789(ault, then)-.1 F .022(sequences of)108 573.6 R F1 +(<space>)2.522 E F0(,)A F1(<tab>)2.522 E F0 2.521(,a)C(nd)-2.521 E F1 +(<newline>)2.521 E F0 .021(at the be)2.521 F .021 +(ginning and end of the results of the pre)-.15 F .021(vious e)-.25 F +(xpan-)-.15 E .585(sions are ignored, and an)108 585.6 R 3.086(ys)-.15 G +.586(equence of)-3.086 F F3(IFS)3.086 E F0 .586 +(characters not at the be)2.836 F .586(ginning or end serv)-.15 F .586 +(es to delimit w)-.15 F(ords.)-.1 E(If)108 597.6 Q F3(IFS)3.617 E F0 +1.117(has a v)3.367 F 1.117(alue other than the def)-.25 F 1.117 +(ault, then sequences of the whitespace characters)-.1 F F1(space)3.617 +E F0(and)3.617 E F1(tab)3.617 E F0(are)3.617 E .315(ignored at the be) +108 609.6 R .315(ginning and end of the w)-.15 F .315 +(ord, as long as the whitespace character is in the v)-.1 F .315 +(alue of)-.25 F F3(IFS)2.815 E F0(\(an)2.566 E F3(IFS)108 621.6 Q F0 +1.054(whitespace character\).)3.304 F(An)6.054 E 3.554(yc)-.15 G 1.054 +(haracter in)-3.554 F F3(IFS)3.554 E F0 1.053(that is not)3.303 F F3 +(IFS)3.553 E F0 1.053(whitespace, along with an)3.303 F 3.553(ya)-.15 G +(djacent)-3.553 E F3(IFS)3.553 E F0 .331 +(whitespace characters, delimits a \214eld.)108 633.6 R 2.831(As)5.331 G +.332(equence of)-2.831 F F3(IFS)2.832 E F0 .332 +(whitespace characters is also treated as a delim-)2.582 F(iter)108 +645.6 Q 5(.I)-.55 G 2.5(ft)-5 G(he v)-2.5 E(alue of)-.25 E F3(IFS)2.5 E +F0(is null, no w)2.25 E(ord splitting occurs.)-.1 E 1.879 +(Explicit null ar)108 662.4 R 1.879(guments \()-.18 F F1 .833("").833 G +F0(or)3.545 E F1 .833<0808>5.211 G F0 4.378(\)a)C 1.878(re retained.) +-4.378 F 1.878(Unquoted implicit null ar)6.878 F 1.878 +(guments, resulting from the)-.18 F -.15(ex)108 674.4 S .176 +(pansion of parameters that ha).15 F .476 -.15(ve n)-.2 H 2.676(ov).15 G +.176(alues, are remo)-2.926 F -.15(ve)-.15 G 2.676(d. If).15 F 2.677(ap) +2.677 G .177(arameter with no v)-2.677 F .177(alue is e)-.25 F .177 +(xpanded within)-.15 F(double quotes, a null ar)108 686.4 Q +(gument results and is retained.)-.18 E(Note that if no e)108 703.2 Q +(xpansion occurs, no splitting is performed.)-.15 E(GNU Bash-4.1)72 768 +Q(2009 December 29)135.965 E(21)185.955 E 0 Cg EP +%%Page: 22 22 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF -.1(Pa)87 84 S(thname Expansion).1 E F0 +.371(After w)108 96 R .371(ord splitting, unless the)-.1 F F1<ad66>2.871 +E F0 .371(option has been set,)2.871 F F1(bash)2.871 E F0 .37 +(scans each w)2.87 F .37(ord for the characters)-.1 F F1(*)2.87 E F0(,)A +F1(?)2.87 E F0 2.87(,a)C(nd)-2.87 E F1([)2.87 E F0(.)A .677 +(If one of these characters appears, then the w)108 108 R .677 +(ord is re)-.1 F -.05(ga)-.15 G .677(rded as a).05 F/F2 10 +/Times-Italic@0 SF(pattern)3.177 E F0 3.177(,a).24 G .678 +(nd replaced with an alphabeti-)-3.177 F 1.457 +(cally sorted list of \214le names matching the pattern.)108 120 R 1.456 +(If no matching \214le names are found, and the shell)6.457 F(option)108 +132 Q F1(nullglob)2.537 E F0 .038(is not enabled, the w)2.537 F .038 +(ord is left unchanged.)-.1 F .038(If the)5.038 F F1(nullglob)2.538 E F0 +.038(option is set, and no matches are)2.538 F .306(found, the w)108 144 +R .306(ord is remo)-.1 F -.15(ve)-.15 G 2.806(d. If).15 F(the)2.805 E F1 +(failglob)2.805 E F0 .305 +(shell option is set, and no matches are found, an error message)2.805 F +.928(is printed and the command is not e)108 156 R -.15(xe)-.15 G 3.428 +(cuted. If).15 F .928(the shell option)3.428 F F1(nocaseglob)3.428 E F0 +.929(is enabled, the match is per)3.429 F(-)-.2 E .033 +(formed without re)108 168 R -.05(ga)-.15 G .033 +(rd to the case of alphabetic characters.).05 F .032 +(When a pattern is used for pathname e)5.032 F(xpansion,)-.15 E .104 +(the character)108 180 R F1 -.63(``)2.604 G -.55(.').63 G(')-.08 E F0 +.104(at the start of a name or immediately follo)5.104 F .105 +(wing a slash must be matched e)-.25 F(xplicitly)-.15 E 2.605(,u)-.65 G +(nless)-2.605 E .888(the shell option)108 192 R F1(dotglob)3.388 E F0 +.888(is set.)3.388 F .887 +(When matching a pathname, the slash character must al)5.888 F -.1(wa) +-.1 G .887(ys be matched).1 F -.15(ex)108 204 S(plicitly).15 E 6.165(.I) +-.65 G 3.665(no)-6.165 G 1.165(ther cases, the)-3.665 F F1 -.63(``)3.665 +G -.55(.').63 G(')-.08 E F0 1.166(character is not treated specially) +6.165 F 6.166(.S)-.65 G 1.166(ee the description of)-6.166 F F1(shopt) +3.666 E F0(belo)3.666 E(w)-.25 E(under)108 216 Q/F3 9/Times-Bold@0 SF +.478(SHELL B)2.978 F(UIL)-.09 E .478(TIN COMMANDS)-.828 F F0 .477 +(for a description of the)2.728 F F1(nocaseglob)2.977 E F0(,)A F1 +(nullglob)2.977 E F0(,)A F1(failglob)2.977 E F0 2.977(,a)C(nd)-2.977 E +F1(dotglob)2.977 E F0(shell options.)108 228 Q(The)108 244.8 Q F3 +(GLOBIGNORE)2.63 E F0 .13(shell v)2.38 F .131 +(ariable may be used to restrict the set of \214le names matching a)-.25 +F F2(pattern)2.631 E F0 5.131(.I).24 G(f)-5.131 E F3(GLO-)2.631 E +(BIGNORE)108 256.8 Q F0 2.015(is set, each matching \214le name that al\ +so matches one of the patterns in)4.265 F F3(GLOBIGNORE)4.515 E F0(is) +4.264 E(remo)108 268.8 Q -.15(ve)-.15 G 2.503(df).15 G .003 +(rom the list of matches.)-2.503 F .003(The \214le names)5.003 F F1 -.63 +(``)2.503 G -.55(.').63 G(')-.08 E F0(and)5.003 E F1 -.63(``)2.503 G(..) +.63 E -.63('')-.55 G F0 .004(are al)5.633 F -.1(wa)-.1 G .004 +(ys ignored when).1 F F3(GLOBIGNORE)2.504 E F0(is)2.254 E .046 +(set and not null.)108 280.8 R(Ho)5.046 E(we)-.25 E -.15(ve)-.25 G .846 +-.4(r, s).15 H(etting).4 E F3(GLOBIGNORE)2.546 E F0 .046 +(to a non-null v)2.296 F .045(alue has the ef)-.25 F .045 +(fect of enabling the)-.25 F F1(dotglob)2.545 E F0 .613 +(shell option, so all other \214le names be)108 292.8 R .614 +(ginning with a)-.15 F F1 -.63(``)3.114 G -.55(.').63 G(')-.08 E F0 .614 +(will match.)5.614 F 2.214 -.8(To g)5.614 H .614(et the old beha).8 F +.614(vior of ignoring)-.2 F .457(\214le names be)108 304.8 R .457 +(ginning with a)-.15 F F1 -.63(``)2.957 G -.55(.').63 G(')-.08 E F0 +2.957(,m)C(ak)-2.957 E(e)-.1 E F1 -.63(``)2.957 G(.*').63 E(')-.63 E F0 +.457(one of the patterns in)5.457 F F3(GLOBIGNORE)2.957 E/F4 9 +/Times-Roman@0 SF(.)A F0(The)4.957 E F1(dotglob)2.956 E F0 .456 +(option is)2.956 F(disabled when)108 316.8 Q F3(GLOBIGNORE)2.5 E F0 +(is unset.)2.25 E F1 -.1(Pa)108 333.6 S(tter).1 E 2.5(nM)-.15 G(atching) +-2.5 E F0(An)108 350.4 Q 3.138(yc)-.15 G .638(haracter that appears in \ +a pattern, other than the special pattern characters described belo) +-3.138 F 1.938 -.65(w, m)-.25 H(atches).65 E 3.62(itself. The)108 362.4 +R 1.12(NUL character may not occur in a pattern.)3.62 F 3.62(Ab)6.12 G +1.12(ackslash escapes the follo)-3.62 F 1.12(wing character; the)-.25 F +.576(escaping backslash is discarded when matching.)108 374.4 R .576 +(The special pattern characters must be quoted if the)5.576 F 3.076(ya) +-.15 G(re)-3.076 E(to be matched literally)108 386.4 Q(.)-.65 E +(The special pattern characters ha)108 403.2 Q .3 -.15(ve t)-.2 H +(he follo).15 E(wing meanings:)-.25 E F1(*)108 420 Q F0 .455(Matches an) +31 F 2.955(ys)-.15 G .455(tring, including the null string.)-2.955 F +.455(When the)5.455 F F1(globstar)2.955 E F0 .455 +(shell option is enabled, and)2.955 F F1(*)2.955 E F0(is)2.955 E .314 +(used in a pathname e)144 432 R .314(xpansion conte)-.15 F .314(xt, tw) +-.15 F 2.814(oa)-.1 G(djacent)-2.814 E F1(*)2.814 E F0 2.814(su)C .314 +(sed as a single pattern will match all \214les)-2.814 F 1.183 +(and zero or more directories and subdirectories.)144 444 R 1.183 +(If follo)6.183 F 1.183(wed by a)-.25 F F1(/)3.683 E F0 3.683(,t)C 1.383 +-.1(wo a)-3.683 H(djacent).1 E F1(*)3.683 E F0 3.683(sw)C 1.183 +(ill match)-3.683 F(only directories and subdirectories.)144 456 Q F1(?) +108 468 Q F0(Matches an)31 E 2.5(ys)-.15 G(ingle character)-2.5 E(.)-.55 +E F1([...])108 480 Q F0 .256(Matches an)21.84 F 2.756(yo)-.15 G .257 +(ne of the enclosed characters.)-2.756 F 2.757(Ap)5.257 G .257 +(air of characters separated by a h)-2.757 F .257(yphen denotes a)-.05 F +F2 -.15(ra)144 492 S(ng).15 E 3.29(ee)-.1 G(xpr)-3.49 E(ession)-.37 E F0 +3.29(;a)C 1.09 -.15(ny c)-3.29 H .789 +(haracter that sorts between those tw).15 F 3.289(oc)-.1 G .789 +(haracters, inclusi)-3.289 F -.15(ve)-.25 G 3.289(,u).15 G .789 +(sing the cur)-3.289 F(-)-.2 E .349(rent locale')144 504 R 2.849(sc)-.55 +G .349(ollating sequence and character set, is matched.)-2.849 F .35 +(If the \214rst character follo)5.349 F .35(wing the)-.25 F F1([)2.85 E +F0 .564(is a)144 516 R F1(!)3.064 E F0 .564(or a)5.564 F F1(^)3.064 E F0 +.564(then an)3.064 F 3.064(yc)-.15 G .564 +(haracter not enclosed is matched.)-3.064 F .563 +(The sorting order of characters in range)5.564 F -.15(ex)144 528 S .467 +(pressions is determined by the current locale and the v).15 F .467 +(alue of the)-.25 F F3(LC_COLLA)2.967 E(TE)-.855 E F0 .467(shell v)2.717 +F(ariable,)-.25 E 1.077(if set.)144 540 R(A)6.077 E F1<ad>3.577 E F0 +1.077(may be matched by including it as the \214rst or last character i\ +n the set.)3.577 F(A)6.076 E F1(])3.576 E F0 1.076(may be)3.576 F +(matched by including it as the \214rst character in the set.)144 552 Q +-.4(Wi)144 570 S(thin).4 E F1([)2.914 E F0(and)2.914 E F1(])2.914 E F0 +(,)A F2 -.15(ch)2.914 G(ar).15 E .414(acter classes)-.15 F F0 .415 +(can be speci\214ed using the syntax)2.915 F F1([:)2.915 E F2(class)A F1 +(:])A F0 2.915(,w)C(here)-2.915 E F2(class)2.915 E F0 .415(is one of) +2.915 F(the follo)144 582 Q +(wing classes de\214ned in the POSIX standard:)-.25 E F1 5.421 +(alnum alpha ascii blank cntrl digit graph lo)144 594 R 5.421 +(wer print punct space upper w)-.1 F(ord)-.1 E(xdigit)144 606 Q F0 2.518 +(Ac)144 618 S .018(haracter class matches an)-2.518 F 2.518(yc)-.15 G +.019(haracter belonging to that class.)-2.518 F(The)5.019 E F1 -.1(wo) +2.519 G(rd).1 E F0 .019(character class matches)2.519 F +(letters, digits, and the character _.)144 630 Q -.4(Wi)144 648 S(thin) +.4 E F1([)3.547 E F0(and)3.547 E F1(])3.547 E F0 3.547(,a)C(n)-3.547 E +F2 1.046(equivalence class)3.546 F F0 1.046 +(can be speci\214ed using the syntax)3.546 F F1([=)3.546 E F2(c)A F1(=]) +A F0 3.546(,w)C 1.046(hich matches all)-3.546 F(characters with the sam\ +e collation weight \(as de\214ned by the current locale\) as the charac\ +ter)144 660 Q F2(c)2.5 E F0(.)A -.4(Wi)144 678 S(thin).4 E F1([)2.5 E F0 +(and)2.5 E F1(])2.5 E F0 2.5(,t)C(he syntax)-2.5 E F1([.)2.5 E F2 +(symbol)A F1(.])A F0(matches the collating symbol)2.5 E F2(symbol)2.5 E +F0(.)A .704(If the)108 694.8 R F1(extglob)3.204 E F0 .705 +(shell option is enabled using the)3.204 F F1(shopt)3.205 E F0 -.2(bu) +3.205 G .705(iltin, se).2 F -.15(ve)-.25 G .705(ral e).15 F .705 +(xtended pattern matching operators)-.15 F .256(are recognized.)108 +706.8 R .256(In the follo)5.256 F .256(wing description, a)-.25 F F2 +(pattern-list)2.755 E F0 .255 +(is a list of one or more patterns separated by a)2.755 F F1(|)2.755 E +F0(.)A(Composite patterns may be formed using one or more of the follo) +108 718.8 Q(wing sub-patterns:)-.25 E(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(22)185.955 E 0 Cg EP +%%Page: 23 23 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(?\()144 84 Q/F2 10/Times-Italic@0 SF +(pattern-list).833 E F1(\)).833 E F0 +(Matches zero or one occurrence of the gi)180 96 Q -.15(ve)-.25 G 2.5 +(np).15 G(atterns)-2.5 E F1(*\()144 108 Q F2(pattern-list).833 E F1(\)) +.833 E F0(Matches zero or more occurrences of the gi)180 120 Q -.15(ve) +-.25 G 2.5(np).15 G(atterns)-2.5 E F1(+\()144 132 Q F2(pattern-list).833 +E F1(\)).833 E F0(Matches one or more occurrences of the gi)180 144 Q +-.15(ve)-.25 G 2.5(np).15 G(atterns)-2.5 E F1(@\()144 156 Q F2 +(pattern-list).833 E F1(\)).833 E F0(Matches one of the gi)180 168 Q +-.15(ve)-.25 G 2.5(np).15 G(atterns)-2.5 E F1(!\()144 180 Q F2 +(pattern-list).833 E F1(\)).833 E F0(Matches an)180 192 Q(ything e)-.15 +E(xcept one of the gi)-.15 E -.15(ve)-.25 G 2.5(np).15 G(atterns)-2.5 E +F1(Quote Remo)87 208.8 Q -.1(va)-.1 G(l).1 E F0 1.112 +(After the preceding e)108 220.8 R 1.112 +(xpansions, all unquoted occurrences of the characters)-.15 F F1(\\) +3.613 E F0(,)A F1<08>3.613 E F0 3.613(,a)C(nd)-3.613 E F1(")4.446 E F0 +1.113(that did not result)4.446 F(from one of the abo)108 232.8 Q .3 +-.15(ve ex)-.15 H(pansions are remo).15 E -.15(ve)-.15 G(d.).15 E/F3 +10.95/Times-Bold@0 SF(REDIRECTION)72 249.6 Q F0 .545 +(Before a command is e)108 261.6 R -.15(xe)-.15 G .545 +(cuted, its input and output may be).15 F F2 -.37(re)3.045 G(dir).37 E +(ected)-.37 E F0 .545(using a special notation interpreted)3.815 F .616 +(by the shell.)108 273.6 R .617(Redirection may also be used to open an\ +d close \214les for the current shell e)5.616 F -.15(xe)-.15 G .617 +(cution en).15 F(viron-)-.4 E 3.275(ment. The)108 285.6 R(follo)3.275 E +.774(wing redirection operators may precede or appear an)-.25 F .774 +(ywhere within a)-.15 F F2 .774(simple command)3.614 F F0(or)4.044 E +(may follo)108 297.6 Q 2.5(wa)-.25 G F2(command)A F0 5(.R).77 G +(edirections are processed in the order the)-5 E 2.5(ya)-.15 G(ppear) +-2.5 E 2.5(,f)-.4 G(rom left to right.)-2.5 E .771(Each redirection tha\ +t may be preceded by a \214le descriptor number may instead be preceded\ + by a w)108 314.4 R .772(ord of)-.1 F .293(the form {)108 326.4 R F2 +(varname)A F0 2.793(}. In)B .293 +(this case, for each redirection operator e)2.793 F .293 +(xcept >&- and <&-, the shell will allocate)-.15 F 3.498<618c>108 338.4 +S .999(le descriptor greater than 10 and assign it to)-3.498 F F2 +(varname)3.499 E F0 5.999(.I)C 3.499(f>)-5.999 G .999 +(&- or <&- is preceded by {)-3.499 F F2(varname)A F0 .999(}, the)B -.25 +(va)108 350.4 S(lue of).25 E F2(varname)2.5 E F0 +(de\214nes the \214le descriptor to close.)2.5 E .284(In the follo)108 +367.2 R .283(wing descriptions, if the \214le descriptor number is omit\ +ted, and the \214rst character of the redirect-)-.25 F .512 +(ion operator is)108 379.2 R F1(<)3.012 E F0 3.012(,t)C .512 +(he redirection refers to the standard input \(\214le descriptor 0\).) +-3.012 F .512(If the \214rst character of the)5.512 F +(redirection operator is)108 391.2 Q F1(>)2.5 E F0 2.5(,t)C +(he redirection refers to the standard output \(\214le descriptor 1\).) +-2.5 E .825(The w)108 408 R .825(ord follo)-.1 F .824 +(wing the redirection operator in the follo)-.25 F .824 +(wing descriptions, unless otherwise noted, is sub-)-.25 F .772 +(jected to brace e)108 420 R .773(xpansion, tilde e)-.15 F .773 +(xpansion, parameter e)-.15 F .773 +(xpansion, command substitution, arithmetic e)-.15 F(xpan-)-.15 E .844 +(sion, quote remo)108 432 R -.25(va)-.15 G .843(l, pathname e).25 F .843 +(xpansion, and w)-.15 F .843(ord splitting.)-.1 F .843(If it e)5.843 F +.843(xpands to more than one w)-.15 F(ord,)-.1 E F1(bash)3.343 E F0 +(reports an error)108 444 Q(.)-.55 E +(Note that the order of redirections is signi\214cant.)108 460.8 Q -.15 +(Fo)5 G 2.5(re).15 G(xample, the command)-2.65 E(ls)144 477.6 Q F1(>)2.5 +E F0(dirlist 2)2.5 E F1(>&)A F0(1)A +(directs both standard output and standard error to the \214le)108 494.4 +Q F2(dirlist)2.5 E F0 2.5(,w).68 G(hile the command)-2.5 E(ls 2)144 +511.2 Q F1(>&)A F0(1)A F1(>)2.5 E F0(dirlist)2.5 E .527 +(directs only the standard output to \214le)108 528 R F2(dirlist)3.027 E +F0 3.027(,b).68 G .527(ecause the standard error w)-3.027 F .527 +(as duplicated from the standard)-.1 F +(output before the standard output w)108 540 Q(as redirected to)-.1 E F2 +(dirlist)2.5 E F0(.).68 E F1(Bash)108 556.8 Q F0 .599(handles se)3.099 F +-.15(ve)-.25 G .599(ral \214lenames specially when the).15 F 3.099(ya) +-.15 G .598(re used in redirections, as described in the follo)-3.099 F +(wing)-.25 E(table:)108 568.8 Q F1(/de)144 585.6 Q(v/fd/)-.15 E F2(fd)A +F0(If)180 597.6 Q F2(fd)2.5 E F0(is a v)2.5 E(alid inte)-.25 E(ger)-.15 +E 2.5<2c8c>-.4 G(le descriptor)-2.5 E F2(fd)2.5 E F0(is duplicated.)2.5 +E F1(/de)144 609.6 Q(v/stdin)-.15 E F0(File descriptor 0 is duplicated.) +180 621.6 Q F1(/de)144 633.6 Q(v/stdout)-.15 E F0 +(File descriptor 1 is duplicated.)180 645.6 Q F1(/de)144 657.6 Q +(v/stderr)-.15 E F0(File descriptor 2 is duplicated.)180 669.6 Q F1(/de) +144 681.6 Q(v/tcp/)-.15 E F2(host)A F1(/)A F2(port)A F0(If)180 693.6 Q +F2(host)2.996 E F0 .496(is a v)2.996 F .496 +(alid hostname or Internet address, and)-.25 F F2(port)2.997 E F0 .497 +(is an inte)2.997 F .497(ger port number or ser)-.15 F(-)-.2 E +(vice name,)180 705.6 Q F1(bash)2.5 E F0 +(attempts to open a TCP connection to the corresponding sock)2.5 E(et.) +-.1 E(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(23)185.955 E 0 Cg +EP +%%Page: 24 24 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(/de)144 84 Q(v/udp/)-.15 E/F2 10 +/Times-Italic@0 SF(host)A F1(/)A F2(port)A F0(If)180 96 Q F2(host)2.997 +E F0 .497(is a v)2.997 F .497(alid hostname or Internet address, and) +-.25 F F2(port)2.996 E F0 .496(is an inte)2.996 F .496 +(ger port number or ser)-.15 F(-)-.2 E(vice name,)180 108 Q F1(bash)2.5 +E F0(attempts to open a UDP connection to the corresponding sock)2.5 E +(et.)-.1 E 2.5(Af)108 124.8 S +(ailure to open or create a \214le causes the redirection to f)-2.6 E +(ail.)-.1 E .946(Redirections using \214le descriptors greater than 9 s\ +hould be used with care, as the)108 141.6 R 3.447(ym)-.15 G .947 +(ay con\215ict with \214le)-3.447 F +(descriptors the shell uses internally)108 153.6 Q(.)-.65 E F1(Redir)87 +170.4 Q(ecting Input)-.18 E F0 .391 +(Redirection of input causes the \214le whose name results from the e) +108 182.4 R .391(xpansion of)-.15 F F2(wor)3.231 E(d)-.37 E F0 .391 +(to be opened for read-)3.661 F(ing on \214le descriptor)108 194.4 Q F2 +(n)2.5 E F0 2.5(,o).24 G 2.5(rt)-2.5 G +(he standard input \(\214le descriptor 0\) if)-2.5 E F2(n)2.86 E F0 +(is not speci\214ed.)2.74 E +(The general format for redirecting input is:)108 211.2 Q([)144 228 Q F2 +(n)A F0(])A F1(<)A F2(wor)A(d)-.37 E F1(Redir)87 244.8 Q(ecting Output) +-.18 E F0 .174 +(Redirection of output causes the \214le whose name results from the e) +108 256.8 R .175(xpansion of)-.15 F F2(wor)3.015 E(d)-.37 E F0 .175 +(to be opened for writ-)3.445 F .825(ing on \214le descriptor)108 268.8 +R F2(n)3.325 E F0 3.325(,o).24 G 3.325(rt)-3.325 G .824 +(he standard output \(\214le descriptor 1\) if)-3.325 F F2(n)3.684 E F0 +.824(is not speci\214ed.)3.564 F .824(If the \214le does not)5.824 F +-.15(ex)108 280.8 S(ist it is created; if it does e).15 E +(xist it is truncated to zero size.)-.15 E +(The general format for redirecting output is:)108 297.6 Q([)144 314.4 Q +F2(n)A F0(])A F1(>)A F2(wor)A(d)-.37 E F0 .154 +(If the redirection operator is)108 331.2 R F1(>)2.654 E F0 2.654(,a)C +.154(nd the)-2.654 F F1(noclob)2.654 E(ber)-.1 E F0 .154(option to the) +2.654 F F1(set)2.655 E F0 -.2(bu)2.655 G .155 +(iltin has been enabled, the redirection).2 F .658(will f)108 343.2 R +.658(ail if the \214le whose name results from the e)-.1 F .658 +(xpansion of)-.15 F F2(wor)3.158 E(d)-.37 E F0 -.15(ex)3.158 G .657 +(ists and is a re).15 F .657(gular \214le.)-.15 F .657(If the redi-) +5.657 F .408(rection operator is)108 355.2 R F1(>|)2.909 E F0 2.909(,o)C +2.909(rt)-2.909 G .409(he redirection operator is)-2.909 F F1(>)2.909 E +F0 .409(and the)2.909 F F1(noclob)2.909 E(ber)-.1 E F0 .409 +(option to the)2.909 F F1(set)2.909 E F0 -.2(bu)2.909 G .409 +(iltin command).2 F(is not enabled, the redirection is attempted e)108 +367.2 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he \214le named by) +-2.5 E F2(wor)2.5 E(d)-.37 E F0 -.15(ex)2.5 G(ists.).15 E F1 -.25(Ap)87 +384 S(pending Redir).25 E(ected Output)-.18 E F0 .642 +(Redirection of output in this f)108 396 R .642 +(ashion causes the \214le whose name results from the e)-.1 F .641 +(xpansion of)-.15 F F2(wor)3.481 E(d)-.37 E F0 .641(to be)3.911 F .473 +(opened for appending on \214le descriptor)108 408 R F2(n)2.973 E F0 +2.974(,o).24 G 2.974(rt)-2.974 G .474 +(he standard output \(\214le descriptor 1\) if)-2.974 F F2(n)3.334 E F0 +.474(is not speci\214ed.)3.214 F(If)5.474 E(the \214le does not e)108 +420 Q(xist it is created.)-.15 E +(The general format for appending output is:)108 436.8 Q([)144 453.6 Q +F2(n)A F0(])A F1(>>)A F2(wor)A(d)-.37 E F1(Redir)87 475.2 Q +(ecting Standard Output and Standard Err)-.18 E(or)-.18 E F0 .249 +(This construct allo)108 487.2 R .249(ws both the standard output \(\ +\214le descriptor 1\) and the standard error output \(\214le descrip-) +-.25 F(tor 2\) to be redirected to the \214le whose name is the e)108 +499.2 Q(xpansion of)-.15 E F2(wor)2.5 E(d)-.37 E F0(.).77 E +(There are tw)108 516 Q 2.5(of)-.1 G +(ormats for redirecting standard output and standard error:)-2.5 E F1 +(&>)144 532.8 Q F2(wor)A(d)-.37 E F0(and)108 544.8 Q F1(>&)144 556.8 Q +F2(wor)A(d)-.37 E F0(Of the tw)108 573.6 Q 2.5(of)-.1 G +(orms, the \214rst is preferred.)-2.5 E(This is semantically equi)5 E +-.25(va)-.25 G(lent to).25 E F1(>)144 590.4 Q F2(wor)A(d)-.37 E F0(2)2.5 +E F1(>&)A F0(1)A F1 -.25(Ap)87 612 S +(pending Standard Output and Standard Err).25 E(or)-.18 E F0 .248 +(This construct allo)108 624 R .249(ws both the standard output \(\214l\ +e descriptor 1\) and the standard error output \(\214le descrip-)-.25 F +(tor 2\) to be appended to the \214le whose name is the e)108 636 Q +(xpansion of)-.15 E F2(wor)2.5 E(d)-.37 E F0(.).77 E +(The format for appending standard output and standard error is:)108 +652.8 Q F1(&>>)144 669.6 Q F2(wor)A(d)-.37 E F0 +(This is semantically equi)108 686.4 Q -.25(va)-.25 G(lent to).25 E F1 +(>>)144 703.2 Q F2(wor)A(d)-.37 E F0(2)2.5 E F1(>&)A F0(1)A +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(24)185.955 E 0 Cg EP +%%Page: 25 25 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(Her)87 84 Q 2.5(eD)-.18 G(ocuments)-2.5 E +F0 .33(This type of redirection instructs the shell to read input from \ +the current source until a line containing only)108 96 R/F2 10 +/Times-Italic@0 SF(delimiter)108.35 108 Q F0 .614 +(\(with no trailing blanks\) is seen.)3.844 F .615 +(All of the lines read up to that point are then used as the stan-)5.615 +F(dard input for a command.)108 120 Q(The format of here-documents is:) +108 136.8 Q F1(<<)144 153.6 Q F0([)A F1<ad>A F0(])A F2(wor)A(d)-.37 E +(her)164 165.6 Q(e-document)-.37 E(delimiter)144 177.6 Q F0 .128 +(No parameter e)108 194.4 R .127 +(xpansion, command substitution, arithmetic e)-.15 F .127 +(xpansion, or pathname e)-.15 F .127(xpansion is performed)-.15 F(on)108 +206.4 Q F2(wor)3.274 E(d)-.37 E F0 5.774(.I).77 G 3.274(fa)-5.774 G +1.074 -.15(ny c)-3.274 H .774(haracters in).15 F F2(wor)3.614 E(d)-.37 E +F0 .774(are quoted, the)4.044 F F2(delimiter)3.624 E F0 .774 +(is the result of quote remo)4.004 F -.25(va)-.15 G 3.275(lo).25 G(n) +-3.275 E F2(wor)3.275 E(d)-.37 E F0 3.275(,a).77 G(nd)-3.275 E .905 +(the lines in the here-document are not e)108 218.4 R 3.405(xpanded. If) +-.15 F F2(wor)3.405 E(d)-.37 E F0 .904 +(is unquoted, all lines of the here-document are)3.405 F .694 +(subjected to parameter e)108 230.4 R .695 +(xpansion, command substitution, and arithmetic e)-.15 F 3.195 +(xpansion. In)-.15 F .695(the latter case, the)3.195 F +(character sequence)108 242.4 Q F1(\\<newline>)2.5 E F0(is ignored, and) +2.5 E F1(\\)2.5 E F0(must be used to quote the characters)2.5 E F1(\\) +2.5 E F0(,)A F1($)2.5 E F0 2.5(,a)C(nd)-2.5 E F1<92>2.5 E F0(.)A .602 +(If the redirection operator is)108 259.2 R F1(<<\255)3.101 E F0 3.101 +(,t)C .601(hen all leading tab characters are stripped from input lines\ + and the line)-3.101 F(containing)108 271.2 Q F2(delimiter)2.5 E F0 5 +(.T).73 G(his allo)-5 E +(ws here-documents within shell scripts to be indented in a natural f) +-.25 E(ashion.)-.1 E F1(Her)87 288 Q 2.5(eS)-.18 G(trings)-2.5 E F0 2.5 +(Av)108 300 S(ariant of here documents, the format is:)-2.75 E F1(<<<) +144 316.8 Q F2(wor)A(d)-.37 E F0(The)108 333.6 Q F2(wor)2.5 E(d)-.37 E +F0(is e)2.5 E +(xpanded and supplied to the command on its standard input.)-.15 E F1 +(Duplicating File Descriptors)87 350.4 Q F0(The redirection operator)108 +362.4 Q([)144 379.2 Q F2(n)A F0(])A F1(<&)A F2(wor)A(d)-.37 E F0 .126 +(is used to duplicate input \214le descriptors.)108 396 R(If)5.127 E F2 +(wor)2.967 E(d)-.37 E F0 -.15(ex)3.397 G .127 +(pands to one or more digits, the \214le descriptor denoted).15 F(by)108 +408 Q F2(n)3.318 E F0 .458(is made to be a cop)3.198 F 2.958(yo)-.1 G +2.958(ft)-2.958 G .457(hat \214le descriptor)-2.958 F 5.457(.I)-.55 G +2.957(ft)-5.457 G .457(he digits in)-2.957 F F2(wor)3.297 E(d)-.37 E F0 +.457(do not specify a \214le descriptor open)3.727 F .149 +(for input, a redirection error occurs.)108 420 R(If)5.149 E F2(wor) +2.989 E(d)-.37 E F0 -.25(eva)3.419 G .149(luates to).25 F F1<ad>2.649 E +F0 2.65<2c8c>C .15(le descriptor)-2.65 F F2(n)3.01 E F0 .15(is closed.) +2.89 F(If)5.15 E F2(n)3.01 E F0 .15(is not speci\214ed,)2.89 F +(the standard input \(\214le descriptor 0\) is used.)108 432 Q +(The operator)108 448.8 Q([)144 465.6 Q F2(n)A F0(])A F1(>&)A F2(wor)A +(d)-.37 E F0 .444 +(is used similarly to duplicate output \214le descriptors.)108 482.4 R +(If)5.444 E F2(n)3.304 E F0 .443 +(is not speci\214ed, the standard output \(\214le descrip-)3.183 F 1.357 +(tor 1\) is used.)108 494.4 R 1.357(If the digits in)6.357 F F2(wor) +4.197 E(d)-.37 E F0 1.358(do not specify a \214le descriptor open for o\ +utput, a redirection error)4.627 F 2.597(occurs. As)108 506.4 R 2.597 +(as)2.597 G .097(pecial case, if)-2.597 F F2(n)2.596 E F0 .096 +(is omitted, and)2.596 F F2(wor)2.596 E(d)-.37 E F0 .096(does not e) +2.596 F .096(xpand to one or more digits, the standard out-)-.15 F +(put and standard error are redirected as described pre)108 518.4 Q +(viously)-.25 E(.)-.65 E F1(Mo)87 535.2 Q(ving File Descriptors)-.1 E F0 +(The redirection operator)108 547.2 Q([)144 564 Q F2(n)A F0(])A F1(<&)A +F2(digit)A F1<ad>A F0(mo)108 580.8 Q -.15(ve)-.15 G 3.035(st).15 G .535 +(he \214le descriptor)-3.035 F F2(digit)3.035 E F0 .535 +(to \214le descriptor)3.035 F F2(n)3.035 E F0 3.035(,o).24 G 3.035(rt) +-3.035 G .536(he standard input \(\214le descriptor 0\) if)-3.035 F F2 +(n)3.036 E F0 .536(is not speci-)3.036 F(\214ed.)108 592.8 Q F2(digit)5 +E F0(is closed after being duplicated to)2.5 E F2(n)2.5 E F0(.)A +(Similarly)108 609.6 Q 2.5(,t)-.65 G(he redirection operator)-2.5 E([) +144 626.4 Q F2(n)A F0(])A F1(>&)A F2(digit)A F1<ad>A F0(mo)108 643.2 Q +-.15(ve)-.15 G 2.786(st).15 G .286(he \214le descriptor)-2.786 F F2 +(digit)2.786 E F0 .286(to \214le descriptor)2.786 F F2(n)2.786 E F0 +2.786(,o).24 G 2.786(rt)-2.786 G .285 +(he standard output \(\214le descriptor 1\) if)-2.786 F F2(n)2.785 E F0 +.285(is not speci-)2.785 F(\214ed.)108 655.2 Q F1 +(Opening File Descriptors f)87 672 Q(or Reading and Writing)-.25 E F0 +(The redirection operator)108 684 Q([)144 700.8 Q F2(n)A F0(])A F1(<>)A +F2(wor)A(d)-.37 E F0 1.349(causes the \214le whose name is the e)108 +717.6 R 1.349(xpansion of)-.15 F F2(wor)4.189 E(d)-.37 E F0 1.349 +(to be opened for both reading and writing on \214le)4.619 F(descriptor) +108 729.6 Q F2(n)2.5 E F0 2.5(,o).24 G 2.5(ro)-2.5 G 2.5<6e8c>-2.5 G +(le descriptor 0 if)-2.5 E F2(n)2.86 E F0(is not speci\214ed.)2.74 E +(If the \214le does not e)5 E(xist, it is created.)-.15 E(GNU Bash-4.1) +72 768 Q(2009 December 29)135.965 E(25)185.955 E 0 Cg EP +%%Page: 26 26 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10.95/Times-Bold@0 SF(ALIASES)72 84 Q/F2 10/Times-Italic@0 SF +(Aliases)108 96 Q F0(allo)3.174 E 3.174(was)-.25 G .674 +(tring to be substituted for a w)-3.174 F .674 +(ord when it is used as the \214rst w)-.1 F .673 +(ord of a simple command.)-.1 F .394(The shell maintains a list of alia\ +ses that may be set and unset with the)108 108 R/F3 10/Times-Bold@0 SF +(alias)2.894 E F0(and)2.894 E F3(unalias)2.894 E F0 -.2(bu)2.894 G .394 +(iltin commands).2 F(\(see)108 120 Q/F4 9/Times-Bold@0 SF 1.98(SHELL B) +4.48 F(UIL)-.09 E 1.98(TIN COMMANDS)-.828 F F0(belo)4.23 E 4.48 +(w\). The)-.25 F 1.98(\214rst w)4.48 F 1.979 +(ord of each simple command, if unquoted, is)-.1 F(check)108 132 Q .472 +(ed to see if it has an alias.)-.1 F .472(If so, that w)5.472 F .473 +(ord is replaced by the te)-.1 F .473(xt of the alias.)-.15 F .473 +(The characters)5.473 F F3(/)2.973 E F0(,)A F3($)2.973 E F0(,)A F3<92> +2.973 E F0(,)A(and)108 144 Q F3(=)3.612 E F0 1.112(and an)3.612 F 3.612 +(yo)-.15 G 3.612(ft)-3.612 G 1.112(he shell)-3.612 F F2(metac)3.612 E +(har)-.15 E(acter)-.15 E(s)-.1 E F0 1.112 +(or quoting characters listed abo)3.612 F 1.411 -.15(ve m)-.15 H 1.111 +(ay not appear in an alias).15 F 3.619(name. The)108 156 R 1.119 +(replacement te)3.619 F 1.119(xt may contain an)-.15 F 3.619(yv)-.15 G +1.119(alid shell input, including shell metacharacters.)-3.869 F 1.12 +(The \214rst)6.12 F -.1(wo)108 168 S .514(rd of the replacement te).1 F +.514(xt is tested for aliases, b)-.15 F .514(ut a w)-.2 F .513 +(ord that is identical to an alias being e)-.1 F .513(xpanded is)-.15 F +.295(not e)108 180 R .295(xpanded a second time.)-.15 F .296 +(This means that one may alias)5.295 F F3(ls)2.796 E F0(to)2.796 E F3 +.296(ls \255F)2.796 F F0 2.796(,f)C .296(or instance, and)-2.796 F F3 +(bash)2.796 E F0 .296(does not try)2.796 F .543(to recursi)108 192 R +-.15(ve)-.25 G .543(ly e).15 F .543(xpand the replacement te)-.15 F +3.043(xt. If)-.15 F .543(the last character of the alias v)3.043 F .542 +(alue is a)-.25 F F2(blank)3.042 E F0 3.042(,t).67 G .542(hen the ne) +-3.042 F(xt)-.15 E(command w)108 204 Q(ord follo)-.1 E +(wing the alias is also check)-.25 E(ed for alias e)-.1 E(xpansion.)-.15 +E(Aliases are created and listed with the)108 220.8 Q F3(alias)2.5 E F0 +(command, and remo)2.5 E -.15(ve)-.15 G 2.5(dw).15 G(ith the)-2.5 E F3 +(unalias)2.5 E F0(command.)2.5 E .284 +(There is no mechanism for using ar)108 237.6 R .284 +(guments in the replacement te)-.18 F 2.784(xt. If)-.15 F(ar)2.784 E +.284(guments are needed, a shell func-)-.18 F(tion should be used \(see) +108 249.6 Q F4(FUNCTIONS)2.5 E F0(belo)2.25 E(w\).)-.25 E 1.22 +(Aliases are not e)108 266.4 R 1.22 +(xpanded when the shell is not interacti)-.15 F -.15(ve)-.25 G 3.72(,u) +.15 G 1.22(nless the)-3.72 F F3(expand_aliases)3.72 E F0 1.22 +(shell option is set)3.72 F(using)108 278.4 Q F3(shopt)2.5 E F0 +(\(see the description of)2.5 E F3(shopt)2.5 E F0(under)2.5 E F4 +(SHELL B)2.5 E(UIL)-.09 E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 +E .435 +(The rules concerning the de\214nition and use of aliases are some)108 +295.2 R .436(what confusing.)-.25 F F3(Bash)5.436 E F0(al)2.936 E -.1 +(wa)-.1 G .436(ys reads at least).1 F .338 +(one complete line of input before e)108 307.2 R -.15(xe)-.15 G .338 +(cuting an).15 F 2.838(yo)-.15 G 2.838(ft)-2.838 G .338 +(he commands on that line.)-2.838 F .337(Aliases are e)5.337 F .337 +(xpanded when)-.15 F 3.403(ac)108 319.2 S .904 +(ommand is read, not when it is e)-3.403 F -.15(xe)-.15 G 3.404 +(cuted. Therefore,).15 F .904 +(an alias de\214nition appearing on the same line as)3.404 F 1.162 +(another command does not tak)108 331.2 R 3.662(ee)-.1 G -.25(ff)-3.662 +G 1.162(ect until the ne).25 F 1.162(xt line of input is read.)-.15 F +1.161(The commands follo)6.161 F 1.161(wing the)-.25 F .277 +(alias de\214nition on that line are not af)108 343.2 R .277 +(fected by the ne)-.25 F 2.777(wa)-.25 G 2.777(lias. This)-2.777 F(beha) +2.777 E .277(vior is also an issue when functions)-.2 F .699(are e)108 +355.2 R -.15(xe)-.15 G 3.199(cuted. Aliases).15 F .699(are e)3.199 F +.699(xpanded when a function de\214nition is read, not when the functio\ +n is e)-.15 F -.15(xe)-.15 G(cuted,).15 E .494 +(because a function de\214nition is itself a compound command.)108 367.2 +R .495(As a consequence, aliases de\214ned in a func-)5.494 F .085 +(tion are not a)108 379.2 R -.25(va)-.2 G .084 +(ilable until after that function is e).25 F -.15(xe)-.15 G 2.584 +(cuted. T).15 F 2.584(ob)-.8 G 2.584(es)-2.584 G .084(afe, al)-2.584 F +-.1(wa)-.1 G .084(ys put alias de\214nitions on a sepa-).1 F +(rate line, and do not use)108 391.2 Q F3(alias)2.5 E F0 +(in compound commands.)2.5 E -.15(Fo)108 408 S 2.5(ra).15 G(lmost e)-2.5 +E -.15(ve)-.25 G(ry purpose, aliases are superseded by shell functions.) +.15 E F1(FUNCTIONS)72 424.8 Q F0 3.467(As)108 436.8 S .967 +(hell function, de\214ned as described abo)-3.467 F 1.267 -.15(ve u)-.15 +H(nder).15 E F4 .967(SHELL GRAMMAR)3.467 F/F5 9/Times-Roman@0 SF(,)A F0 +.968(stores a series of commands for)3.217 F 1.002(later e)108 448.8 R +-.15(xe)-.15 G 3.502(cution. When).15 F 1.002(the name of a shell funct\ +ion is used as a simple command name, the list of com-)3.502 F .315 +(mands associated with that function name is e)108 460.8 R -.15(xe)-.15 +G 2.816(cuted. Functions).15 F .316(are e)2.816 F -.15(xe)-.15 G .316 +(cuted in the conte).15 F .316(xt of the current)-.15 F .036 +(shell; no ne)108 472.8 R 2.536(wp)-.25 G .036 +(rocess is created to interpret them \(contrast this with the e)-2.536 F +-.15(xe)-.15 G .036(cution of a shell script\).).15 F .035(When a)5.035 +F .639(function is e)108 484.8 R -.15(xe)-.15 G .639(cuted, the ar).15 F +.639 +(guments to the function become the positional parameters during its e) +-.18 F -.15(xe)-.15 G(cution.).15 E .533(The special parameter)108 496.8 +R F3(#)3.033 E F0 .532(is updated to re\215ect the change.)3.033 F .532 +(Special parameter 0 is unchanged.)5.532 F .532(The \214rst ele-)5.532 F +(ment of the)108 508.8 Q F4(FUNCN)2.5 E(AME)-.18 E F0 -.25(va)2.25 G +(riable is set to the name of the function while the function is e).25 E +-.15(xe)-.15 G(cuting.).15 E 1.25(All other aspects of the shell e)108 +525.6 R -.15(xe)-.15 G 1.25(cution en).15 F 1.25 +(vironment are identical between a function and its caller with)-.4 F +1.049(these e)108 537.6 R 3.548(xceptions: the)-.15 F F4(DEB)3.548 E(UG) +-.09 E F0(and)3.298 E F3(RETURN)3.548 E F0 1.048 +(traps \(see the description of the)3.548 F F3(trap)3.548 E F0 -.2(bu) +3.548 G 1.048(iltin under).2 F F4(SHELL)3.548 E -.09(BU)108 549.6 S(IL) +.09 E .478(TIN COMMANDS)-.828 F F0(belo)2.728 E .479 +(w\) are not inherited unless the function has been gi)-.25 F -.15(ve) +-.25 G 2.979(nt).15 G(he)-2.979 E F3(trace)2.979 E F0(attrib)2.979 E +.479(ute \(see)-.2 F .421(the description of the)108 561.6 R F4(declar) +2.92 E(e)-.162 E F0 -.2(bu)2.67 G .42(iltin belo).2 F .42(w\) or the) +-.25 F F3 .42(\255o functrace)2.92 F F0 .42 +(shell option has been enabled with the)2.92 F F3(set)2.92 E F0 -.2(bu) +108 573.6 S .071(iltin \(in which case all functions inherit the).2 F F3 +(DEB)2.572 E(UG)-.1 E F0(and)2.572 E F3(RETURN)2.572 E F0 .072 +(traps\), and the)2.572 F F4(ERR)2.572 E F0 .072(trap is not inher)2.322 +F(-)-.2 E(ited unless the)108 585.6 Q F3(\255o errtrace)2.5 E F0 +(shell option has been enabled.)2.5 E -1.11(Va)108 602.4 S .656 +(riables local to the function may be declared with the)1.11 F F3(local) +3.155 E F0 -.2(bu)3.155 G .655(iltin command.).2 F(Ordinarily)5.655 E +3.155(,v)-.65 G .655(ariables and)-3.405 F(their v)108 614.4 Q +(alues are shared between the function and its caller)-.25 E(.)-.55 E +.043(If the b)108 631.2 R .043(uiltin command)-.2 F F3 -.18(re)2.543 G +(tur).18 E(n)-.15 E F0 .043(is e)2.543 F -.15(xe)-.15 G .043 +(cuted in a function, the function completes and e).15 F -.15(xe)-.15 G +.044(cution resumes with).15 F 1.012(the ne)108 643.2 R 1.012 +(xt command after the function call.)-.15 F(An)6.011 E 3.511(yc)-.15 G +1.011(ommand associated with the)-3.511 F F3(RETURN)3.511 E F0 1.011 +(trap is e)3.511 F -.15(xe)-.15 G(cuted).15 E .213(before e)108 655.2 R +-.15(xe)-.15 G .213(cution resumes.).15 F .213 +(When a function completes, the v)5.213 F .214 +(alues of the positional parameters and the spe-)-.25 F(cial parameter) +108 667.2 Q F3(#)2.5 E F0(are restored to the v)2.5 E(alues the)-.25 E +2.5(yh)-.15 G(ad prior to the function')-2.5 E 2.5(se)-.55 G -.15(xe) +-2.65 G(cution.).15 E 1.359 +(Function names and de\214nitions may be listed with the)108 684 R F3 +<ad66>3.858 E F0 1.358(option to the)3.858 F F3(declar)3.858 E(e)-.18 E +F0(or)3.858 E F3(typeset)3.858 E F0 -.2(bu)3.858 G 1.358(iltin com-).2 F +3.39(mands. The)108 696 R F3<ad46>3.39 E F0 .89(option to)3.39 F F3 +(declar)3.39 E(e)-.18 E F0(or)3.39 E F3(typeset)3.39 E F0 .89 +(will list the function names only \(and optionally the source)3.39 F +.327(\214le and line number)108 708 R 2.827(,i)-.4 G 2.827(ft)-2.827 G +(he)-2.827 E F3(extdeb)2.827 E(ug)-.2 E F0 .326 +(shell option is enabled\).)2.827 F .326(Functions may be e)5.326 F .326 +(xported so that subshells)-.15 F 1.297(automatically ha)108 720 R 1.597 +-.15(ve t)-.2 H 1.297(hem de\214ned with the).15 F F3<ad66>3.797 E F0 +1.297(option to the)3.797 F F3(export)3.798 E F0 -.2(bu)3.798 G 3.798 +(iltin. A).2 F 1.298(function de\214nition may be)3.798 F(GNU Bash-4.1) +72 768 Q(2009 December 29)135.965 E(26)185.955 E 0 Cg EP +%%Page: 27 27 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .161(deleted using the)108 84 R/F1 10/Times-Bold@0 SF<ad66>2.661 +E F0 .161(option to the)2.661 F F1(unset)2.661 E F0 -.2(bu)2.661 G 2.661 +(iltin. Note).2 F .16(that shell functions and v)2.661 F .16 +(ariables with the same name)-.25 F 1.325 +(may result in multiple identically-named entries in the en)108 96 R +1.325(vironment passed to the shell')-.4 F 3.825(sc)-.55 G 3.825 +(hildren. Care)-3.825 F(should be tak)108 108 Q +(en in cases where this may cause a problem.)-.1 E +(Functions may be recursi)108 124.8 Q -.15(ve)-.25 G 5(.N).15 G 2.5(ol) +-5 G(imit is imposed on the number of recursi)-2.5 E .3 -.15(ve c)-.25 H +(alls.).15 E/F2 10.95/Times-Bold@0 SF(ARITHMETIC EV)72 141.6 Q(ALU) +-1.478 E -1.04(AT)-.657 G(ION)1.04 E F0 2.298(The shell allo)108 153.6 R +2.297(ws arithmetic e)-.25 F 2.297(xpressions to be e)-.15 F -.25(va) +-.25 G 2.297(luated, under certain circumstances \(see the).25 F F1(let) +4.797 E F0(and)4.797 E F1(declar)108 165.6 Q(e)-.18 E F0 -.2(bu)2.705 G +.205(iltin commands and).2 F F1 .205(Arithmetic Expansion)2.705 F F0 +2.705(\). Ev)B .205(aluation is done in \214x)-.25 F .206(ed-width inte) +-.15 F .206(gers with no)-.15 F .429(check for o)108 177.6 R -.15(ve) +-.15 G(r\215o).15 E 1.729 -.65(w, t)-.25 H .429(hough di).65 F .428 +(vision by 0 is trapped and \215agged as an error)-.25 F 5.428(.T)-.55 G +.428(he operators and their prece-)-5.428 F 1.919(dence, associati)108 +189.6 R(vity)-.25 E 4.419(,a)-.65 G 1.919(nd v)-4.419 F 1.919 +(alues are the same as in the C language.)-.25 F 1.92(The follo)6.92 F +1.92(wing list of operators is)-.25 F(grouped into le)108 201.6 Q -.15 +(ve)-.25 G(ls of equal-precedence operators.).15 E(The le)5 E -.15(ve) +-.25 G(ls are listed in order of decreasing precedence.).15 E/F3 10 +/Times-Italic@0 SF(id)108 218.4 Q F1(++)A F3(id)2.5 E F1<adad>A F0 -.25 +(va)144 230.4 S(riable post-increment and post-decrement).25 E F1(++)108 +242.4 Q F3(id)A F1<adad>2.5 E F3(id)A F0 -.25(va)144 254.4 S +(riable pre-increment and pre-decrement).25 E F1 2.5<ad2b>108 266.4 S F0 +(unary minus and plus)19.6 E F1 2.5(!~)108 278.4 S F0 +(logical and bitwise ne)24.34 E -.05(ga)-.15 G(tion).05 E F1(**)108 +290.4 Q F0 -.15(ex)26 G(ponentiation).15 E F1 2.5(*/%)108 302.4 S F0 +(multiplication, di)10.72 E(vision, remainder)-.25 E F1 2.5<2bad>108 +314.4 S F0(addition, subtraction)19.6 E F1(<< >>)108 326.4 Q F0 +(left and right bitwise shifts)10.7 E F1(<= >= < >)108 338.4 Q F0 +(comparison)144 350.4 Q F1(== !=)108 362.4 Q F0(equality and inequality) +13.07 E F1(&)108 374.4 Q F0(bitwise AND)27.67 E F1(^)108 386.4 Q F0 +(bitwise e)32.67 E(xclusi)-.15 E .3 -.15(ve O)-.25 H(R).15 E F1(|)108 +398.4 Q F0(bitwise OR)33.8 E F1(&&)108 410.4 Q F0(logical AND)19.34 E F1 +(||)108 422.4 Q F0(logical OR)31.6 E F3 -.2(ex)108 434.4 S(pr).2 E F1(?) +A F3 -.2(ex)C(pr).2 E F1(:)A F3 -.2(ex)C(pr).2 E F0 +(conditional operator)144 446.4 Q F1 2.5(=*)108 458.4 S 2.5(=/)-2.5 G +2.5(=%)-2.5 G 2.5(=+)-2.5 G 2.5<3dad>-2.5 G 2.5(=<)-2.5 G +(<= >>= &= ^= |=)-2.5 E F0(assignment)144 470.4 Q F3 -.2(ex)108 482.4 S +(pr1).2 E F1(,)2.5 E F3 -.2(ex)2.5 G(pr2).2 E F0(comma)144 494.4 Q .68 +(Shell v)108 511.2 R .68(ariables are allo)-.25 F .68 +(wed as operands; parameter e)-.25 F .68 +(xpansion is performed before the e)-.15 F .68(xpression is e)-.15 F +-.25(va)-.25 G(lu-).25 E 3.507(ated. W)108 523.2 R 1.007(ithin an e)-.4 +F 1.007(xpression, shell v)-.15 F 1.007 +(ariables may also be referenced by name without using the parameter) +-.25 F -.15(ex)108 535.2 S 1.041(pansion syntax.).15 F 3.541(As)6.041 G +1.041(hell v)-3.541 F 1.041(ariable that is null or unset e)-.25 F -.25 +(va)-.25 G 1.04(luates to 0 when referenced by name without).25 F 1.466 +(using the parameter e)108 547.2 R 1.466(xpansion syntax.)-.15 F 1.467 +(The v)6.466 F 1.467(alue of a v)-.25 F 1.467(ariable is e)-.25 F -.25 +(va)-.25 G 1.467(luated as an arithmetic e).25 F(xpression)-.15 E 1.39 +(when it is referenced, or when a v)108 559.2 R 1.389 +(ariable which has been gi)-.25 F -.15(ve)-.25 G 3.889(nt).15 G(he) +-3.889 E F3(inte)3.889 E -.1(ge)-.4 G(r).1 E F0(attrib)3.889 E 1.389 +(ute using)-.2 F F1(declar)3.889 E 3.889(e-)-.18 G(i)-3.889 E F0(is) +3.889 E .343(assigned a v)108 571.2 R 2.843(alue. A)-.25 F .343(null v) +2.843 F .343(alue e)-.25 F -.25(va)-.25 G .343(luates to 0.).25 F 2.843 +(As)5.343 G .343(hell v)-2.843 F .343(ariable need not ha)-.25 F .643 +-.15(ve i)-.2 H .343(ts inte).15 F .344(ger attrib)-.15 F .344 +(ute turned on)-.2 F(to be used in an e)108 583.2 Q(xpression.)-.15 E +1.406(Constants with a leading 0 are interpreted as octal numbers.)108 +600 R 3.906(Al)6.406 G 1.406(eading 0x or 0X denotes he)-3.906 F +(xadecimal.)-.15 E .589(Otherwise, numbers tak)108 612 R 3.089(et)-.1 G +.589(he form [)-3.089 F F3(base#)A F0 .589(]n, where)B F3(base)3.089 E +F0 .59(is a decimal number between 2 and 64 represent-)3.089 F .093 +(ing the arithmetic base, and)108 624 R F3(n)2.593 E F0 .093 +(is a number in that base.)2.593 F(If)5.093 E F3(base#)2.593 E F0 .092 +(is omitted, then base 10 is used.)2.593 F .092(The digits)5.092 F .064 +(greater than 9 are represented by the lo)108 636 R .064 +(wercase letters, the uppercase letters, @, and _, in that order)-.25 F +5.065(.I)-.55 G(f)-5.065 E F3(base)2.565 E F0 .433 +(is less than or equal to 36, lo)108 648 R .432(wercase and uppercase l\ +etters may be used interchangeably to represent num-)-.25 F +(bers between 10 and 35.)108 660 Q .234(Operators are e)108 676.8 R -.25 +(va)-.25 G .234(luated in order of precedence.).25 F(Sub-e)5.234 E .234 +(xpressions in parentheses are e)-.15 F -.25(va)-.25 G .235 +(luated \214rst and may).25 F -.15(ove)108 688.8 S +(rride the precedence rules abo).15 E -.15(ve)-.15 G(.).15 E F2 +(CONDITION)72 705.6 Q(AL EXPRESSIONS)-.219 E F0 .256(Conditional e)108 +717.6 R .256(xpressions are used by the)-.15 F F1([[)2.755 E F0 .255 +(compound command and the)2.755 F F1(test)2.755 E F0(and)2.755 E F1([) +2.755 E F0 -.2(bu)2.755 G .255(iltin commands to test).2 F .77 +(\214le attrib)108 729.6 R .77 +(utes and perform string and arithmetic comparisons.)-.2 F .77 +(Expressions are formed from the follo)5.77 F(wing)-.25 E(GNU Bash-4.1) +72 768 Q(2009 December 29)135.965 E(27)185.955 E 0 Cg EP +%%Page: 28 28 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 1.041(unary or binary primaries.)108 84 R 1.041(If an)6.041 F(y) +-.15 E/F1 10/Times-Italic@0 SF(\214le)3.541 E F0(ar)3.541 E 1.04 +(gument to one of the primaries is of the form)-.18 F F1(/de)3.54 E +(v/fd/n)-.15 E F0 3.54(,t)C 1.04(hen \214le)-3.54 F(descriptor)108 96 Q +F1(n)3.788 E F0 1.289(is check)3.788 F 3.789(ed. If)-.1 F(the)3.789 E F1 +(\214le)3.789 E F0(ar)3.789 E 1.289 +(gument to one of the primaries is one of)-.18 F F1(/de)3.789 E(v/stdin) +-.15 E F0(,)A F1(/de)3.789 E(v/stdout)-.15 E F0 3.789(,o)C(r)-3.789 E F1 +(/de)108 108 Q(v/stderr)-.15 E F0 2.5<2c8c>C +(le descriptor 0, 1, or 2, respecti)-2.5 E -.15(ve)-.25 G(ly).15 E 2.5 +(,i)-.65 G 2.5(sc)-2.5 G(heck)-2.5 E(ed.)-.1 E .722 +(Unless otherwise speci\214ed, primaries that operate on \214les follo) +108 124.8 R 3.221(ws)-.25 G .721(ymbolic links and operate on the tar) +-3.221 F(get)-.18 E(of the link, rather than the link itself.)108 136.8 +Q(When used with)108 154.8 Q/F2 10/Times-Bold@0 SF([[)2.5 E F0 2.5(,T)C +(he)-2.5 E F2(<)2.5 E F0(and)2.5 E F2(>)2.5 E F0(operators sort le)2.5 E +(xicographically using the current locale.)-.15 E F2<ad61>108 178.8 Q F1 +(\214le)2.5 E F0 -.35(Tr)10.58 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists.).15 E F2<ad62>108 190.8 Q F1(\214le)2.5 E F0 -.35(Tr)10.02 G +(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and is a block special \214le.).15 E F2<ad63>108 202.8 Q F1 +(\214le)2.5 E F0 -.35(Tr)11.14 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists and is a character special \214le.).15 E F2<ad64>108 214.8 Q +F1(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15 +(ex)2.5 G(ists and is a directory).15 E(.)-.65 E F2<ad65>108 226.8 Q F1 +(\214le)2.5 E F0 -.35(Tr)11.14 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists.).15 E F2<ad66>108 238.8 Q F1(\214le)2.5 E F0 -.35(Tr)12.25 G +(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is a re).15 E +(gular \214le.)-.15 E F2<ad67>108 250.8 Q F1(\214le)2.5 E F0 -.35(Tr) +10.58 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and is set-group-id.).15 E F2<ad68>108 262.8 Q F1(\214le)2.5 E F0 +-.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and is a symbolic link.).15 E F2<ad6b>108 274.8 Q F1(\214le)2.5 E +F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and its `).15 E(`stick)-.74 E(y')-.15 E 2.5('b)-.74 G(it is set.) +-2.5 E F2<ad70>108 286.8 Q F1(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 +E F1(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is a named pipe \(FIFO\).) +.15 E F2<ad72>108 298.8 Q F1(\214le)2.5 E F0 -.35(Tr)11.14 G(ue if).35 E +F1(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is readable.).15 E F2<ad73>108 +310.8 Q F1(\214le)2.5 E F0 -.35(Tr)11.69 G(ue if).35 E F1(\214le)2.5 E +F0 -.15(ex)2.5 G(ists and has a size greater than zero.).15 E F2<ad74> +108 322.8 Q F1(fd)2.5 E F0 -.35(Tr)16.69 G(ue if \214le descriptor).35 E +F1(fd)4.47 E F0(is open and refers to a terminal.)3.27 E F2<ad75>108 +334.8 Q F1(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E +F0 -.15(ex)2.5 G(ists and its set-user).15 E(-id bit is set.)-.2 E F2 +<ad77>108 346.8 Q F1(\214le)2.5 E F0 -.35(Tr)8.36 G(ue if).35 E F1 +(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is writable.).15 E F2<ad78>108 +358.8 Q F1(\214le)2.5 E F0 -.35(Tr)10.58 G(ue if).35 E F1(\214le)2.5 E +F0 -.15(ex)2.5 G(ists and is e).15 E -.15(xe)-.15 G(cutable.).15 E F2 +<ad4f>108 370.8 Q F1(\214le)2.5 E F0 -.35(Tr)7.8 G(ue if).35 E F1 +(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is o).15 E(wned by the ef)-.25 E +(fecti)-.25 E .3 -.15(ve u)-.25 H(ser id.).15 E F2<ad47>108 382.8 Q F1 +(\214le)2.5 E F0 -.35(Tr)7.8 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists and is o).15 E(wned by the ef)-.25 E(fecti)-.25 E .3 -.15 +(ve g)-.25 H(roup id.).15 E F2<ad4c>108 394.8 Q F1(\214le)2.5 E F0 -.35 +(Tr)8.91 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and is a symbolic link.).15 E F2<ad53>108 406.8 Q F1(\214le)2.5 E +F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and is a sock).15 E(et.)-.1 E F2<ad4e>108 418.8 Q F1(\214le)2.5 E +F0 -.35(Tr)8.36 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and has been modi\214ed since it w).15 E(as last read.)-.1 E F1 +(\214le1)108 430.8 Q F0<ad>2.5 E F2(nt)A F1(\214le2)2.5 E F0 -.35(Tr)144 +442.8 S .038(ue if).35 F F1(\214le1)2.538 E F0 .039(is ne)2.539 F .039 +(wer \(according to modi\214cation date\) than)-.25 F F1(\214le2)2.539 E +F0 2.539(,o)C 2.539(ri)-2.539 G(f)-2.539 E F1(\214le1)2.539 E F0 -.15 +(ex)2.539 G .039(ists and).15 F F1(\214le2)2.539 E F0 .039(does not.) +2.539 F F1(\214le1)108 454.8 Q F0<ad>2.5 E F2(ot)A F1(\214le2)2.5 E F0 +-.35(Tr)144 466.8 S(ue if).35 E F1(\214le1)2.5 E F0(is older than)2.5 E +F1(\214le2)2.5 E F0 2.5(,o)C 2.5(ri)-2.5 G(f)-2.5 E F1(\214le2)2.5 E F0 +-.15(ex)2.5 G(ists and).15 E F1(\214le1)2.5 E F0(does not.)2.5 E F1 +(\214le1)108 478.8 Q F2(\255ef)2.5 E F1(\214le2)2.5 E F0 -.35(Tr)144 +490.8 S(ue if).35 E F1(\214le1)2.5 E F0(and)2.5 E F1(\214le2)2.5 E F0 +(refer to the same de)2.5 E(vice and inode numbers.)-.25 E F2<ad6f>108 +502.8 Q F1(optname)2.5 E F0 -.35(Tr)144 514.8 S 1.144 +(ue if shell option).35 F F1(optname)3.874 E F0 1.144(is enabled.)3.824 +F 1.143(See the list of options under the description of the)6.144 F F2 +<ad6f>3.643 E F0(option to the)144 526.8 Q F2(set)2.5 E F0 -.2(bu)2.5 G +(iltin belo).2 E -.65(w.)-.25 G F2<ad7a>108 538.8 Q F1(string)2.5 E F0 +-.35(Tr)144 550.8 S(ue if the length of).35 E F1(string)2.5 E F0 +(is zero.)2.5 E F1(string)108 562.8 Q F2<ad6e>108 574.8 Q F1(string)2.5 +E F0 -.35(Tr)144 586.8 S(ue if the length of).35 E F1(string)2.84 E F0 +(is non-zero.)2.72 E F1(string1)108 603.6 Q F2(==)2.5 E F1(string2)2.5 E +(string1)108 615.6 Q F2(=)2.5 E F1(string2)2.5 E F0 -.35(Tr)144 627.6 S +(ue if the strings are equal.).35 E F2(=)5 E F0(should be used with the) +2.5 E F2(test)2.5 E F0(command for POSIX conformance.)2.5 E F1(string1) +108 644.4 Q F2(!=)2.5 E F1(string2)2.5 E F0 -.35(Tr)144 656.4 S +(ue if the strings are not equal.).35 E F1(string1)108 673.2 Q F2(<)2.5 +E F1(string2)2.5 E F0 -.35(Tr)144 685.2 S(ue if).35 E F1(string1)2.5 E +F0(sorts before)2.5 E F1(string2)2.5 E F0(le)2.5 E(xicographically)-.15 +E(.)-.65 E F1(string1)108 702 Q F2(>)2.5 E F1(string2)2.5 E F0 -.35(Tr) +144 714 S(ue if).35 E F1(string1)2.5 E F0(sorts after)2.5 E F1(string2) +2.5 E F0(le)2.5 E(xicographically)-.15 E(.)-.65 E(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(28)185.955 E 0 Cg EP +%%Page: 29 29 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Italic@0 SF(ar)108.33 84 Q(g1)-.37 E/F2 10 +/Times-Bold@0 SF(OP)2.5 E F1(ar)2.5 E(g2)-.37 E/F3 9/Times-Bold@0 SF(OP) +144 96 Q F0 .385(is one of)2.634 F F2(\255eq)2.885 E F0(,)A F2(\255ne) +2.885 E F0(,)A F2(\255lt)2.885 E F0(,)A F2(\255le)2.885 E F0(,)A F2 +(\255gt)2.885 E F0 2.885(,o)C(r)-2.885 E F2(\255ge)2.885 E F0 5.385(.T)C +.385(hese arithmetic binary operators return true if)-5.385 F F1(ar) +2.885 E(g1)-.37 E F0 .845(is equal to, not equal to, less than, less th\ +an or equal to, greater than, or greater than or equal to)144 108 R F1 +(ar)144 120 Q(g2)-.37 E F0 2.5(,r)C(especti)-2.5 E -.15(ve)-.25 G(ly).15 +E(.)-.65 E F1(Ar)6.01 E(g1)-.37 E F0(and)2.5 E F1(ar)2.83 E(g2)-.37 E F0 +(may be positi)2.52 E .3 -.15(ve o)-.25 H 2.5(rn).15 G -2.25 -.15(eg a) +-2.5 H(ti).15 E .3 -.15(ve i)-.25 H(nte).15 E(gers.)-.15 E/F4 10.95 +/Times-Bold@0 SF(SIMPLE COMMAND EXP)72 136.8 Q(ANSION)-.81 E F0 .613 +(When a simple command is e)108 148.8 R -.15(xe)-.15 G .614 +(cuted, the shell performs the follo).15 F .614(wing e)-.25 F .614 +(xpansions, assignments, and redi-)-.15 F(rections, from left to right.) +108 160.8 Q 26(1. The)108 177.6 R -.1(wo)4.349 G 1.849 +(rds that the parser has mark).1 F 1.848(ed as v)-.1 F 1.848 +(ariable assignments \(those preceding the command)-.25 F +(name\) and redirections are sa)144 189.6 Q -.15(ve)-.2 G 2.5(df).15 G +(or later processing.)-2.5 E 26(2. The)108 206.4 R -.1(wo)3.663 G 1.163 +(rds that are not v).1 F 1.164 +(ariable assignments or redirections are e)-.25 F 3.664(xpanded. If)-.15 +F(an)3.664 E 3.664(yw)-.15 G 1.164(ords remain)-3.764 F .776(after e)144 +218.4 R .776(xpansion, the \214rst w)-.15 F .776(ord is tak)-.1 F .775 +(en to be the name of the command and the remaining w)-.1 F(ords)-.1 E +(are the ar)144 230.4 Q(guments.)-.18 E 26(3. Redirections)108 247.2 R +(are performed as described abo)2.5 E .3 -.15(ve u)-.15 H(nder).15 E F3 +(REDIRECTION)2.5 E/F5 9/Times-Roman@0 SF(.)A F0 26(4. The)108 264 R(te) +3.216 E .717(xt after the)-.15 F F2(=)3.217 E F0 .717(in each v)3.217 F +.717(ariable assignment under)-.25 F .717(goes tilde e)-.18 F .717 +(xpansion, parameter e)-.15 F(xpansion,)-.15 E .34 +(command substitution, arithmetic e)144 276 R .339 +(xpansion, and quote remo)-.15 F -.25(va)-.15 G 2.839(lb).25 G .339 +(efore being assigned to the v)-2.839 F(ari-)-.25 E(able.)144 288 Q .332 +(If no command name results, the v)108 304.8 R .332 +(ariable assignments af)-.25 F .332(fect the current shell en)-.25 F +2.833(vironment. Otherwise,)-.4 F(the)2.833 E -.25(va)108 316.8 S .757 +(riables are added to the en).25 F .757(vironment of the e)-.4 F -.15 +(xe)-.15 G .757(cuted command and do not af).15 F .757 +(fect the current shell en)-.25 F(vi-)-.4 E 3.176(ronment. If)108 328.8 +R(an)3.176 E 3.176(yo)-.15 G 3.176(ft)-3.176 G .677 +(he assignments attempts to assign a v)-3.176 F .677 +(alue to a readonly v)-.25 F .677(ariable, an error occurs, and)-.25 F +(the command e)108 340.8 Q(xits with a non-zero status.)-.15 E .15 +(If no command name results, redirections are performed, b)108 357.6 R +.149(ut do not af)-.2 F .149(fect the current shell en)-.25 F 2.649 +(vironment. A)-.4 F(redirection error causes the command to e)108 369.6 +Q(xit with a non-zero status.)-.15 E 1.064 +(If there is a command name left after e)108 386.4 R 1.064(xpansion, e) +-.15 F -.15(xe)-.15 G 1.064(cution proceeds as described belo).15 F +4.864 -.65(w. O)-.25 H 1.064(therwise, the).65 F .069(command e)108 +398.4 R 2.569(xits. If)-.15 F .069(one of the e)2.569 F .069 +(xpansions contained a command substitution, the e)-.15 F .068 +(xit status of the command)-.15 F .466(is the e)108 410.4 R .466 +(xit status of the last command substitution performed.)-.15 F .467 +(If there were no command substitutions, the)5.466 F(command e)108 422.4 +Q(xits with a status of zero.)-.15 E F4(COMMAND EXECUTION)72 439.2 Q F0 +.547(After a command has been split into w)108 451.2 R .546 +(ords, if it results in a simple command and an optional list of ar)-.1 +F(gu-)-.18 E(ments, the follo)108 463.2 Q(wing actions are tak)-.25 E +(en.)-.1 E .379(If the command name contains no slashes, the shell atte\ +mpts to locate it.)108 480 R .379(If there e)5.379 F .379 +(xists a shell function by)-.15 F .246(that name, that function is in) +108 492 R -.2(vo)-.4 G -.1(ke).2 G 2.746(da).1 G 2.746(sd)-2.746 G .246 +(escribed abo)-2.746 F .546 -.15(ve i)-.15 H(n).15 E F3(FUNCTIONS)2.746 +E F5(.)A F0 .246(If the name does not match a func-)4.746 F +(tion, the shell searches for it in the list of shell b)108 504 Q 2.5 +(uiltins. If)-.2 F 2.5(am)2.5 G(atch is found, that b)-2.5 E +(uiltin is in)-.2 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E .309 +(If the name is neither a shell function nor a b)108 520.8 R .31 +(uiltin, and contains no slashes,)-.2 F F2(bash)2.81 E F0 .31 +(searches each element of)2.81 F(the)108 532.8 Q F3 -.666(PA)3.163 G(TH) +-.189 E F0 .662(for a directory containing an e)2.913 F -.15(xe)-.15 G +.662(cutable \214le by that name.).15 F F2(Bash)5.662 E F0 .662 +(uses a hash table to remember)3.162 F 1.914(the full pathnames of e)108 +544.8 R -.15(xe)-.15 G 1.915(cutable \214les \(see).15 F F2(hash)4.415 E +F0(under)4.415 E F3 1.915(SHELL B)4.415 F(UIL)-.09 E 1.915(TIN COMMANDS) +-.828 F F0(belo)4.165 E 4.415(w\). A)-.25 F(full)4.415 E .72 +(search of the directories in)108 556.8 R F3 -.666(PA)3.22 G(TH)-.189 E +F0 .719 +(is performed only if the command is not found in the hash table.)2.97 F +.719(If the)5.719 F .956(search is unsuccessful, the shell searches for\ + a de\214ned shell function named)108 568.8 R F2(command_not_f)3.456 E +(ound_han-)-.25 E(dle)108 580.8 Q F0 5.278(.I)C 2.778(ft)-5.278 G .278 +(hat function e)-2.778 F .278(xists, it is in)-.15 F -.2(vo)-.4 G -.1 +(ke).2 G 2.778(dw).1 G .277 +(ith the original command and the original command')-2.778 F 2.777(sa) +-.55 G -.18(rg)-2.777 G(uments).18 E .775(as its ar)108 592.8 R .775 +(guments, and the function')-.18 F 3.275(se)-.55 G .775 +(xit status becomes the e)-3.425 F .775(xit status of the shell.)-.15 F +.776(If that function is not)5.776 F +(de\214ned, the shell prints an error message and returns an e)108 604.8 +Q(xit status of 127.)-.15 E 1.089(If the search is successful, or if th\ +e command name contains one or more slashes, the shell e)108 621.6 R +-.15(xe)-.15 G 1.089(cutes the).15 F .197(named program in a separate e) +108 633.6 R -.15(xe)-.15 G .197(cution en).15 F 2.698(vironment. Ar)-.4 +F .198(gument 0 is set to the name gi)-.18 F -.15(ve)-.25 G .198 +(n, and the remain-).15 F(ing ar)108 645.6 Q +(guments to the command are set to the ar)-.18 E(guments gi)-.18 E -.15 +(ve)-.25 G(n, if an).15 E -.65(y.)-.15 G 1.809(If this e)108 662.4 R +-.15(xe)-.15 G 1.809(cution f).15 F 1.809 +(ails because the \214le is not in e)-.1 F -.15(xe)-.15 G 1.809 +(cutable format, and the \214le is not a directory).15 F 4.309(,i)-.65 G +4.309(ti)-4.309 G(s)-4.309 E .677(assumed to be a)108 674.4 R F1 .678 +(shell script)3.177 F F0 3.178(,a\214)C .678 +(le containing shell commands.)-3.178 F 3.178(As)5.678 G .678 +(ubshell is spa)-3.178 F .678(wned to e)-.15 F -.15(xe)-.15 G .678 +(cute it.).15 F(This)5.678 E .33 +(subshell reinitializes itself, so that the ef)108 686.4 R .33 +(fect is as if a ne)-.25 F 2.829(ws)-.25 G .329(hell had been in)-2.829 +F -.2(vo)-.4 G -.1(ke).2 G 2.829(dt).1 G 2.829(oh)-2.829 G .329 +(andle the script, with)-2.829 F 1.219(the e)108 698.4 R 1.219 +(xception that the locations of commands remembered by the parent \(see) +-.15 F F2(hash)3.719 E F0(belo)3.719 E 3.719(wu)-.25 G(nder)-3.719 E F3 +(SHELL)3.719 E -.09(BU)108 710.4 S(IL).09 E(TIN COMMANDS)-.828 E F5(\))A +F0(are retained by the child.)2.25 E 1.375 +(If the program is a \214le be)108 727.2 R 1.374(ginning with)-.15 F F2 +(#!)3.874 E F0 3.874(,t)C 1.374 +(he remainder of the \214rst line speci\214es an interpreter for the) +-3.874 F(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(29)185.955 E 0 +Cg EP +%%Page: 30 30 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 5.485(program. The)108 84 R 2.985(shell e)5.485 F -.15(xe)-.15 G +2.986(cutes the speci\214ed interpreter on operating systems that do no\ +t handle this).15 F -.15(exe)108 96 S .762(cutable format themselv).15 F +3.262(es. The)-.15 F(ar)3.262 E .761 +(guments to the interpreter consist of a single optional ar)-.18 F .761 +(gument fol-)-.18 F(lo)108 108 Q .156 +(wing the interpreter name on the \214rst line of the program, follo) +-.25 F .157(wed by the name of the program, follo)-.25 F(wed)-.25 E +(by the command ar)108 120 Q(guments, if an)-.18 E -.65(y.)-.15 G/F1 +10.95/Times-Bold@0 SF(COMMAND EXECUTION ENVIR)72 136.8 Q(ONMENT)-.329 E +F0(The shell has an)108 148.8 Q/F2 10/Times-Italic@0 SF -.2(ex)2.5 G +(ecution en).2 E(vir)-.4 E(onment)-.45 E F0 2.5(,w)C +(hich consists of the follo)-2.5 E(wing:)-.25 E 32.5<836f>108 165.6 S +1.406(pen \214les inherited by the shell at in)-32.5 F -.2(vo)-.4 G +1.405(cation, as modi\214ed by redirections supplied to the).2 F/F3 10 +/Times-Bold@0 SF(exec)3.905 E F0 -.2(bu)144 177.6 S(iltin).2 E 32.5 +<8374>108 194.4 S(he current w)-32.5 E(orking directory as set by)-.1 E +F3(cd)2.5 E F0(,)A F3(pushd)2.5 E F0 2.5(,o)C(r)-2.5 E F3(popd)2.5 E F0 +2.5(,o)C 2.5(ri)-2.5 G(nherited by the shell at in)-2.5 E -.2(vo)-.4 G +(cation).2 E 32.5<8374>108 211.2 S +(he \214le creation mode mask as set by)-32.5 E F3(umask)2.5 E F0 +(or inherited from the shell')2.5 E 2.5(sp)-.55 G(arent)-2.5 E 32.5 +<8363>108 228 S(urrent traps set by)-32.5 E F3(trap)2.5 E F0 32.5<8373> +108 244.8 S .256(hell parameters that are set by v)-32.5 F .256 +(ariable assignment or with)-.25 F F3(set)2.756 E F0 .257 +(or inherited from the shell')2.756 F 2.757(sp)-.55 G(arent)-2.757 E +(in the en)144 256.8 Q(vironment)-.4 E 32.5<8373>108 273.6 S +(hell functions de\214ned during e)-32.5 E -.15(xe)-.15 G +(cution or inherited from the shell').15 E 2.5(sp)-.55 G +(arent in the en)-2.5 E(vironment)-.4 E 32.5<836f>108 290.4 S +(ptions enabled at in)-32.5 E -.2(vo)-.4 G(cation \(either by def).2 E +(ault or with command-line ar)-.1 E(guments\) or by)-.18 E F3(set)2.5 E +F0 32.5<836f>108 307.2 S(ptions enabled by)-32.5 E F3(shopt)2.5 E F0 +32.5<8373>108 324 S(hell aliases de\214ned with)-32.5 E F3(alias)2.5 E +F0 32.5<8376>108 340.8 S +(arious process IDs, including those of background jobs, the v)-32.75 E +(alue of)-.25 E F3($$)2.5 E F0 2.5(,a)C(nd the v)-2.5 E(alue of)-.25 E +/F4 9/Times-Bold@0 SF(PPID)2.5 E F0 .427 +(When a simple command other than a b)108 357.6 R .426 +(uiltin or shell function is to be e)-.2 F -.15(xe)-.15 G .426 +(cuted, it is in).15 F -.2(vo)-.4 G -.1(ke).2 G 2.926(di).1 G 2.926(nas) +-2.926 G(eparate)-2.926 E -.15(exe)108 369.6 S .133(cution en).15 F .133 +(vironment that consists of the follo)-.4 F 2.634(wing. Unless)-.25 F +.134(otherwise noted, the v)2.634 F .134(alues are inherited from)-.25 F +(the shell.)108 381.6 Q 32.5<8374>108 398.4 S 1.056(he shell')-32.5 F +3.556(so)-.55 G 1.056(pen \214les, plus an)-3.556 F 3.556(ym)-.15 G +1.056 +(odi\214cations and additions speci\214ed by redirections to the com-) +-3.556 F(mand)144 410.4 Q 32.5<8374>108 427.2 S(he current w)-32.5 E +(orking directory)-.1 E 32.5<8374>108 444 S +(he \214le creation mode mask)-32.5 E 32.5<8373>108 460.8 S .856(hell v) +-32.5 F .857(ariables and functions mark)-.25 F .857(ed for e)-.1 F .857 +(xport, along with v)-.15 F .857(ariables e)-.25 F .857 +(xported for the command,)-.15 F(passed in the en)144 472.8 Q(vironment) +-.4 E 32.5<8374>108 489.6 S .307 +(raps caught by the shell are reset to the v)-32.5 F .306 +(alues inherited from the shell')-.25 F 2.806(sp)-.55 G .306 +(arent, and traps ignored)-2.806 F(by the shell are ignored)144 501.6 Q +2.5(Ac)108 518.4 S(ommand in)-2.5 E -.2(vo)-.4 G -.1(ke).2 G 2.5(di).1 G +2.5(nt)-2.5 G(his separate en)-2.5 E(vironment cannot af)-.4 E +(fect the shell')-.25 E 2.5(se)-.55 G -.15(xe)-2.65 G(cution en).15 E +(vironment.)-.4 E .577(Command substitution, commands grouped with pare\ +ntheses, and asynchronous commands are in)108 535.2 R -.2(vo)-.4 G -.1 +(ke).2 G 3.078(di).1 G(n)-3.078 E 2.745(as)108 547.2 S .245(ubshell en) +-2.745 F .245(vironment that is a duplicate of the shell en)-.4 F .244 +(vironment, e)-.4 F .244(xcept that traps caught by the shell are)-.15 F +.358(reset to the v)108 559.2 R .358 +(alues that the shell inherited from its parent at in)-.25 F -.2(vo)-.4 +G 2.858(cation. Builtin).2 F .359(commands that are in)2.859 F -.2(vo) +-.4 G -.1(ke).2 G(d).1 E .857(as part of a pipeline are also e)108 571.2 +R -.15(xe)-.15 G .856(cuted in a subshell en).15 F 3.356 +(vironment. Changes)-.4 F .856(made to the subshell en)3.356 F(viron-) +-.4 E(ment cannot af)108 583.2 Q(fect the shell')-.25 E 2.5(se)-.55 G +-.15(xe)-2.65 G(cution en).15 E(vironment.)-.4 E 1.376(Subshells spa)108 +600 R 1.376(wned to e)-.15 F -.15(xe)-.15 G 1.377 +(cute command substitutions inherit the v).15 F 1.377(alue of the)-.25 F +F3<ad65>3.877 E F0 1.377(option from the parent)3.877 F 2.5(shell. When) +108 612 R(not in posix mode, Bash clears the)2.5 E F3<ad65>2.5 E F0 +(option in such subshells.)2.5 E .405(If a command is follo)108 628.8 R +.405(wed by a)-.25 F F3(&)2.905 E F0 .404(and job control is not acti) +2.905 F -.15(ve)-.25 G 2.904(,t).15 G .404(he def)-2.904 F .404 +(ault standard input for the command)-.1 F .197(is the empty \214le)108 +640.8 R F2(/de)2.697 E(v/null)-.15 E F0 5.197(.O)C .197 +(therwise, the in)-5.197 F -.2(vo)-.4 G -.1(ke).2 G 2.697(dc).1 G .198 +(ommand inherits the \214le descriptors of the calling shell)-2.697 F +(as modi\214ed by redirections.)108 652.8 Q F1(ENVIR)72 669.6 Q(ONMENT) +-.329 E F0 2.354(When a program is in)108 681.6 R -.2(vo)-.4 G -.1(ke).2 +G 4.853(di).1 G 4.853(ti)-4.853 G 4.853(sg)-4.853 G -2.15 -.25(iv e) +-4.853 H 4.853(na).25 G 4.853(na)-4.853 G 2.353 +(rray of strings called the)-4.853 F F2(en)4.853 E(vir)-.4 E(onment)-.45 +E F0 7.353(.T).68 G 2.353(his is a list of)-7.353 F F2(name)108 693.6 Q +F0<ad>A F2(value)A F0(pairs, of the form)2.5 E F2(name)2.5 E F0(=)A F2 +(value)A F0(.).18 E 1.485(The shell pro)108 710.4 R 1.485(vides se)-.15 +F -.15(ve)-.25 G 1.485(ral w).15 F 1.485(ays to manipulate the en)-.1 F +3.985(vironment. On)-.4 F(in)3.985 E -.2(vo)-.4 G 1.486 +(cation, the shell scans its o).2 F(wn)-.25 E(en)108 722.4 Q 1.431(viro\ +nment and creates a parameter for each name found, automatically markin\ +g it for)-.4 F F2 -.2(ex)3.93 G(port).2 E F0 1.43(to child)4.61 F +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(30)185.955 E 0 Cg EP +%%Page: 31 31 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 4.177(processes. Ex)108 84 R 1.677 +(ecuted commands inherit the en)-.15 F 4.177(vironment. The)-.4 F/F1 10 +/Times-Bold@0 SF(export)4.178 E F0(and)4.178 E F1(declar)4.178 E 4.178 +<65ad>-.18 G(x)-4.178 E F0 1.678(commands allo)4.178 F(w)-.25 E .647 +(parameters and functions to be added to and deleted from the en)108 96 +R 3.147(vironment. If)-.4 F .646(the v)3.146 F .646 +(alue of a parameter in)-.25 F .513(the en)108 108 R .513 +(vironment is modi\214ed, the ne)-.4 F 3.013(wv)-.25 G .513 +(alue becomes part of the en)-3.263 F .513 +(vironment, replacing the old.)-.4 F .514(The en)5.514 F(vi-)-.4 E .523 +(ronment inherited by an)108 120 R 3.022(ye)-.15 G -.15(xe)-3.172 G .522 +(cuted command consists of the shell').15 F 3.022(si)-.55 G .522 +(nitial en)-3.022 F .522(vironment, whose v)-.4 F .522(alues may)-.25 F +.578(be modi\214ed in the shell, less an)108 132 R 3.078(yp)-.15 G .578 +(airs remo)-3.078 F -.15(ve)-.15 G 3.078(db).15 G 3.078(yt)-3.078 G(he) +-3.078 E F1(unset)3.078 E F0 .579(command, plus an)3.078 F 3.079(ya)-.15 +G .579(dditions via the)-3.079 F F1(export)3.079 E F0(and)108 144 Q F1 +(declar)2.5 E 2.5<65ad>-.18 G(x)-2.5 E F0(commands.)2.5 E .563(The en) +108 160.8 R .563(vironment for an)-.4 F(y)-.15 E/F2 10/Times-Italic@0 SF +.563(simple command)3.403 F F0 .562 +(or function may be augmented temporarily by pre\214xing it with)3.833 F +.202(parameter assignments, as described abo)108 172.8 R .502 -.15(ve i) +-.15 H(n).15 E/F3 9/Times-Bold@0 SF -.666(PA)2.702 G(RAMETERS).666 E/F4 +9/Times-Roman@0 SF(.)A F0 .202(These assignment statements af)4.702 F +.203(fect only the)-.25 F(en)108 184.8 Q +(vironment seen by that command.)-.4 E .81(If the)108 201.6 R F1<ad6b> +3.31 E F0 .81(option is set \(see the)3.31 F F1(set)3.31 E F0 -.2(bu) +3.31 G .81(iltin command belo).2 F .81(w\), then)-.25 F F2(all)3.64 E F0 +.81(parameter assignments are placed in)3.82 F(the en)108 213.6 Q +(vironment for a command, not just those that precede the command name.) +-.4 E(When)108 230.4 Q F1(bash)3.396 E F0(in)3.396 E -.2(vo)-.4 G -.1 +(ke).2 G 3.396(sa).1 G 3.397(ne)-3.396 G .897(xternal command, the v) +-3.547 F(ariable)-.25 E F1(_)3.397 E F0 .897 +(is set to the full \214le name of the command and)3.397 F +(passed to that command in its en)108 242.4 Q(vironment.)-.4 E/F5 10.95 +/Times-Bold@0 SF(EXIT ST)72 259.2 Q -1.04(AT)-.986 G(US)1.04 E F0 .151 +(The e)108 271.2 R .151(xit status of an e)-.15 F -.15(xe)-.15 G .151 +(cuted command is the v).15 F .15(alue returned by the)-.25 F F2 +(waitpid)2.65 E F0 .15(system call or equi)2.65 F -.25(va)-.25 G .15 +(lent func-).25 F 2.847(tion. Exit)108 283.2 R .347(statuses f)2.847 F +.347(all between 0 and 255, though, as e)-.1 F .347(xplained belo)-.15 F +1.647 -.65(w, t)-.25 H .347(he shell may use v).65 F .348(alues abo)-.25 +F .648 -.15(ve 1)-.15 H(25).15 E(specially)108 295.2 Q 5.674(.E)-.65 G +.674(xit statuses from shell b)-5.674 F .673 +(uiltins and compound commands are also limited to this range. Under)-.2 +F(certain circumstances, the shell will use special v)108 307.2 Q +(alues to indicate speci\214c f)-.25 E(ailure modes.)-.1 E -.15(Fo)108 +324 S 3.372(rt).15 G .872(he shell')-3.372 F 3.372(sp)-.55 G .873 +(urposes, a command which e)-3.372 F .873(xits with a zero e)-.15 F .873 +(xit status has succeeded.)-.15 F .873(An e)5.873 F .873(xit status of) +-.15 F .049(zero indicates success.)108 336 R 2.549(An)5.049 G .049 +(on-zero e)-2.549 F .049(xit status indicates f)-.15 F 2.549 +(ailure. When)-.1 F 2.549(ac)2.549 G .048(ommand terminates on a f) +-2.549 F .048(atal sig-)-.1 F(nal)108 348 Q F2(N)2.5 E F0(,)A F1(bash) +2.5 E F0(uses the v)2.5 E(alue of 128+)-.25 E F2(N)A F0(as the e)2.5 E +(xit status.)-.15 E .404 +(If a command is not found, the child process created to e)108 364.8 R +-.15(xe)-.15 G .404(cute it returns a status of 127.).15 F .405 +(If a command is)5.405 F(found b)108 376.8 Q(ut is not e)-.2 E -.15(xe) +-.15 G(cutable, the return status is 126.).15 E(If a command f)108 393.6 +Q(ails because of an error during e)-.1 E +(xpansion or redirection, the e)-.15 E(xit status is greater than zero.) +-.15 E .081(Shell b)108 410.4 R .081 +(uiltin commands return a status of 0 \()-.2 F F2(true)A F0 2.581(\)i)C +2.581(fs)-2.581 G .08(uccessful, and non-zero \()-2.581 F F2(false)A F0 +2.58(\)i)C 2.58(fa)-2.58 G 2.58(ne)-2.58 G .08(rror occurs while)-2.58 F +(the)108 422.4 Q 2.5(ye)-.15 G -.15(xe)-2.65 G 2.5(cute. All).15 F -.2 +(bu)2.5 G(iltins return an e).2 E +(xit status of 2 to indicate incorrect usage.)-.15 E F1(Bash)108 439.2 Q +F0 .201(itself returns the e)2.701 F .202 +(xit status of the last command e)-.15 F -.15(xe)-.15 G .202 +(cuted, unless a syntax error occurs, in which case).15 F(it e)108 451.2 +Q(xits with a non-zero v)-.15 E 2.5(alue. See)-.25 F(also the)2.5 E F1 +(exit)2.5 E F0 -.2(bu)2.5 G(iltin command belo).2 E -.65(w.)-.25 G F5 +(SIGN)72 468 Q(ALS)-.219 E F0(When)108 480 Q F1(bash)3.183 E F0 .683 +(is interacti)3.183 F -.15(ve)-.25 G 3.183(,i).15 G 3.183(nt)-3.183 G +.683(he absence of an)-3.183 F 3.183(yt)-.15 G .683(raps, it ignores) +-3.183 F F3(SIGTERM)3.183 E F0 .682(\(so that)2.933 F F1 .682(kill 0) +3.182 F F0 .682(does not kill an)3.182 F(interacti)108 492 Q .757 -.15 +(ve s)-.25 H .457(hell\), and).15 F F3(SIGINT)2.957 E F0 .458 +(is caught and handled \(so that the)2.707 F F1(wait)2.958 E F0 -.2(bu) +2.958 G .458(iltin is interruptible\).).2 F .458(In all cases,)5.458 F +F1(bash)108 504 Q F0(ignores)2.5 E F3(SIGQ)2.5 E(UIT)-.09 E F4(.)A F0 +(If job control is in ef)4.5 E(fect,)-.25 E F1(bash)2.5 E F0(ignores)2.5 +E F3(SIGTTIN)2.5 E F4(,)A F3(SIGTT)2.25 E(OU)-.162 E F4(,)A F0(and)2.25 +E F3(SIGTSTP)2.5 E F4(.)A F0(Non-b)108 520.8 Q 1.065 +(uiltin commands run by)-.2 F F1(bash)3.565 E F0(ha)3.565 E 1.365 -.15 +(ve s)-.2 H 1.065(ignal handlers set to the v).15 F 1.064 +(alues inherited by the shell from its)-.25 F 3.247(parent. When)108 +532.8 R .747(job control is not in ef)3.247 F .747 +(fect, asynchronous commands ignore)-.25 F F3(SIGINT)3.248 E F0(and) +2.998 E F3(SIGQ)3.248 E(UIT)-.09 E F0 .748(in addi-)2.998 F .653 +(tion to these inherited handlers.)108 544.8 R .653 +(Commands run as a result of command substitution ignore the k)5.653 F +-.15(ey)-.1 G(board-).15 E(generated job control signals)108 556.8 Q F3 +(SIGTTIN)2.5 E F4(,)A F3(SIGTT)2.25 E(OU)-.162 E F4(,)A F0(and)2.25 E F3 +(SIGTSTP)2.5 E F4(.)A F0 2.045(The shell e)108 573.6 R 2.045 +(xits by def)-.15 F 2.045(ault upon receipt of a)-.1 F F3(SIGHUP)4.545 E +F4(.)A F0 2.045(Before e)6.545 F 2.045(xiting, an interacti)-.15 F 2.346 +-.15(ve s)-.25 H 2.046(hell resends the).15 F F3(SIGHUP)108 585.6 Q F0 +1.005(to all jobs, running or stopped.)3.255 F 1.004 +(Stopped jobs are sent)6.005 F F3(SIGCONT)3.504 E F0 1.004 +(to ensure that the)3.254 F 3.504(yr)-.15 G(ecei)-3.504 E 1.304 -.15 +(ve t)-.25 H(he).15 E F3(SIGHUP)108 597.6 Q F4(.)A F0 2.529 -.8(To p) +5.429 H(re).8 E -.15(ve)-.25 G .93(nt the shell from sending the signal\ + to a particular job, it should be remo).15 F -.15(ve)-.15 G 3.43(df).15 +G .93(rom the)-3.43 F 1.357(jobs table with the)108 609.6 R F1(diso) +3.857 E(wn)-.1 E F0 -.2(bu)3.857 G 1.357(iltin \(see).2 F F3 1.356 +(SHELL B)3.856 F(UIL)-.09 E 1.356(TIN COMMANDS)-.828 F F0(belo)3.606 E +1.356(w\) or mark)-.25 F 1.356(ed to not recei)-.1 F -.15(ve)-.25 G F3 +(SIGHUP)108 621.6 Q F0(using)2.25 E F1(diso)2.5 E(wn \255h)-.1 E F0(.)A +.166(If the)108 638.4 R F1(huponexit)2.666 E F0 .166 +(shell option has been set with)2.666 F F1(shopt)2.666 E F0(,)A F1(bash) +2.666 E F0 .166(sends a)2.666 F F3(SIGHUP)2.666 E F0 .166 +(to all jobs when an interacti)2.416 F -.15(ve)-.25 G(login shell e)108 +650.4 Q(xits.)-.15 E(If)108 667.2 Q F1(bash)3.047 E F0 .547(is w)3.047 F +.546(aiting for a command to complete and recei)-.1 F -.15(ve)-.25 G +3.046(sas).15 G .546(ignal for which a trap has been set, the trap) +-3.046 F .662(will not be e)108 679.2 R -.15(xe)-.15 G .662 +(cuted until the command completes.).15 F(When)5.663 E F1(bash)3.163 E +F0 .663(is w)3.163 F .663(aiting for an asynchronous command)-.1 F .99 +(via the)108 691.2 R F1(wait)3.49 E F0 -.2(bu)3.49 G .99(iltin, the rec\ +eption of a signal for which a trap has been set will cause the).2 F F1 +(wait)3.49 E F0 -.2(bu)3.49 G .99(iltin to).2 F +(return immediately with an e)108 703.2 Q +(xit status greater than 128, immediately after which the trap is e)-.15 +E -.15(xe)-.15 G(cuted.).15 E(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(31)185.955 E 0 Cg EP +%%Page: 32 32 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10.95/Times-Bold@0 SF(JOB CONTR)72 84 Q(OL)-.329 E/F2 10 +/Times-Italic@0 SF -.25(Jo)108 96 S 4.567(bc).25 G(ontr)-4.567 E(ol)-.45 +E F0 2.067(refers to the ability to selecti)5.077 F -.15(ve)-.25 G 2.067 +(ly stop \().15 F F2(suspend)A F0 4.567(\)t)C 2.068(he e)-4.567 F -.15 +(xe)-.15 G 2.068(cution of processes and continue).15 F(\()108 108 Q F2 +-.37(re)C(sume).37 E F0 3.202(\)t)C .702(heir e)-3.202 F -.15(xe)-.15 G +.702(cution at a later point.).15 F 3.202(Au)5.702 G .702 +(ser typically emplo)-3.202 F .702(ys this f)-.1 F .702 +(acility via an interacti)-.1 F 1.001 -.15(ve i)-.25 H(nterf).15 E(ace) +-.1 E(supplied jointly by the operating system k)108 120 Q(ernel')-.1 E +2.5(st)-.55 G(erminal dri)-2.5 E -.15(ve)-.25 G 2.5(ra).15 G(nd)-2.5 E +/F3 10/Times-Bold@0 SF(bash)2.5 E F0(.)A .784(The shell associates a)108 +136.8 R F2(job)5.024 E F0 .784(with each pipeline.)3.514 F .784(It k) +5.784 F .785(eeps a table of currently e)-.1 F -.15(xe)-.15 G .785 +(cuting jobs, which may be).15 F .341(listed with the)108 148.8 R F3 +(jobs)2.841 E F0 2.841(command. When)2.841 F F3(bash)2.841 E F0 .341 +(starts a job asynchronously \(in the)2.841 F F2(bac)2.84 E(kgr)-.2 E +(ound)-.45 E F0 .34(\), it prints a line).77 F(that looks lik)108 160.8 +Q(e:)-.1 E([1] 25647)144 177.6 Q .241(indicating that this job is job n\ +umber 1 and that the process ID of the last process in the pipeline ass\ +ociated)108 194.4 R .733(with this job is 25647.)108 206.4 R .732 +(All of the processes in a single pipeline are members of the same job) +5.733 F(.)-.4 E F3(Bash)5.732 E F0(uses)3.232 E(the)108 218.4 Q F2(job) +4.24 E F0(abstraction as the basis for job control.)2.73 E 3.062 -.8 +(To f)108 235.2 T 1.462(acilitate the implementation of the user interf) +.7 F 1.463(ace to job control, the operating system maintains the)-.1 F +.871(notion of a)108 247.2 R F2(curr)3.371 E .871(ent terminal pr)-.37 F +.871(ocess gr)-.45 F .871(oup ID)-.45 F F0 5.871(.M)C .87 +(embers of this process group \(processes whose process)-5.871 F .023 +(group ID is equal to the current terminal process group ID\) recei)108 +259.2 R .323 -.15(ve k)-.25 H -.15(ey).05 G .023 +(board-generated signals such as).15 F/F4 9/Times-Bold@0 SF(SIG-)2.523 E +(INT)108 271.2 Q/F5 9/Times-Roman@0 SF(.)A F0 1.347 +(These processes are said to be in the)5.847 F F2(for)3.846 E -.4(eg) +-.37 G -.45(ro).4 G(und).45 E F0(.).77 E F2(Bac)6.926 E(kgr)-.2 E(ound) +-.45 E F0 1.346(processes are those whose process)4.616 F .145 +(group ID dif)108 283.2 R .145(fers from the terminal')-.25 F .146 +(s; such processes are immune to k)-.55 F -.15(ey)-.1 G .146 +(board-generated signals.).15 F .146(Only fore-)5.146 F .16 +(ground processes are allo)108 295.2 R .16(wed to read from or)-.25 F +2.66(,i)-.4 G 2.66(ft)-2.66 G .16(he user so speci\214es with)-2.66 F/F6 +10/Courier@0 SF .16(stty tostop)2.66 F F0 2.66(,w)C .16(rite to the ter) +-2.66 F(-)-.2 E 3.051(minal. Background)108 307.2 R .551 +(processes which attempt to read from \(write to when)3.051 F F6 .551 +(stty tostop)3.051 F F0 .552(is in ef)3.052 F .552(fect\) the)-.25 F +.718(terminal are sent a)108 319.2 R F4 .718(SIGTTIN \(SIGTT)3.218 F +(OU\))-.162 E F0 .718(signal by the k)2.968 F(ernel')-.1 E 3.217(st)-.55 +G .717(erminal dri)-3.217 F -.15(ve)-.25 G 1.517 -.4(r, w).15 H .717 +(hich, unless caught, sus-).4 F(pends the process.)108 331.2 Q 1.087 +(If the operating system on which)108 348 R F3(bash)3.587 E F0 1.088 +(is running supports job control,)3.588 F F3(bash)3.588 E F0 1.088 +(contains f)3.588 F 1.088(acilities to use it.)-.1 F -.8(Ty)108 360 S +.302(ping the).8 F F2(suspend)3.142 E F0 .302(character \(typically) +3.572 F F3(^Z)2.801 E F0 2.801(,C)C .301 +(ontrol-Z\) while a process is running causes that process to be)-2.801 +F 2.142(stopped and returns control to)108 372 R F3(bash)4.642 E F0 +7.142(.T)C 2.142(yping the)-7.942 F F2 2.142(delayed suspend)4.992 F F0 +2.143(character \(typically)5.413 F F3(^Y)4.643 E F0 4.643(,C)C +(ontrol-Y\))-4.643 E .021(causes the process to be stopped when it atte\ +mpts to read input from the terminal, and control to be returned)108 384 +R(to)108 396 Q F3(bash)3.392 E F0 5.892(.T)C .892 +(he user may then manipulate the state of this job, using the)-5.892 F +F3(bg)3.392 E F0 .892(command to continue it in the)3.392 F .895 +(background, the)108 408 R F3(fg)3.395 E F0 .895 +(command to continue it in the fore)3.395 F .895(ground, or the)-.15 F +F3(kill)3.395 E F0 .894(command to kill it.)3.395 F(A)5.894 E F3(^Z) +3.394 E F0(tak)3.394 E(es)-.1 E(ef)108 420 Q .948(fect immediately)-.25 +F 3.448(,a)-.65 G .948(nd has the additional side ef)-3.448 F .948 +(fect of causing pending output and typeahead to be dis-)-.25 F(carded.) +108 432 Q .777(There are a number of w)108 448.8 R .777 +(ays to refer to a job in the shell.)-.1 F .777(The character)5.777 F F3 +(%)3.277 E F0 .777(introduces a job speci\214cation)3.277 F(\()108 460.8 +Q F2(jobspec)A F0 3.457(\). Job)B(number)3.457 E F2(n)3.817 E F0 .957 +(may be referred to as)3.697 F F3(%n)3.457 E F0 5.957(.A)C .957 +(job may also be referred to using a pre\214x of the)-2.5 F .59(name us\ +ed to start it, or using a substring that appears in its command line.) +108 472.8 R -.15(Fo)5.59 G 3.09(re).15 G(xample,)-3.24 E F3(%ce)3.09 E +F0 .59(refers to a)3.09 F(stopped)108 484.8 Q F3(ce)3.463 E F0(job)3.463 +E 5.963(.I)-.4 G 3.463(fap)-5.963 G .963 +(re\214x matches more than one job,)-3.463 F F3(bash)3.463 E F0 .963 +(reports an error)3.463 F 5.963(.U)-.55 G(sing)-5.963 E F3(%?ce)3.463 E +F0 3.464(,o)C 3.464(nt)-3.464 G .964(he other)-3.464 F .087 +(hand, refers to an)108 496.8 R 2.587(yj)-.15 G .087 +(ob containing the string)-2.587 F F3(ce)2.587 E F0 .087 +(in its command line.)2.587 F .087 +(If the substring matches more than one)5.087 F(job,)108 508.8 Q F3 +(bash)2.518 E F0 .018(reports an error)2.518 F 5.018(.T)-.55 G .018 +(he symbols)-5.018 F F3(%%)2.518 E F0(and)2.518 E F3(%+)2.518 E F0 .018 +(refer to the shell')2.518 F 2.518(sn)-.55 G .018(otion of the)-2.518 F +F2(curr)2.518 E .018(ent job)-.37 F F0 2.518(,w).23 G .018(hich is) +-2.518 F .495(the last job stopped while it w)108 520.8 R .495 +(as in the fore)-.1 F .495(ground or started in the background.)-.15 F +(The)5.494 E F2(pr)4.244 E -.15(ev)-.37 G .494(ious job).15 F F0 .494 +(may be)3.224 F .787(referenced using)108 532.8 R F3<25ad>3.287 E F0 +5.787(.I)C 3.287(ft)-5.787 G .787(here is only a single job,)-3.287 F F3 +(%+)3.287 E F0(and)3.287 E F3<25ad>3.287 E F0 .788 +(can both be used to refer to that job)3.287 F 5.788(.I)-.4 G(n)-5.788 E +.257(output pertaining to jobs \(e.g., the output of the)108 544.8 R F3 +(jobs)2.756 E F0 .256(command\), the current job is al)2.756 F -.1(wa) +-.1 G .256(ys \215agged with a).1 F F3(+)2.756 E F0(,)A .41(and the pre) +108 556.8 R .41(vious job with a)-.25 F F3<ad>2.91 E F0 5.41(.A)C .411 +(single % \(with no accompan)-2.5 F .411 +(ying job speci\214cation\) also refers to the cur)-.15 F(-)-.2 E +(rent job)108 568.8 Q(.)-.4 E .444 +(Simply naming a job can be used to bring it into the fore)108 585.6 R +(ground:)-.15 E F3(%1)2.943 E F0 .443(is a synon)2.943 F .443(ym for) +-.15 F F3 -.63(``)2.943 G .443(fg %1').63 F(')-.63 E F0 2.943(,b)C +(ringing)-2.943 E 1.472(job 1 from the background into the fore)108 +597.6 R 3.972(ground. Similarly)-.15 F(,)-.65 E F3 -.63(``)3.973 G 1.473 +(%1 &').63 F(')-.63 E F0 1.473(resumes job 1 in the background,)3.973 F +(equi)108 609.6 Q -.25(va)-.25 G(lent to).25 E F3 -.63(``)2.5 G(bg %1') +.63 E(')-.63 E F0(.)A .131(The shell learns immediately whene)108 626.4 +R -.15(ve)-.25 G 2.631(raj).15 G .131(ob changes state.)-2.631 F +(Normally)5.131 E(,)-.65 E F3(bash)2.631 E F0 -.1(wa)2.63 G .13 +(its until it is about to print a).1 F .157 +(prompt before reporting changes in a job')108 638.4 R 2.657(ss)-.55 G +.157(tatus so as to not interrupt an)-2.657 F 2.658(yo)-.15 G .158 +(ther output.)-2.658 F .158(If the)5.158 F F3<ad62>2.658 E F0 .158 +(option to)2.658 F(the)108 650.4 Q F3(set)3.952 E F0 -.2(bu)3.952 G +1.452(iltin command is enabled,).2 F F3(bash)3.952 E F0 1.451 +(reports such changes immediately)3.952 F 6.451(.A)-.65 G 1.751 -.15 +(ny t)-6.451 H 1.451(rap on).15 F F4(SIGCHLD)3.951 E F0(is)3.701 E -.15 +(exe)108 662.4 S(cuted for each child that e).15 E(xits.)-.15 E .032 +(If an attempt to e)108 679.2 R(xit)-.15 E F3(bash)2.532 E F0 .032 +(is made while jobs are stopped \(or)2.532 F 2.533(,i)-.4 G 2.533(ft) +-2.533 G(he)-2.533 E F3(checkjobs)2.533 E F0 .033 +(shell option has been enabled)2.533 F 2.02(using the)108 691.2 R F3 +(shopt)4.52 E F0 -.2(bu)4.52 G 2.02 +(iltin, running\), the shell prints a w).2 F 2.019 +(arning message, and, if the)-.1 F F3(checkjobs)4.519 E F0 2.019 +(option is)4.519 F .458(enabled, lists the jobs and their statuses.)108 +703.2 R(The)5.458 E F3(jobs)2.958 E F0 .459 +(command may then be used to inspect their status.)2.958 F .459(If a) +5.459 F .604(second attempt to e)108 715.2 R .604 +(xit is made without an interv)-.15 F .604 +(ening command, the shell does not print another w)-.15 F(arning,)-.1 E +(and an)108 727.2 Q 2.5(ys)-.15 G(topped jobs are terminated.)-2.5 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(32)185.955 E 0 Cg EP +%%Page: 33 33 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10.95/Times-Bold@0 SF(PR)72 84 Q(OMPTING)-.329 E F0 .644 +(When e)108 96 R -.15(xe)-.15 G .644(cuting interacti).15 F -.15(ve)-.25 +G(ly).15 E(,)-.65 E/F2 10/Times-Bold@0 SF(bash)3.144 E F0 .645 +(displays the primary prompt)3.145 F/F3 9/Times-Bold@0 SF(PS1)3.145 E F0 +.645(when it is ready to read a command,)2.895 F 1.826 +(and the secondary prompt)108 108 R F3(PS2)4.326 E F0 1.825 +(when it needs more input to complete a command.)4.076 F F2(Bash)6.825 E +F0(allo)4.325 E 1.825(ws these)-.25 F 1.499(prompt strings to be custom\ +ized by inserting a number of backslash-escaped special characters that\ + are)108 120 R(decoded as follo)108 132 Q(ws:)-.25 E F2(\\a)144 144 Q F0 +(an ASCII bell character \(07\))28.22 E F2(\\d)144 156 Q F0 +(the date in "W)27.66 E(eekday Month Date" format \(e.g., "T)-.8 E +(ue May 26"\))-.45 E F2(\\D{)144 168 Q/F4 10/Times-Italic@0 SF(format)A +F2(})A F0(the)180 180 Q F4(format)3.927 E F0 1.427(is passed to)3.927 F +F4(strftime)3.927 E F0 1.427 +(\(3\) and the result is inserted into the prompt string; an)B(empty)180 +192 Q F4(format)2.5 E F0 +(results in a locale-speci\214c time representation.)2.5 E +(The braces are required)5 E F2(\\e)144 204 Q F0 +(an ASCII escape character \(033\))28.78 E F2(\\h)144 216 Q F0 +(the hostname up to the \214rst `.)27.66 E(')-.7 E F2(\\H)144 228 Q F0 +(the hostname)25.44 E F2(\\j)144 240 Q F0 +(the number of jobs currently managed by the shell)29.89 E F2(\\l)144 +252 Q F0(the basename of the shell')30.44 E 2.5(st)-.55 G(erminal de) +-2.5 E(vice name)-.25 E F2(\\n)144 264 Q F0(ne)27.66 E(wline)-.25 E F2 +(\\r)144 276 Q F0(carriage return)28.78 E F2(\\s)144 288 Q F0 +(the name of the shell, the basename of)29.33 E F2($0)2.5 E F0 +(\(the portion follo)2.5 E(wing the \214nal slash\))-.25 E F2(\\t)144 +300 Q F0(the current time in 24-hour HH:MM:SS format)29.89 E F2(\\T)144 +312 Q F0(the current time in 12-hour HH:MM:SS format)26.55 E F2(\\@)144 +324 Q F0(the current time in 12-hour am/pm format)23.92 E F2(\\A)144 336 +Q F0(the current time in 24-hour HH:MM format)26 E F2(\\u)144 348 Q F0 +(the username of the current user)27.66 E F2(\\v)144 360 Q F0(the v) +28.22 E(ersion of)-.15 E F2(bash)2.5 E F0(\(e.g., 2.00\))2.5 E F2(\\V) +144 372 Q F0(the release of)26 E F2(bash)2.5 E F0 2.5(,v)C +(ersion + patch le)-2.65 E -.15(ve)-.25 G 2.5(l\().15 G(e.g., 2.00.0\)) +-2.5 E F2(\\w)144 384 Q F0 .115(the current w)26 F .115 +(orking directory)-.1 F 2.615(,w)-.65 G(ith)-2.615 E F3($HOME)2.615 E F0 +(abbre)2.365 E .116(viated with a tilde \(uses the v)-.25 F .116 +(alue of the)-.25 F F3(PR)180 396 Q(OMPT_DIR)-.27 E(TRIM)-.36 E F0 -.25 +(va)2.25 G(riable\)).25 E F2(\\W)144 408 Q F0 +(the basename of the current w)23.22 E(orking directory)-.1 E 2.5(,w) +-.65 G(ith)-2.5 E F3($HOME)2.5 E F0(abbre)2.25 E(viated with a tilde) +-.25 E F2(\\!)144 420 Q F0(the history number of this command)29.89 E F2 +(\\#)144 432 Q F0(the command number of this command)28.22 E F2(\\$)144 +444 Q F0(if the ef)28.22 E(fecti)-.25 E .3 -.15(ve U)-.25 H(ID is 0, a) +.15 E F2(#)2.5 E F0 2.5(,o)C(therwise a)-2.5 E F2($)2.5 E(\\)144 456 Q +F4(nnn)A F0(the character corresponding to the octal number)18.22 E F4 +(nnn)2.5 E F2(\\\\)144 468 Q F0 2.5(ab)30.44 G(ackslash)-2.5 E F2(\\[) +144 480 Q F0(be)29.89 E 1.257(gin a sequence of non-printing characters\ +, which could be used to embed a terminal)-.15 F +(control sequence into the prompt)180 492 Q F2(\\])144 504 Q F0 +(end a sequence of non-printing characters)29.89 E .119 +(The command number and the history number are usually dif)108 520.8 R +.12(ferent: the history number of a command is its)-.25 F 1.585(positio\ +n in the history list, which may include commands restored from the his\ +tory \214le \(see)108 532.8 R F3(HIST)4.084 E(OR)-.162 E(Y)-.315 E F0 +(belo)108 544.8 Q .541(w\), while the command number is the position in\ + the sequence of commands e)-.25 F -.15(xe)-.15 G .541 +(cuted during the cur).15 F(-)-.2 E .546(rent shell session.)108 556.8 R +.546(After the string is decoded, it is e)5.546 F .546 +(xpanded via parameter e)-.15 F .546(xpansion, command substitu-)-.15 F +.351(tion, arithmetic e)108 568.8 R .352(xpansion, and quote remo)-.15 F +-.25(va)-.15 G .352(l, subject to the v).25 F .352(alue of the)-.25 F F2 +(pr)2.852 E(omptv)-.18 E(ars)-.1 E F0 .352(shell option \(see the)2.852 +F(description of the)108 580.8 Q F2(shopt)2.5 E F0(command under)2.5 E +F3(SHELL B)2.5 E(UIL)-.09 E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).) +-.25 E F1(READLINE)72 597.6 Q F0 .151 +(This is the library that handles reading input when using an interacti) +108 609.6 R .45 -.15(ve s)-.25 H .15(hell, unless the).15 F F2 +(\255\255noediting)2.65 E F0(option)2.65 E 1.208(is gi)108 621.6 R -.15 +(ve)-.25 G 3.708(na).15 G 3.708(ts)-3.708 G 1.208(hell in)-3.708 F -.2 +(vo)-.4 G 3.708(cation. Line).2 F 1.208 +(editing is also used when using the)3.708 F F2<ad65>3.709 E F0 1.209 +(option to the)3.709 F F2 -.18(re)3.709 G(ad).18 E F0 -.2(bu)3.709 G +3.709(iltin. By).2 F(def)108 633.6 Q .95 +(ault, the line editing commands are similar to those of emacs.)-.1 F +3.449(Av)5.949 G .949(i-style line editing interf)-3.449 F .949 +(ace is also)-.1 F -.2(av)108 645.6 S 3.35(ailable. Line)-.05 F .85 +(editing can be enabled at an)3.35 F 3.35(yt)-.15 G .85(ime using the) +-3.35 F F2 .85(\255o emacs)3.35 F F0(or)3.35 E F2 .85(\255o vi)3.35 F F0 +.85(options to the)3.35 F F2(set)3.35 E F0 -.2(bu)3.35 G(iltin).2 E +(\(see)108 657.6 Q F3 .763(SHELL B)3.263 F(UIL)-.09 E .763(TIN COMMANDS) +-.828 F F0(belo)3.013 E 3.263(w\). T)-.25 F 3.263(ot)-.8 G .763(urn of) +-3.263 F 3.263(fl)-.25 G .763 +(ine editing after the shell is running, use the)-3.263 F F2(+o)3.262 E +(emacs)108 669.6 Q F0(or)2.5 E F2(+o vi)2.5 E F0(options to the)2.5 E F2 +(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F2(Readline Notation)87 686.4 Q +F0 .567(In this section, the emacs-style notation is used to denote k) +108 698.4 R -.15(ey)-.1 G(strok).15 E 3.068(es. Control)-.1 F -.1(ke) +3.068 G .568(ys are denoted by C\255)-.05 F F4 -.1(ke)C(y)-.2 E F0(,)A +1.153(e.g., C\255n means Control\255N.)108 710.4 R(Similarly)6.153 E(,) +-.65 E F4(meta)4.033 E F0 -.1(ke)3.913 G 1.153(ys are denoted by M\255) +-.05 F F4 -.1(ke)C(y)-.2 E F0 3.652(,s)C 3.652(oM)-3.652 G 1.152 +(\255x means Meta\255X.)-3.652 F(\(On)6.152 E -.1(ke)108 722.4 S .83 +(yboards without a)-.05 F F4(meta)3.71 E F0 -.1(ke)3.59 G 2.13 -.65 +(y, M)-.05 H<ad>.65 E F4(x)A F0 .83(means ESC)3.33 F F4(x)3.33 E F0 3.33 +(,i)C .831(.e., press the Escape k)-3.33 F 1.131 -.15(ey t)-.1 H .831 +(hen the).15 F F4(x)4.101 E F0 -.1(ke)3.861 G 4.631 -.65(y. T)-.05 H +.831(his mak).65 F(es)-.1 E(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(33)185.955 E 0 Cg EP +%%Page: 34 34 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .6(ESC the)108 84 R/F1 10/Times-Italic@0 SF .6(meta pr)3.1 F +(e\214x)-.37 E F0 5.6(.T)C .6(he combination M\255C\255)-5.6 F F1(x)A F0 +.599(means ESC\255Control\255)3.099 F F1(x)A F0 3.099(,o)C 3.099(rp) +-3.099 G .599(ress the Escape k)-3.099 F .899 -.15(ey t)-.1 H .599 +(hen hold).15 F(the Control k)108 96 Q .3 -.15(ey w)-.1 H +(hile pressing the).15 E F1(x)3.27 E F0 -.1(ke)3.03 G -.65(y.)-.05 G(\)) +.65 E .619(Readline commands may be gi)108 112.8 R -.15(ve)-.25 G 3.119 +(nn).15 G(umeric)-3.119 E F1(ar)3.119 E(guments)-.37 E F0 3.119(,w).27 G +.619(hich normally act as a repeat count.)-3.119 F(Sometimes,)5.62 E(ho) +108 124.8 Q(we)-.25 E -.15(ve)-.25 G 1.419 -.4(r, i).15 H 3.119(ti).4 G +3.119(st)-3.119 G .619(he sign of the ar)-3.119 F .619 +(gument that is signi\214cant.)-.18 F -.15(Pa)5.619 G .619(ssing a ne) +.15 F -.05(ga)-.15 G(ti).05 E .919 -.15(ve a)-.25 H -.18(rg).15 G .619 +(ument to a command that).18 F 1.018(acts in the forw)108 136.8 R 1.018 +(ard direction \(e.g.,)-.1 F/F2 10/Times-Bold@0 SF(kill\255line)3.518 E +F0 3.518(\)c)C 1.018(auses that command to act in a backw)-3.518 F 1.019 +(ard direction.)-.1 F(Com-)6.019 E(mands whose beha)108 148.8 Q +(vior with ar)-.2 E(guments de)-.18 E(viates from this are noted belo) +-.25 E -.65(w.)-.25 G .812(When a command is described as)108 165.6 R F1 +(killing)3.311 E F0(te)3.311 E .811(xt, the te)-.15 F .811 +(xt deleted is sa)-.15 F -.15(ve)-.2 G 3.311(df).15 G .811 +(or possible future retrie)-3.311 F -.25(va)-.25 G 3.311(l\().25 G F1 +(yank-)-3.311 E(ing)108 177.6 Q F0 2.529(\). The)B .029(killed te)2.529 +F .029(xt is sa)-.15 F -.15(ve)-.2 G 2.529(di).15 G 2.529(na)-2.529 G F1 +.029(kill ring)B F0 5.029(.C)C(onsecuti)-5.029 E .329 -.15(ve k)-.25 H +.029(ills cause the te).15 F .029(xt to be accumulated into one unit,) +-.15 F .567(which can be yank)108 189.6 R .567(ed all at once.)-.1 F +.567(Commands which do not kill te)5.567 F .567 +(xt separate the chunks of te)-.15 F .567(xt on the kill)-.15 F(ring.) +108 201.6 Q F2(Readline Initialization)87 218.4 Q F0 .091(Readline is c\ +ustomized by putting commands in an initialization \214le \(the)108 +230.4 R F1(inputr)2.591 E(c)-.37 E F0 2.591(\214le\). The)2.591 F .092 +(name of this \214le)2.591 F .197(is tak)108 242.4 R .196(en from the v) +-.1 F .196(alue of the)-.25 F/F3 9/Times-Bold@0 SF(INPUTRC)2.696 E F0 +-.25(va)2.446 G 2.696(riable. If).25 F .196(that v)2.696 F .196 +(ariable is unset, the def)-.25 F .196(ault is)-.1 F F1(~/.inputr)2.696 +E(c)-.37 E F0 5.196(.W).31 G .196(hen a)-5.196 F 1.034(program which us\ +es the readline library starts up, the initialization \214le is read, a\ +nd the k)108 254.4 R 1.335 -.15(ey b)-.1 H 1.035(indings and).15 F -.25 +(va)108 266.4 S 1.15(riables are set.).25 F 1.15(There are only a fe) +6.15 F 3.649(wb)-.25 G 1.149(asic constructs allo)-3.649 F 1.149 +(wed in the readline initialization \214le.)-.25 F(Blank)6.149 E .736 +(lines are ignored.)108 278.4 R .737(Lines be)5.737 F .737 +(ginning with a)-.15 F F2(#)3.237 E F0 .737(are comments.)3.237 F .737 +(Lines be)5.737 F .737(ginning with a)-.15 F F2($)3.237 E F0 .737 +(indicate conditional)3.237 F 2.5(constructs. Other)108 290.4 R +(lines denote k)2.5 E .3 -.15(ey b)-.1 H(indings and v).15 E +(ariable settings.)-.25 E .987(The def)108 307.2 R .987(ault k)-.1 F +-.15(ey)-.1 G .987(-bindings may be changed with an).15 F F1(inputr) +3.497 E(c)-.37 E F0 3.487(\214le. Other)3.797 F .987 +(programs that use this library may)3.487 F(add their o)108 319.2 Q +(wn commands and bindings.)-.25 E -.15(Fo)108 336 S 2.5(re).15 G +(xample, placing)-2.65 E(M\255Control\255u: uni)144 352.8 Q -.15(ve)-.25 +G(rsal\255ar).15 E(gument)-.18 E(or)108 364.8 Q(C\255Meta\255u: uni)144 +376.8 Q -.15(ve)-.25 G(rsal\255ar).15 E(gument)-.18 E(into the)108 388.8 +Q F1(inputr)2.51 E(c)-.37 E F0 -.1(wo)2.81 G(uld mak).1 E 2.5(eM)-.1 G +(\255C\255u e)-2.5 E -.15(xe)-.15 G(cute the readline command).15 E F1 +(univer)2.5 E(sal\255ar)-.1 E(gument)-.37 E F0(.).68 E 1.26(The follo) +108 405.6 R 1.261(wing symbolic character names are recognized:)-.25 F +F1 -.4(RU)3.761 G(BOUT).4 E F0(,)1.27 E F1(DEL)3.761 E F0(,).53 E F1 +(ESC)3.761 E F0(,).72 E F1(LFD)3.761 E F0(,).28 E F1(NEWLINE)3.761 E F0 +(,).73 E F1(RET)3.761 E F0(,)1.27 E F1(RETURN)108 417.6 Q F0(,)1.1 E F1 +(SPC)2.5 E F0(,).72 E F1(SP)2.5 E -.3(AC)-.9 G(E).3 E F0 2.5(,a).73 G +(nd)-2.5 E F1 -.5(TA)2.5 G(B).5 E F0(.).27 E .209 +(In addition to command names, readline allo)108 434.4 R .209(ws k)-.25 +F -.15(ey)-.1 G 2.709(st).15 G 2.709(ob)-2.709 G 2.709(eb)-2.709 G .209 +(ound to a string that is inserted when the k)-2.709 F .509 -.15(ey i) +-.1 H(s).15 E(pressed \(a)108 446.4 Q F1(macr)2.5 E(o)-.45 E F0(\).)A F2 +(Readline K)87 463.2 Q(ey Bindings)-.25 E F0 .366 +(The syntax for controlling k)108 475.2 R .666 -.15(ey b)-.1 H .366 +(indings in the).15 F F1(inputr)2.876 E(c)-.37 E F0 .366 +(\214le is simple.)3.176 F .366(All that is required is the name of the) +5.366 F .383(command or the te)108 487.2 R .383(xt of a macro and a k) +-.15 F .683 -.15(ey s)-.1 H .383 +(equence to which it should be bound. The name may be speci-).15 F .853 +(\214ed in one of tw)108 499.2 R 3.353(ow)-.1 G .853 +(ays: as a symbolic k)-3.453 F 1.153 -.15(ey n)-.1 H .853 +(ame, possibly with).15 F F1(Meta\255)3.353 E F0(or)3.353 E F1(Contr) +3.353 E(ol\255)-.45 E F0(pre\214x)3.353 E .853(es, or as a k)-.15 F -.15 +(ey)-.1 G(sequence.)108 511.2 Q 1.542(When using the form)108 528 R F2 +-.1(ke)4.042 G(yname).1 E F0(:)A F1(function\255name).833 E F0(or)4.042 +E F1(macr)4.042 E(o)-.45 E F0(,)A F1 -.1(ke)4.042 G(yname)-.2 E F0 1.542 +(is the name of a k)4.222 F 1.841 -.15(ey s)-.1 H 1.541(pelled out in) +.15 F 2.5(English. F)108 540 R(or e)-.15 E(xample:)-.15 E +(Control-u: uni)144 564 Q -.15(ve)-.25 G(rsal\255ar).15 E(gument)-.18 E +(Meta-Rubout: backw)144 576 Q(ard-kill-w)-.1 E(ord)-.1 E +(Control-o: "> output")144 588 Q .698(In the abo)108 604.8 R .998 -.15 +(ve ex)-.15 H(ample,).15 E F1(C\255u)3.038 E F0 .698 +(is bound to the function)3.448 F F2(uni)3.198 E -.1(ve)-.1 G +(rsal\255ar).1 E(gument)-.1 E F0(,)A F1(M\255DEL)3.878 E F0 .698 +(is bound to the func-)3.728 F(tion)108 616.8 Q F2 +(backward\255kill\255w)2.759 E(ord)-.1 E F0 2.759(,a)C(nd)-2.759 E F1 +(C\255o)2.599 E F0 .258(is bound to run the macro e)2.939 F .258 +(xpressed on the right hand side \(that is, to)-.15 F(insert the te)108 +628.8 Q(xt)-.15 E/F4 10/Courier@0 SF 6(>o)2.5 G(utput)-6 E F0 +(into the line\).)2.5 E .055(In the second form,)108 645.6 R F2("k)2.555 +E(eyseq")-.1 E F0(:)A F1(function\255name).833 E F0(or)2.555 E F1(macr) +2.555 E(o)-.45 E F0(,)A F2 -.1(ke)2.555 G(yseq).1 E F0(dif)2.556 E .056 +(fers from)-.25 F F2 -.1(ke)2.556 G(yname).1 E F0(abo)2.556 E .356 -.15 +(ve i)-.15 H 2.556(nt).15 G .056(hat strings)-2.556 F 1.284 +(denoting an entire k)108 657.6 R 1.584 -.15(ey s)-.1 H 1.284(equence m\ +ay be speci\214ed by placing the sequence within double quotes.).15 F +(Some)6.284 E .385(GNU Emacs style k)108 669.6 R .685 -.15(ey e)-.1 H +.385(scapes can be used, as in the follo).15 F .385(wing e)-.25 F .386 +(xample, b)-.15 F .386(ut the symbolic character names)-.2 F +(are not recognized.)108 681.6 Q("\\C\255u": uni)144 705.6 Q -.15(ve) +-.25 G(rsal\255ar).15 E(gument)-.18 E +("\\C\255x\\C\255r": re\255read\255init\255\214le)144 717.6 Q +("\\e[11~": "Function K)144 729.6 Q .3 -.15(ey 1)-.25 H(").15 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(34)185.955 E 0 Cg EP +%%Page: 35 35 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .315(In this e)108 84 R(xample,)-.15 E/F1 10/Times-Italic@0 SF +(C\255u)2.655 E F0 .315(is ag)3.065 F .315(ain bound to the function) +-.05 F/F2 10/Times-Bold@0 SF(uni)2.815 E -.1(ve)-.1 G(rsal\255ar).1 E +(gument)-.1 E F0(.)A F1 .315(C\255x C\255r)5.155 F F0 .314 +(is bound to the func-)3.544 F(tion)108 96 Q F2 -.18(re)2.5 G<ad72>.18 E +(ead\255init\255\214le)-.18 E F0 2.5(,a)C(nd)-2.5 E F1(ESC [ 1 1 ~)3.01 +E F0(is bound to insert the te)3.94 E(xt)-.15 E/F3 10/Courier@0 SF +(Function Key 1)2.5 E F0(.)A +(The full set of GNU Emacs style escape sequences is)108 112.8 Q F2 +<5c43ad>144 124.8 Q F0(control pre\214x)20.3 E F2<5c4dad>144 136.8 Q F0 +(meta pre\214x)18.08 E F2(\\e)144 148.8 Q F0(an escape character)28.78 E +F2(\\\\)144 160.8 Q F0(backslash)30.44 E F2(\\")144 172.8 Q F0 +(literal ")27.67 E F2<5c08>144 184.8 Q F0(literal \010)30.44 E(In addit\ +ion to the GNU Emacs style escape sequences, a second set of backslash \ +escapes is a)108 201.6 Q -.25(va)-.2 G(ilable:).25 E F2(\\a)144 213.6 Q +F0(alert \(bell\))28.22 E F2(\\b)144 225.6 Q F0(backspace)27.66 E F2 +(\\d)144 237.6 Q F0(delete)27.66 E F2(\\f)144 249.6 Q F0(form feed)29.89 +E F2(\\n)144 261.6 Q F0(ne)27.66 E(wline)-.25 E F2(\\r)144 273.6 Q F0 +(carriage return)28.78 E F2(\\t)144 285.6 Q F0(horizontal tab)29.89 E F2 +(\\v)144 297.6 Q F0 -.15(ve)28.22 G(rtical tab).15 E F2(\\)144 309.6 Q +F1(nnn)A F0(the eight-bit character whose v)18.22 E(alue is the octal v) +-.25 E(alue)-.25 E F1(nnn)2.5 E F0(\(one to three digits\))2.5 E F2(\\x) +144 321.6 Q F1(HH)A F0(the eight-bit character whose v)13.78 E +(alue is the he)-.25 E(xadecimal v)-.15 E(alue)-.25 E F1(HH)2.5 E F0 +(\(one or tw)2.5 E 2.5(oh)-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E 1.141 +(When entering the te)108 338.4 R 1.141(xt of a macro, single or double\ + quotes must be used to indicate a macro de\214nition.)-.15 F .09 +(Unquoted te)108 350.4 R .09(xt is assumed to be a function name.)-.15 F +.089(In the macro body)5.089 F 2.589(,t)-.65 G .089 +(he backslash escapes described abo)-2.589 F -.15(ve)-.15 G(are e)108 +362.4 Q 2.5(xpanded. Backslash)-.15 F(will quote an)2.5 E 2.5(yo)-.15 G +(ther character in the macro te)-2.5 E(xt, including " and \010.)-.15 E +F2(Bash)108 379.2 Q F0(allo)2.929 E .429(ws the current readline k)-.25 +F .729 -.15(ey b)-.1 H .429 +(indings to be displayed or modi\214ed with the).15 F F2(bind)2.93 E F0 +-.2(bu)2.93 G .43(iltin command.).2 F .046 +(The editing mode may be switched during interacti)108 391.2 R .346 -.15 +(ve u)-.25 H .046(se by using the).15 F F2<ad6f>2.545 E F0 .045 +(option to the)2.545 F F2(set)2.545 E F0 -.2(bu)2.545 G .045 +(iltin command).2 F(\(see)108 403.2 Q/F4 9/Times-Bold@0 SF(SHELL B)2.5 E +(UIL)-.09 E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 E F2 +(Readline V)87 420 Q(ariables)-.92 E F0 .043(Readline has v)108 432 R +.043(ariables that can be used to further customize its beha)-.25 F +(vior)-.2 E 5.043(.A)-.55 G -.25(va)-2.5 G .043 +(riable may be set in the).25 F F1(inpu-)2.554 E(tr)108 444 Q(c)-.37 E +F0(\214le with a statement of the form)2.81 E F2(set)144 460.8 Q F1 +(variable\255name value)2.5 E F0 .79(Except where noted, readline v)108 +477.6 R .79(ariables can tak)-.25 F 3.29(et)-.1 G .79(he v)-3.29 F +(alues)-.25 E F2(On)3.29 E F0(or)3.29 E F2(Off)3.29 E F0 .79 +(\(without re)3.29 F -.05(ga)-.15 G .79(rd to case\).).05 F(Unrecog-) +5.79 E .448(nized v)108 489.6 R .448(ariable names are ignored.)-.25 F +.448(When a v)5.448 F .448(ariable v)-.25 F .448 +(alue is read, empty or null v)-.25 F .449(alues, "on" \(case-insensi-) +-.25 F(ti)108 501.6 Q -.15(ve)-.25 G .468(\), and "1" are equi).15 F +-.25(va)-.25 G .468(lent to).25 F F2(On)2.968 E F0 5.468(.A)C .468 +(ll other v)-5.468 F .468(alues are equi)-.25 F -.25(va)-.25 G .468 +(lent to).25 F F2(Off)2.968 E F0 5.468(.T)C .467(he v)-5.468 F .467 +(ariables and their def)-.25 F(ault)-.1 E -.25(va)108 513.6 S(lues are:) +.25 E F2(bell\255style \(audible\))108 530.4 Q F0 .01 +(Controls what happens when readline w)144 542.4 R .011 +(ants to ring the terminal bell.)-.1 F .011(If set to)5.011 F F2(none) +2.511 E F0 2.511(,r)C .011(eadline ne)-2.511 F -.15(ve)-.25 G(r).15 E +.94(rings the bell.)144 554.4 R .94(If set to)5.94 F F2(visible)3.44 E +F0 3.44(,r)C .94(eadline uses a visible bell if one is a)-3.44 F -.25 +(va)-.2 G 3.44(ilable. If).25 F .94(set to)3.44 F F2(audible)3.44 E F0 +(,)A(readline attempts to ring the terminal')144 566.4 Q 2.5(sb)-.55 G +(ell.)-2.5 E F2(bind\255tty\255special\255chars \(On\))108 578.4 Q F0 +.055(If set to)144 590.4 R F2(On)2.555 E F0 2.555(,r)C .056(eadline att\ +empts to bind the control characters treated specially by the k)-2.555 F +(ernel')-.1 E 2.556(st)-.55 G(ermi-)-2.556 E(nal dri)144 602.4 Q -.15 +(ve)-.25 G 2.5(rt).15 G 2.5(ot)-2.5 G(heir readline equi)-2.5 E -.25(va) +-.25 G(lents.).25 E F2(comment\255begin \(`)108 614.4 Q(`#')-.63 E('\)) +-.63 E F0 .885(The string that is inserted when the readline)144 626.4 R +F2(insert\255comment)3.385 E F0 .884(command is e)3.384 F -.15(xe)-.15 G +3.384(cuted. This).15 F(com-)3.384 E(mand is bound to)144 638.4 Q F2 +(M\255#)2.5 E F0(in emacs mode and to)2.5 E F2(#)2.5 E F0 +(in vi command mode.)2.5 E F2(completion\255ignor)108 650.4 Q +(e\255case \(Off\))-.18 E F0(If set to)144 662.4 Q F2(On)2.5 E F0 2.5 +(,r)C(eadline performs \214lename matching and completion in a case\255\ +insensiti)-2.5 E .3 -.15(ve f)-.25 H(ashion.).05 E F2(completion\255pr) +108 674.4 Q(e\214x\255display\255length \(0\))-.18 E F0 .829(The length\ + in characters of the common pre\214x of a list of possible completions\ + that is displayed)144 686.4 R 1.275(without modi\214cation.)144 698.4 R +1.275(When set to a v)6.275 F 1.274 +(alue greater than zero, common pre\214x)-.25 F 1.274 +(es longer than this)-.15 F -.25(va)144 710.4 S(lue are replaced with a\ +n ellipsis when displaying possible completions.).25 E(GNU Bash-4.1)72 +768 Q(2009 December 29)135.965 E(35)185.955 E 0 Cg EP +%%Page: 36 36 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(completion\255query\255items \(100\))108 84 +Q F0 .529(This determines when the user is queried about vie)144 96 R +.53(wing the number of possible completions gen-)-.25 F .561 +(erated by the)144 108 R F1(possible\255completions)3.061 E F0 3.061 +(command. It)3.061 F .561(may be set to an)3.061 F 3.06(yi)-.15 G(nte) +-3.06 E .56(ger v)-.15 F .56(alue greater than or)-.25 F .782 +(equal to zero.)144 120 R .783(If the number of possible completions is\ + greater than or equal to the v)5.782 F .783(alue of this)-.25 F -.25 +(va)144 132 S .237(riable, the user is ask).25 F .237 +(ed whether or not he wishes to vie)-.1 F 2.737(wt)-.25 G .237 +(hem; otherwise the)-2.737 F 2.737(ya)-.15 G .237(re simply listed) +-2.737 F(on the terminal.)144 144 Q F1(con)108 156 Q -.1(ve)-.4 G +(rt\255meta \(On\)).1 E F0 .612(If set to)144 168 R F1(On)3.112 E F0 +3.112(,r)C .613(eadline will con)-3.112 F -.15(ve)-.4 G .613 +(rt characters with the eighth bit set to an ASCII k).15 F .913 -.15 +(ey s)-.1 H .613(equence by).15 F .541 +(stripping the eighth bit and pre\214xing an escape character \(in ef) +144 180 R .541(fect, using escape as the)-.25 F/F2 10/Times-Italic@0 SF +.541(meta pr)3.041 F(e-)-.37 E<8c78>144 192 Q F0(\).)A F1 +(disable\255completion \(Off\))108 204 Q F0 .038(If set to)144 216 R F1 +(On)2.538 E F0 2.538(,r)C .038(eadline will inhibit w)-2.538 F .038 +(ord completion.)-.1 F .038 +(Completion characters will be inserted into the)5.038 F(line as if the) +144 228 Q 2.5(yh)-.15 G(ad been mapped to)-2.5 E F1(self-insert)2.5 E F0 +(.)A F1(editing\255mode \(emacs\))108 240 Q F0 .253 +(Controls whether readline be)144 252 R .253(gins with a set of k)-.15 F +.553 -.15(ey b)-.1 H .253(indings similar to).15 F F2(emacs)2.752 E F0 +(or)2.752 E F2(vi)2.752 E F0(.)A F1(editing\255mode)5.252 E F0 +(can be set to either)144 264 Q F1(emacs)2.5 E F0(or)2.5 E F1(vi)2.5 E +F0(.)A F1(echo\255contr)108 276 Q(ol\255characters \(On\))-.18 E F0 1.21 +(When set to)144 288 R F1(On)3.71 E F0 3.71(,o)C 3.71(no)-3.71 G 1.211 +(perating systems that indicate the)-3.71 F 3.711(ys)-.15 G 1.211 +(upport it, readline echoes a character)-3.711 F +(corresponding to a signal generated from the k)144 300 Q -.15(ey)-.1 G +(board.).15 E F1(enable\255k)108 312 Q(eypad \(Off\))-.1 E F0 .893 +(When set to)144 324 R F1(On)3.393 E F0 3.393(,r)C .893 +(eadline will try to enable the application k)-3.393 F -.15(ey)-.1 G +.893(pad when it is called.).15 F .892(Some sys-)5.893 F +(tems need this to enable the arro)144 336 Q 2.5(wk)-.25 G -.15(ey)-2.6 +G(s.).15 E F1(enable\255meta\255k)108 348 Q(ey \(On\))-.1 E F0 .64 +(When set to)144 360 R F1(On)3.14 E F0 3.14(,r)C .64 +(eadline will try to enable an)-3.14 F 3.14(ym)-.15 G .64 +(eta modi\214er k)-3.14 F .94 -.15(ey t)-.1 H .64 +(he terminal claims to support).15 F(when it is called.)144 372 Q +(On man)5 E 2.5(yt)-.15 G(erminals, the meta k)-2.5 E .3 -.15(ey i)-.1 H +2.5(su).15 G(sed to send eight-bit characters.)-2.5 E F1 +(expand\255tilde \(Off\))108 384 Q F0(If set to)144 396 Q F1(on)2.5 E F0 +2.5(,t)C(ilde e)-2.5 E(xpansion is performed when readline attempts w) +-.15 E(ord completion.)-.1 E F1(history\255pr)108 408 Q(eser)-.18 E -.1 +(ve)-.1 G(\255point \(Off\)).1 E F0 1.493(If set to)144 420 R F1(on) +3.993 E F0 3.993(,t)C 1.493(he history code attempts to place point at \ +the same location on each history line)-3.993 F(retrie)144 432 Q -.15 +(ve)-.25 G 2.5(dw).15 G(ith)-2.5 E F1(pr)2.5 E -.15(ev)-.18 G +(ious-history).15 E F0(or)2.5 E F1(next-history)2.5 E F0(.)A F1 +(history\255size \(0\))108 444 Q F0 .462 +(Set the maximum number of history entries sa)144 456 R -.15(ve)-.2 G +2.963(di).15 G 2.963(nt)-2.963 G .463(he history list.)-2.963 F .463 +(If set to zero, the number of)5.463 F +(entries in the history list is not limited.)144 468 Q F1 +(horizontal\255scr)108 480 Q(oll\255mode \(Off\))-.18 E F0 .449 +(When set to)144 492 R F1(On)2.949 E F0 2.949(,m)C(ak)-2.949 E .448 +(es readline use a single line for display)-.1 F 2.948(,s)-.65 G .448 +(crolling the input horizontally on a)-2.948 F 1.194(single screen line\ + when it becomes longer than the screen width rather than wrapping to a\ + ne)144 504 R(w)-.25 E(line.)144 516 Q F1(input\255meta \(Off\))108 528 +Q F0 .228(If set to)144 540 R F1(On)2.728 E F0 2.728(,r)C .227(eadline \ +will enable eight-bit input \(that is, it will not strip the high bit f\ +rom the char)-2.728 F(-)-.2 E .956(acters it reads\), re)144 552 R -.05 +(ga)-.15 G .956(rdless of what the terminal claims it can support.).05 F +.957(The name)5.956 F F1(meta\255\215ag)3.457 E F0 .957(is a)3.457 F +(synon)144 564 Q(ym for this v)-.15 E(ariable.)-.25 E F1(isear)108 576 Q +(ch\255terminators \(`)-.18 E(`C\255[C\255J')-.63 E('\))-.63 E F0 .439(\ +The string of characters that should terminate an incremental search wi\ +thout subsequently e)144 588 R -.15(xe)-.15 G(cut-).15 E .934 +(ing the character as a command.)144 600 R .935(If this v)5.935 F .935 +(ariable has not been gi)-.25 F -.15(ve)-.25 G 3.435(nav).15 G .935 +(alue, the characters)-3.685 F F2(ESC)3.435 E F0(and)144 612 Q F2 +(C\255J)2.5 E F0(will terminate an incremental search.)2.5 E F1 -.1(ke) +108 624 S(ymap \(emacs\)).1 E F0 2.021(Set the current readline k)144 +636 R -.15(ey)-.1 G 4.521(map. The).15 F 2.021(set of v)4.521 F 2.021 +(alid k)-.25 F -.15(ey)-.1 G 2.021(map names is).15 F F2 2.02 +(emacs, emacs\255standar)4.52 F(d,)-.37 E .068 +(emacs\255meta, emacs\255ctlx, vi, vi\255command)144 648 R F0 2.568(,a)C +(nd)-2.568 E F2(vi\255insert)2.568 E F0(.).68 E F2(vi)5.068 E F0 .068 +(is equi)2.568 F -.25(va)-.25 G .068(lent to).25 F F2(vi\255command) +2.569 E F0(;)A F2(emacs)2.569 E F0 1.544(is equi)144 660 R -.25(va)-.25 +G 1.544(lent to).25 F F2(emacs\255standar)4.044 E(d)-.37 E F0 6.544(.T)C +1.544(he def)-6.544 F 1.544(ault v)-.1 F 1.544(alue is)-.25 F F2(emacs) +4.044 E F0 4.044(;t).27 G 1.544(he v)-4.044 F 1.544(alue of)-.25 F F1 +(editing\255mode)4.043 E F0(also)4.043 E(af)144 672 Q(fects the def)-.25 +E(ault k)-.1 E -.15(ey)-.1 G(map.).15 E F1(mark\255dir)108 684 Q +(ectories \(On\))-.18 E F0(If set to)144 696 Q F1(On)2.5 E F0 2.5(,c)C +(ompleted directory names ha)-2.5 E .3 -.15(ve a s)-.2 H(lash appended.) +.15 E(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(36)185.955 E 0 Cg +EP +%%Page: 37 37 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(mark\255modi\214ed\255lines \(Off\))108 84 +Q F0(If set to)144 96 Q F1(On)2.5 E F0 2.5(,h)C(istory lines that ha) +-2.5 E .3 -.15(ve b)-.2 H +(een modi\214ed are displayed with a preceding asterisk \().15 E F1(*)A +F0(\).)A F1(mark\255symlink)108 108 Q(ed\255dir)-.1 E(ectories \(Off\)) +-.18 E F0 .175(If set to)144 120 R F1(On)2.675 E F0 2.675(,c)C .175 +(ompleted names which are symbolic links to directories ha)-2.675 F .475 +-.15(ve a s)-.2 H .175(lash appended \(sub-).15 F(ject to the v)144 132 +Q(alue of)-.25 E F1(mark\255dir)2.5 E(ectories)-.18 E F0(\).)A F1 +(match\255hidden\255\214les \(On\))108 144 Q F0 .193(This v)144 156 R +.193(ariable, when set to)-.25 F F1(On)2.693 E F0 2.693(,c)C .192 +(auses readline to match \214les whose names be)-2.693 F .192 +(gin with a `.)-.15 F 2.692('\()-.7 G(hidden)-2.692 E 1.023 +(\214les\) when performing \214lename completion, unless the leading `.) +144 168 R 3.523('i)-.7 G 3.523(ss)-3.523 G 1.024 +(upplied by the user in the)-3.523 F(\214lename to be completed.)144 180 +Q F1(output\255meta \(Off\))108 192 Q F0 .507(If set to)144 204 R F1(On) +3.007 E F0 3.007(,r)C .507(eadline will display characters with the eig\ +hth bit set directly rather than as a meta-)-3.007 F(pre\214x)144 216 Q +(ed escape sequence.)-.15 E F1(page\255completions \(On\))108 228 Q F0 +.808(If set to)144 240 R F1(On)3.308 E F0 3.308(,r)C .808 +(eadline uses an internal)-3.308 F/F2 10/Times-Italic@0 SF(mor)3.308 E +(e)-.37 E F0(-lik)A 3.308(ep)-.1 G .808 +(ager to display a screenful of possible comple-)-3.308 F +(tions at a time.)144 252 Q F1 +(print\255completions\255horizontally \(Off\))108 264 Q F0 1.319 +(If set to)144 276 R F1(On)3.819 E F0 3.819(,r)C 1.318(eadline will dis\ +play completions with matches sorted horizontally in alphabetical)-3.819 +F(order)144 288 Q 2.5(,r)-.4 G(ather than do)-2.5 E(wn the screen.)-.25 +E F1 -2.29 -.18(re v)108 300 T(ert\255all\255at\255newline \(Off\)).08 E +F0 .872(If set to)144 312 R F1(on)3.372 E F0 3.372(,r)C .873 +(eadline will undo all changes to history lines before returning when) +-3.372 F F1(accept\255line)3.373 E F0(is)3.373 E -.15(exe)144 324 S +2.686(cuted. By).15 F(def)2.686 E .186 +(ault, history lines may be modi\214ed and retain indi)-.1 F .186 +(vidual undo lists across calls to)-.25 F F1 -.18(re)144 336 S(adline) +.18 E F0(.)A F1(sho)108 348 Q(w\255all\255if\255ambiguous \(Off\))-.1 E +F0 .477(This alters the def)144 360 R .477(ault beha)-.1 F .477 +(vior of the completion functions.)-.2 F .478(If set to)5.478 F F1(on) +2.978 E F0 2.978(,w)C .478(ords which ha)-3.078 F .778 -.15(ve m)-.2 H +(ore).15 E 1.264(than one possible completion cause the matches to be l\ +isted immediately instead of ringing the)144 372 R(bell.)144 384 Q F1 +(sho)108 396 Q(w\255all\255if\255unmodi\214ed \(Off\))-.1 E F0 5.345 +(This alters the def)144 408 R 5.345(ault beha)-.1 F 5.345 +(vior of the completion functions in a f)-.2 F 5.346(ashion similar to) +-.1 F F1(sho)144 420 Q(w\255all\255if\255ambiguous)-.1 E F0 6.923(.I)C +4.423(fs)-6.923 G 1.923(et to)-4.423 F F1(on)4.423 E F0 4.423(,w)C 1.923 +(ords which ha)-4.523 F 2.222 -.15(ve m)-.2 H 1.922 +(ore than one possible completion).15 F 1.039(without an)144 432 R 3.539 +(yp)-.15 G 1.039 +(ossible partial completion \(the possible completions don')-3.539 F +3.539(ts)-.18 G 1.04(hare a common pre\214x\))-3.539 F(cause the matche\ +s to be listed immediately instead of ringing the bell.)144 444 Q F1 +(skip\255completed\255text \(Off\))108 456 Q F0 .095(If set to)144 468 R +F1(On)2.595 E F0 2.595(,t)C .095(his alters the def)-2.595 F .095 +(ault completion beha)-.1 F .094 +(vior when inserting a single match into the line.)-.2 F(It')144 480 Q +2.545(so)-.55 G .045(nly acti)-2.545 F .345 -.15(ve w)-.25 H .046 +(hen performing completion in the middle of a w).15 F 2.546(ord. If)-.1 +F .046(enabled, readline does not)2.546 F 1.394(insert characters from \ +the completion that match characters after point in the w)144 492 R +1.394(ord being com-)-.1 F(pleted, so portions of the w)144 504 Q +(ord follo)-.1 E(wing the cursor are not duplicated.)-.25 E F1 +(visible\255stats \(Off\))108 516 Q F0 .846(If set to)144 528 R F1(On) +3.346 E F0 3.346(,ac)C .846(haracter denoting a \214le')-3.346 F 3.346 +(st)-.55 G .846(ype as reported by)-3.346 F F2(stat)3.346 E F0 .846 +(\(2\) is appended to the \214lename)B +(when listing possible completions.)144 540 Q F1 +(Readline Conditional Constructs)87 556.8 Q F0 .05 +(Readline implements a f)108 568.8 R .05(acility similar in spirit to t\ +he conditional compilation features of the C preprocessor)-.1 F .096 +(which allo)108 580.8 R .096(ws k)-.25 F .396 -.15(ey b)-.1 H .096 +(indings and v).15 F .096 +(ariable settings to be performed as the result of tests.)-.25 F .097 +(There are four parser)5.096 F(directi)108 592.8 Q -.15(ve)-.25 G 2.5 +(su).15 G(sed.)-2.5 E F1($if)108 609.6 Q F0(The)24.89 E F1($if)2.963 E +F0 .463(construct allo)2.963 F .462(ws bindings to be made based on the\ + editing mode, the terminal being used,)-.25 F .477 +(or the application using readline.)144 621.6 R .477(The te)5.477 F .477 +(xt of the test e)-.15 F .477 +(xtends to the end of the line; no characters)-.15 F +(are required to isolate it.)144 633.6 Q F1(mode)144 650.4 Q F0(The) +12.67 E F1(mode=)3.712 E F0 1.212(form of the)3.712 F F1($if)3.711 E F0 +(directi)3.711 E 1.511 -.15(ve i)-.25 H 3.711(su).15 G 1.211 +(sed to test whether readline is in emacs or vi)-3.711 F 3.065 +(mode. This)180 662.4 R .565(may be used in conjunction with the)3.065 F +F1 .565(set k)3.065 F(eymap)-.1 E F0 .565(command, for instance, to) +3.065 F .735(set bindings in the)180 674.4 R F2(emacs\255standar)3.235 E +(d)-.37 E F0(and)3.235 E F2(emacs\255ctlx)3.235 E F0 -.1(ke)3.235 G .735 +(ymaps only if readline is starting)-.05 F(out in emacs mode.)180 686.4 +Q F1(term)144 703.2 Q F0(The)15.46 E F1(term=)3.196 E F0 .696 +(form may be used to include terminal-speci\214c k)3.196 F .996 -.15 +(ey b)-.1 H .697(indings, perhaps to bind).15 F .654(the k)180 715.2 R +.954 -.15(ey s)-.1 H .654(equences output by the terminal').15 F 3.154 +(sf)-.55 G .654(unction k)-3.154 F -.15(ey)-.1 G 3.154(s. The).15 F -.1 +(wo)3.154 G .654(rd on the right side of).1 F(the)180 727.2 Q F1(=)3.231 +E F0 .731(is tested ag)3.231 F .732(ainst the both full name of the ter\ +minal and the portion of the terminal)-.05 F(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(37)185.955 E 0 Cg EP +%%Page: 38 38 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(name before the \214rst)180 84 Q/F1 10/Times-Bold@0 SF<ad>2.5 E +F0 5(.T)C(his allo)-5 E(ws)-.25 E/F2 10/Times-Italic@0 SF(sun)2.84 E F0 +(to match both)2.74 E F2(sun)2.84 E F0(and)2.74 E F2(sun\255cmd)2.5 E F0 +2.5(,f).77 G(or instance.)-2.5 E F1(application)144 100.8 Q F0(The)180 +112.8 Q F1(application)3.003 E F0 .503 +(construct is used to include application-speci\214c settings.)3.003 F +.503(Each program)5.503 F .114(using the readline library sets the)180 +124.8 R F2 .114(application name)2.614 F F0 2.614(,a)C .114 +(nd an initialization \214le can test for a)-2.614 F .501(particular v) +180 136.8 R 3.001(alue. This)-.25 F .501(could be used to bind k)3.001 F +.801 -.15(ey s)-.1 H .5(equences to functions useful for a spe-).15 F +.396(ci\214c program.)180 148.8 R -.15(Fo)5.396 G 2.896(ri).15 G .396 +(nstance, the follo)-2.896 F .396(wing command adds a k)-.25 F .696 -.15 +(ey s)-.1 H .397(equence that quotes the).15 F(current or pre)180 160.8 +Q(vious w)-.25 E(ord in Bash:)-.1 E F1($if)180 184.8 Q F0(Bash)2.5 E 2.5 +(#Q)180 196.8 S(uote the current or pre)-2.5 E(vious w)-.25 E(ord)-.1 E +("\\C\255xq": "\\eb\\"\\ef\\"")180 208.8 Q F1($endif)180 220.8 Q($endif) +108 237.6 Q F0(This command, as seen in the pre)9.33 E(vious e)-.25 E +(xample, terminates an)-.15 E F1($if)2.5 E F0(command.)2.5 E F1($else) +108 254.4 Q F0(Commands in this branch of the)15.45 E F1($if)2.5 E F0 +(directi)2.5 E .3 -.15(ve a)-.25 H(re e).15 E -.15(xe)-.15 G +(cuted if the test f).15 E(ails.)-.1 E F1($include)108 271.2 Q F0 .357 +(This directi)144 283.2 R .657 -.15(ve t)-.25 H(ak).15 E .357 +(es a single \214lename as an ar)-.1 F .356 +(gument and reads commands and bindings from that)-.18 F 2.5(\214le. F) +144 295.2 R(or e)-.15 E(xample, the follo)-.15 E(wing directi)-.25 E .3 +-.15(ve w)-.25 H(ould read).05 E F2(/etc/inputr)2.5 E(c)-.37 E F0(:)A F1 +($include)144 319.2 Q F2(/etc/inputr)5.833 E(c)-.37 E F1(Sear)87 336 Q +(ching)-.18 E F0 .834(Readline pro)108 348 R .834 +(vides commands for searching through the command history \(see)-.15 F +/F3 9/Times-Bold@0 SF(HIST)3.335 E(OR)-.162 E(Y)-.315 E F0(belo)3.085 E +.835(w\) for lines)-.25 F(containing a speci\214ed string.)108 360 Q +(There are tw)5 E 2.5(os)-.1 G(earch modes:)-2.5 E F2(incr)2.51 E +(emental)-.37 E F0(and)3.01 E F2(non-incr)2.5 E(emental)-.37 E F0(.).51 +E .698(Incremental searches be)108 376.8 R .698 +(gin before the user has \214nished typing the search string.)-.15 F +.697(As each character of the)5.697 F .112 +(search string is typed, readline displays the ne)108 388.8 R .112 +(xt entry from the history matching the string typed so f)-.15 F(ar)-.1 +E 5.113(.A)-.55 G(n)-5.113 E .542 +(incremental search requires only as man)108 400.8 R 3.042(yc)-.15 G +.542(haracters as needed to \214nd the desired history entry)-3.042 F +5.541(.T)-.65 G .541(he char)-5.541 F(-)-.2 E .224 +(acters present in the v)108 412.8 R .224(alue of the)-.25 F F1(isear) +2.724 E(ch-terminators)-.18 E F0 -.25(va)2.724 G .224 +(riable are used to terminate an incremental search.).25 F .66 +(If that v)108 424.8 R .66(ariable has not been assigned a v)-.25 F .66 +(alue the Escape and Control-J characters will terminate an incre-)-.25 +F .096(mental search.)108 436.8 R .096(Control-G will abort an incremen\ +tal search and restore the original line.)5.096 F .097 +(When the search is)5.097 F(terminated, the history entry containing th\ +e search string becomes the current line.)108 448.8 Q 2.939 -.8(To \214) +108 465.6 T 1.339(nd other matching entries in the history list, type C\ +ontrol-S or Control-R as appropriate.).8 F 1.338(This will)6.338 F .674 +(search backw)108 477.6 R .674(ard or forw)-.1 F .674 +(ard in the history for the ne)-.1 F .675 +(xt entry matching the search string typed so f)-.15 F(ar)-.1 E 5.675 +(.A)-.55 G -.15(ny)-5.675 G .175(other k)108 489.6 R .475 -.15(ey s)-.1 +H .174 +(equence bound to a readline command will terminate the search and e).15 +F -.15(xe)-.15 G .174(cute that command.).15 F -.15(Fo)5.174 G(r).15 E +.54(instance, a)108 501.6 R F2(ne)3.04 E(wline)-.15 E F0 .541 +(will terminate the search and accept the line, thereby e)3.04 F -.15 +(xe)-.15 G .541(cuting the command from the).15 F(history list.)108 +513.6 Q .653(Readline remembers the last incremental search string.)108 +530.4 R .653(If tw)5.653 F 3.153(oC)-.1 G .653 +(ontrol-Rs are typed without an)-3.153 F 3.152(yi)-.15 G(nterv)-3.152 E +(en-)-.15 E(ing characters de\214ning a ne)108 542.4 Q 2.5(ws)-.25 G +(earch string, an)-2.5 E 2.5(yr)-.15 G(emembered search string is used.) +-2.5 E .567(Non-incremental searches read the entire search string befo\ +re starting to search for matching history lines.)108 559.2 R(The searc\ +h string may be typed by the user or be part of the contents of the cur\ +rent line.)108 571.2 Q F1(Readline Command Names)87 588 Q F0 1.392 +(The follo)108 600 R 1.391 +(wing is a list of the names of the commands and the def)-.25 F 1.391 +(ault k)-.1 F 1.691 -.15(ey s)-.1 H 1.391(equences to which the).15 F +3.891(ya)-.15 G(re)-3.891 E 2.621(bound. Command)108 612 R .121 +(names without an accompan)2.621 F .121(ying k)-.15 F .421 -.15(ey s)-.1 +H .122(equence are unbound by def).15 F 2.622(ault. In)-.1 F .122 +(the follo)2.622 F(wing)-.25 E(descriptions,)108 624 Q F2(point)3.411 E +F0 .911(refers to the current cursor position, and)3.411 F F2(mark)3.411 +E F0 .91(refers to a cursor position sa)3.411 F -.15(ve)-.2 G 3.41(db) +.15 G 3.41(yt)-3.41 G(he)-3.41 E F1(set\255mark)108 636 Q F0 2.5 +(command. The)2.5 F(te)2.5 E +(xt between the point and mark is referred to as the)-.15 E F2 -.37(re) +2.5 G(gion)-.03 E F0(.)A F1(Commands f)87 652.8 Q(or Mo)-.25 E(ving)-.1 +E(beginning\255of\255line \(C\255a\))108 664.8 Q F0(Mo)144 676.8 Q .3 +-.15(ve t)-.15 H 2.5(ot).15 G(he start of the current line.)-2.5 E F1 +(end\255of\255line \(C\255e\))108 688.8 Q F0(Mo)144 700.8 Q .3 -.15 +(ve t)-.15 H 2.5(ot).15 G(he end of the line.)-2.5 E(GNU Bash-4.1)72 768 +Q(2009 December 29)135.965 E(38)185.955 E 0 Cg EP +%%Page: 39 39 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF -.25(fo)108 84 S(rward\255char \(C\255f\)) +.25 E F0(Mo)144 96 Q .3 -.15(ve f)-.15 H(orw).15 E(ard a character)-.1 E +(.)-.55 E F1(backward\255char \(C\255b\))108 108 Q F0(Mo)144 120 Q .3 +-.15(ve b)-.15 H(ack a character).15 E(.)-.55 E F1 -.25(fo)108 132 S +(rward\255w).25 E(ord \(M\255f\))-.1 E F0(Mo)144 144 Q .822 -.15(ve f) +-.15 H(orw).15 E .522(ard to the end of the ne)-.1 F .523(xt w)-.15 F +3.023(ord. W)-.1 F .523 +(ords are composed of alphanumeric characters \(let-)-.8 F +(ters and digits\).)144 156 Q F1(backward\255w)108 168 Q(ord \(M\255b\)) +-.1 E F0(Mo)144 180 Q 1.71 -.15(ve b)-.15 H 1.41 +(ack to the start of the current or pre).15 F 1.41(vious w)-.25 F 3.91 +(ord. W)-.1 F 1.41(ords are composed of alphanumeric)-.8 F +(characters \(letters and digits\).)144 192 Q F1(shell\255f)108 204 Q +(orward\255w)-.25 E(ord)-.1 E F0(Mo)144 216 Q .784 -.15(ve f)-.15 H(orw) +.15 E .484(ard to the end of the ne)-.1 F .484(xt w)-.15 F 2.984(ord. W) +-.1 F .484(ords are delimited by non-quoted shell metacharac-)-.8 F +(ters.)144 228 Q F1(shell\255backward\255w)108 240 Q(ord)-.1 E F0(Mo)144 +252 Q .909 -.15(ve b)-.15 H .609(ack to the start of the current or pre) +.15 F .609(vious w)-.25 F 3.109(ord. W)-.1 F .608 +(ords are delimited by non-quoted shell)-.8 F(metacharacters.)144 264 Q +F1(clear\255scr)108 276 Q(een \(C\255l\))-.18 E F0 .993 +(Clear the screen lea)144 288 R .993 +(ving the current line at the top of the screen.)-.2 F -.4(Wi)5.993 G +.993(th an ar).4 F .993(gument, refresh the)-.18 F +(current line without clearing the screen.)144 300 Q F1 -.18(re)108 312 +S(draw\255curr).18 E(ent\255line)-.18 E F0(Refresh the current line.)144 +324 Q F1(Commands f)87 340.8 Q(or Manipulating the History)-.25 E +(accept\255line \(Newline, Retur)108 352.8 Q(n\))-.15 E F0 .159 +(Accept the line re)144 364.8 R -.05(ga)-.15 G .159 +(rdless of where the cursor is.).05 F .158(If this line is non-empty) +5.158 F 2.658(,a)-.65 G .158(dd it to the history list)-2.658 F .699 +(according to the state of the)144 376.8 R/F2 9/Times-Bold@0 SF +(HISTCONTR)3.199 E(OL)-.27 E F0 -.25(va)2.949 G 3.199(riable. If).25 F +.699(the line is a modi\214ed history line, then)3.199 F +(restore the history line to its original state.)144 388.8 Q F1(pr)108 +400.8 Q -.15(ev)-.18 G(ious\255history \(C\255p\)).15 E F0 +(Fetch the pre)144 412.8 Q(vious command from the history list, mo)-.25 +E(ving back in the list.)-.15 E F1(next\255history \(C\255n\))108 424.8 +Q F0(Fetch the ne)144 436.8 Q(xt command from the history list, mo)-.15 +E(ving forw)-.15 E(ard in the list.)-.1 E F1 +(beginning\255of\255history \(M\255<\))108 448.8 Q F0(Mo)144 460.8 Q .3 +-.15(ve t)-.15 H 2.5(ot).15 G(he \214rst line in the history)-2.5 E(.) +-.65 E F1(end\255of\255history \(M\255>\))108 472.8 Q F0(Mo)144 484.8 Q +.3 -.15(ve t)-.15 H 2.5(ot).15 G(he end of the input history)-2.5 E 2.5 +(,i)-.65 G(.e., the line currently being entered.)-2.5 E F1 -2.29 -.18 +(re v)108 496.8 T(erse\255sear).08 E(ch\255history \(C\255r\))-.18 E F0 +1.471(Search backw)144 508.8 R 1.471 +(ard starting at the current line and mo)-.1 F 1.47 +(ving `up' through the history as necessary)-.15 F(.)-.65 E +(This is an incremental search.)144 520.8 Q F1 -.25(fo)108 532.8 S +(rward\255sear).25 E(ch\255history \(C\255s\))-.18 E F0 1.131 +(Search forw)144 544.8 R 1.131(ard starting at the current line and mo) +-.1 F 1.132(ving `do)-.15 F 1.132(wn' through the history as necessary) +-.25 F(.)-.65 E(This is an incremental search.)144 556.8 Q F1 +(non\255incr)108 568.8 Q(emental\255r)-.18 E -2.3 -.15(ev e)-.18 H +(rse\255sear).15 E(ch\255history \(M\255p\))-.18 E F0 .165(Search backw) +144 580.8 R .164(ard through the history starting at the current line u\ +sing a non-incremental search for)-.1 F 2.5(as)144 592.8 S +(tring supplied by the user)-2.5 E(.)-.55 E F1(non\255incr)108 604.8 Q +(emental\255f)-.18 E(orward\255sear)-.25 E(ch\255history \(M\255n\))-.18 +E F0 1.353(Search forw)144 616.8 R 1.354(ard through the history using \ +a non-incremental search for a string supplied by the)-.1 F(user)144 +628.8 Q(.)-.55 E F1(history\255sear)108 640.8 Q(ch\255f)-.18 E(orward) +-.25 E F0 .249(Search forw)144 652.8 R .249(ard through the history for\ + the string of characters between the start of the current line)-.1 F +(and the point.)144 664.8 Q(This is a non-incremental search.)5 E F1 +(history\255sear)108 676.8 Q(ch\255backward)-.18 E F0 .95(Search backw) +144 688.8 R .951(ard through the history for the string of characters b\ +etween the start of the current)-.1 F(line and the point.)144 700.8 Q +(This is a non-incremental search.)5 E(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(39)185.955 E 0 Cg EP +%%Page: 40 40 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(yank\255nth\255ar)108 84 Q 2.5(g\()-.1 G +<4dad43ad7929>-2.5 E F0 .622(Insert the \214rst ar)144 96 R .622 +(gument to the pre)-.18 F .622(vious command \(usually the second w)-.25 +F .622(ord on the pre)-.1 F .622(vious line\))-.25 F .794(at point.)144 +108 R -.4(Wi)5.794 G .794(th an ar).4 F(gument)-.18 E/F2 10 +/Times-Italic@0 SF(n)3.294 E F0 3.294(,i).24 G .794(nsert the)-3.294 F +F2(n)3.294 E F0 .794(th w)B .794(ord from the pre)-.1 F .794 +(vious command \(the w)-.25 F .795(ords in the)-.1 F(pre)144 120 Q .292 +(vious command be)-.25 F .292(gin with w)-.15 F .291(ord 0\).)-.1 F +2.791(An)5.291 G -2.25 -.15(eg a)-2.791 H(ti).15 E .591 -.15(ve a)-.25 H +-.18(rg).15 G .291(ument inserts the).18 F F2(n)2.791 E F0 .291(th w)B +.291(ord from the end of)-.1 F .281(the pre)144 132 R .281 +(vious command.)-.25 F .281(Once the ar)5.281 F(gument)-.18 E F2(n)2.781 +E F0 .281(is computed, the ar)2.781 F .281(gument is e)-.18 F .282 +(xtracted as if the "!)-.15 F F2(n)A F0(")A(history e)144 144 Q +(xpansion had been speci\214ed.)-.15 E F1(yank\255last\255ar)108 156 Q +2.5(g\()-.1 G -1.667(M\255. ,)-2.5 F -1.667(M\255_ \))2.5 F F0 1.308 +(Insert the last ar)144 168 R 1.308(gument to the pre)-.18 F 1.307 +(vious command \(the last w)-.25 F 1.307(ord of the pre)-.1 F 1.307 +(vious history entry\).)-.25 F -.4(Wi)144 180 S .735(th an ar).4 F .735 +(gument, beha)-.18 F 1.035 -.15(ve ex)-.2 H .735(actly lik).15 F(e)-.1 E +F1(yank\255nth\255ar)3.235 E(g)-.1 E F0 5.736(.S)C(uccessi)-5.736 E +1.036 -.15(ve c)-.25 H .736(alls to).15 F F1(yank\255last\255ar)3.236 E +(g)-.1 E F0(mo)3.236 E -.15(ve)-.15 G .728 +(back through the history list, inserting the last ar)144 192 R .728 +(gument of each line in turn.)-.18 F .728(The history e)5.728 F(xpan-) +-.15 E .14(sion f)144 204 R .14(acilities are used to e)-.1 F .14 +(xtract the last ar)-.15 F .14(gument, as if the "!$" history e)-.18 F +.14(xpansion had been speci-)-.15 F(\214ed.)144 216 Q F1 +(shell\255expand\255line \(M\255C\255e\))108 228 Q F0 .623 +(Expand the line as the shell does.)144 240 R .622 +(This performs alias and history e)5.622 F .622 +(xpansion as well as all of the)-.15 F(shell w)144 252 Q(ord e)-.1 E 2.5 +(xpansions. See)-.15 F/F3 9/Times-Bold@0 SF(HIST)2.5 E(OR)-.162 E 2.25 +(YE)-.315 G(XP)-2.25 E(ANSION)-.666 E F0(belo)2.25 E 2.5(wf)-.25 G +(or a description of history e)-2.5 E(xpansion.)-.15 E F1 +(history\255expand\255line \(M\255^\))108 264 Q F0 .938 +(Perform history e)144 276 R .939(xpansion on the current line.)-.15 F +(See)5.939 E F3(HIST)3.439 E(OR)-.162 E 3.189(YE)-.315 G(XP)-3.189 E +(ANSION)-.666 E F0(belo)3.189 E 3.439(wf)-.25 G .939(or a descrip-) +-3.439 F(tion of history e)144 288 Q(xpansion.)-.15 E F1(magic\255space) +108 300 Q F0 1.627(Perform history e)144 312 R 1.627 +(xpansion on the current line and insert a space.)-.15 F(See)6.626 E F3 +(HIST)4.126 E(OR)-.162 E 3.876(YE)-.315 G(XP)-3.876 E(ANSION)-.666 E F0 +(belo)144 324 Q 2.5(wf)-.25 G(or a description of history e)-2.5 E +(xpansion.)-.15 E F1(alias\255expand\255line)108 336 Q F0 .394 +(Perform alias e)144 348 R .394(xpansion on the current line.)-.15 F +(See)5.395 E F3(ALIASES)2.895 E F0(abo)2.645 E .695 -.15(ve f)-.15 H +.395(or a description of alias e).15 F(xpan-)-.15 E(sion.)144 360 Q F1 +(history\255and\255alias\255expand\255line)108 372 Q F0 +(Perform history and alias e)144 384 Q(xpansion on the current line.) +-.15 E F1(insert\255last\255ar)108 396 Q(gument \(M\255.)-.1 E 2.5(,M) +.833 G -1.667(\255_ \))-2.5 F F0 2.5(As)144 408 S(ynon)-2.5 E(ym for) +-.15 E F1(yank\255last\255ar)2.5 E(g)-.1 E F0(.)A F1 +(operate\255and\255get\255next \(C\255o\))108 420 Q F0 .948 +(Accept the current line for e)144 432 R -.15(xe)-.15 G .948 +(cution and fetch the ne).15 F .948(xt line relati)-.15 F 1.247 -.15 +(ve t)-.25 H 3.447(ot).15 G .947(he current line from the)-3.447 F +(history for editing.)144 444 Q(An)5 E 2.5(ya)-.15 G -.18(rg)-2.5 G +(ument is ignored.).18 E F1 +(edit\255and\255execute\255command \(C\255xC\255e\))108 456 Q F0(In)144 +468 Q -.2(vo)-.4 G 1.226 -.1(ke a).2 H 3.526(ne).1 G 1.026 +(ditor on the current command line, and e)-3.526 F -.15(xe)-.15 G 1.026 +(cute the result as shell commands.).15 F F1(Bash)6.026 E F0 +(attempts to in)144 480 Q -.2(vo)-.4 G -.1(ke).2 G F3($VISU)2.6 E(AL) +-.54 E/F4 9/Times-Roman@0 SF(,)A F3($EDIT)2.25 E(OR)-.162 E F4(,)A F0 +(and)2.25 E F2(emacs)2.5 E F0(as the editor)2.5 E 2.5(,i)-.4 G 2.5(nt) +-2.5 G(hat order)-2.5 E(.)-.55 E F1(Commands f)87 496.8 Q(or Changing T) +-.25 E(ext)-.92 E(delete\255char \(C\255d\))108 508.8 Q F0 .358 +(Delete the character at point.)144 520.8 R .358(If point is at the be) +5.358 F .358(ginning of the line, there are no characters in the)-.15 F +(line, and the last character typed w)144 532.8 Q(as not bound to)-.1 E +F1(delete\255char)2.5 E F0 2.5(,t)C(hen return)-2.5 E F3(EOF)2.5 E F4(.) +A F1(backward\255delete\255char \(Rubout\))108 544.8 Q F0 .552 +(Delete the character behind the cursor)144 556.8 R 5.553(.W)-.55 G .553 +(hen gi)-5.553 F -.15(ve)-.25 G 3.053(nan).15 G .553(umeric ar)-3.053 F +.553(gument, sa)-.18 F .853 -.15(ve t)-.2 H .553(he deleted te).15 F +.553(xt on)-.15 F(the kill ring.)144 568.8 Q F1 -.25(fo)108 580.8 S +(rward\255backward\255delete\255char).25 E F0 .474 +(Delete the character under the cursor)144 592.8 R 2.974(,u)-.4 G .474 +(nless the cursor is at the end of the line, in which case the)-2.974 F +(character behind the cursor is deleted.)144 604.8 Q F1 +(quoted\255insert \(C\255q, C\255v\))108 616.8 Q F0 .778(Add the ne)144 +628.8 R .779(xt character typed to the line v)-.15 F 3.279 +(erbatim. This)-.15 F .779(is ho)3.279 F 3.279(wt)-.25 G 3.279(oi)-3.279 +G .779(nsert characters lik)-3.279 F(e)-.1 E F1(C\255q)3.279 E F0 3.279 +(,f)C(or)-3.279 E -.15(ex)144 640.8 S(ample.).15 E F1 +(tab\255insert \(C\255v T)108 652.8 Q(AB\))-.9 E F0 +(Insert a tab character)144 664.8 Q(.)-.55 E F1 +(self\255insert \(a, b, A, 1, !, ...\))108 676.8 Q F0 +(Insert the character typed.)144 688.8 Q F1 +(transpose\255chars \(C\255t\))108 700.8 Q F0 .322 +(Drag the character before point forw)144 712.8 R .321(ard o)-.1 F -.15 +(ve)-.15 G 2.821(rt).15 G .321(he character at point, mo)-2.821 F .321 +(ving point forw)-.15 F .321(ard as well.)-.1 F 1.182 +(If point is at the end of the line, then this transposes the tw)144 +724.8 R 3.683(oc)-.1 G 1.183(haracters before point.)-3.683 F(Ne)6.183 E +-.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(40)185.955 E 0 Cg EP +%%Page: 41 41 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(ar)144 84 Q(guments ha)-.18 E .3 -.15(ve n)-.2 H 2.5(oe).15 G +-.25(ff)-2.5 G(ect.).25 E/F1 10/Times-Bold@0 SF(transpose\255w)108 96 Q +(ords \(M\255t\))-.1 E F0 .024(Drag the w)144 108 R .024 +(ord before point past the w)-.1 F .023(ord after point, mo)-.1 F .023 +(ving point o)-.15 F -.15(ve)-.15 G 2.523(rt).15 G .023(hat w)-2.523 F +.023(ord as well.)-.1 F .023(If point)5.023 F +(is at the end of the line, this transposes the last tw)144 120 Q 2.5 +(ow)-.1 G(ords on the line.)-2.6 E F1(upcase\255w)108 132 Q +(ord \(M\255u\))-.1 E F0 1.698(Uppercase the current \(or follo)144 144 +R 1.698(wing\) w)-.25 F 4.198(ord. W)-.1 F 1.698(ith a ne)-.4 F -.05(ga) +-.15 G(ti).05 E 1.999 -.15(ve a)-.25 H -.18(rg).15 G 1.699 +(ument, uppercase the pre).18 F(vious)-.25 E -.1(wo)144 156 S(rd, b).1 E +(ut do not mo)-.2 E .3 -.15(ve p)-.15 H(oint.).15 E F1(do)108 168 Q +(wncase\255w)-.1 E(ord \(M\255l\))-.1 E F0(Lo)144 180 Q 1.648 +(wercase the current \(or follo)-.25 F 1.648(wing\) w)-.25 F 4.148 +(ord. W)-.1 F 1.647(ith a ne)-.4 F -.05(ga)-.15 G(ti).05 E 1.947 -.15 +(ve a)-.25 H -.18(rg).15 G 1.647(ument, lo).18 F 1.647(wercase the pre) +-.25 F(vious)-.25 E -.1(wo)144 192 S(rd, b).1 E(ut do not mo)-.2 E .3 +-.15(ve p)-.15 H(oint.).15 E F1(capitalize\255w)108 204 Q +(ord \(M\255c\))-.1 E F0 1.974(Capitalize the current \(or follo)144 216 +R 1.974(wing\) w)-.25 F 4.474(ord. W)-.1 F 1.974(ith a ne)-.4 F -.05(ga) +-.15 G(ti).05 E 2.274 -.15(ve a)-.25 H -.18(rg).15 G 1.975 +(ument, capitalize the pre).18 F(vious)-.25 E -.1(wo)144 228 S(rd, b).1 +E(ut do not mo)-.2 E .3 -.15(ve p)-.15 H(oint.).15 E F1 -.1(ove)108 240 +S(rwrite\255mode).1 E F0 -.8(To)144 252 S .438(ggle o).8 F -.15(ve)-.15 +G .438(rwrite mode.).15 F -.4(Wi)5.438 G .438(th an e).4 F .438 +(xplicit positi)-.15 F .737 -.15(ve n)-.25 H .437(umeric ar).15 F .437 +(gument, switches to o)-.18 F -.15(ve)-.15 G .437(rwrite mode.).15 F -.4 +(Wi)144 264 S .78(th an e).4 F .781(xplicit non-positi)-.15 F 1.081 -.15 +(ve n)-.25 H .781(umeric ar).15 F .781(gument, switches to insert mode.) +-.18 F .781(This command af)5.781 F(fects)-.25 E(only)144 276 Q F1 +(emacs)4.395 E F0(mode;)4.395 E F1(vi)4.395 E F0 1.894(mode does o)4.395 +F -.15(ve)-.15 G 1.894(rwrite dif).15 F(ferently)-.25 E 6.894(.E)-.65 G +1.894(ach call to)-6.894 F/F2 10/Times-Italic@0 SF -.37(re)4.394 G +(adline\(\)).37 E F0 1.894(starts in insert)4.394 F 3.968(mode. In)144 +288 R -.15(ove)3.968 G 1.468(rwrite mode, characters bound to).15 F F1 +(self\255insert)3.969 E F0 1.469(replace the te)3.969 F 1.469 +(xt at point rather than)-.15 F .958(pushing the te)144 300 R .958 +(xt to the right.)-.15 F .957(Characters bound to)5.958 F F1 +(backward\255delete\255char)3.457 E F0 .957(replace the character)3.457 +F(before point with a space.)144 312 Q(By def)5 E +(ault, this command is unbound.)-.1 E F1(Killing and Y)87 328.8 Q +(anking)-.85 E(kill\255line \(C\255k\))108 340.8 Q F0(Kill the te)144 +352.8 Q(xt from point to the end of the line.)-.15 E F1 +(backward\255kill\255line \(C\255x Rubout\))108 364.8 Q F0(Kill backw) +144 376.8 Q(ard to the be)-.1 E(ginning of the line.)-.15 E F1 +(unix\255line\255discard \(C\255u\))108 388.8 Q F0(Kill backw)144 400.8 +Q(ard from point to the be)-.1 E(ginning of the line.)-.15 E +(The killed te)5 E(xt is sa)-.15 E -.15(ve)-.2 G 2.5(do).15 G 2.5(nt) +-2.5 G(he kill-ring.)-2.5 E F1(kill\255whole\255line)108 412.8 Q F0 +(Kill all characters on the current line, no matter where point is.)144 +424.8 Q F1(kill\255w)108 436.8 Q(ord \(M\255d\))-.1 E F0 .728 +(Kill from point to the end of the current w)144 448.8 R .729 +(ord, or if between w)-.1 F .729(ords, to the end of the ne)-.1 F .729 +(xt w)-.15 F(ord.)-.1 E -.8(Wo)144 460.8 S +(rd boundaries are the same as those used by).8 E F1 -.25(fo)2.5 G +(rward\255w).25 E(ord)-.1 E F0(.)A F1(backward\255kill\255w)108 472.8 Q +(ord \(M\255Rubout\))-.1 E F0(Kill the w)144 484.8 Q(ord behind point.) +-.1 E -.8(Wo)5 G(rd boundaries are the same as those used by).8 E F1 +(backward\255w)2.5 E(ord)-.1 E F0(.)A F1(shell\255kill\255w)108 496.8 Q +(ord \(M\255d\))-.1 E F0 .729 +(Kill from point to the end of the current w)144 508.8 R .728 +(ord, or if between w)-.1 F .728(ords, to the end of the ne)-.1 F .728 +(xt w)-.15 F(ord.)-.1 E -.8(Wo)144 520.8 S +(rd boundaries are the same as those used by).8 E F1(shell\255f)2.5 E +(orward\255w)-.25 E(ord)-.1 E F0(.)A F1(shell\255backward\255kill\255w) +108 532.8 Q(ord \(M\255Rubout\))-.1 E F0 3.025(Kill the w)144 544.8 R +3.025(ord behind point.)-.1 F -.8(Wo)8.025 G 3.025 +(rd boundaries are the same as those used by).8 F F1(shell\255back-) +5.525 E(ward\255w)144 556.8 Q(ord)-.1 E F0(.)A F1(unix\255w)108 568.8 Q +(ord\255rubout \(C\255w\))-.1 E F0 .365(Kill the w)144 580.8 R .365 +(ord behind point, using white space as a w)-.1 F .364(ord boundary)-.1 +F 5.364(.T)-.65 G .364(he killed te)-5.364 F .364(xt is sa)-.15 F -.15 +(ve)-.2 G 2.864(do).15 G 2.864(nt)-2.864 G(he)-2.864 E(kill-ring.)144 +592.8 Q F1(unix\255\214lename\255rubout)108 604.8 Q F0 .166(Kill the w) +144 616.8 R .166 +(ord behind point, using white space and the slash character as the w) +-.1 F .167(ord boundaries.)-.1 F(The)5.167 E(killed te)144 628.8 Q +(xt is sa)-.15 E -.15(ve)-.2 G 2.5(do).15 G 2.5(nt)-2.5 G(he kill-ring.) +-2.5 E F1(delete\255horizontal\255space \(M\255\\\))108 640.8 Q F0 +(Delete all spaces and tabs around point.)144 652.8 Q F1(kill\255r)108 +664.8 Q(egion)-.18 E F0(Kill the te)144 676.8 Q(xt in the current re) +-.15 E(gion.)-.15 E F1(copy\255r)108 688.8 Q(egion\255as\255kill)-.18 E +F0(Cop)144 700.8 Q 2.5(yt)-.1 G(he te)-2.5 E(xt in the re)-.15 E +(gion to the kill b)-.15 E(uf)-.2 E(fer)-.25 E(.)-.55 E(GNU Bash-4.1)72 +768 Q(2009 December 29)135.965 E(41)185.955 E 0 Cg EP +%%Page: 42 42 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(copy\255backward\255w)108 84 Q(ord)-.1 E F0 +(Cop)144 96 Q 4.801(yt)-.1 G 2.301(he w)-4.801 F 2.301 +(ord before point to the kill b)-.1 F(uf)-.2 E(fer)-.25 E 7.301(.T)-.55 +G 2.301(he w)-7.301 F 2.3(ord boundaries are the same as)-.1 F F1(back-) +4.8 E(ward\255w)144 108 Q(ord)-.1 E F0(.)A F1(copy\255f)108 120 Q +(orward\255w)-.25 E(ord)-.1 E F0(Cop)144 132 Q 4.507(yt)-.1 G 2.007 +(he w)-4.507 F 2.007(ord follo)-.1 F 2.007(wing point to the kill b)-.25 +F(uf)-.2 E(fer)-.25 E 7.008(.T)-.55 G 2.008(he w)-7.008 F 2.008 +(ord boundaries are the same as)-.1 F F1 -.25(fo)4.508 G -.37(r-).25 G +(ward\255w)144 144 Q(ord)-.1 E F0(.)A F1(yank \(C\255y\))108 156 Q F0 -1 +(Ya)144 168 S(nk the top of the kill ring into the b)1 E(uf)-.2 E +(fer at point.)-.25 E F1(yank\255pop \(M\255y\))108 180 Q F0 +(Rotate the kill ring, and yank the ne)144 192 Q 2.5(wt)-.25 G 2.5 +(op. Only)-2.5 F -.1(wo)2.5 G(rks follo).1 E(wing)-.25 E F1(yank)2.5 E +F0(or)2.5 E F1(yank\255pop)2.5 E F0(.)A F1(Numeric Ar)87 208.8 Q +(guments)-.1 E(digit\255ar)108 220.8 Q +(gument \(M\2550, M\2551, ..., M\255\255\))-.1 E F0 .642 +(Add this digit to the ar)144 232.8 R .641 +(gument already accumulating, or start a ne)-.18 F 3.141(wa)-.25 G -.18 +(rg)-3.141 G 3.141(ument. M\255\255).18 F .641(starts a ne)3.141 F(g-) +-.15 E(ati)144 244.8 Q .3 -.15(ve a)-.25 H -.18(rg).15 G(ument.).18 E F1 +(uni)108 256.8 Q -.1(ve)-.1 G(rsal\255ar).1 E(gument)-.1 E F0 .778 +(This is another w)144 268.8 R .779(ay to specify an ar)-.1 F 3.279 +(gument. If)-.18 F .779(this command is follo)3.279 F .779 +(wed by one or more digits,)-.25 F 1.376 +(optionally with a leading minus sign, those digits de\214ne the ar)144 +280.8 R 3.876(gument. If)-.18 F 1.376(the command is fol-)3.876 F(lo)144 +292.8 Q 1.17(wed by digits, e)-.25 F -.15(xe)-.15 G(cuting).15 E F1(uni) +3.67 E -.1(ve)-.1 G(rsal\255ar).1 E(gument)-.1 E F0(ag)3.67 E 1.17 +(ain ends the numeric ar)-.05 F 1.17(gument, b)-.18 F 1.17(ut is other) +-.2 F(-)-.2 E .899(wise ignored.)144 304.8 R .898 +(As a special case, if this command is immediately follo)5.899 F .898 +(wed by a character that is)-.25 F .243 +(neither a digit or minus sign, the ar)144 316.8 R .243 +(gument count for the ne)-.18 F .243(xt command is multiplied by four) +-.15 F 5.243(.T)-.55 G(he)-5.243 E(ar)144 328.8 Q .378 +(gument count is initially one, so e)-.18 F -.15(xe)-.15 G .378 +(cuting this function the \214rst time mak).15 F .378(es the ar)-.1 F +.378(gument count)-.18 F(four)144 340.8 Q 2.5(,as)-.4 G(econd time mak) +-2.5 E(es the ar)-.1 E(gument count sixteen, and so on.)-.18 E F1 +(Completing)87 357.6 Q(complete \(T)108 369.6 Q(AB\))-.9 E F0 1.137 +(Attempt to perform completion on the te)144 381.6 R 1.137 +(xt before point.)-.15 F F1(Bash)6.137 E F0 1.137 +(attempts completion treating the)3.637 F(te)144 393.6 Q .533(xt as a v) +-.15 F .533(ariable \(if the te)-.25 F .533(xt be)-.15 F .533(gins with) +-.15 F F1($)3.033 E F0 .533(\), username \(if the te)B .532(xt be)-.15 F +.532(gins with)-.15 F F1(~)3.032 E F0 .532(\), hostname \(if the)B(te) +144 405.6 Q .701(xt be)-.15 F .701(gins with)-.15 F F1(@)3.201 E F0 .701 +(\), or command \(including aliases and functions\) in turn.)B .702 +(If none of these pro-)5.701 F +(duces a match, \214lename completion is attempted.)144 417.6 Q F1 +(possible\255completions \(M\255?\))108 429.6 Q F0 +(List the possible completions of the te)144 441.6 Q(xt before point.) +-.15 E F1(insert\255completions \(M\255*\))108 453.6 Q F0 .783 +(Insert all completions of the te)144 465.6 R .783 +(xt before point that w)-.15 F .783(ould ha)-.1 F 1.083 -.15(ve b)-.2 H +.783(een generated by).15 F F1(possible\255com-)3.282 E(pletions)144 +477.6 Q F0(.)A F1(menu\255complete)108 489.6 Q F0 .928(Similar to)144 +501.6 R F1(complete)3.428 E F0 3.428(,b)C .929(ut replaces the w)-3.628 +F .929(ord to be completed with a single match from the list of)-.1 F +1.194(possible completions.)144 513.6 R 1.194(Repeated e)6.194 F -.15 +(xe)-.15 G 1.194(cution of).15 F F1(menu\255complete)3.694 E F0 1.193 +(steps through the list of possible)3.694 F .828 +(completions, inserting each match in turn.)144 525.6 R .828 +(At the end of the list of completions, the bell is rung)5.828 F .727 +(\(subject to the setting of)144 537.6 R F1(bell\255style)3.227 E F0 +3.227(\)a)C .727(nd the original te)-3.227 F .727(xt is restored.)-.15 F +.727(An ar)5.727 F .727(gument of)-.18 F/F2 10/Times-Italic@0 SF(n)3.227 +E F0(mo)3.227 E -.15(ve)-.15 G(s).15 E F2(n)3.227 E F0 1.73 +(positions forw)144 549.6 R 1.73(ard in the list of matches; a ne)-.1 F +-.05(ga)-.15 G(ti).05 E 2.03 -.15(ve a)-.25 H -.18(rg).15 G 1.73 +(ument may be used to mo).18 F 2.03 -.15(ve b)-.15 H(ackw).15 E(ard)-.1 +E(through the list.)144 561.6 Q(This command is intended to be bound to) +5 E F1 -.9(TA)2.5 G(B).9 E F0 2.5(,b)C(ut is unbound by def)-2.7 E +(ault.)-.1 E F1(menu\255complete-)108 573.6 Q(w)10 I(k)-7.22 -10 M(c) +-5.56 -10 M(rd)2.78 10 M F0 .82(Identical to)144 585.6 R F1 +(menu\255complete)3.32 E F0 3.32(,b)C .82(ut mo)-3.52 F -.15(ve)-.15 G +3.32(sb).15 G(ackw)-3.32 E .82 +(ard through the list of possible completions, as if)-.1 F F1 +(menu\255complete)144 597.6 Q F0(had been gi)2.5 E -.15(ve)-.25 G 2.5 +(nan).15 G -2.25 -.15(eg a)-2.5 H(ti).15 E .3 -.15(ve a)-.25 H -.18(rg) +.15 G 2.5(ument. This).18 F(command is unbound by def)2.5 E(ault.)-.1 E +F1(delete\255char\255or\255list)108 609.6 Q F0 .234 +(Deletes the character under the cursor if not at the be)144 621.6 R +.234(ginning or end of the line \(lik)-.15 F(e)-.1 E F1(delete\255char) +2.735 E F0(\).)A .425(If at the end of the line, beha)144 633.6 R -.15 +(ve)-.2 G 2.925(si).15 G .425(dentically to)-2.925 F F1 +(possible\255completions)2.925 E F0 5.425(.T)C .425 +(his command is unbound)-5.425 F(by def)144 645.6 Q(ault.)-.1 E F1 +(complete\255\214lename \(M\255/\))108 657.6 Q F0 +(Attempt \214lename completion on the te)144 669.6 Q(xt before point.) +-.15 E F1(possible\255\214lename\255completions \(C\255x /\))108 681.6 Q +F0(List the possible completions of the te)144 693.6 Q +(xt before point, treating it as a \214lename.)-.15 E F1 +(complete\255user)108 705.6 Q(name \(M\255~\))-.15 E F0 +(Attempt completion on the te)144 717.6 Q +(xt before point, treating it as a username.)-.15 E(GNU Bash-4.1)72 768 +Q(2009 December 29)135.965 E(42)185.955 E 0 Cg EP +%%Page: 43 43 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(possible\255user)108 84 Q +(name\255completions \(C\255x ~\))-.15 E F0 +(List the possible completions of the te)144 96 Q +(xt before point, treating it as a username.)-.15 E F1(complete\255v)108 +108 Q(ariable \(M\255$\))-.1 E F0(Attempt completion on the te)144 120 Q +(xt before point, treating it as a shell v)-.15 E(ariable.)-.25 E F1 +(possible\255v)108 132 Q(ariable\255completions \(C\255x $\))-.1 E F0 +(List the possible completions of the te)144 144 Q +(xt before point, treating it as a shell v)-.15 E(ariable.)-.25 E F1 +(complete\255hostname \(M\255@\))108 156 Q F0 +(Attempt completion on the te)144 168 Q +(xt before point, treating it as a hostname.)-.15 E F1 +(possible\255hostname\255completions \(C\255x @\))108 180 Q F0 +(List the possible completions of the te)144 192 Q +(xt before point, treating it as a hostname.)-.15 E F1 +(complete\255command \(M\255!\))108 204 Q F0 .58 +(Attempt completion on the te)144 216 R .581 +(xt before point, treating it as a command name.)-.15 F .581 +(Command comple-)5.581 F .715(tion attempts to match the te)144 228 R +.715(xt ag)-.15 F .715(ainst aliases, reserv)-.05 F .715(ed w)-.15 F +.715(ords, shell functions, shell b)-.1 F .715(uiltins, and)-.2 F +(\214nally e)144 240 Q -.15(xe)-.15 G +(cutable \214lenames, in that order).15 E(.)-.55 E F1 +(possible\255command\255completions \(C\255x !\))108 252 Q F0 +(List the possible completions of the te)144 264 Q +(xt before point, treating it as a command name.)-.15 E F1 +(dynamic\255complete\255history \(M\255T)108 276 Q(AB\))-.9 E F0 .424 +(Attempt completion on the te)144 288 R .425 +(xt before point, comparing the te)-.15 F .425(xt ag)-.15 F .425 +(ainst lines from the history list)-.05 F +(for possible completion matches.)144 300 Q F1(dab)108 312 Q(br)-.1 E +-.15(ev)-.18 G(\255expand).15 E F0 .611 +(Attempt menu completion on the te)144 324 R .611 +(xt before point, comparing the te)-.15 F .61(xt ag)-.15 F .61 +(ainst lines from the his-)-.05 F +(tory list for possible completion matches.)144 336 Q F1 +(complete\255into\255braces \(M\255{\))108 348 Q F0 .4(Perform \214lena\ +me completion and insert the list of possible completions enclosed with\ +in braces so)144 360 R(the list is a)144 372 Q -.25(va)-.2 G +(ilable to the shell \(see).25 E F1(Brace Expansion)2.5 E F0(abo)2.5 E +-.15(ve)-.15 G(\).).15 E F1 -.25(Ke)87 388.8 S(yboard Macr).25 E(os)-.18 +E(start\255kbd\255macr)108 400.8 Q 2.5(o\()-.18 G(C\255x \()-2.5 E(\)) +.833 E F0(Be)144 412.8 Q(gin sa)-.15 E +(ving the characters typed into the current k)-.2 E -.15(ey)-.1 G +(board macro.).15 E F1(end\255kbd\255macr)108 424.8 Q 2.5(o\()-.18 G +(C\255x \))-2.5 E(\)).833 E F0(Stop sa)144 436.8 Q +(ving the characters typed into the current k)-.2 E -.15(ey)-.1 G +(board macro and store the de\214nition.).15 E F1 +(call\255last\255kbd\255macr)108 448.8 Q 2.5(o\()-.18 G(C\255x e\))-2.5 +E F0(Re-e)144 460.8 Q -.15(xe)-.15 G 1(cute the last k).15 F -.15(ey)-.1 +G .999(board macro de\214ned, by making the characters in the macro app\ +ear as if).15 F(typed at the k)144 472.8 Q -.15(ey)-.1 G(board.).15 E F1 +(Miscellaneous)87 489.6 Q -.18(re)108 501.6 S<ad72>.18 E +(ead\255init\255\214le \(C\255x C\255r\))-.18 E F0 1.776 +(Read in the contents of the)144 513.6 R/F2 10/Times-Italic@0 SF(inputr) +4.276 E(c)-.37 E F0 1.777(\214le, and incorporate an)4.276 F 4.277(yb) +-.15 G 1.777(indings or v)-4.277 F 1.777(ariable assignments)-.25 F +(found there.)144 525.6 Q F1(abort \(C\255g\))108 537.6 Q F0 3.249 +(Abort the current editing command and ring the terminal')144 549.6 R +5.748(sb)-.55 G 3.248(ell \(subject to the setting of)-5.748 F F1 +(bell\255style)144 561.6 Q F0(\).)A F1(do\255upper)108 573.6 Q +(case\255v)-.18 E(ersion \(M\255a, M\255b, M\255)-.1 E F2(x)A F1 2.5(,.) +C(..\))-2.5 E F0 1.755(If the meta\214ed character)144 585.6 R F2(x) +4.255 E F0 1.755(is lo)4.255 F 1.756 +(wercase, run the command that is bound to the corresponding)-.25 F +(uppercase character)144 597.6 Q(.)-.55 E F1(pr)108 609.6 Q +(e\214x\255meta \(ESC\))-.18 E F0(Metafy the ne)144 621.6 Q +(xt character typed.)-.15 E/F3 9/Times-Bold@0 SF(ESC)5 E F1(f)2.25 E F0 +(is equi)2.5 E -.25(va)-.25 G(lent to).25 E F1(Meta\255f)2.5 E F0(.)A F1 +(undo \(C\255_, C\255x C\255u\))108 633.6 Q F0 +(Incremental undo, separately remembered for each line.)144 645.6 Q F1 +-2.29 -.18(re v)108 657.6 T(ert\255line \(M\255r\)).08 E F0 1.095 +(Undo all changes made to this line.)144 669.6 R 1.095(This is lik)6.095 +F 3.595(ee)-.1 G -.15(xe)-3.745 G 1.095(cuting the).15 F F1(undo)3.595 E +F0 1.095(command enough times to)3.595 F +(return the line to its initial state.)144 681.6 Q F1 +(tilde\255expand \(M\255&\))108 693.6 Q F0(Perform tilde e)144 705.6 Q +(xpansion on the current w)-.15 E(ord.)-.1 E(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(43)185.955 E 0 Cg EP +%%Page: 44 44 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(set\255mark \(C\255@, M\255<space>\))108 84 +Q F0(Set the mark to the point.)144 96 Q(If a numeric ar)5 E +(gument is supplied, the mark is set to that position.)-.18 E F1 +(exchange\255point\255and\255mark \(C\255x C\255x\))108 108 Q F0(Sw)144 +120 Q .282(ap the point with the mark.)-.1 F .283 +(The current cursor position is set to the sa)5.283 F -.15(ve)-.2 G +2.783(dp).15 G .283(osition, and the old)-2.783 F(cursor position is sa) +144 132 Q -.15(ve)-.2 G 2.5(da).15 G 2.5(st)-2.5 G(he mark.)-2.5 E F1 +(character\255sear)108 144 Q(ch \(C\255]\))-.18 E F0 3.036(Ac)144 156 S +.536(haracter is read and point is mo)-3.036 F -.15(ve)-.15 G 3.035(dt) +.15 G 3.035(ot)-3.035 G .535(he ne)-3.035 F .535 +(xt occurrence of that character)-.15 F 5.535(.A)-.55 G(ne)-2.5 E -.05 +(ga)-.15 G(ti).05 E .835 -.15(ve c)-.25 H(ount).15 E(searches for pre) +144 168 Q(vious occurrences.)-.25 E F1(character\255sear)108 180 Q +(ch\255backward \(M\255C\255]\))-.18 E F0 3.543(Ac)144 192 S 1.043 +(haracter is read and point is mo)-3.543 F -.15(ve)-.15 G 3.544(dt).15 G +3.544(ot)-3.544 G 1.044(he pre)-3.544 F 1.044 +(vious occurrence of that character)-.25 F 6.044(.A)-.55 G(ne)-2.5 E +-.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G +(count searches for subsequent occurrences.)144 204 Q F1 +(skip\255csi\255sequence \(\))108 216 Q F0 1.827 +(Read enough characters to consume a multi-k)144 228 R 2.126 -.15(ey s) +-.1 H 1.826(equence such as those de\214ned for k).15 F -.15(ey)-.1 G +4.326(sl).15 G(ik)-4.326 E(e)-.1 E .79(Home and End.)144 240 R .791 +(Such sequences be)5.79 F .791 +(gin with a Control Sequence Indicator \(CSI\), usually ESC\255[.)-.15 F +.332(If this sequence is bound to "\\[", k)144 252 R -.15(ey)-.1 G 2.831 +(sp).15 G .331(roducing such sequences will ha)-2.831 F .631 -.15(ve n) +-.2 H 2.831(oe).15 G -.25(ff)-2.831 G .331(ect unless e).25 F(xplic-) +-.15 E .026(itly bound to a readline command, instead of inserting stra\ +y characters into the editing b)144 264 R(uf)-.2 E(fer)-.25 E 5.026(.T) +-.55 G(his)-5.026 E(is unbound by def)144 276 Q(ault, b)-.1 E +(ut usually bound to ESC\255[.)-.2 E F1(insert\255comment \(M\255#\))108 +288 Q F0 -.4(Wi)144 300 S .481(thout a numeric ar).4 F .481 +(gument, the v)-.18 F .481(alue of the readline)-.25 F F1 +(comment\255begin)2.981 E F0 -.25(va)2.981 G .48 +(riable is inserted at the).25 F(be)144 312 Q .097 +(ginning of the current line.)-.15 F .098(If a numeric ar)5.097 F .098 +(gument is supplied, this command acts as a toggle:)-.18 F(if)5.098 E +.322(the characters at the be)144 324 R .321 +(ginning of the line do not match the v)-.15 F .321(alue of)-.25 F F1 +(comment\255begin)2.821 E F0 2.821(,t)C .321(he v)-2.821 F .321(alue is) +-.25 F .831(inserted, otherwise the characters in)144 336 R F1 +(comment\255begin)3.331 E F0 .832(are deleted from the be)3.331 F .832 +(ginning of the line.)-.15 F 1.469 +(In either case, the line is accepted as if a ne)144 348 R 1.468 +(wline had been typed.)-.25 F 1.468(The def)6.468 F 1.468(ault v)-.1 F +1.468(alue of)-.25 F F1(com-)3.968 E(ment\255begin)144 360 Q F0 .839 +(causes this command to mak)3.339 F 3.339(et)-.1 G .839 +(he current line a shell comment.)-3.339 F .84(If a numeric ar)5.84 F +(gu-)-.18 E(ment causes the comment character to be remo)144 372 Q -.15 +(ve)-.15 G(d, the line will be e).15 E -.15(xe)-.15 G +(cuted by the shell.).15 E F1(glob\255complete\255w)108 384 Q +(ord \(M\255g\))-.1 E F0 .792(The w)144 396 R .791 +(ord before point is treated as a pattern for pathname e)-.1 F .791 +(xpansion, with an asterisk implicitly)-.15 F 2.5(appended. This)144 408 +R(pattern is used to generate a list of matching \214le names for possi\ +ble completions.)2.5 E F1(glob\255expand\255w)108 420 Q +(ord \(C\255x *\))-.1 E F0 .371(The w)144 432 R .372 +(ord before point is treated as a pattern for pathname e)-.1 F .372 +(xpansion, and the list of matching \214le)-.15 F .516 +(names is inserted, replacing the w)144 444 R 3.016(ord. If)-.1 F 3.016 +(an)3.016 G .516(umeric ar)-3.016 F .516 +(gument is supplied, an asterisk is appended)-.18 F(before pathname e) +144 456 Q(xpansion.)-.15 E F1(glob\255list\255expansions \(C\255x g\)) +108 468 Q F0 .923(The list of e)144 480 R .923(xpansions that w)-.15 F +.923(ould ha)-.1 F 1.223 -.15(ve b)-.2 H .923(een generated by).15 F F1 +(glob\255expand\255w)3.423 E(ord)-.1 E F0 .923(is displayed, and)3.423 F +.872(the line is redra)144 492 R 3.372(wn. If)-.15 F 3.372(an)3.372 G +.872(umeric ar)-3.372 F .872 +(gument is supplied, an asterisk is appended before pathname)-.18 F -.15 +(ex)144 504 S(pansion.).15 E F1(dump\255functions)108 516 Q F0 .626 +(Print all of the functions and their k)144 528 R .926 -.15(ey b)-.1 H +.627(indings to the readline output stream.).15 F .627(If a numeric ar) +5.627 F(gu-)-.18 E +(ment is supplied, the output is formatted in such a w)144 540 Q +(ay that it can be made part of an)-.1 E/F2 10/Times-Italic@0 SF(inputr) +2.5 E(c)-.37 E F0(\214le.)2.5 E F1(dump\255v)108 552 Q(ariables)-.1 E F0 +1.8(Print all of the settable readline v)144 564 R 1.799 +(ariables and their v)-.25 F 1.799(alues to the readline output stream.) +-.25 F 1.799(If a)6.799 F .304(numeric ar)144 576 R .304 +(gument is supplied, the output is formatted in such a w)-.18 F .304 +(ay that it can be made part of an)-.1 F F2(inputr)144 588 Q(c)-.37 E F0 +(\214le.)2.5 E F1(dump\255macr)108 600 Q(os)-.18 E F0 .593 +(Print all of the readline k)144 612 R .893 -.15(ey s)-.1 H .592 +(equences bound to macros and the strings the).15 F 3.092(yo)-.15 G +3.092(utput. If)-3.092 F 3.092(an)3.092 G(umeric)-3.092 E(ar)144 624 Q +.528(gument is supplied, the output is formatted in such a w)-.18 F .528 +(ay that it can be made part of an)-.1 F F2(inputr)3.028 E(c)-.37 E F0 +(\214le.)144 636 Q F1(display\255shell\255v)108 648 Q +(ersion \(C\255x C\255v\))-.1 E F0(Display v)144 660 Q +(ersion information about the current instance of)-.15 E F1(bash)2.5 E +F0(.)A F1(Pr)87 676.8 Q(ogrammable Completion)-.18 E F0 .147(When w)108 +688.8 R .147(ord completion is attempted for an ar)-.1 F .147 +(gument to a command for which a completion speci\214cation \(a)-.18 F +F2(compspec)108 700.8 Q F0 3.828(\)h)C 1.329 +(as been de\214ned using the)-3.828 F F1(complete)3.829 E F0 -.2(bu) +3.829 G 1.329(iltin \(see).2 F/F3 9/Times-Bold@0 SF 1.329(SHELL B)3.829 +F(UIL)-.09 E 1.329(TIN COMMANDS)-.828 F F0(belo)3.579 E 1.329(w\), the) +-.25 F(programmable completion f)108 712.8 Q(acilities are in)-.1 E -.2 +(vo)-.4 G -.1(ke).2 G(d.).1 E .498 +(First, the command name is identi\214ed.)108 729.6 R .498 +(If the command w)5.498 F .497 +(ord is the empty string \(completion attempted at)-.1 F(GNU Bash-4.1)72 +768 Q(2009 December 29)135.965 E(44)185.955 E 0 Cg EP +%%Page: 45 45 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .233(the be)108 84 R .233(ginning of an empty line\), an)-.15 F +2.733(yc)-.15 G .233(ompspec de\214ned with the)-2.733 F/F1 10 +/Times-Bold@0 SF<ad45>2.733 E F0 .233(option to)2.733 F F1(complete) +2.733 E F0 .233(is used.)2.733 F .234(If a comp-)5.234 F .481(spec has \ +been de\214ned for that command, the compspec is used to generate the l\ +ist of possible completions)108 96 R .822(for the w)108 108 R 3.322 +(ord. If)-.1 F .822(the command w)3.322 F .823(ord is a full pathname, \ +a compspec for the full pathname is searched for)-.1 F 2.867 +(\214rst. If)108 120 R .366(no compspec is found for the full pathname,\ + an attempt is made to \214nd a compspec for the portion)2.867 F(follo) +108 132 Q .421(wing the \214nal slash.)-.25 F .422 +(If those searches to not result in a compspec, an)5.421 F 2.922(yc)-.15 +G .422(ompspec de\214ned with the)-2.922 F F1<ad44>2.922 E F0(option to) +108 144 Q F1(complete)2.5 E F0(is used as the def)2.5 E(ault.)-.1 E .817 +(Once a compspec has been found, it is used to generate the list of mat\ +ching w)108 160.8 R 3.317(ords. If)-.1 F 3.317(ac)3.317 G .817 +(ompspec is not)-3.317 F(found, the def)108 172.8 Q(ault)-.1 E F1(bash) +2.5 E F0(completion as described abo)2.5 E .3 -.15(ve u)-.15 H(nder).15 +E F1(Completing)2.5 E F0(is performed.)2.5 E .463 +(First, the actions speci\214ed by the compspec are used.)108 189.6 R +.464(Only matches which are pre\214x)5.464 F .464(ed by the w)-.15 F +.464(ord being)-.1 F .596(completed are returned.)108 201.6 R .596 +(When the)5.596 F F1<ad66>3.096 E F0(or)3.095 E F1<ad64>3.095 E F0 .595 +(option is used for \214lename or directory name completion, the)3.095 F +(shell v)108 213.6 Q(ariable)-.25 E/F2 9/Times-Bold@0 SF(FIGNORE)2.5 E +F0(is used to \214lter the matches.)2.25 E(An)108 230.4 Q 4.084(yc)-.15 +G 1.584(ompletions speci\214ed by a pathname e)-4.084 F 1.584 +(xpansion pattern to the)-.15 F F1<ad47>4.084 E F0 1.584 +(option are generated ne)4.084 F 4.084(xt. The)-.15 F -.1(wo)108 242.4 S +.555(rds generated by the pattern need not match the w).1 F .554 +(ord being completed.)-.1 F(The)5.554 E F2(GLOBIGNORE)3.054 E F0 .554 +(shell v)2.804 F(ari-)-.25 E +(able is not used to \214lter the matches, b)108 254.4 Q(ut the)-.2 E F2 +(FIGNORE)2.5 E F0 -.25(va)2.25 G(riable is used.).25 E(Ne)108 271.2 Q +.32(xt, the string speci\214ed as the ar)-.15 F .32(gument to the)-.18 F +F1<ad57>2.82 E F0 .321(option is considered.)2.821 F .321 +(The string is \214rst split using the)5.321 F .413(characters in the) +108 283.2 R F2(IFS)2.913 E F0 .412(special v)2.663 F .412 +(ariable as delimiters.)-.25 F .412(Shell quoting is honored.)5.412 F +.412(Each w)5.412 F .412(ord is then e)-.1 F(xpanded)-.15 E .091 +(using brace e)108 295.2 R .091(xpansion, tilde e)-.15 F .092 +(xpansion, parameter and v)-.15 F .092(ariable e)-.25 F .092 +(xpansion, command substitution, and arith-)-.15 F 1.397(metic e)108 +307.2 R 1.396(xpansion, as described abo)-.15 F 1.696 -.15(ve u)-.15 H +(nder).15 E F2(EXP)3.896 E(ANSION)-.666 E/F3 9/Times-Roman@0 SF(.)A F0 +1.396(The results are split using the rules described)5.896 F(abo)108 +319.2 Q .509 -.15(ve u)-.15 H(nder).15 E F1 -.75(Wo)2.709 G .209 +(rd Splitting).75 F F0 5.209(.T)C .209(he results of the e)-5.209 F .209 +(xpansion are pre\214x-matched ag)-.15 F .21(ainst the w)-.05 F .21 +(ord being com-)-.1 F(pleted, and the matching w)108 331.2 Q +(ords become the possible completions.)-.1 E 1.238 +(After these matches ha)108 348 R 1.538 -.15(ve b)-.2 H 1.238 +(een generated, an).15 F 3.738(ys)-.15 G 1.237 +(hell function or command speci\214ed with the)-3.738 F F1<ad46>3.737 E +F0(and)3.737 E F1<ad43>3.737 E F0 3.375(options is in)108 360 R -.2(vo) +-.4 G -.1(ke).2 G 5.875(d. When).1 F 3.375 +(the command or function is in)5.875 F -.2(vo)-.4 G -.1(ke).2 G 3.375 +(d, the).1 F F2(COMP_LINE)5.876 E F3(,)A F2(COMP_POINT)5.626 E F3(,)A F2 +(COMP_KEY)108 372 Q F3(,)A F0(and)2.408 E F2(COMP_TYPE)2.658 E F0 -.25 +(va)2.408 G .157(riables are assigned v).25 F .157 +(alues as described abo)-.25 F .457 -.15(ve u)-.15 H(nder).15 E F1 .157 +(Shell V)2.657 F(ariables)-.92 E F0 5.157(.I)C(f)-5.157 E 3.485(as)108 +384 S .986(hell function is being in)-3.485 F -.2(vo)-.4 G -.1(ke).2 G +.986(d, the).1 F F2(COMP_W)3.486 E(ORDS)-.09 E F0(and)3.236 E F2 +(COMP_CW)3.486 E(ORD)-.09 E F0 -.25(va)3.236 G .986 +(riables are also set.).25 F(When)5.986 E .609 +(the function or command is in)108 396 R -.2(vo)-.4 G -.1(ke).2 G .608 +(d, the \214rst ar).1 F .608(gument is the name of the command whose ar) +-.18 F .608(guments are)-.18 F .073(being completed, the second ar)108 +408 R .073(gument is the w)-.18 F .073 +(ord being completed, and the third ar)-.1 F .073(gument is the w)-.18 F +.073(ord pre-)-.1 F .608(ceding the w)108 420 R .607 +(ord being completed on the current command line.)-.1 F .607 +(No \214ltering of the generated completions)5.607 F(ag)108 432 Q .093 +(ainst the w)-.05 F .093(ord being completed is performed; the function\ + or command has complete freedom in generat-)-.1 F(ing the matches.)108 +444 Q(An)108 460.8 Q 2.938(yf)-.15 G .437(unction speci\214ed with) +-2.938 F F1<ad46>2.937 E F0 .437(is in)2.937 F -.2(vo)-.4 G -.1(ke).2 G +2.937<648c>.1 G 2.937(rst. The)-2.937 F .437(function may use an)2.937 F +2.937(yo)-.15 G 2.937(ft)-2.937 G .437(he shell f)-2.937 F .437 +(acilities, including)-.1 F(the)108 472.8 Q F1(compgen)2.956 E F0 -.2 +(bu)2.956 G .456(iltin described belo).2 F 1.756 -.65(w, t)-.25 H 2.956 +(og).65 G .456(enerate the matches.)-2.956 F .457 +(It must put the possible completions in the)5.456 F F2(COMPREPL)108 +484.8 Q(Y)-.828 E F0(array v)2.25 E(ariable.)-.25 E(Ne)108 501.6 Q .081 +(xt, an)-.15 F 2.581(yc)-.15 G .081(ommand speci\214ed with the)-2.581 F +F1<ad43>2.581 E F0 .081(option is in)2.581 F -.2(vo)-.4 G -.1(ke).2 G +2.581(di).1 G 2.58(na)-2.581 G 2.58(ne)-2.58 G -.4(nv)-2.58 G .08 +(ironment equi).4 F -.25(va)-.25 G .08(lent to command sub-).25 F 2.858 +(stitution. It)108 513.6 R .359(should print a list of completions, one\ + per line, to the standard output.)2.858 F .359(Backslash may be used) +5.359 F(to escape a ne)108 525.6 Q(wline, if necessary)-.25 E(.)-.65 E +.377(After all of the possible completions are generated, an)108 542.4 R +2.877<798c>-.15 G .377(lter speci\214ed with the)-2.877 F F1<ad58>2.876 +E F0 .376(option is applied to the)2.876 F 3.181(list. The)108 554.4 R +.681(\214lter is a pattern as used for pathname e)3.181 F .681 +(xpansion; a)-.15 F F1(&)3.181 E F0 .682 +(in the pattern is replaced with the te)3.182 F .682(xt of)-.15 F .523 +(the w)108 566.4 R .523(ord being completed.)-.1 F 3.023(Al)5.523 G +(iteral)-3.023 E F1(&)3.023 E F0 .522 +(may be escaped with a backslash; the backslash is remo)3.022 F -.15(ve) +-.15 G 3.022(db).15 G(efore)-3.022 E .849(attempting a match.)108 578.4 +R(An)5.849 E 3.349(yc)-.15 G .849 +(ompletion that matches the pattern will be remo)-3.349 F -.15(ve)-.15 G +3.35(df).15 G .85(rom the list.)-3.35 F 3.35(Al)5.85 G(eading)-3.35 E F1 +(!)3.35 E F0(ne)108 590.4 Q -.05(ga)-.15 G +(tes the pattern; in this case an).05 E 2.5(yc)-.15 G +(ompletion not matching the pattern will be remo)-2.5 E -.15(ve)-.15 G +(d.).15 E(Finally)108 607.2 Q 3.087(,a)-.65 G .887 -.15(ny p)-3.087 H +.587(re\214x and suf).15 F .587(\214x speci\214ed with the)-.25 F F1 +<ad50>3.087 E F0(and)3.087 E F1<ad53>3.087 E F0 .587 +(options are added to each member of the com-)3.087 F(pletion list, and\ + the result is returned to the readline completion code as the list of \ +possible completions.)108 619.2 Q .246(If the pre)108 636 R .247 +(viously-applied actions do not generate an)-.25 F 2.747(ym)-.15 G .247 +(atches, and the)-2.747 F F1 .247(\255o dir)2.747 F(names)-.15 E F0 .247 +(option w)2.747 F .247(as supplied to)-.1 F F1(complete)108 648 Q F0 +(when the compspec w)2.5 E +(as de\214ned, directory name completion is attempted.)-.1 E .462 +(If the)108 664.8 R F1 .462(\255o plusdirs)2.962 F F0 .462(option w) +2.962 F .462(as supplied to)-.1 F F1(complete)2.962 E F0 .462 +(when the compspec w)2.962 F .462(as de\214ned, directory name com-)-.1 +F(pletion is attempted and an)108 676.8 Q 2.5(ym)-.15 G +(atches are added to the results of the other actions.)-2.5 E .559 +(By def)108 693.6 R .559(ault, if a compspec is found, whate)-.1 F -.15 +(ve)-.25 G 3.059(ri).15 G 3.059(tg)-3.059 G .56 +(enerates is returned to the completion code as the full set)-3.059 F +.632(of possible completions.)108 705.6 R .632(The def)5.632 F(ault)-.1 +E F1(bash)3.132 E F0 .631 +(completions are not attempted, and the readline def)3.131 F .631 +(ault of \214le-)-.1 F .558(name completion is disabled.)108 717.6 R +.558(If the)5.558 F F1 .559(\255o bashdefault)3.059 F F0 .559(option w) +3.059 F .559(as supplied to)-.1 F F1(complete)3.059 E F0 .559 +(when the compspec)3.059 F -.1(wa)108 729.6 S 3.172(sd).1 G .672 +(e\214ned, the)-3.172 F F1(bash)3.172 E F0(def)3.172 E .671 +(ault completions are attempted if the compspec generates no matches.) +-.1 F .671(If the)5.671 F F1<ad6f>3.171 E F0(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(45)185.955 E 0 Cg EP +%%Page: 46 46 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(default)108 84 Q F0 1.207(option w)3.706 F +1.207(as supplied to)-.1 F F1(complete)3.707 E F0 1.207 +(when the compspec w)3.707 F 1.207(as de\214ned, readline')-.1 F 3.707 +(sd)-.55 G(ef)-3.707 E 1.207(ault completion)-.1 F +(will be performed if the compspec \(and, if attempted, the def)108 96 Q +(ault)-.1 E F1(bash)2.5 E F0(completions\) generate no matches.)2.5 E +.245(When a compspec indicates that directory name completion is desire\ +d, the programmable completion func-)108 112.8 R .632(tions force readl\ +ine to append a slash to completed names which are symbolic links to di\ +rectories, subject)108 124.8 R 2.762(to the v)108 136.8 R 2.762 +(alue of the)-.25 F F1(mark\255dir)5.262 E(ectories)-.18 E F0 2.761 +(readline v)5.262 F 2.761(ariable, re)-.25 F -.05(ga)-.15 G 2.761 +(rdless of the setting of the).05 F F1(mark-sym-)5.261 E(link)108 148.8 +Q(ed\255dir)-.1 E(ectories)-.18 E F0(readline v)2.5 E(ariable.)-.25 E +.19(There is some support for dynamically modifying completions.)108 +165.6 R .191(This is most useful when used in combina-)5.191 F 1.33 +(tion with a def)108 177.6 R 1.33(ault completion speci\214ed with)-.1 F +F1 1.33(complete -D)3.83 F F0 6.33(.I)C(t')-6.33 E 3.83(sp)-.55 G 1.33 +(ossible for shell functions e)-3.83 F -.15(xe)-.15 G 1.33(cuted as).15 +F .93(completion handlers to indicate that completion should be retried\ + by returning an e)108 189.6 R .93(xit status of 124.)-.15 F .93(If a) +5.93 F .1(shell function returns 124, and changes the compspec associat\ +ed with the command on which completion is)108 201.6 R .665 +(being attempted \(supplied as the \214rst ar)108 213.6 R .666 +(gument when the function is e)-.18 F -.15(xe)-.15 G .666 +(cuted\), programmable completion).15 F 1.139(restarts from the be)108 +225.6 R 1.139 +(ginning, with an attempt to \214nd a compspec for that command.)-.15 F +1.139(This allo)6.139 F 1.138(ws a set of)-.25 F(completions to be b)108 +237.6 Q(uilt dynamically as completion is attempted, rather than being \ +loaded all at once.)-.2 E -.15(Fo)108 254.4 S 2.636(ri).15 G .137 +(nstance, assuming that there is a library of compspecs, each k)-2.636 F +.137(ept in a \214le corresponding to the name of)-.1 F +(the command, the follo)108 266.4 Q(wing def)-.25 E +(ault completion function w)-.1 E(ould load completions dynamically:)-.1 +E/F2 10/Courier@0 SF(_completion_loader\(\))108 283.2 Q({)108 295.2 Q 6 +(.")144 307.2 S +(/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124)-6 E(})108 +319.2 Q(complete -D -F _completion_loader)108 331.2 Q/F3 10.95 +/Times-Bold@0 SF(HIST)72 360 Q(OR)-.197 E(Y)-.383 E F0 .372(When the)108 +372 R F1 .372(\255o history)2.872 F F0 .372(option to the)2.872 F F1 +(set)2.872 E F0 -.2(bu)2.872 G .372(iltin is enabled, the shell pro).2 F +.371(vides access to the)-.15 F/F4 10/Times-Italic@0 SF .371 +(command history)2.871 F F0(,)A .304(the list of commands pre)108 384 R +.304(viously typed.)-.25 F .304(The v)5.304 F .304(alue of the)-.25 F/F5 +9/Times-Bold@0 SF(HISTSIZE)2.804 E F0 -.25(va)2.554 G .305 +(riable is used as the number of com-).25 F .43(mands to sa)108 396 R +.73 -.15(ve i)-.2 H 2.93(nah).15 G .43(istory list.)-2.93 F .43(The te) +5.43 F .429(xt of the last)-.15 F F5(HISTSIZE)2.929 E F0 .429 +(commands \(def)2.679 F .429(ault 500\) is sa)-.1 F -.15(ve)-.2 G 2.929 +(d. The).15 F(shell)2.929 E .287 +(stores each command in the history list prior to parameter and v)108 +408 R .287(ariable e)-.25 F .287(xpansion \(see)-.15 F F5(EXP)2.787 E +(ANSION)-.666 E F0(abo)2.537 E -.15(ve)-.15 G(\)).15 E -.2(bu)108 420 S +4.066(ta).2 G 1.565(fter history e)-4.066 F 1.565 +(xpansion is performed, subject to the v)-.15 F 1.565 +(alues of the shell v)-.25 F(ariables)-.25 E F5(HISTIGNORE)4.065 E F0 +(and)3.815 E F5(HISTCONTR)108 432 Q(OL)-.27 E/F6 9/Times-Roman@0 SF(.)A +F0 .082 +(On startup, the history is initialized from the \214le named by the v) +108 448.8 R(ariable)-.25 E F5(HISTFILE)2.583 E F0(\(def)2.333 E(ault)-.1 +E F4(~/.bash_history)2.583 E F0(\).)A .315(The \214le named by the v)108 +460.8 R .315(alue of)-.25 F F5(HISTFILE)2.815 E F0 .315 +(is truncated, if necessary)2.565 F 2.815(,t)-.65 G 2.815(oc)-2.815 G +.315(ontain no more than the number of)-2.815 F .532 +(lines speci\214ed by the v)108 472.8 R .532(alue of)-.25 F F5 +(HISTFILESIZE)3.032 E F6(.)A F0 .532 +(When the history \214le is read, lines be)5.032 F .532 +(ginning with the his-)-.15 F 1.159(tory comment character follo)108 +484.8 R 1.158(wed immediately by a digit are interpreted as timestamps \ +for the preceding)-.25 F .052(history line.)108 496.8 R .053 +(These timestamps are optionally displayed depending on the v)5.052 F +.053(alue of the)-.25 F F5(HISTTIMEFORMA)2.553 E(T)-.855 E F0 -.25(va) +108 508.8 S 4.387(riable. When).25 F 1.887(an interacti)4.387 F 2.187 +-.15(ve s)-.25 H 1.887(hell e).15 F 1.887(xits, the last)-.15 F F5 +($HISTSIZE)4.387 E F0 1.887(lines are copied from the history list to) +4.137 F F5($HISTFILE)108 520.8 Q F6(.)A F0 .056(If the)4.556 F F1 +(histappend)2.556 E F0 .056 +(shell option is enabled \(see the description of)2.556 F F1(shopt)2.556 +E F0(under)2.556 E F5 .056(SHELL B)2.556 F(UIL)-.09 E(TIN)-.828 E +(COMMANDS)108 532.8 Q F0(belo)2.672 E .422(w\), the lines are appended \ +to the history \214le, otherwise the history \214le is o)-.25 F -.15(ve) +-.15 G 2.921(rwritten. If).15 F F5(HISTFILE)108 544.8 Q F0 .435(is unse\ +t, or if the history \214le is unwritable, the history is not sa)2.684 F +-.15(ve)-.2 G 2.935(d. If).15 F(the)2.935 E F5(HISTTIMEFORMA)2.935 E(T) +-.855 E F0 -.25(va)108 556.8 S .917 +(riable is set, time stamps are written to the history \214le, mark).25 +F .916(ed with the history comment character)-.1 F 3.416(,s)-.4 G(o) +-3.416 E(the)108 568.8 Q 3.082(ym)-.15 G .582(ay be preserv)-3.082 F +.582(ed across shell sessions.)-.15 F .583 +(This uses the history comment character to distinguish time-)5.583 F +.987(stamps from other history lines.)108 580.8 R .987(After sa)5.987 F +.987(ving the history)-.2 F 3.486(,t)-.65 G .986 +(he history \214le is truncated to contain no more)-3.486 F(than)108 +592.8 Q F5(HISTFILESIZE)2.5 E F0 2.5(lines. If)2.25 F F5(HISTFILESIZE) +2.5 E F0(is not set, no truncation is performed.)2.25 E 1.293(The b)108 +609.6 R 1.293(uiltin command)-.2 F F1(fc)3.793 E F0(\(see)3.793 E F5 +1.293(SHELL B)3.793 F(UIL)-.09 E 1.293(TIN COMMANDS)-.828 F F0(belo) +3.543 E 1.294(w\) may be used to list or edit and re-)-.25 F -.15(exe) +108 621.6 S .674(cute a portion of the history list.).15 F(The)5.673 E +F1(history)3.173 E F0 -.2(bu)3.173 G .673 +(iltin may be used to display or modify the history list).2 F .279 +(and manipulate the history \214le.)108 633.6 R .279 +(When using command-line editing, search commands are a)5.279 F -.25(va) +-.2 G .28(ilable in each).25 F(editing mode that pro)108 645.6 Q +(vide access to the history list.)-.15 E 1.486(The shell allo)108 662.4 +R 1.486(ws control o)-.25 F -.15(ve)-.15 G 3.986(rw).15 G 1.486 +(hich commands are sa)-3.986 F -.15(ve)-.2 G 3.986(do).15 G 3.986(nt) +-3.986 G 1.486(he history list.)-3.986 F(The)6.485 E F5(HISTCONTR)3.985 +E(OL)-.27 E F0(and)3.735 E F5(HISTIGNORE)108 674.4 Q F0 -.25(va)2.707 G +.457(riables may be set to cause the shell to sa).25 F .758 -.15(ve o) +-.2 H .458(nly a subset of the commands entered.).15 F(The)5.458 E F1 +(cmdhist)108 686.4 Q F0 .75 +(shell option, if enabled, causes the shell to attempt to sa)3.25 F 1.05 +-.15(ve e)-.2 H .75(ach line of a multi-line command in).15 F 1.077 +(the same history entry)108 698.4 R 3.577(,a)-.65 G 1.077 +(dding semicolons where necessary to preserv)-3.577 F 3.577(es)-.15 G +1.077(yntactic correctness.)-3.577 F(The)6.077 E F1(lithist)3.577 E F0 +.374(shell option causes the shell to sa)108 710.4 R .674 -.15(ve t)-.2 +H .374(he command with embedded ne).15 F .373 +(wlines instead of semicolons.)-.25 F .373(See the)5.373 F .318 +(description of the)108 722.4 R F1(shopt)2.818 E F0 -.2(bu)2.818 G .318 +(iltin belo).2 F 2.818(wu)-.25 G(nder)-2.818 E F5 .318(SHELL B)2.818 F +(UIL)-.09 E .318(TIN COMMANDS)-.828 F F0 .319 +(for information on setting and)2.568 F(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(46)185.955 E 0 Cg EP +%%Page: 47 47 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(unsetting shell options.)108 84 Q/F1 10.95/Times-Bold@0 SF(HIST) +72 100.8 Q(OR)-.197 E 2.738(YE)-.383 G(XP)-2.738 E(ANSION)-.81 E F0 .611 +(The shell supports a history e)108 112.8 R .611 +(xpansion feature that is similar to the history e)-.15 F .61 +(xpansion in)-.15 F/F2 10/Times-Bold@0 SF(csh.)3.11 E F0 .61 +(This section)5.61 F .87(describes what syntax features are a)108 124.8 +R -.25(va)-.2 G 3.371(ilable. This).25 F .871(feature is enabled by def) +3.371 F .871(ault for interacti)-.1 F 1.171 -.15(ve s)-.25 H .871 +(hells, and).15 F 2.014(can be disabled using the)108 136.8 R F2(+H) +4.514 E F0 2.014(option to the)4.514 F F2(set)4.514 E F0 -.2(bu)4.514 G +2.014(iltin command \(see).2 F/F3 9/Times-Bold@0 SF 2.013(SHELL B)4.513 +F(UIL)-.09 E 2.013(TIN COMMANDS)-.828 F F0(belo)108 148.8 Q 2.5 +(w\). Non-interacti)-.25 F .3 -.15(ve s)-.25 H +(hells do not perform history e).15 E(xpansion by def)-.15 E(ault.)-.1 E +1.305(History e)108 165.6 R 1.305(xpansions introduce w)-.15 F 1.306(or\ +ds from the history list into the input stream, making it easy to repea\ +t)-.1 F .21(commands, insert the ar)108 177.6 R .21(guments to a pre) +-.18 F .209 +(vious command into the current input line, or \214x errors in pre)-.25 +F(vious)-.25 E(commands quickly)108 189.6 Q(.)-.65 E 1.163(History e)108 +206.4 R 1.163(xpansion is performed immediately after a complete line i\ +s read, before the shell breaks it into)-.15 F -.1(wo)108 218.4 S 3.2 +(rds. It).1 F(tak)3.2 E .7(es place in tw)-.1 F 3.2(op)-.1 G 3.2 +(arts. The)-3.2 F .7 +(\214rst is to determine which line from the history list to use during) +3.2 F 4.367(substitution. The)108 230.4 R 1.868(second is to select por\ +tions of that line for inclusion into the current one.)4.367 F 1.868 +(The line)6.868 F .663(selected from the history is the)108 242.4 R/F4 +10/Times-Italic@0 SF -.15(ev)3.163 G(ent).15 E F0 3.163(,a)C .663 +(nd the portions of that line that are acted upon are)-3.163 F F4(wor) +3.162 E(ds)-.37 E F0 5.662(.V)C(arious)-6.772 E F4(modi\214er)108 254.4 +Q(s)-.1 E F0 .226(are a)2.726 F -.25(va)-.2 G .226 +(ilable to manipulate the selected w).25 F 2.726(ords. The)-.1 F .227 +(line is brok)2.726 F .227(en into w)-.1 F .227(ords in the same f)-.1 F +(ashion)-.1 E .352(as when reading input, so that se)108 266.4 R -.15 +(ve)-.25 G(ral).15 E F4(metac)2.852 E(har)-.15 E(acter)-.15 E F0 .351 +(-separated w)B .351(ords surrounded by quotes are considered)-.1 F .624 +(one w)108 278.4 R 3.124(ord. History)-.1 F -.15(ex)3.124 G .624 +(pansions are introduced by the appearance of the history e).15 F .625 +(xpansion character)-.15 F 3.125(,w)-.4 G(hich)-3.125 E(is)108 290.4 Q +F2(!)3.333 E F0(by def)3.333 E 2.5(ault. Only)-.1 F(backslash \()2.5 E +F2(\\).833 E F0 2.5(\)a).833 G(nd single quotes can quote the history e) +-2.5 E(xpansion character)-.15 E(.)-.55 E(Se)108 307.2 Q -.15(ve)-.25 G +.03(ral characters inhibit history e).15 F .03 +(xpansion if found immediately follo)-.15 F .03(wing the history e)-.25 +F .03(xpansion character)-.15 F(,)-.4 E -2.15 -.25(ev e)108 319.2 T +3.162(ni).25 G 3.162(fi)-3.162 G 3.162(ti)-3.162 G 3.162(su)-3.162 G +.662(nquoted: space, tab, ne)-3.162 F .662(wline, carriage return, and) +-.25 F F2(=)3.162 E F0 5.662(.I)C 3.162(ft)-5.662 G(he)-3.162 E F2 +(extglob)3.162 E F0 .662(shell option is enabled,)3.162 F F2(\()3.163 E +F0(will also inhibit e)108 331.2 Q(xpansion.)-.15 E(Se)108 348 Q -.15 +(ve)-.25 G .11(ral shell options settable with the).15 F F2(shopt)2.61 E +F0 -.2(bu)2.61 G .109(iltin may be used to tailor the beha).2 F .109 +(vior of history e)-.2 F(xpansion.)-.15 E 1.142(If the)108 360 R F2 +(histv)3.643 E(erify)-.1 E F0 1.143 +(shell option is enabled \(see the description of the)3.643 F F2(shopt) +3.643 E F0 -.2(bu)3.643 G 1.143(iltin belo).2 F 1.143(w\), and)-.25 F F2 +-.18(re)3.643 G(adline).18 E F0(is)3.643 E .461(being used, history sub\ +stitutions are not immediately passed to the shell parser)108 372 R 5.46 +(.I)-.55 G .46(nstead, the e)-5.46 F .46(xpanded line)-.15 F 1.515 +(is reloaded into the)108 384 R F2 -.18(re)4.015 G(adline).18 E F0 1.515 +(editing b)4.015 F(uf)-.2 E 1.516(fer for further modi\214cation.)-.25 F +(If)6.516 E F2 -.18(re)4.016 G(adline).18 E F0 1.516 +(is being used, and the)4.016 F F2(histr)108 396 Q(eedit)-.18 E F0 1.202 +(shell option is enabled, a f)3.702 F 1.202 +(ailed history substitution will be reloaded into the)-.1 F F2 -.18(re) +3.702 G(adline).18 E F0(editing)3.702 E -.2(bu)108 408 S -.25(ff).2 G +1.16(er for correction.).25 F(The)6.16 E F2<ad70>3.66 E F0 1.16 +(option to the)3.66 F F2(history)3.66 E F0 -.2(bu)3.661 G 1.161 +(iltin command may be used to see what a history).2 F -.15(ex)108 420 S +.056(pansion will do before using it.).15 F(The)5.056 E F2<ad73>2.556 E +F0 .056(option to the)2.556 F F2(history)2.555 E F0 -.2(bu)2.555 G .055 +(iltin may be used to add commands to the).2 F +(end of the history list without actually e)108 432 Q -.15(xe)-.15 G +(cuting them, so that the).15 E 2.5(ya)-.15 G(re a)-2.5 E -.25(va)-.2 G +(ilable for subsequent recall.).25 E 2.2(The shell allo)108 448.8 R 2.2 +(ws control of the v)-.25 F 2.2(arious characters used by the history e) +-.25 F 2.2(xpansion mechanism \(see the)-.15 F 1.147(description of)108 +460.8 R F2(histchars)3.647 E F0(abo)3.647 E 1.447 -.15(ve u)-.15 H(nder) +.15 E F2 1.147(Shell V)3.647 F(ariables)-.92 E F0 3.646(\). The)B 1.146 +(shell uses the history comment character to)3.646 F +(mark history timestamps when writing the history \214le.)108 472.8 Q F2 +(Ev)87 489.6 Q(ent Designators)-.1 E F0(An e)108 501.6 Q -.15(ve)-.25 G +(nt designator is a reference to a command line entry in the history li\ +st.).15 E F2(!)108 518.4 Q F0 1.607(Start a history substitution, e) +32.67 F 1.607(xcept when follo)-.15 F 1.607(wed by a)-.25 F F2(blank) +4.107 E F0 4.107(,n)C -.25(ew)-4.107 G 1.608 +(line, carriage return, = or \().25 F(\(when the)144 530.4 Q F2(extglob) +2.5 E F0(shell option is enabled using the)2.5 E F2(shopt)2.5 E F0 -.2 +(bu)2.5 G(iltin\).).2 E F2(!)108 542.4 Q F4(n)A F0 +(Refer to command line)27.67 E F4(n)2.5 E F0(.).24 E F2<21ad>108 554.4 Q +F4(n)A F0(Refer to the current command line minus)21.97 E F4(n)2.5 E F0 +(.).24 E F2(!!)108 566.4 Q F0(Refer to the pre)29.34 E(vious command.) +-.25 E(This is a synon)5 E(ym for `!\2551'.)-.15 E F2(!)108 578.4 Q F4 +(string)A F0(Refer to the most recent command starting with)9.33 E F4 +(string)2.5 E F0(.).22 E F2(!?)108 590.4 Q F4(string)A F2([?])A F0 1.022 +(Refer to the most recent command containing)144 602.4 R F4(string)3.522 +E F0 6.022(.T).22 G 1.022(he trailing)-6.022 F F2(?)3.522 E F0 1.022 +(may be omitted if)3.522 F F4(string)3.861 E F0(is)3.741 E(follo)144 +614.4 Q(wed immediately by a ne)-.25 E(wline.)-.25 E/F5 12/Times-Bold@0 +SF(^)108 631.4 Q F4(string1)-5 I F5(^)5 I F4(string2)-5 I F5(^)5 I F0 +2.629(Quick substitution.)144 638.4 R 2.629 +(Repeat the last command, replacing)7.629 F F4(string1)5.469 E F0(with) +5.129 E F4(string2)5.129 E F0 7.629(.E).02 G(qui)-7.629 E -.25(va)-.25 G +2.63(lent to).25 F -.74(``)144 650.4 S(!!:s/).74 E F4(string1)A F0(/)A +F4(string2)A F0(/')A 2.5('\()-.74 G(see)-2.5 E F2(Modi\214ers)2.5 E F0 +(belo)2.5 E(w\).)-.25 E F2(!#)108 662.4 Q F0 +(The entire command line typed so f)27.67 E(ar)-.1 E(.)-.55 E F2 -.75 +(Wo)87 679.2 S(rd Designators).75 E F0 -.8(Wo)108 691.2 S 1.314 +(rd designators are used to select desired w).8 F 1.314(ords from the e) +-.1 F -.15(ve)-.25 G 3.814(nt. A).15 F F2(:)3.814 E F0 1.313 +(separates the e)3.813 F -.15(ve)-.25 G 1.313(nt speci\214cation).15 F +.529(from the w)108 703.2 R .529(ord designator)-.1 F 5.529(.I)-.55 G +3.029(tm)-5.529 G .529(ay be omitted if the w)-3.029 F .529 +(ord designator be)-.1 F .529(gins with a)-.15 F F2(^)3.029 E F0(,)A F2 +($)3.029 E F0(,)A F2(*)3.029 E F0(,)A F2<ad>3.029 E F0 3.029(,o)C(r) +-3.029 E F2(%)3.029 E F0 5.53(.W)C(ords)-6.33 E 1.301 +(are numbered from the be)108 715.2 R 1.301 +(ginning of the line, with the \214rst w)-.15 F 1.3 +(ord being denoted by 0 \(zero\).)-.1 F -.8(Wo)6.3 G 1.3(rds are).8 F +(inserted into the current line separated by single spaces.)108 727.2 Q +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(47)185.955 E 0 Cg EP +%%Page: 48 48 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF 2.5(0\()108 84 S(zer)-2.5 E(o\))-.18 E F0 +(The zeroth w)144 96 Q 2.5(ord. F)-.1 F +(or the shell, this is the command w)-.15 E(ord.)-.1 E/F2 10 +/Times-Italic@0 SF(n)108.36 108 Q F0(The)30.64 E F2(n)2.5 E F0(th w)A +(ord.)-.1 E F1(^)108 120 Q F0(The \214rst ar)32.67 E 2.5(gument. That) +-.18 F(is, w)2.5 E(ord 1.)-.1 E F1($)108 132 Q F0(The last ar)31 E +(gument.)-.18 E F1(%)108 144 Q F0(The w)26 E +(ord matched by the most recent `?)-.1 E F2(string)A F0(?' search.)A F2 +(x)108.77 156 Q F1<ad>A F2(y)A F0 2.5(Ar)20.65 G(ange of w)-2.5 E +(ords; `\255)-.1 E F2(y)A F0 2.5('a)C(bbre)-2.5 E(viates `0\255)-.25 E +F2(y)A F0('.)A F1(*)108 168 Q F0 .315(All of the w)31 F .315(ords b)-.1 +F .315(ut the zeroth.)-.2 F .315(This is a synon)5.315 F .315(ym for `) +-.15 F F2(1\255$)A F0 2.815('. It)B .315(is not an error to use)2.815 F +F1(*)2.816 E F0 .316(if there is)2.816 F(just one w)144 180 Q +(ord in the e)-.1 E -.15(ve)-.25 G +(nt; the empty string is returned in that case.).15 E F1(x*)108 192 Q F0 +(Abbre)26 E(viates)-.25 E F2(x\255$)2.5 E F0(.)A F1<78ad>108 204 Q F0 +(Abbre)25.3 E(viates)-.25 E F2(x\255$)2.5 E F0(lik)2.5 E(e)-.1 E F1(x*) +2.5 E F0 2.5(,b)C(ut omits the last w)-2.7 E(ord.)-.1 E(If a w)108 220.8 +Q(ord designator is supplied without an e)-.1 E -.15(ve)-.25 G +(nt speci\214cation, the pre).15 E(vious command is used as the e)-.25 E +-.15(ve)-.25 G(nt.).15 E F1(Modi\214ers)87 237.6 Q F0 .184 +(After the optional w)108 249.6 R .184(ord designator)-.1 F 2.684(,t)-.4 +G .183(here may appear a sequence of one or more of the follo)-2.684 F +.183(wing modi\214ers,)-.25 F(each preceded by a `:'.)108 261.6 Q F1(h) +108 278.4 Q F0(Remo)30.44 E .3 -.15(ve a t)-.15 H +(railing \214le name component, lea).15 E(ving only the head.)-.2 E F1 +(t)108 290.4 Q F0(Remo)32.67 E .3 -.15(ve a)-.15 H +(ll leading \214le name components, lea).15 E(ving the tail.)-.2 E F1(r) +108 302.4 Q F0(Remo)31.56 E .3 -.15(ve a t)-.15 H(railing suf).15 E +(\214x of the form)-.25 E F2(.xxx)2.5 E F0 2.5(,l)C(ea)-2.5 E +(ving the basename.)-.2 E F1(e)108 314.4 Q F0(Remo)31.56 E .3 -.15(ve a) +-.15 H(ll b).15 E(ut the trailing suf)-.2 E(\214x.)-.25 E F1(p)108 326.4 +Q F0(Print the ne)30.44 E 2.5(wc)-.25 G(ommand b)-2.5 E(ut do not e)-.2 +E -.15(xe)-.15 G(cute it.).15 E F1(q)108 338.4 Q F0 +(Quote the substituted w)30.44 E(ords, escaping further substitutions.) +-.1 E F1(x)108 350.4 Q F0(Quote the substituted w)31 E(ords as with)-.1 +E F1(q)2.5 E F0 2.5(,b)C(ut break into w)-2.7 E(ords at)-.1 E F1(blanks) +2.5 E F0(and ne)2.5 E(wlines.)-.25 E F1(s/)108 362.4 Q F2(old)A F1(/)A +F2(ne)A(w)-.15 E F1(/)A F0(Substitute)144 374.4 Q F2(ne)3.081 E(w)-.15 E +F0 .221(for the \214rst occurrence of)3.031 F F2(old)2.951 E F0 .221 +(in the e)3.491 F -.15(ve)-.25 G .221(nt line.).15 F(An)5.221 E 2.721 +(yd)-.15 G .221(elimiter can be used in place)-2.721 F .617(of /.)144 +386.4 R .617 +(The \214nal delimiter is optional if it is the last character of the e) +5.617 F -.15(ve)-.25 G .617(nt line.).15 F .616(The delimiter may)5.616 +F .666(be quoted in)144 398.4 R F2(old)3.396 E F0(and)3.936 E F2(ne) +3.526 E(w)-.15 E F0 .666(with a single backslash.)3.476 F .666 +(If & appears in)5.666 F F2(ne)3.166 E(w)-.15 E F0 3.166(,i).31 G 3.166 +(ti)-3.166 G 3.166(sr)-3.166 G .666(eplaced by)-3.166 F F2(old)3.166 E +F0 5.666(.A).77 G .275(single backslash will quote the &.)144 410.4 R +(If)5.275 E F2(old)3.004 E F0 .274(is null, it is set to the last)3.544 +F F2(old)3.004 E F0 .274(substituted, or)3.544 F 2.774(,i)-.4 G 2.774 +(fn)-2.774 G 2.774(op)-2.774 G(re)-2.774 E(vi-)-.25 E +(ous history substitutions took place, the last)144 422.4 Q F2(string) +2.84 E F0(in a)2.72 E F1(!?)2.5 E F2(string)A F1([?])A F0(search.)5 E F1 +(&)108 434.4 Q F0(Repeat the pre)27.67 E(vious substitution.)-.25 E F1 +(g)108 446.4 Q F0 .397(Cause changes to be applied o)31 F -.15(ve)-.15 G +2.897(rt).15 G .398(he entire e)-2.897 F -.15(ve)-.25 G .398(nt line.) +.15 F .398(This is used in conjunction with `)5.398 F F1(:s)A F0 2.898 +('\()C(e.g.,)-2.898 E(`)144 458.4 Q F1(:gs/)A F2(old)A F1(/)A F2(ne)A(w) +-.15 E F1(/)A F0 1.219('\) or `)B F1(:&)A F0 3.719('. If)B 1.219 +(used with `)3.719 F F1(:s)A F0 1.218(', an)B 3.718(yd)-.15 G 1.218 +(elimiter can be used in place of /, and the \214nal)-3.718 F .089 +(delimiter is optional if it is the last character of the e)144 470.4 R +-.15(ve)-.25 G .09(nt line.).15 F(An)5.09 E F1(a)2.59 E F0 .09 +(may be used as a synon)2.59 F .09(ym for)-.15 F F1(g)144 482.4 Q F0(.)A +F1(G)108 494.4 Q F0(Apply the follo)28.22 E(wing `)-.25 E F1(s)A F0 2.5 +('m)C(odi\214er once to each w)-2.5 E(ord in the e)-.1 E -.15(ve)-.25 G +(nt line.).15 E/F3 10.95/Times-Bold@0 SF(SHELL B)72 511.2 Q(UIL)-.11 E +(TIN COMMANDS)-1.007 E F0 .063(Unless otherwise noted, each b)108 523.2 +R .062(uiltin command documented in this section as accepting options p\ +receded by)-.2 F F1<ad>108 535.2 Q F0(accepts)2.533 E F1<adad>2.533 E F0 +.034(to signify the end of the options.)2.533 F(The)5.034 E F1(:)2.534 E +F0(,)A F1(true)2.534 E F0(,)A F1(false)2.534 E F0 2.534(,a)C(nd)-2.534 E +F1(test)2.534 E F0 -.2(bu)2.534 G .034(iltins do not accept options and) +.2 F .078(do not treat)108 547.2 R F1<adad>2.577 E F0(specially)2.577 E +5.077(.T)-.65 G(he)-5.077 E F1(exit)2.577 E F0(,)A F1(logout)2.577 E F0 +(,)A F1(br)2.577 E(eak)-.18 E F0(,)A F1(continue)2.577 E F0(,)A F1(let) +2.577 E F0 2.577(,a)C(nd)-2.577 E F1(shift)2.577 E F0 -.2(bu)2.577 G +.077(iltins accept and process ar).2 F(gu-)-.18 E .319(ments be)108 +559.2 R .319(ginning with)-.15 F F1<ad>2.819 E F0 .319 +(without requiring)2.819 F F1<adad>2.819 E F0 5.319(.O)C .319(ther b) +-5.319 F .319(uiltins that accept ar)-.2 F .32(guments b)-.18 F .32 +(ut are not speci\214ed as)-.2 F 1.144(accepting options interpret ar) +108 571.2 R 1.144(guments be)-.18 F 1.144(ginning with)-.15 F F1<ad> +3.643 E F0 1.143(as in)3.643 F -.25(va)-.4 G 1.143 +(lid options and require).25 F F1<adad>3.643 E F0 1.143(to pre)3.643 F +-.15(ve)-.25 G 1.143(nt this).15 F(interpretation.)108 583.2 Q F1(:)108 +601.2 Q F0([)2.5 E F2(ar)A(guments)-.37 E F0(])A .451(No ef)144 613.2 R +.451(fect; the command does nothing be)-.25 F .452(yond e)-.15 F +(xpanding)-.15 E F2(ar)3.282 E(guments)-.37 E F0 .452(and performing an) +3.222 F 2.952(ys)-.15 G(peci\214ed)-2.952 E 2.5(redirections. A)144 +625.2 R(zero e)2.5 E(xit code is returned.)-.15 E F1(.)110.5 642 Q F2 +(\214lename)6.666 E F0([)2.5 E F2(ar)A(guments)-.37 E F0(])A F1(sour)108 +654 Q(ce)-.18 E F2(\214lename)2.5 E F0([)2.5 E F2(ar)A(guments)-.37 E F0 +(])A 1.02(Read and e)144 666 R -.15(xe)-.15 G 1.02(cute commands from) +.15 F F2(\214lename)5.43 E F0 1.02(in the current shell en)3.7 F 1.02 +(vironment and return the e)-.4 F(xit)-.15 E 1.68 +(status of the last command e)144 678 R -.15(xe)-.15 G 1.68(cuted from) +.15 F F2(\214lename)4.18 E F0 6.68(.I).18 G(f)-6.68 E F2(\214lename)6.09 +E F0 1.68(does not contain a slash, \214le)4.36 F .608(names in)144 690 +R/F4 9/Times-Bold@0 SF -.666(PA)3.108 G(TH)-.189 E F0 .608 +(are used to \214nd the directory containing)2.858 F F2(\214lename)3.108 +E F0 5.608(.T).18 G .608(he \214le searched for in)-5.608 F F4 -.666(PA) +3.108 G(TH)-.189 E F0 .832(need not be e)144 702 R -.15(xe)-.15 G 3.332 +(cutable. When).15 F F1(bash)3.332 E F0 .832(is not in)3.332 F F2 .832 +(posix mode)3.332 F F0 3.332(,t)C .833 +(he current directory is searched if no)-3.332 F .982 +(\214le is found in)144 714 R F4 -.666(PA)3.481 G(TH)-.189 E/F5 9 +/Times-Roman@0 SF(.)A F0 .981(If the)5.481 F F1(sour)3.481 E(cepath)-.18 +E F0 .981(option to the)3.481 F F1(shopt)3.481 E F0 -.2(bu)3.481 G .981 +(iltin command is turned of).2 F .981(f, the)-.25 F F4 -.666(PA)144 726 +S(TH)-.189 E F0 .112(is not searched.)2.362 F .112(If an)5.112 F(y)-.15 +E F2(ar)2.612 E(guments)-.37 E F0 .112(are supplied, the)2.612 F 2.612 +(yb)-.15 G .112(ecome the positional parameters when)-2.612 F +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(48)185.955 E 0 Cg EP +%%Page: 49 49 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Italic@0 SF(\214lename)144 84 Q F0 .342(is e)2.842 F +-.15(xe)-.15 G 2.842(cuted. Otherwise).15 F .342 +(the positional parameters are unchanged.)2.842 F .341 +(The return status is the)5.341 F .716(status of the last command e)144 +96 R .716(xited within the script \(0 if no commands are e)-.15 F -.15 +(xe)-.15 G .716(cuted\), and f).15 F .716(alse if)-.1 F F1(\214lename) +145.91 108 Q F0(is not found or cannot be read.)2.68 E/F2 10 +/Times-Bold@0 SF(alias)108 124.8 Q F0([)2.5 E F2<ad70>A F0 2.5(][)C F1 +(name)-2.5 E F0([=)A F1(value)A F0 2.5(].)C(..])-2.5 E F2(Alias)144 +136.8 Q F0 2.725(with no ar)5.225 F 2.724(guments or with the)-.18 F F2 +<ad70>5.224 E F0 2.724(option prints the list of aliases in the form) +5.224 F F2(alias)5.224 E F1(name)144 148.8 Q F0(=)A F1(value)A F0 .58 +(on standard output.)3.08 F .58(When ar)5.58 F .58 +(guments are supplied, an alias is de\214ned for each)-.18 F F1(name) +3.08 E F0(whose)144 160.8 Q F1(value)2.895 E F0 .395(is gi)2.895 F -.15 +(ve)-.25 G 2.895(n. A).15 F .395(trailing space in)2.895 F F1(value) +5.395 E F0 .395(causes the ne)2.895 F .395(xt w)-.15 F .395 +(ord to be check)-.1 F .395(ed for alias sub-)-.1 F .054 +(stitution when the alias is e)144 172.8 R 2.554(xpanded. F)-.15 F .054 +(or each)-.15 F F1(name)2.554 E F0 .054(in the ar)2.554 F .054 +(gument list for which no)-.18 F F1(value)2.554 E F0 .054(is sup-)2.554 +F 1.314(plied, the name and v)144 184.8 R 1.314 +(alue of the alias is printed.)-.25 F F2(Alias)6.314 E F0 1.314 +(returns true unless a)3.814 F F1(name)3.814 E F0 1.313(is gi)3.814 F +-.15(ve)-.25 G 3.813(nf).15 G(or)-3.813 E +(which no alias has been de\214ned.)144 196.8 Q F2(bg)108 213.6 Q F0([) +2.5 E F1(jobspec)A F0(...])2.5 E .744(Resume each suspended job)144 +225.6 R F1(jobspec)3.244 E F0 .745 +(in the background, as if it had been started with)3.244 F F2(&)3.245 E +F0 5.745(.I)C(f)-5.745 E F1(job-)4.985 E(spec)144 237.6 Q F0 .672 +(is not present, the shell')3.482 F 3.172(sn)-.55 G .672(otion of the) +-3.172 F F1(curr)3.172 E .672(ent job)-.37 F F0 .672(is used.)3.172 F F2 +(bg)5.671 E F1(jobspec)4.911 E F0 .671(returns 0 unless run)3.481 F .418 +(when job control is disabled or)144 249.6 R 2.919(,w)-.4 G .419 +(hen run with job control enabled, an)-2.919 F 2.919(ys)-.15 G +(peci\214ed)-2.919 E F1(jobspec)2.919 E F0 -.1(wa)2.919 G 2.919(sn).1 G +(ot)-2.919 E(found or w)144 261.6 Q(as started without job control.)-.1 +E F2(bind)108 278.4 Q F0([)2.5 E F2<ad6d>A F1 -.1(ke)2.5 G(ymap)-.2 E F0 +2.5(][)C F2(\255lpsvPSV)-2.5 E F0(])A F2(bind)108 290.4 Q F0([)2.5 E F2 +<ad6d>A F1 -.1(ke)2.5 G(ymap)-.2 E F0 2.5(][)C F2<ad71>-2.5 E F1 +(function)2.5 E F0 2.5(][)C F2<ad75>-2.5 E F1(function)2.5 E F0 2.5(][)C +F2<ad72>-2.5 E F1 -.1(ke)2.5 G(yseq)-.2 E F0(])A F2(bind)108 302.4 Q F0 +([)2.5 E F2<ad6d>A F1 -.1(ke)2.5 G(ymap)-.2 E F0(])A F2<ad66>2.5 E F1 +(\214lename)2.5 E F2(bind)108 314.4 Q F0([)2.5 E F2<ad6d>A F1 -.1(ke)2.5 +G(ymap)-.2 E F0(])A F2<ad78>2.5 E F1 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F1 +(shell\255command)A F2(bind)108 326.4 Q F0([)2.5 E F2<ad6d>A F1 -.1(ke) +2.5 G(ymap)-.2 E F0(])A F1 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F1 +(function\255name)A F2(bind)108 338.4 Q F1 -.37(re)2.5 G +(adline\255command).37 E F0 .239(Display current)144 350.4 R F2 -.18(re) +2.739 G(adline).18 E F0 -.1(ke)2.739 G 2.739(ya)-.05 G .239 +(nd function bindings, bind a k)-2.739 F .539 -.15(ey s)-.1 H .238 +(equence to a).15 F F2 -.18(re)2.738 G(adline).18 E F0 .238(function or) +2.738 F .475(macro, or set a)144 362.4 R F2 -.18(re)2.975 G(adline).18 E +F0 -.25(va)2.975 G 2.975(riable. Each).25 F .476(non-option ar)2.976 F +.476(gument is a command as it w)-.18 F .476(ould appear in)-.1 F F1 +(.inputr)144 374.4 Q(c)-.37 E F0 2.984(,b).31 G .484 +(ut each binding or command must be passed as a separate ar)-3.184 F +.483(gument; e.g., '"\\C\255x\\C\255r":)-.18 F 2.5 +(re\255read\255init\255\214le'. Options,)144 386.4 R(if supplied, ha)2.5 +E .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F2<ad6d>144 +398.4 Q F1 -.1(ke)2.5 G(ymap)-.2 E F0(Use)180 410.4 Q F1 -.1(ke)5.158 G +(ymap)-.2 E F0 2.658(as the k)5.348 F -.15(ey)-.1 G 2.658(map to be af) +.15 F 2.659(fected by the subsequent bindings.)-.25 F(Acceptable)7.659 E +F1 -.1(ke)180 422.4 S(ymap)-.2 E F0 3.193(names are)5.883 F F1 3.193 +(emacs, emacs\255standar)5.693 F 3.192 +(d, emacs\255meta, emacs\255ctlx, vi, vi\255mo)-.37 F(ve)-.1 E(,)-.1 E +(vi\255command)180 434.4 Q F0 4.429(,a)C(nd)-4.429 E F1(vi\255insert) +4.429 E F0(.).68 E F1(vi)6.929 E F0 1.929(is equi)4.429 F -.25(va)-.25 G +1.929(lent to).25 F F1(vi\255command)4.429 E F0(;)A F1(emacs)4.429 E F0 +1.929(is equi)4.429 F -.25(va)-.25 G 1.93(lent to).25 F F1 +(emacs\255standar)180 446.4 Q(d)-.37 E F0(.)A F2<ad6c>144 458.4 Q F0 +(List the names of all)27.52 E F2 -.18(re)2.5 G(adline).18 E F0 +(functions.)2.5 E F2<ad70>144 470.4 Q F0(Display)24.74 E F2 -.18(re)2.5 +G(adline).18 E F0(function names and bindings in such a w)2.5 E +(ay that the)-.1 E 2.5(yc)-.15 G(an be re-read.)-2.5 E F2<ad50>144 482.4 +Q F0(List current)24.19 E F2 -.18(re)2.5 G(adline).18 E F0 +(function names and bindings.)2.5 E F2<ad73>144 494.4 Q F0(Display)26.41 +E F2 -.18(re)3.655 G(adline).18 E F0 -.1(ke)3.655 G 3.655(ys)-.05 G +1.155(equences bound to macros and the strings the)-3.655 F 3.655(yo) +-.15 G 1.155(utput in such a)-3.655 F -.1(wa)180 506.4 S 2.5(yt).1 G +(hat the)-2.5 E 2.5(yc)-.15 G(an be re-read.)-2.5 E F2<ad53>144 518.4 Q +F0(Display)24.74 E F2 -.18(re)2.5 G(adline).18 E F0 -.1(ke)2.5 G 2.5(ys) +-.05 G(equences bound to macros and the strings the)-2.5 E 2.5(yo)-.15 G +(utput.)-2.5 E F2<ad76>144 530.4 Q F0(Display)25.3 E F2 -.18(re)2.5 G +(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E +(alues in such a w)-.25 E(ay that the)-.1 E 2.5(yc)-.15 G +(an be re-read.)-2.5 E F2<ad56>144 542.4 Q F0(List current)23.08 E F2 +-.18(re)2.5 G(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E +(alues.)-.25 E F2<ad66>144 554.4 Q F1(\214lename)2.5 E F0(Read k)180 +566.4 Q .3 -.15(ey b)-.1 H(indings from).15 E F1(\214lename)2.5 E F0(.)A +F2<ad71>144 578.4 Q F1(function)2.5 E F0(Query about which k)180 590.4 Q +-.15(ey)-.1 G 2.5(si).15 G -1.9 -.4(nv o)-2.5 H .2 -.1(ke t).4 H +(he named).1 E F1(function)2.5 E F0(.)A F2<ad75>144 602.4 Q F1(function) +2.5 E F0(Unbind all k)180 614.4 Q -.15(ey)-.1 G 2.5(sb).15 G +(ound to the named)-2.5 E F1(function)2.5 E F0(.)A F2<ad72>144 626.4 Q +F1 -.1(ke)2.5 G(yseq)-.2 E F0(Remo)180 638.4 Q .3 -.15(ve a)-.15 H .3 +-.15(ny c).15 H(urrent binding for).15 E F1 -.1(ke)2.5 G(yseq)-.2 E F0 +(.)A F2<ad78>144 650.4 Q F1 -.1(ke)2.5 G(yseq)-.2 E F2(:)A F1 +(shell\255command)A F0(Cause)180 662.4 Q F1(shell\255command)4.325 E F0 +1.825(to be e)4.325 F -.15(xe)-.15 G 1.825(cuted whene).15 F -.15(ve) +-.25 G(r).15 E F1 -.1(ke)4.325 G(yseq)-.2 E F0 1.825(is entered.)4.325 F +(When)6.825 E F1(shell\255com-)4.325 E(mand)180 674.4 Q F0 1.765(is e) +4.265 F -.15(xe)-.15 G 1.765(cuted, the shell sets the).15 F/F3 9 +/Times-Bold@0 SF(READLINE_LINE)4.265 E F0 -.25(va)4.015 G 1.765 +(riable to the contents of the).25 F F2 -.18(re)180 686.4 S(adline).18 E +F0 1.353(line b)3.852 F(uf)-.2 E 1.353(fer and the)-.25 F F3 +(READLINE_POINT)3.853 E F0 -.25(va)3.603 G 1.353 +(riable to the current location of the).25 F 2.012(insertion point.)180 +698.4 R 2.011(If the e)7.012 F -.15(xe)-.15 G 2.011 +(cuted command changes the v).15 F 2.011(alue of)-.25 F F3 +(READLINE_LINE)4.511 E F0(or)4.261 E F3(READLINE_POINT)180 710.4 Q/F4 9 +/Times-Roman@0 SF(,)A F0(those ne)2.25 E 2.5(wv)-.25 G +(alues will be re\215ected in the editing state.)-2.75 E(The return v) +144 727.2 Q(alue is 0 unless an unrecognized option is gi)-.25 E -.15 +(ve)-.25 G 2.5(no).15 G 2.5(ra)-2.5 G 2.5(ne)-2.5 G(rror occurred.)-2.5 +E(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(49)185.955 E 0 Cg EP +%%Page: 50 50 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(br)108 84 Q(eak)-.18 E F0([)2.5 E/F2 10 +/Times-Italic@0 SF(n)A F0(])A .054(Exit from within a)144 96 R F1 -.25 +(fo)2.554 G(r).25 E F0(,)A F1(while)2.554 E F0(,)A F1(until)2.555 E F0 +2.555(,o)C(r)-2.555 E F1(select)2.555 E F0 2.555(loop. If)2.555 F F2(n) +2.555 E F0 .055(is speci\214ed, break)2.555 F F2(n)2.555 E F0(le)2.555 E +-.15(ve)-.25 G(ls.).15 E F2(n)5.415 E F0 .055(must be)2.795 F/F3 10 +/Symbol SF<b3>2.555 E F0(1.)2.555 E(If)144 108 Q F2(n)3.075 E F0 .215(i\ +s greater than the number of enclosing loops, all enclosing loops are e) +2.955 F 2.714(xited. The)-.15 F .214(return v)2.714 F(alue)-.25 E +(is 0 unless)144 120 Q F2(n)2.5 E F0(is not greater than or equal to 1.) +2.5 E F1 -.2(bu)108 136.8 S(iltin).2 E F2(shell\255b)2.5 E(uiltin)-.2 E +F0([)2.5 E F2(ar)A(guments)-.37 E F0(])A(Ex)144 148.8 Q .792 +(ecute the speci\214ed shell b)-.15 F .792(uiltin, passing it)-.2 F F2 +(ar)3.293 E(guments)-.37 E F0 3.293(,a).27 G .793(nd return its e)-3.293 +F .793(xit status.)-.15 F .793(This is useful)5.793 F .616 +(when de\214ning a function whose name is the same as a shell b)144 +160.8 R .615(uiltin, retaining the functionality of)-.2 F .57(the b)144 +172.8 R .57(uiltin within the function.)-.2 F(The)5.57 E F1(cd)3.07 E F0 +-.2(bu)3.07 G .57(iltin is commonly rede\214ned this w).2 F(ay)-.1 E +5.57(.T)-.65 G .57(he return status)-5.57 F(is f)144 184.8 Q(alse if)-.1 +E F2(shell\255b)2.84 E(uiltin)-.2 E F0(is not a shell b)2.74 E +(uiltin command.)-.2 E F1(caller)108 201.6 Q F0([)2.5 E F2 -.2(ex)C(pr) +.2 E F0(])A .254(Returns the conte)144 213.6 R .254(xt of an)-.15 F +2.754(ya)-.15 G(cti)-2.754 E .554 -.15(ve s)-.25 H .254 +(ubroutine call \(a shell function or a script e).15 F -.15(xe)-.15 G +.254(cuted with the).15 F F1(.)2.753 E F0(or)2.753 E F1(sour)144 225.6 Q +(ce)-.18 E F0 -.2(bu)3.062 G 3.062(iltins. W).2 F(ithout)-.4 E F2 -.2 +(ex)3.062 G(pr).2 E F0(,)A F1(caller)3.062 E F0 .562 +(displays the line number and source \214lename of the current)3.062 F +.254(subroutine call.)144 237.6 R .254(If a non-ne)5.254 F -.05(ga)-.15 +G(ti).05 E .554 -.15(ve i)-.25 H(nte).15 E .253(ger is supplied as)-.15 +F F2 -.2(ex)2.753 G(pr).2 E F0(,)A F1(caller)2.753 E F0 .253 +(displays the line number)2.753 F 2.753(,s)-.4 G(ub-)-2.753 E 1.327(rou\ +tine name, and source \214le corresponding to that position in the curr\ +ent e)144 249.6 R -.15(xe)-.15 G 1.328(cution call stack.).15 F .001 +(This e)144 261.6 R .001(xtra information may be used, for e)-.15 F .001 +(xample, to print a stack trace.)-.15 F(The current frame is frame)5 E +3.019(0. The)144 273.6 R .519(return v)3.019 F .519 +(alue is 0 unless the shell is not e)-.25 F -.15(xe)-.15 G .52 +(cuting a subroutine call or).15 F F2 -.2(ex)3.02 G(pr).2 E F0 .52 +(does not corre-)3.02 F(spond to a v)144 285.6 Q +(alid position in the call stack.)-.25 E F1(cd)108 302.4 Q F0([)2.5 E F1 +(\255L|-P)A F0 2.5(][)C F2(dir)-2.5 E F0(])A .21 +(Change the current directory to)144 314.4 R F2(dir)2.71 E F0 5.21(.T)C +.21(he v)-5.21 F(ariable)-.25 E/F4 9/Times-Bold@0 SF(HOME)2.71 E F0 .21 +(is the def)2.46 F(ault)-.1 E F2(dir)2.71 E F0 5.21(.T).73 G .21(he v) +-5.21 F(ariable)-.25 E F4(CDP)2.71 E -.855(AT)-.666 G(H).855 E F0 .776 +(de\214nes the search path for the directory containing)144 326.4 R F2 +(dir)3.276 E F0 5.777(.A).73 G(lternati)-5.777 E 1.077 -.15(ve d)-.25 H +.777(irectory names in).15 F F4(CDP)3.277 E -.855(AT)-.666 G(H).855 E F0 +.764(are separated by a colon \(:\).)144 338.4 R 3.264(An)5.764 G .764 +(ull directory name in)-3.264 F F4(CDP)3.264 E -.855(AT)-.666 G(H).855 E +F0 .764(is the same as the current direc-)3.014 F(tory)144 350.4 Q 2.973 +(,i)-.65 G .473(.e., `)-2.973 F(`)-.74 E F1(.)A F0 -.74('')C 5.473(.I) +.74 G(f)-5.473 E F2(dir)3.323 E F0(be)3.703 E .474 +(gins with a slash \(/\), then)-.15 F F4(CDP)2.974 E -.855(AT)-.666 G(H) +.855 E F0 .474(is not used. The)2.724 F F1<ad50>2.974 E F0 .474 +(option says to use)2.974 F .58(the ph)144 362.4 R .58 +(ysical directory structure instead of follo)-.05 F .579 +(wing symbolic links \(see also the)-.25 F F1<ad50>3.079 E F0 .579 +(option to the)3.079 F F1(set)144 374.4 Q F0 -.2(bu)3.383 G .883 +(iltin command\); the).2 F F1<ad4c>3.383 E F0 .884 +(option forces symbolic links to be follo)3.384 F 3.384(wed. An)-.25 F +(ar)3.384 E .884(gument of)-.18 F F1<ad>3.384 E F0(is)3.384 E(equi)144 +386.4 Q -.25(va)-.25 G .316(lent to).25 F F4($OLDPWD)2.816 E/F5 9 +/Times-Roman@0 SF(.)A F0 .316(If a non-empty directory name from)4.816 F +F4(CDP)2.815 E -.855(AT)-.666 G(H).855 E F0 .315(is used, or if)2.565 F +F1<ad>2.815 E F0 .315(is the \214rst)2.815 F(ar)144 398.4 Q .116(gument\ +, and the directory change is successful, the absolute pathname of the \ +ne)-.18 F 2.616(ww)-.25 G .116(orking direc-)-2.716 F 1.165 +(tory is written to the standard output.)144 410.4 R 1.164(The return v) +6.164 F 1.164(alue is true if the directory w)-.25 F 1.164 +(as successfully)-.1 F(changed; f)144 422.4 Q(alse otherwise.)-.1 E F1 +(command)108 439.2 Q F0([)2.5 E F1(\255pVv)A F0(])A F2(command)2.5 E F0 +([)2.5 E F2(ar)A(g)-.37 E F0(...])2.5 E(Run)144 451.2 Q F2(command)2.956 +E F0(with)3.527 E F2(ar)3.087 E(gs)-.37 E F0 .257 +(suppressing the normal shell function lookup. Only b)3.027 F .257 +(uiltin commands or)-.2 F .502(commands found in the)144 463.2 R F4 +-.666(PA)3.002 G(TH)-.189 E F0 .502(are e)2.752 F -.15(xe)-.15 G 3.002 +(cuted. If).15 F(the)3.002 E F1<ad70>3.002 E F0 .502(option is gi)3.002 +F -.15(ve)-.25 G .501(n, the search for).15 F F2(command)3.201 E F0(is) +3.771 E .399(performed using a def)144 475.2 R .399(ault v)-.1 F .399 +(alue for)-.25 F F4 -.666(PA)2.899 G(TH)-.189 E F0 .4 +(that is guaranteed to \214nd all of the standard utilities.)2.649 F(If) +5.4 E .175(either the)144 487.2 R F1<ad56>2.675 E F0(or)2.675 E F1<ad76> +2.675 E F0 .175(option is supplied, a description of)2.675 F F2(command) +2.875 E F0 .174(is printed.)3.445 F(The)5.174 E F1<ad76>2.674 E F0 .174 +(option causes)2.674 F 3.11(as)144 499.2 S .61(ingle w)-3.11 F .61 +(ord indicating the command or \214le name used to in)-.1 F -.2(vo)-.4 G +-.1(ke).2 G F2(command)3.41 E F0 .61(to be displayed; the)3.88 F F1 +<ad56>144 511.2 Q F0 .25(option produces a more v)2.75 F .25 +(erbose description.)-.15 F .249(If the)5.25 F F1<ad56>2.749 E F0(or) +2.749 E F1<ad76>2.749 E F0 .249(option is supplied, the e)2.749 F .249 +(xit status)-.15 F 1.004(is 0 if)144 523.2 R F2(command)3.704 E F0 -.1 +(wa)4.274 G 3.504(sf).1 G 1.005(ound, and 1 if not.)-3.504 F 1.005 +(If neither option is supplied and an error occurred or)6.005 F F2 +(command)144.2 535.2 Q F0 1.599(cannot be found, the e)4.869 F 1.599 +(xit status is 127.)-.15 F 1.599(Otherwise, the e)6.599 F 1.598 +(xit status of the)-.15 F F1(command)4.098 E F0 -.2(bu)144 547.2 S +(iltin is the e).2 E(xit status of)-.15 E F2(command)2.5 E F0(.).77 E F1 +(compgen)108 564 Q F0([)2.5 E F2(option)A F0 2.5(][)C F2(wor)-2.5 E(d) +-.37 E F0(])A .012(Generate possible completion matches for)144 576 R F2 +(wor)2.513 E(d)-.37 E F0 .013(according to the)2.513 F F2(option)2.513 E +F0 .013(s, which may be an)B 2.513(yo)-.15 G(ption)-2.513 E .982 +(accepted by the)144 588 R F1(complete)3.482 E F0 -.2(bu)3.481 G .981 +(iltin with the e).2 F .981(xception of)-.15 F F1<ad70>3.481 E F0(and) +3.481 E F1<ad72>3.481 E F0 3.481(,a)C .981(nd write the matches to the) +-3.481 F 1.415(standard output.)144 600 R 1.415(When using the)6.415 F +F1<ad46>3.915 E F0(or)3.915 E F1<ad43>3.915 E F0 1.415(options, the v) +3.915 F 1.415(arious shell v)-.25 F 1.415(ariables set by the pro-)-.25 +F(grammable completion f)144 612 Q(acilities, while a)-.1 E -.25(va)-.2 +G(ilable, will not ha).25 E .3 -.15(ve u)-.2 H(seful v).15 E(alues.)-.25 +E .352(The matches will be generated in the same w)144 636 R .352 +(ay as if the programmable completion code had gen-)-.1 F .02(erated th\ +em directly from a completion speci\214cation with the same \215ags.)144 +648 R(If)5.02 E F2(wor)2.52 E(d)-.37 E F0 .02(is speci\214ed, only)2.52 +F(those completions matching)144 660 Q F2(wor)2.5 E(d)-.37 E F0 +(will be displayed.)2.5 E(The return v)144 684 Q +(alue is true unless an in)-.25 E -.25(va)-.4 G +(lid option is supplied, or no matches were generated.).25 E F1 +(complete)108 700.8 Q F0([)3.729 E F1(\255abcdefgjksuv)A F0 3.729(][)C +F1<ad6f>-3.729 E F2(comp-option)3.729 E F0 3.729(][)C F1(\255DE)-3.729 E +F0 3.728(][)C F1<ad41>-3.728 E F2(action)3.728 E F0 3.728(][)C F1<ad47> +-3.728 E F2(globpat)3.728 E F0 3.728(][)C F1<ad57>-3.728 E F2(wor)3.728 +E(dlist)-.37 E F0 3.728(][)C F1<ad46>-3.728 E F2(func-)3.728 E(tion)108 +712.8 Q F0 2.5(][)C F1<ad43>-2.5 E F2(command)2.5 E F0(])A([)144 724.8 Q +F1<ad58>A F2(\214lterpat)2.5 E F0 2.5(][)C F1<ad50>-2.5 E F2(pr)2.5 E +(e\214x)-.37 E F0 2.5(][)C F1<ad53>-2.5 E F2(suf)2.5 E<8c78>-.18 E F0(]) +A F2(name)2.5 E F0([)2.5 E F2(name ...)A F0(])A(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(50)185.955 E 0 Cg EP +%%Page: 51 51 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(complete \255pr)108 84 Q F0([)2.5 E F1 +(\255DE)A F0 2.5(][)C/F2 10/Times-Italic@0 SF(name)-2.5 E F0(...])2.5 E +.634(Specify ho)144 96 R 3.134(wa)-.25 G -.18(rg)-3.134 G .634 +(uments to each).18 F F2(name)3.134 E F0 .634(should be completed.)3.134 +F .633(If the)5.634 F F1<ad70>3.133 E F0 .633 +(option is supplied, or if no)3.133 F .139(options are supplied, e)144 +108 R .139(xisting completion speci\214cations are printed in a w)-.15 F +.14(ay that allo)-.1 F .14(ws them to be)-.25 F .31(reused as input.)144 +120 R(The)5.31 E F1<ad72>2.81 E F0 .31(option remo)2.81 F -.15(ve)-.15 G +2.81(sac).15 G .31(ompletion speci\214cation for each)-2.81 F F2(name) +2.81 E F0 2.81(,o)C 1.11 -.4(r, i)-2.81 H 2.81(fn).4 G(o)-2.81 E F2 +(name)2.81 E F0(s)A 1.346 +(are supplied, all completion speci\214cations.)144 132 R(The)6.347 E F1 +<ad44>3.847 E F0 1.347(option indicates that the remaining options)3.847 +F .5(and actions should apply to the `)144 144 R(`def)-.74 E(ault')-.1 E +3('c)-.74 G .5(ommand completion; that is, completion attempted on)-3 F +3.455(ac)144 156 S .955(ommand for which no completion has pre)-3.455 F +.955(viously been de\214ned.)-.25 F(The)5.955 E F1<ad45>3.455 E F0 .955 +(option indicates that)3.455 F .065 +(the remaining options and actions should apply to `)144 168 R(`empty') +-.74 E 2.564('c)-.74 G .064(ommand completion; that is, comple-)-2.564 F +(tion attempted on a blank line.)144 180 Q 1.437 +(The process of applying these completion speci\214cations when w)144 +204 R 1.438(ord completion is attempted is)-.1 F(described abo)144 216 Q +.3 -.15(ve u)-.15 H(nder).15 E F1(Pr)2.5 E(ogrammable Completion)-.18 E +F0(.)A .556(Other options, if speci\214ed, ha)144 240 R .856 -.15(ve t) +-.2 H .555(he follo).15 F .555(wing meanings.)-.25 F .555(The ar)5.555 F +.555(guments to the)-.18 F F1<ad47>3.055 E F0(,)A F1<ad57>3.055 E F0 +3.055(,a)C(nd)-3.055 E F1<ad58>3.055 E F0 .722 +(options \(and, if necessary)144 252 R 3.222(,t)-.65 G(he)-3.222 E F1 +<ad50>3.222 E F0(and)3.222 E F1<ad53>3.222 E F0 .723 +(options\) should be quoted to protect them from e)3.222 F(xpan-)-.15 E +(sion before the)144 264 Q F1(complete)2.5 E F0 -.2(bu)2.5 G +(iltin is in).2 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E F1<ad6f>144 276 Q F2 +(comp-option)2.5 E F0(The)184 288 Q F2(comp-option)2.791 E F0 .291 +(controls se)2.791 F -.15(ve)-.25 G .291(ral aspects of the compspec') +.15 F 2.791(sb)-.55 G(eha)-2.791 E .291(vior be)-.2 F .291 +(yond the simple)-.15 F(generation of completions.)184 300 Q F2 +(comp-option)5 E F0(may be one of:)2.5 E F1(bashdefault)184 312 Q F0 +.281(Perform the rest of the def)224 324 R(ault)-.1 E F1(bash)2.781 E F0 +.281(completions if the compspec generates no)2.781 F(matches.)224 336 Q +F1(default)184 348 Q F0 2.876(Use readline')10 F 5.376(sd)-.55 G(ef) +-5.376 E 2.875(ault \214lename completion if the compspec generates no) +-.1 F(matches.)224 360 Q F1(dir)184 372 Q(names)-.15 E F0(Perform direc\ +tory name completion if the compspec generates no matches.)224 384 Q F1 +(\214lenames)184 396 Q F0 -.7(Te)224 408 S .137(ll readline that the co\ +mpspec generates \214lenames, so it can perform an).7 F 2.637<798c>-.15 +G(le-)-2.637 E .134(name\255speci\214c processing \(lik)224 420 R 2.634 +(ea)-.1 G .134(dding a slash to directory names, quoting spe-)-2.634 F +.45(cial characters, or suppressing trailing spaces\).)224 432 R .45 +(Intended to be used with shell)5.45 F(functions.)224 444 Q F1(nospace) +184 456 Q F0 -.7(Te)6.11 G .22 +(ll readline not to append a space \(the def).7 F .22(ault\) to w)-.1 F +.22(ords completed at the end)-.1 F(of the line.)224 468 Q F1(plusdirs) +184 480 Q F0 1.985(After an)5.54 F 4.485(ym)-.15 G 1.985 +(atches de\214ned by the compspec are generated, directory name)-4.485 F +.584(completion is attempted and an)224 492 R 3.084(ym)-.15 G .584 +(atches are added to the results of the other)-3.084 F(actions.)224 504 +Q F1<ad41>144 516 Q F2(action)2.5 E F0(The)184 528 Q F2(action)2.5 E F0 +(may be one of the follo)2.5 E +(wing to generate a list of possible completions:)-.25 E F1(alias)184 +540 Q F0(Alias names.)20.55 E(May also be speci\214ed as)5 E F1<ad61>2.5 +E F0(.)A F1(arrayv)184 552 Q(ar)-.1 E F0(Array v)224 564 Q +(ariable names.)-.25 E F1 4.7(binding Readline)184 576 R F0 -.1(ke)2.5 G +2.5(yb)-.05 G(inding names.)-2.5 E F1 -.2(bu)184 588 S(iltin).2 E F0 +(Names of shell b)11.85 E(uiltin commands.)-.2 E +(May also be speci\214ed as)5 E F1<ad62>2.5 E F0(.)A F1(command)184 600 +Q F0(Command names.)224 612 Q(May also be speci\214ed as)5 E F1<ad63>2.5 +E F0(.)A F1(dir)184 624 Q(ectory)-.18 E F0(Directory names.)224 636 Q +(May also be speci\214ed as)5 E F1<ad64>2.5 E F0(.)A F1(disabled)184 648 +Q F0(Names of disabled shell b)224 660 Q(uiltins.)-.2 E F1(enabled)184 +672 Q F0(Names of enabled shell b)6.66 E(uiltins.)-.2 E F1(export)184 +684 Q F0(Names of e)12.23 E(xported shell v)-.15 E 2.5(ariables. May) +-.25 F(also be speci\214ed as)2.5 E F1<ad65>2.5 E F0(.)A F1(\214le)184 +696 Q F0(File names.)27.22 E(May also be speci\214ed as)5 E F1<ad66>2.5 +E F0(.)A(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(51)185.955 E 0 +Cg EP +%%Page: 52 52 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(function)184 84 Q F0 +(Names of shell functions.)224 96 Q F1(gr)184 108 Q(oup)-.18 E F0 +(Group names.)14.62 E(May also be speci\214ed as)5 E F1<ad67>2.5 E F0(.) +A F1(helptopic)184 120 Q F0(Help topics as accepted by the)224 132 Q F1 +(help)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1(hostname)184 144 Q F0 +(Hostnames, as tak)224 156 Q(en from the \214le speci\214ed by the)-.1 E +/F2 9/Times-Bold@0 SF(HOSTFILE)2.5 E F0(shell v)2.25 E(ariable.)-.25 E +F1(job)184 168 Q F0(Job names, if job control is acti)26.11 E -.15(ve) +-.25 G 5(.M).15 G(ay also be speci\214ed as)-5 E F1<ad6a>2.5 E F0(.)A F1 +-.1(ke)184 180 S(yw).1 E(ord)-.1 E F0(Shell reserv)224 192 Q(ed w)-.15 E +2.5(ords. May)-.1 F(also be speci\214ed as)2.5 E F1<ad6b>2.5 E F0(.)A F1 +(running)184 204 Q F0(Names of running jobs, if job control is acti)5.54 +E -.15(ve)-.25 G(.).15 E F1(ser)184 216 Q(vice)-.1 E F0(Service names.) +10.67 E(May also be speci\214ed as)5 E F1<ad73>2.5 E F0(.)A F1(setopt) +184 228 Q F0 -1.11(Va)14.45 G(lid ar)1.11 E(guments for the)-.18 E F1 +<ad6f>2.5 E F0(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.) +.2 E F1(shopt)184 240 Q F0(Shell option names as accepted by the)16.66 E +F1(shopt)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1(signal)184 252 Q F0 +(Signal names.)14.99 E F1(stopped)184 264 Q F0 +(Names of stopped jobs, if job control is acti)6.66 E -.15(ve)-.25 G(.) +.15 E F1(user)184 276 Q F0(User names.)21.67 E +(May also be speci\214ed as)5 E F1<ad75>2.5 E F0(.)A F1 -.1(va)184 288 S +(riable).1 E F0(Names of all shell v)5.1 E 2.5(ariables. May)-.25 F +(also be speci\214ed as)2.5 E F1<ad76>2.5 E F0(.)A F1<ad47>144 300 Q/F3 +10/Times-Italic@0 SF(globpat)2.5 E F0 1.007(The pathname e)184 312 R +1.007(xpansion pattern)-.15 F F3(globpat)3.507 E F0 1.007(is e)3.507 F +1.008(xpanded to generate the possible comple-)-.15 F(tions.)184 324 Q +F1<ad57>144 336 Q F3(wor)2.5 E(dlist)-.37 E F0(The)184 348 Q F3(wor)3.64 +E(dlist)-.37 E F0 1.14(is split using the characters in the)3.64 F F2 +(IFS)3.64 E F0 1.139(special v)3.39 F 1.139(ariable as delimiters, and) +-.25 F 2.007(each resultant w)184 360 R 2.007(ord is e)-.1 F 4.507 +(xpanded. The)-.15 F 2.008(possible completions are the members of the) +4.507 F(resultant list which match the w)184 372 Q(ord being completed.) +-.1 E F1<ad43>144 384 Q F3(command)2.5 E(command)184 396 Q F0 1.056 +(is e)3.556 F -.15(xe)-.15 G 1.056(cuted in a subshell en).15 F 1.056 +(vironment, and its output is used as the possible)-.4 F(completions.) +184 408 Q F1<ad46>144 420 Q F3(function)2.5 E F0 1.18 +(The shell function)184 432 R F3(function)3.68 E F0 1.181(is e)3.681 F +-.15(xe)-.15 G 1.181(cuted in the current shell en).15 F 3.681 +(vironment. When)-.4 F 1.181(it \214n-)3.681 F .932 +(ishes, the possible completions are retrie)184 444 R -.15(ve)-.25 G +3.432(df).15 G .932(rom the v)-3.432 F .932(alue of the)-.25 F F2 +(COMPREPL)3.431 E(Y)-.828 E F0(array)3.181 E -.25(va)184 456 S(riable.) +.25 E F1<ad58>144 468 Q F3(\214lterpat)2.5 E(\214lterpat)184 480 Q F0 +.455(is a pattern as used for pathname e)2.955 F 2.956(xpansion. It)-.15 +F .456(is applied to the list of possible)2.956 F 1.596 +(completions generated by the preceding options and ar)184 492 R 1.596 +(guments, and each completion)-.18 F(matching)184 504 Q F3(\214lterpat) +3.204 E F0 .704(is remo)3.204 F -.15(ve)-.15 G 3.204(df).15 G .704 +(rom the list.)-3.204 F 3.204(Al)5.704 G(eading)-3.204 E F1(!)3.204 E F0 +(in)3.204 E F3(\214lterpat)3.205 E F0(ne)3.205 E -.05(ga)-.15 G .705 +(tes the pattern;).05 F(in this case, an)184 516 Q 2.5(yc)-.15 G +(ompletion not matching)-2.5 E F3(\214lterpat)2.5 E F0(is remo)2.5 E +-.15(ve)-.15 G(d.).15 E F1<ad50>144 528 Q F3(pr)2.5 E(e\214x)-.37 E(pr) +184 540 Q(e\214x)-.37 E F0 .535(is added at the be)3.035 F .534 +(ginning of each possible completion after all other options ha)-.15 F +-.15(ve)-.2 G(been applied.)184 552 Q F1<ad53>144 564 Q F3(suf)2.5 E +2.81(\214x suf)-.18 F<8c78>-.18 E F0 +(is appended to each possible completion after all other options ha)2.5 +E .3 -.15(ve b)-.2 H(een applied.).15 E .466(The return v)144 580.8 R +.466(alue is true unless an in)-.25 F -.25(va)-.4 G .466 +(lid option is supplied, an option other than).25 F F1<ad70>2.967 E F0 +(or)2.967 E F1<ad72>2.967 E F0 .467(is sup-)2.967 F 1.362 +(plied without a)144 592.8 R F3(name)3.862 E F0(ar)3.862 E 1.361 +(gument, an attempt is made to remo)-.18 F 1.661 -.15(ve a c)-.15 H +1.361(ompletion speci\214cation for a).15 F F3(name)144 604.8 Q F0 +(for which no speci\214cation e)2.5 E +(xists, or an error occurs adding a completion speci\214cation.)-.15 E +F1(compopt)108 621.6 Q F0([)2.5 E F1<ad6f>A F3(option)2.5 E F0 2.5(][)C +F1(\255DE)-2.5 E F0 2.5(][)C F1(+o)-2.5 E F3(option)2.5 E F0 2.5(][)C F3 +(name)-2.5 E F0(])A .447(Modify completion options for each)144 633.6 R +F3(name)2.947 E F0 .447(according to the)2.947 F F3(option)2.947 E F0 +.447(s, or for the currently-e)B -.15(xe)-.15 G(cution).15 E .726 +(completion if no)144 645.6 R F3(name)3.226 E F0 3.226(sa)C .726 +(re supplied.)-3.226 F .725(If no)5.725 F F3(option)3.225 E F0 3.225(sa) +C .725(re gi)-3.225 F -.15(ve)-.25 G .725 +(n, display the completion options for).15 F(each)144 657.6 Q F3(name) +3.223 E F0 .723(or the current completion.)3.223 F .724(The possible v) +5.724 F .724(alues of)-.25 F F3(option)3.224 E F0 .724(are those v)3.224 +F .724(alid for the)-.25 F F1(com-)3.224 E(plete)144 669.6 Q F0 -.2(bu) +2.798 G .298(iltin described abo).2 F -.15(ve)-.15 G 5.297(.T).15 G(he) +-5.297 E F1<ad44>2.797 E F0 .297 +(option indicates that the remaining options should apply to)2.797 F +1.227(the `)144 681.6 R(`def)-.74 E(ault')-.1 E 3.727('c)-.74 G 1.228(o\ +mmand completion; that is, completion attempted on a command for which \ +no)-3.727 F 2.178(completion has pre)144 693.6 R 2.178 +(viously been de\214ned.)-.25 F(The)7.178 E F1<ad45>4.678 E F0 2.177 +(option indicates that the remaining options)4.677 F(should apply to `) +144 705.6 Q(`empty')-.74 E 2.5('c)-.74 G +(ommand completion; that is, completion attempted on a blank line.)-2.5 +E .327(The return v)108 722.4 R .327(alue is true unless an in)-.25 F +-.25(va)-.4 G .327 +(lid option is supplied, an attempt is made to modify the options for a) +.25 F(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(52)185.955 E 0 Cg +EP +%%Page: 53 53 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Italic@0 SF(name)108 84 Q F0 +(for which no completion speci\214cation e)2.5 E +(xists, or an output error occurs.)-.15 E/F2 10/Times-Bold@0 SF +(continue)108 100.8 Q F0([)2.5 E F1(n)A F0(])A 1.754(Resume the ne)144 +112.8 R 1.754(xt iteration of the enclosing)-.15 F F2 -.25(fo)4.254 G(r) +.25 E F0(,)A F2(while)4.254 E F0(,)A F2(until)4.254 E F0 4.254(,o)C(r) +-4.254 E F2(select)4.254 E F0 4.253(loop. If)4.254 F F1(n)4.613 E F0 +1.753(is speci\214ed,)4.493 F 1.208(resume at the)144 124.8 R F1(n)3.709 +E F0 1.209(th enclosing loop.)B F1(n)6.569 E F0 1.209(must be)3.949 F/F3 +10/Symbol SF<b3>3.709 E F0 3.709(1. If)3.709 F F1(n)4.069 E F0 1.209 +(is greater than the number of enclosing)3.949 F .514 +(loops, the last enclosing loop \(the `)144 136.8 R(`top-le)-.74 E -.15 +(ve)-.25 G(l').15 E 3.014('l)-.74 G .514(oop\) is resumed.)-3.014 F .513 +(The return v)5.513 F .513(alue is 0 unless)-.25 F F1(n)3.013 E F0(is) +3.013 E(not greater than or equal to 1.)144 148.8 Q F2(declar)108 165.6 +Q(e)-.18 E F0([)2.5 E F2(\255aAfFilrtux)A F0 2.5(][)C F2<ad70>-2.5 E F0 +2.5(][)C F1(name)-2.5 E F0([=)A F1(value)A F0 2.5(].)C(..])-2.5 E F2 +(typeset)108 177.6 Q F0([)2.5 E F2(\255aAfFilrtux)A F0 2.5(][)C F2<ad70> +-2.5 E F0 2.5(][)C F1(name)-2.5 E F0([=)A F1(value)A F0 2.5(].)C(..]) +-2.5 E 1.264(Declare v)144 189.6 R 1.264(ariables and/or gi)-.25 F 1.564 +-.15(ve t)-.25 H 1.264(hem attrib).15 F 3.765(utes. If)-.2 F(no)3.765 E +F1(name)3.765 E F0 3.765(sa)C 1.265(re gi)-3.765 F -.15(ve)-.25 G 3.765 +(nt).15 G 1.265(hen display the v)-3.765 F 1.265(alues of)-.25 F -.25 +(va)144 201.6 S 3.483(riables. The).25 F F2<ad70>3.483 E F0 .983 +(option will display the attrib)3.483 F .983(utes and v)-.2 F .982 +(alues of each)-.25 F F1(name)3.482 E F0 5.982(.W).18 G(hen)-5.982 E F2 +<ad70>3.482 E F0 .982(is used)3.482 F(with)144 213.6 Q F1(name)3.579 E +F0(ar)3.579 E 1.079(guments, additional options are ignored.)-.18 F +(When)6.079 E F2<ad70>3.579 E F0 1.079(is supplied without)3.579 F F1 +(name)3.58 E F0(ar)3.58 E(gu-)-.18 E .151 +(ments, it will display the attrib)144 225.6 R .151(utes and v)-.2 F +.151(alues of all v)-.25 F .15(ariables ha)-.25 F .15(ving the attrib) +-.2 F .15(utes speci\214ed by the)-.2 F .046(additional options.)144 +237.6 R .046(If no other options are supplied with)5.046 F F2<ad70>2.547 +E F0(,)A F2(declar)2.547 E(e)-.18 E F0 .047(will display the attrib) +2.547 F .047(utes and)-.2 F -.25(va)144 249.6 S 1.363 +(lues of all shell v).25 F 3.863(ariables. The)-.25 F F2<ad66>3.863 E F0 +1.362(option will restrict the display to shell functions.)3.863 F(The) +6.362 E F2<ad46>3.862 E F0 2.422(option inhibits the display of functio\ +n de\214nitions; only the function name and attrib)144 261.6 R 2.423 +(utes are)-.2 F 2.664(printed. If)144 273.6 R(the)2.664 E F2(extdeb) +2.664 E(ug)-.2 E F0 .164(shell option is enabled using)2.664 F F2(shopt) +2.664 E F0 2.664(,t)C .163(he source \214le name and line number)-2.664 +F 1.382(where the function is de\214ned are displayed as well.)144 285.6 +R(The)6.382 E F2<ad46>3.882 E F0 1.382(option implies)3.882 F F2<ad66> +3.882 E F0 6.382(.T)C 1.382(he follo)-6.382 F(wing)-.25 E .794 +(options can be used to restrict output to v)144 297.6 R .794 +(ariables with the speci\214ed attrib)-.25 F .793(ute or to gi)-.2 F +1.093 -.15(ve v)-.25 H(ariables)-.1 E(attrib)144 309.6 Q(utes:)-.2 E F2 +<ad61>144 321.6 Q F0(Each)25.3 E F1(name)2.5 E F0(is an inde)2.5 E -.15 +(xe)-.15 G 2.5(da).15 G(rray v)-2.5 E(ariable \(see)-.25 E F2(Arrays)2.5 +E F0(abo)2.5 E -.15(ve)-.15 G(\).).15 E F2<ad41>144 333.6 Q F0(Each) +23.08 E F1(name)2.5 E F0(is an associati)2.5 E .3 -.15(ve a)-.25 H +(rray v).15 E(ariable \(see)-.25 E F2(Arrays)2.5 E F0(abo)2.5 E -.15(ve) +-.15 G(\).).15 E F2<ad66>144 345.6 Q F0(Use function names only)26.97 E +(.)-.65 E F2<ad69>144 357.6 Q F0 .557(The v)27.52 F .558 +(ariable is treated as an inte)-.25 F .558(ger; arithmetic e)-.15 F -.25 +(va)-.25 G .558(luation \(see).25 F/F4 9/Times-Bold@0 SF .558 +(ARITHMETIC EV)3.058 F(ALU)-1.215 E(A-)-.54 E(TION)180 369.6 Q F0(abo) +2.25 E -.15(ve)-.15 G 2.5(\)i).15 G 2.5(sp)-2.5 G(erformed when the v) +-2.5 E(ariable is assigned a v)-.25 E(alue.)-.25 E F2<ad6c>144 381.6 Q +F0 .91(When the v)27.52 F .909(ariable is assigned a v)-.25 F .909 +(alue, all upper)-.25 F .909(-case characters are con)-.2 F -.15(ve)-.4 +G .909(rted to lo).15 F(wer)-.25 E(-)-.2 E 2.5(case. The)180 393.6 R +(upper)2.5 E(-case attrib)-.2 E(ute is disabled.)-.2 E F2<ad72>144 405.6 +Q F0(Mak)25.86 E(e)-.1 E F1(name)5.046 E F0 5.046(sr)C(eadonly)-5.046 E +7.546(.T)-.65 G 2.546(hese names cannot then be assigned v)-7.546 F +2.547(alues by subsequent)-.25 F(assignment statements or unset.)180 +417.6 Q F2<ad74>144 429.6 Q F0(Gi)26.97 E .73 -.15(ve e)-.25 H(ach).15 E +F1(name)2.93 E F0(the)2.929 E F1(tr)2.929 E(ace)-.15 E F0(attrib)2.929 E +2.929(ute. T)-.2 F .429(raced functions inherit the)-.35 F F2(DEB)2.929 +E(UG)-.1 E F0(and)2.929 E F2(RETURN)2.929 E F0 +(traps from the calling shell.)180 441.6 Q(The trace attrib)5 E +(ute has no special meaning for v)-.2 E(ariables.)-.25 E F2<ad75>144 +453.6 Q F0 .909(When the v)24.74 F .909(ariable is assigned a v)-.25 F +.909(alue, all lo)-.25 F(wer)-.25 E .909(-case characters are con)-.2 F +-.15(ve)-.4 G .91(rted to upper).15 F(-)-.2 E 2.5(case. The)180 465.6 R +(lo)2.5 E(wer)-.25 E(-case attrib)-.2 E(ute is disabled.)-.2 E F2<ad78> +144 477.6 Q F0(Mark)25.3 E F1(name)2.5 E F0 2.5(sf)C(or e)-2.5 E +(xport to subsequent commands via the en)-.15 E(vironment.)-.4 E .121 +(Using `+' instead of `\255' turns of)144 494.4 R 2.621(ft)-.25 G .121 +(he attrib)-2.621 F .121(ute instead, with the e)-.2 F .12 +(xceptions that)-.15 F F2(+a)2.62 E F0 .12(may not be used)2.62 F .644 +(to destro)144 506.4 R 3.144(ya)-.1 G 3.144(na)-3.144 G .644(rray v) +-3.144 F .644(ariable and)-.25 F F2(+r)3.145 E F0 .645(will not remo) +3.145 F .945 -.15(ve t)-.15 H .645(he readonly attrib).15 F 3.145 +(ute. When)-.2 F .645(used in a func-)3.145 F 1.945(tion, mak)144 518.4 +R 1.945(es each)-.1 F F1(name)4.445 E F0 1.945(local, as with the)4.445 +F F2(local)4.444 E F0 4.444(command. If)4.444 F 4.444(av)4.444 G 1.944 +(ariable name is follo)-4.694 F 1.944(wed by)-.25 F(=)144 530.4 Q F1 +(value)A F0 3.238(,t)C .738(he v)-3.238 F .738(alue of the v)-.25 F .738 +(ariable is set to)-.25 F F1(value)3.238 E F0 5.738(.T)C .738 +(he return v)-5.738 F .739(alue is 0 unless an in)-.25 F -.25(va)-.4 G +.739(lid option is).25 F .603 +(encountered, an attempt is made to de\214ne a function using)144 542.4 +R/F5 10/Courier@0 SF .603(\255f foo=bar)3.103 F F0 3.103(,a)C 3.103(na) +-3.103 G .603(ttempt is made to)-3.103 F 1.242(assign a v)144 554.4 R +1.242(alue to a readonly v)-.25 F 1.242 +(ariable, an attempt is made to assign a v)-.25 F 1.243 +(alue to an array v)-.25 F(ariable)-.25 E 1.386 +(without using the compound assignment syntax \(see)144 566.4 R F2 +(Arrays)3.886 E F0(abo)3.886 E -.15(ve)-.15 G 1.386(\), one of the).15 F +F1(names)3.886 E F0 1.386(is not a)3.886 F -.25(va)144 578.4 S .171 +(lid shell v).25 F .171(ariable name, an attempt is made to turn of)-.25 +F 2.671(fr)-.25 G .171(eadonly status for a readonly v)-2.671 F .172 +(ariable, an)-.25 F .96(attempt is made to turn of)144 590.4 R 3.46(fa) +-.25 G .96(rray status for an array v)-3.46 F .96 +(ariable, or an attempt is made to display a)-.25 F(non-e)144 602.4 Q +(xistent function with)-.15 E F2<ad66>2.5 E F0(.)A F2(dirs [+)108 619.2 +Q F1(n)A F2 2.5(][)C<ad>-2.5 E F1(n)A F2 2.5(][)C(\255cplv])-2.5 E F0 +-.4(Wi)144 631.2 S .328 +(thout options, displays the list of currently remembered directories.) +.4 F .329(The def)5.329 F .329(ault display is on a)-.1 F 1.238 +(single line with directory names separated by spaces.)144 643.2 R 1.238 +(Directories are added to the list with the)6.238 F F2(pushd)144 655.2 Q +F0(command; the)2.5 E F2(popd)2.5 E F0(command remo)2.5 E -.15(ve)-.15 G +2.5(se).15 G(ntries from the list.)-2.5 E F2(+)144 667.2 Q F1(n)A F0 +1.564(Displays the)25.3 F F1(n)4.064 E F0 1.565 +(th entry counting from the left of the list sho)B 1.565(wn by)-.25 F F2 +(dirs)4.065 E F0 1.565(when in)4.065 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 679.2 Q F2<ad>144 691.2 Q F1 +(n)A F0 1.194(Displays the)25.3 F F1(n)3.694 E F0 1.194 +(th entry counting from the right of the list sho)B 1.194(wn by)-.25 F +F2(dirs)3.694 E F0 1.194(when in)3.694 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 703.2 Q F2<ad63>144 715.2 Q F0 +(Clears the directory stack by deleting all of the entries.)25.86 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(53)185.955 E 0 Cg EP +%%Page: 54 54 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF<ad6c>144 84 Q F0 .324 +(Produces a longer listing; the def)27.52 F .324 +(ault listing format uses a tilde to denote the home direc-)-.1 F(tory) +180 96 Q(.)-.65 E F1<ad70>144 108 Q F0 +(Print the directory stack with one entry per line.)24.74 E F1<ad76>144 +120 Q F0 .273(Print the directory stack with one entry per line, pre\ +\214xing each entry with its inde)25.3 F 2.772(xi)-.15 G 2.772(nt)-2.772 +G(he)-2.772 E(stack.)180 132 Q .257(The return v)144 148.8 R .258 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G .258 +(lid option is supplied or).25 F/F2 10/Times-Italic@0 SF(n)2.758 E F0 +(inde)2.758 E -.15(xe)-.15 G 2.758(sb).15 G -.15(ey)-2.758 G .258 +(ond the end of the direc-).15 F(tory stack.)144 160.8 Q F1(diso)108 +177.6 Q(wn)-.1 E F0([)2.5 E F1(\255ar)A F0 2.5(][)C F1<ad68>-2.5 E F0 +2.5(][)C F2(jobspec)-2.5 E F0(...])2.5 E -.4(Wi)144 189.6 S .295 +(thout options, each).4 F F2(jobspec)4.535 E F0 .295(is remo)3.105 F +-.15(ve)-.15 G 2.795(df).15 G .295(rom the table of acti)-2.795 F .595 +-.15(ve j)-.25 H 2.795(obs. If).15 F F2(jobspec)4.535 E F0 .295 +(is not present,)3.105 F .422(and neither)144 201.6 R F1<ad61>2.922 E F0 +(nor)2.922 E F1<ad72>2.922 E F0 .422(is supplied, the shell')2.922 F +2.922(sn)-.55 G .422(otion of the)-2.922 F F2(curr)2.923 E .423(ent job) +-.37 F F0 .423(is used.)2.923 F .423(If the)5.423 F F1<ad68>2.923 E F0 +.423(option is)2.923 F(gi)144 213.6 Q -.15(ve)-.25 G .141(n, each).15 F +F2(jobspec)4.381 E F0 .141(is not remo)2.951 F -.15(ve)-.15 G 2.641(df) +.15 G .141(rom the table, b)-2.641 F .141(ut is mark)-.2 F .141 +(ed so that)-.1 F/F3 9/Times-Bold@0 SF(SIGHUP)2.641 E F0 .14 +(is not sent to the)2.39 F .004(job if the shell recei)144 225.6 R -.15 +(ve)-.25 G 2.504(sa).15 G F3(SIGHUP)A/F4 9/Times-Roman@0 SF(.)A F0 .004 +(If no)4.504 F F2(jobspec)4.244 E F0 .004(is present, and neither the) +2.814 F F1<ad61>2.504 E F0 .005(nor the)2.504 F F1<ad72>2.505 E F0 .005 +(option is)2.505 F 1.229(supplied, the)144 237.6 R F2(curr)3.729 E 1.229 +(ent job)-.37 F F0 1.229(is used.)3.729 F 1.229(If no)6.229 F F2 +(jobspec)5.469 E F0 1.229(is supplied, the)4.039 F F1<ad61>3.729 E F0 +1.228(option means to remo)3.729 F 1.528 -.15(ve o)-.15 H(r).15 E .656 +(mark all jobs; the)144 249.6 R F1<ad72>3.156 E F0 .657 +(option without a)3.156 F F2(jobspec)4.897 E F0(ar)3.467 E .657 +(gument restricts operation to running jobs.)-.18 F(The)5.657 E +(return v)144 261.6 Q(alue is 0 unless a)-.25 E F2(jobspec)4.24 E F0 +(does not specify a v)2.81 E(alid job)-.25 E(.)-.4 E F1(echo)108 278.4 Q +F0([)2.5 E F1(\255neE)A F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0(...])2.5 E +.395(Output the)144 290.4 R F2(ar)2.895 E(g)-.37 E F0 .395 +(s, separated by spaces, follo)B .395(wed by a ne)-.25 F 2.895 +(wline. The)-.25 F .394(return status is al)2.895 F -.1(wa)-.1 G .394 +(ys 0.).1 F(If)5.394 E F1<ad6e>2.894 E F0 .548 +(is speci\214ed, the trailing ne)144 302.4 R .548(wline is suppressed.) +-.25 F .548(If the)5.548 F F1<ad65>3.048 E F0 .548(option is gi)3.048 F +-.15(ve)-.25 G .548(n, interpretation of the fol-).15 F(lo)144 314.4 Q +.053(wing backslash-escaped characters is enabled.)-.25 F(The)5.053 E F1 +<ad45>2.553 E F0 .052(option disables the interpretation of these)2.552 +F 1.502(escape characters, e)144 326.4 R -.15(ve)-.25 G 4.002(no).15 G +4.002(ns)-4.002 G 1.502(ystems where the)-4.002 F 4.002(ya)-.15 G 1.502 +(re interpreted by def)-4.002 F 4.003(ault. The)-.1 F F1(xpg_echo)4.003 +E F0(shell)4.003 E .009 +(option may be used to dynamically determine whether or not)144 338.4 R +F1(echo)2.509 E F0 -.15(ex)2.509 G .009(pands these escape characters) +.15 F .659(by def)144 350.4 R(ault.)-.1 E F1(echo)5.659 E F0 .659 +(does not interpret)3.159 F F1<adad>3.159 E F0 .659 +(to mean the end of options.)3.159 F F1(echo)5.66 E F0 .66 +(interprets the follo)3.16 F(wing)-.25 E(escape sequences:)144 362.4 Q +F1(\\a)144 374.4 Q F0(alert \(bell\))28.22 E F1(\\b)144 386.4 Q F0 +(backspace)27.66 E F1(\\c)144 398.4 Q F0(suppress further output)28.78 E +F1(\\e)144 410.4 Q F0(an escape character)28.78 E F1(\\f)144 422.4 Q F0 +(form feed)29.89 E F1(\\n)144 434.4 Q F0(ne)27.66 E 2.5(wl)-.25 G(ine) +-2.5 E F1(\\r)144 446.4 Q F0(carriage return)28.78 E F1(\\t)144 458.4 Q +F0(horizontal tab)29.89 E F1(\\v)144 470.4 Q F0 -.15(ve)28.22 G +(rtical tab).15 E F1(\\\\)144 482.4 Q F0(backslash)30.44 E F1(\\0)144 +494.4 Q F2(nnn)A F0(the eight-bit character whose v)13.22 E +(alue is the octal v)-.25 E(alue)-.25 E F2(nnn)2.5 E F0 +(\(zero to three octal digits\))2.5 E F1(\\x)144 506.4 Q F2(HH)A F0 +(the eight-bit character whose v)13.78 E(alue is the he)-.25 E +(xadecimal v)-.15 E(alue)-.25 E F2(HH)2.5 E F0(\(one or tw)2.5 E 2.5(oh) +-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E F1(enable)108 523.2 Q F0([)2.5 E +F1<ad61>A F0 2.5(][)C F1(\255dnps)-2.5 E F0 2.5(][)C F1<ad66>-2.5 E F2 +(\214lename)2.5 E F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E .278 +(Enable and disable b)144 535.2 R .278(uiltin shell commands.)-.2 F .278 +(Disabling a b)5.278 F .278(uiltin allo)-.2 F .278 +(ws a disk command which has)-.25 F .833(the same name as a shell b)144 +547.2 R .834(uiltin to be e)-.2 F -.15(xe)-.15 G .834 +(cuted without specifying a full pathname, e).15 F -.15(ve)-.25 G 3.334 +(nt).15 G(hough)-3.334 E .99(the shell normally searches for b)144 559.2 +R .989(uiltins before disk commands.)-.2 F(If)5.989 E F1<ad6e>3.489 E F0 +.989(is used, each)3.489 F F2(name)3.489 E F0 .989(is dis-)3.489 F 1.581 +(abled; otherwise,)144 571.2 R F2(names)4.082 E F0 1.582(are enabled.) +4.082 F -.15(Fo)6.582 G 4.082(re).15 G 1.582(xample, to use the)-4.232 F +F1(test)4.082 E F0 1.582(binary found via the)4.082 F F3 -.666(PA)4.082 +G(TH)-.189 E F0 .081(instead of the shell b)144 583.2 R .081(uiltin v) +-.2 F .081(ersion, run)-.15 F/F5 10/Courier@0 SF .081(enable -n test) +2.581 F F0 5.081(.T)C(he)-5.081 E F1<ad66>2.58 E F0 .08 +(option means to load the ne)2.58 F(w)-.25 E -.2(bu)144 595.2 S 1.524 +(iltin command).2 F F2(name)4.384 E F0 1.524(from shared object)4.204 F +F2(\214lename)4.024 E F0 4.024(,o).18 G 4.024(ns)-4.024 G 1.524 +(ystems that support dynamic loading.)-4.024 F(The)144 607.2 Q F1<ad64> +2.867 E F0 .367(option will delete a b)2.867 F .367(uiltin pre)-.2 F +.367(viously loaded with)-.25 F F1<ad66>2.866 E F0 5.366(.I)C 2.866(fn) +-5.366 G(o)-2.866 E F2(name)2.866 E F0(ar)2.866 E .366(guments are gi) +-.18 F -.15(ve)-.25 G .366(n, or).15 F .398(if the)144 619.2 R F1<ad70> +2.898 E F0 .399(option is supplied, a list of shell b)2.899 F .399 +(uiltins is printed.)-.2 F -.4(Wi)5.399 G .399(th no other option ar).4 +F .399(guments, the)-.18 F .099(list consists of all enabled shell b)144 +631.2 R 2.598(uiltins. If)-.2 F F1<ad6e>2.598 E F0 .098 +(is supplied, only disabled b)2.598 F .098(uiltins are printed.)-.2 F +(If)5.098 E F1<ad61>2.598 E F0 1.916 +(is supplied, the list printed includes all b)144 643.2 R 1.916 +(uiltins, with an indication of whether or not each is)-.2 F 2.879 +(enabled. If)144 655.2 R F1<ad73>2.879 E F0 .379 +(is supplied, the output is restricted to the POSIX)2.879 F F2(special) +2.879 E F0 -.2(bu)2.878 G 2.878(iltins. The).2 F .378(return v)2.878 F +(alue)-.25 E .994(is 0 unless a)144 667.2 R F2(name)3.854 E F0 .994 +(is not a shell b)3.674 F .994(uiltin or there is an error loading a ne) +-.2 F 3.495(wb)-.25 G .995(uiltin from a shared)-3.695 F(object.)144 +679.2 Q F1 -2.3 -.15(ev a)108 696 T(l).15 E F0([)2.5 E F2(ar)A(g)-.37 E +F0(...])2.5 E(The)144 708 Q F2(ar)3.171 E(g)-.37 E F0 3.171(sa)C .671 +(re read and concatenated together into a single command.)-3.171 F .67 +(This command is then read)5.67 F .495(and e)144 720 R -.15(xe)-.15 G +.495(cuted by the shell, and its e).15 F .495 +(xit status is returned as the v)-.15 F .495(alue of)-.25 F F1 -2.3 -.15 +(ev a)2.995 H(l).15 E F0 5.495(.I)C 2.995(ft)-5.495 G .495(here are no) +-2.995 F F2(ar)2.995 E(gs)-.37 E F0(,).27 E(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(54)185.955 E 0 Cg EP +%%Page: 55 55 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(or only null ar)144 84 Q(guments,)-.18 E/F1 10/Times-Bold@0 SF +-2.3 -.15(ev a)2.5 H(l).15 E F0(returns 0.)2.5 E F1(exec)108 100.8 Q F0 +([)2.5 E F1(\255cl)A F0 2.5(][)C F1<ad61>-2.5 E/F2 10/Times-Italic@0 SF +(name)2.5 E F0 2.5(][)C F2(command)-2.5 E F0([)2.5 E F2(ar)A(guments) +-.37 E F0(]])A(If)144 112.8 Q F2(command)3.006 E F0 .306 +(is speci\214ed, it replaces the shell.)3.576 F .305(No ne)5.305 F 2.805 +(wp)-.25 G .305(rocess is created.)-2.805 F(The)5.305 E F2(ar)3.135 E +(guments)-.37 E F0(become)3.075 E .176(the ar)144 124.8 R .176 +(guments to)-.18 F F2(command)2.676 E F0 5.176(.I)C 2.676(ft)-5.176 G +(he)-2.676 E F1<ad6c>2.676 E F0 .176 +(option is supplied, the shell places a dash at the be)2.676 F .177 +(ginning of)-.15 F .5(the zeroth ar)144 136.8 R .5(gument passed to)-.18 +F F2(command)3 E F0 5.499(.T).77 G .499(his is what)-5.499 F F2(lo)2.999 +E(gin)-.1 E F0 .499(\(1\) does.).24 F(The)5.499 E F1<ad63>2.999 E F0 +.499(option causes)2.999 F F2(com-)3.199 E(mand)144 148.8 Q F0 .638 +(to be e)3.908 F -.15(xe)-.15 G .638(cuted with an empty en).15 F 3.138 +(vironment. If)-.4 F F1<ad61>3.138 E F0 .638 +(is supplied, the shell passes)3.138 F F2(name)3.499 E F0 .639(as the) +3.319 F 1.078(zeroth ar)144 160.8 R 1.077(gument to the e)-.18 F -.15 +(xe)-.15 G 1.077(cuted command.).15 F(If)6.077 E F2(command)3.777 E F0 +1.077(cannot be e)4.347 F -.15(xe)-.15 G 1.077(cuted for some reason, a) +.15 F(non-interacti)144 172.8 Q .617 -.15(ve s)-.25 H .317(hell e).15 F +.317(xits, unless the shell option)-.15 F F1(execfail)2.817 E F0 .318 +(is enabled, in which case it returns f)2.817 F(ail-)-.1 E 2.505 +(ure. An)144 184.8 R(interacti)2.505 E .305 -.15(ve s)-.25 H .005 +(hell returns f).15 F .005(ailure if the \214le cannot be e)-.1 F -.15 +(xe)-.15 G 2.505(cuted. If).15 F F2(command)2.705 E F0 .005 +(is not speci\214ed,)3.275 F(an)144 196.8 Q 3.036(yr)-.15 G .536 +(edirections tak)-3.036 F 3.036(ee)-.1 G -.25(ff)-3.036 G .536 +(ect in the current shell, and the return status is 0.).25 F .536 +(If there is a redirection)5.536 F(error)144 208.8 Q 2.5(,t)-.4 G +(he return status is 1.)-2.5 E F1(exit)108 225.6 Q F0([)2.5 E F2(n)A F0 +6.29(]C)C .096(ause the shell to e)-6.29 F .096(xit with a status of) +-.15 F F2(n)2.596 E F0 5.096(.I)C(f)-5.096 E F2(n)2.955 E F0 .095 +(is omitted, the e)2.835 F .095(xit status is that of the last command) +-.15 F -.15(exe)144 237.6 S 2.5(cuted. A).15 F(trap on)2.5 E/F3 9 +/Times-Bold@0 SF(EXIT)2.5 E F0(is e)2.25 E -.15(xe)-.15 G +(cuted before the shell terminates.).15 E F1(export)108 254.4 Q F0([)2.5 +E F1(\255fn)A F0 2.5(][).833 G F2(name)-2.5 E F0([=)A F2(wor)A(d)-.37 E +F0(]] ...)A F1(export \255p)108 266.4 Q F0 .256(The supplied)144 278.4 R +F2(names)3.117 E F0 .257(are mark)3.027 F .257(ed for automatic e)-.1 F +.257(xport to the en)-.15 F .257(vironment of subsequently e)-.4 F -.15 +(xe)-.15 G(cuted).15 E 2.627(commands. If)144 290.4 R(the)2.627 E F1 +<ad66>2.627 E F0 .127(option is gi)2.627 F -.15(ve)-.25 G .127(n, the) +.15 F F2(names)2.987 E F0 .127(refer to functions.)2.897 F .127(If no) +5.127 F F2(names)2.987 E F0 .127(are gi)2.897 F -.15(ve)-.25 G .126 +(n, or if the).15 F F1<ad70>144 302.4 Q F0 .659 +(option is supplied, a list of all names that are e)3.159 F .66 +(xported in this shell is printed.)-.15 F(The)5.66 E F1<ad6e>3.16 E F0 +(option)3.16 E 1.587(causes the e)144 314.4 R 1.587 +(xport property to be remo)-.15 F -.15(ve)-.15 G 4.086(df).15 G 1.586 +(rom each)-4.086 F F2(name)4.086 E F0 6.586(.I)C 4.086(fav)-6.586 G +1.586(ariable name is follo)-4.336 F 1.586(wed by)-.25 F(=)144 326.4 Q +F2(wor)A(d)-.37 E F0 2.803(,t)C .303(he v)-2.803 F .303(alue of the v) +-.25 F .304(ariable is set to)-.25 F F2(wor)2.804 E(d)-.37 E F0(.)A F1 +(export)5.304 E F0 .304(returns an e)2.804 F .304 +(xit status of 0 unless an in)-.15 F -.25(va)-.4 G(lid).25 E .294 +(option is encountered, one of the)144 338.4 R F2(names)2.793 E F0 .293 +(is not a v)2.793 F .293(alid shell v)-.25 F .293(ariable name, or)-.25 +F F1<ad66>2.793 E F0 .293(is supplied with a)2.793 F F2(name)144.36 +350.4 Q F0(that is not a function.)2.68 E F1(fc)108 367.2 Q F0([)2.5 E +F1<ad65>A F2(ename)2.5 E F0 2.5(][)C F1(\255lnr)-2.5 E F0 2.5(][)C F2 +<8c72>-2.5 E(st)-.1 E F0 2.5(][)C F2(last)-2.5 E F0(])A F1(fc \255s)108 +379.2 Q F0([)2.5 E F2(pat)A F0(=)A F2 -.37(re)C(p).37 E F0 2.5(][)C F2 +(cmd)-2.5 E F0(])A .477(Fix Command.)144 391.2 R .478 +(In the \214rst form, a range of commands from)5.477 F F2<8c72>4.888 E +(st)-.1 E F0(to)3.658 E F2(last)3.068 E F0 .478 +(is selected from the his-)3.658 F .882(tory list.)144 403.2 R F2 -.45 +(Fi)5.882 G -.1(rs).45 G(t).1 E F0(and)4.062 E F2(last)3.472 E F0 .882 +(may be speci\214ed as a string \(to locate the last command be)4.062 F +.881(ginning with)-.15 F .797(that string\) or as a number \(an inde)144 +415.2 R 3.297(xi)-.15 G .797(nto the history list, where a ne)-3.297 F +-.05(ga)-.15 G(ti).05 E 1.097 -.15(ve n)-.25 H .797(umber is used as an) +.15 F(of)144 427.2 Q .277(fset from the current command number\).)-.25 F +(If)5.277 E F2(last)2.867 E F0 .276 +(is not speci\214ed it is set to the current command)3.457 F .092 +(for listing \(so that)144 439.2 R/F4 10/Courier@0 SF .092 +(fc \255l \25510)2.592 F F0 .092(prints the last 10 commands\) and to) +2.592 F F2<8c72>4.502 E(st)-.1 E F0 2.592(otherwise. If)3.272 F F2<8c72> +4.502 E(st)-.1 E F0 .093(is not)3.273 F +(speci\214ed it is set to the pre)144 451.2 Q +(vious command for editing and \25516 for listing.)-.25 E(The)144 475.2 +Q F1<ad6e>2.522 E F0 .022 +(option suppresses the command numbers when listing.)2.522 F(The)5.022 E +F1<ad72>2.522 E F0 .022(option re)2.522 F -.15(ve)-.25 G .022 +(rses the order of).15 F .438(the commands.)144 487.2 R .438(If the) +5.438 F F1<ad6c>2.938 E F0 .438(option is gi)2.938 F -.15(ve)-.25 G .438 +(n, the commands are listed on standard output.).15 F(Otherwise,)5.438 E +.335(the editor gi)144 499.2 R -.15(ve)-.25 G 2.835(nb).15 G(y)-2.835 E +F2(ename)3.025 E F0 .335(is in)3.015 F -.2(vo)-.4 G -.1(ke).2 G 2.835 +(do).1 G 2.835(na\214)-2.835 G .335(le containing those commands.)-2.835 +F(If)5.334 E F2(ename)3.024 E F0 .334(is not gi)3.014 F -.15(ve)-.25 G +(n,).15 E .63(the v)144 511.2 R .63(alue of the)-.25 F F3(FCEDIT)3.13 E +F0 -.25(va)2.88 G .631(riable is used, and the v).25 F .631(alue of)-.25 +F F3(EDIT)3.131 E(OR)-.162 E F0(if)2.881 E F3(FCEDIT)3.131 E F0 .631 +(is not set.)2.881 F .631(If nei-)5.631 F .951(ther v)144 523.2 R .951 +(ariable is set,)-.25 F F2(vi)5.117 E F0 .951(is used.)5.117 F .95 +(When editing is complete, the edited commands are echoed and)5.951 F +-.15(exe)144 535.2 S(cuted.).15 E .039(In the second form,)144 559.2 R +F2(command)2.539 E F0 .039(is re-e)2.539 F -.15(xe)-.15 G .039 +(cuted after each instance of).15 F F2(pat)2.54 E F0 .04(is replaced by) +2.54 F F2 -.37(re)2.54 G(p).37 E F0 5.04(.A)C(useful)-2.5 E .406 +(alias to use with this is)144 571.2 R F4 .406(r='fc \255s')2.906 F F0 +2.906(,s)C 2.906(ot)-2.906 G .406(hat typing)-2.906 F F4 6.406(rc)2.906 +G(c)-6.406 E F0 .406(runs the last command be)2.906 F .406(ginning with) +-.15 F F4(cc)144 583.2 Q F0(and typing)2.5 E F4(r)2.5 E F0(re-e)2.5 E +-.15(xe)-.15 G(cutes the last command.).15 E .142 +(If the \214rst form is used, the return v)144 607.2 R .142 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G .142 +(lid option is encountered or).25 F F2<8c72>4.552 E(st)-.1 E F0(or)3.322 +E F2(last)2.732 E F0 .455(specify history lines out of range.)144 619.2 +R .454(If the)5.454 F F1<ad65>2.954 E F0 .454 +(option is supplied, the return v)2.954 F .454(alue is the v)-.25 F .454 +(alue of the)-.25 F .787(last command e)144 631.2 R -.15(xe)-.15 G .787 +(cuted or f).15 F .788 +(ailure if an error occurs with the temporary \214le of commands.)-.1 F +.788(If the)5.788 F 1.136 +(second form is used, the return status is that of the command re-e)144 +643.2 R -.15(xe)-.15 G 1.135(cuted, unless).15 F F2(cmd)3.835 E F0 1.135 +(does not)4.405 F(specify a v)144 655.2 Q +(alid history line, in which case)-.25 E F1(fc)2.5 E F0(returns f)2.5 E +(ailure.)-.1 E F1(fg)108 672 Q F0([)2.5 E F2(jobspec)A F0(])A(Resume)144 +684 Q F2(jobspec)5.653 E F0 1.413(in the fore)4.223 F 1.413 +(ground, and mak)-.15 F 3.913(ei)-.1 G 3.913(tt)-3.913 G 1.413 +(he current job)-3.913 F 6.413(.I)-.4 G(f)-6.413 E F2(jobspec)5.653 E F0 +1.414(is not present, the)4.223 F(shell')144 696 Q 3.117(sn)-.55 G .617 +(otion of the)-3.117 F F2(curr)3.117 E .617(ent job)-.37 F F0 .617 +(is used.)3.117 F .617(The return v)5.617 F .616 +(alue is that of the command placed into the)-.25 F(fore)144 708 Q .362 +(ground, or f)-.15 F .362(ailure if run when job control is disabled or) +-.1 F 2.862(,w)-.4 G .363(hen run with job control enabled, if)-2.862 F +F2(jobspec)145.74 720 Q F0 .004(does not specify a v)2.815 F .004 +(alid job or)-.25 F F2(jobspec)4.244 E F0 .004(speci\214es a job that w) +2.814 F .004(as started without job control.)-.1 F(GNU Bash-4.1)72 768 Q +(2009 December 29)135.965 E(55)185.955 E 0 Cg EP +%%Page: 56 56 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(getopts)108 84 Q/F2 10/Times-Italic@0 SF +(optstring name)2.5 E F0([)2.5 E F2(ar)A(gs)-.37 E F0(])A F1(getopts)144 +96 Q F0 .793 +(is used by shell procedures to parse positional parameters.)3.293 F F2 +(optstring)6.023 E F0 .793(contains the option)3.513 F .15 +(characters to be recognized; if a character is follo)144 108 R .149 +(wed by a colon, the option is e)-.25 F .149(xpected to ha)-.15 F .449 +-.15(ve a)-.2 H(n).15 E(ar)144 120 Q .578 +(gument, which should be separated from it by white space.)-.18 F .579 +(The colon and question mark char)5.579 F(-)-.2 E 1.665 +(acters may not be used as option characters.)144 132 R 1.665 +(Each time it is in)6.665 F -.2(vo)-.4 G -.1(ke).2 G(d,).1 E F1(getopts) +4.165 E F0 1.665(places the ne)4.165 F(xt)-.15 E .796 +(option in the shell v)144 144 R(ariable)-.25 E F2(name)3.296 E F0 3.296 +(,i).18 G(nitializing)-3.296 E F2(name)3.657 E F0 .797(if it does not e) +3.477 F .797(xist, and the inde)-.15 F 3.297(xo)-.15 G 3.297(ft)-3.297 G +.797(he ne)-3.297 F(xt)-.15 E(ar)144 156 Q .085 +(gument to be processed into the v)-.18 F(ariable)-.25 E/F3 9 +/Times-Bold@0 SF(OPTIND)2.585 E/F4 9/Times-Roman@0 SF(.)A F3(OPTIND) +4.585 E F0 .085(is initialized to 1 each time the shell)2.335 F .845 +(or a shell script is in)144 168 R -.2(vo)-.4 G -.1(ke).2 G 3.345 +(d. When).1 F .845(an option requires an ar)3.345 F(gument,)-.18 E F1 +(getopts)3.346 E F0 .846(places that ar)3.346 F(gument)-.18 E .804 +(into the v)144 180 R(ariable)-.25 E F3(OPT)3.304 E(ARG)-.81 E F4(.)A F0 +.803(The shell does not reset)5.304 F F3(OPTIND)3.303 E F0 .803 +(automatically; it must be manually)3.053 F .293 +(reset between multiple calls to)144 192 R F1(getopts)2.793 E F0 .293 +(within the same shell in)2.793 F -.2(vo)-.4 G .293(cation if a ne).2 F +2.793(ws)-.25 G .294(et of parameters)-2.793 F(is to be used.)144 204 Q +2.044(When the end of options is encountered,)144 228 R F1(getopts)4.543 +E F0 -.15(ex)4.543 G 2.043(its with a return v).15 F 2.043 +(alue greater than zero.)-.25 F F3(OPTIND)144 240 Q F0 +(is set to the inde)2.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G +(he \214rst non-option ar)-2.5 E(gument, and)-.18 E F1(name)2.5 E F0 +(is set to ?.)2.5 E F1(getopts)144 264 Q F0 2.392 +(normally parses the positional parameters, b)4.892 F 2.392 +(ut if more ar)-.2 F 2.393(guments are gi)-.18 F -.15(ve)-.25 G 4.893 +(ni).15 G(n)-4.893 E F2(ar)4.893 E(gs)-.37 E F0(,).27 E F1(getopts)144 +276 Q F0(parses those instead.)2.5 E F1(getopts)144 300 Q F0 1.166 +(can report errors in tw)3.666 F 3.665(ow)-.1 G 3.665(ays. If)-3.765 F +1.165(the \214rst character of)3.665 F F2(optstring)3.895 E F0 1.165 +(is a colon,)3.885 F F2(silent)4.005 E F0(error)4.345 E 1.263 +(reporting is used.)144 312 R 1.263 +(In normal operation diagnostic messages are printed when in)6.263 F +-.25(va)-.4 G 1.263(lid options or).25 F .394(missing option ar)144 324 +R .394(guments are encountered.)-.18 F .394(If the v)5.394 F(ariable) +-.25 E F3(OPTERR)2.894 E F0 .394(is set to 0, no error messages)2.644 F +(will be displayed, e)144 336 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 +G(he \214rst character of)-2.5 E F2(optstring)2.73 E F0(is not a colon.) +2.72 E .666(If an in)144 360 R -.25(va)-.4 G .666(lid option is seen,) +.25 F F1(getopts)3.166 E F0 .667(places ? into)3.167 F F2(name)3.527 E +F0 .667(and, if not silent, prints an error message)3.347 F .4 +(and unsets)144 372 R F3(OPT)2.9 E(ARG)-.81 E F4(.)A F0(If)4.899 E F1 +(getopts)2.899 E F0 .399 +(is silent, the option character found is placed in)2.899 F F3(OPT)2.899 +E(ARG)-.81 E F0 .399(and no)2.649 F(diagnostic message is printed.)144 +384 Q 1.241(If a required ar)144 408 R 1.241(gument is not found, and) +-.18 F F1(getopts)3.741 E F0 1.241(is not silent, a question mark \() +3.741 F F1(?).833 E F0 3.742(\)i).833 G 3.742(sp)-3.742 G 1.242 +(laced in)-3.742 F F2(name)144 420 Q F0(,).18 E F3(OPT)2.735 E(ARG)-.81 +E F0 .234(is unset, and a diagnostic message is printed.)2.485 F(If) +5.234 E F1(getopts)2.734 E F0 .234(is silent, then a colon \()2.734 F F1 +(:).833 E F0(\)).833 E(is placed in)144 432 Q F2(name)2.86 E F0(and)2.68 +E F3(OPT)2.5 E(ARG)-.81 E F0(is set to the option character found.)2.25 +E F1(getopts)144 456 Q F0 .902 +(returns true if an option, speci\214ed or unspeci\214ed, is found.) +3.401 F .902(It returns f)5.902 F .902(alse if the end of)-.1 F +(options is encountered or an error occurs.)144 468 Q F1(hash)108 484.8 +Q F0([)2.5 E F1(\255lr)A F0 2.5(][)C F1<ad70>-2.5 E F2(\214lename)2.5 E +F0 2.5(][)C F1(\255dt)-2.5 E F0 2.5(][)C F2(name)-2.5 E F0(])A -.15(Fo) +144 496.8 S 3.555(re).15 G(ach)-3.555 E F2(name)3.555 E F0 3.555(,t).18 +G 1.054(he full \214le name of the command is determined by searching t\ +he directories in)-3.555 F F1($P)144 508.8 Q -.95(AT)-.74 G(H).95 E F0 +.349(and remembered.)2.849 F .349(If the)5.349 F F1<ad70>2.849 E F0 .349 +(option is supplied, no path search is performed, and)2.849 F F2 +(\214lename)4.76 E F0 .452 +(is used as the full \214le name of the command.)144 520.8 R(The)5.452 E +F1<ad72>2.952 E F0 .452(option causes the shell to for)2.952 F .452 +(get all remem-)-.18 F .592(bered locations.)144 532.8 R(The)5.592 E F1 +<ad64>3.092 E F0 .593(option causes the shell to for)3.092 F .593 +(get the remembered location of each)-.18 F F2(name)3.093 E F0(.)A .021 +(If the)144 544.8 R F1<ad74>2.521 E F0 .021 +(option is supplied, the full pathname to which each)2.521 F F2(name) +2.52 E F0 .02(corresponds is printed.)2.52 F .02(If multi-)5.02 F(ple) +144 556.8 Q F2(name)3.703 E F0(ar)3.703 E 1.203 +(guments are supplied with)-.18 F F1<ad74>3.703 E F0 3.703(,t)C(he) +-3.703 E F2(name)3.703 E F0 1.204 +(is printed before the hashed full pathname.)3.703 F(The)144 568.8 Q F1 +<ad6c>3.216 E F0 .715(option causes output to be displayed in a format \ +that may be reused as input.)3.216 F .715(If no ar)5.715 F(gu-)-.18 E +1.183(ments are gi)144 580.8 R -.15(ve)-.25 G 1.183(n, or if only).15 F +F1<ad6c>3.683 E F0 1.184 +(is supplied, information about remembered commands is printed.)3.684 F +(The return status is true unless a)144 592.8 Q F2(name)2.86 E F0 +(is not found or an in)2.68 E -.25(va)-.4 G(lid option is supplied.).25 +E F1(help)108 609.6 Q F0([)2.5 E F1(\255dms)A F0 2.5(][)C F2(pattern) +-2.5 E F0(])A .867(Display helpful information about b)144 621.6 R .867 +(uiltin commands.)-.2 F(If)5.867 E F2(pattern)4.617 E F0 .866 +(is speci\214ed,)3.607 F F1(help)3.366 E F0(gi)3.366 E -.15(ve)-.25 G +3.366(sd).15 G(etailed)-3.366 E .306(help on all commands matching)144 +633.6 R F2(pattern)2.806 E F0 2.807(;o).24 G .307 +(therwise help for all the b)-2.807 F .307 +(uiltins and shell control struc-)-.2 F(tures is printed.)144 645.6 Q F1 +<ad64>144 657.6 Q F0(Display a short description of each)24.74 E F2 +(pattern)2.5 E F1<ad6d>144 669.6 Q F0(Display the description of each) +21.97 E F2(pattern)2.5 E F0(in a manpage-lik)2.5 E 2.5(ef)-.1 G(ormat) +-2.5 E F1<ad73>144 681.6 Q F0 +(Display only a short usage synopsis for each)26.41 E F2(pattern)2.5 E +F0(The return status is 0 unless no command matches)108 693.6 Q F2 +(pattern)2.5 E F0(.).24 E(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 +E(56)185.955 E 0 Cg EP +%%Page: 57 57 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(history [)108 84 Q/F2 10/Times-Italic@0 SF +(n)A F1(])A(history \255c)108 96 Q(history \255d)108 108 Q F2(of)2.5 E +(fset)-.18 E F1(history \255anrw)108 120 Q F0([)2.5 E F2(\214lename)A F0 +(])A F1(history \255p)108 132 Q F2(ar)2.5 E(g)-.37 E F0([)2.5 E F2(ar)A +2.5(g.)-.37 G(..)-2.5 E F0(])A F1(history \255s)108 144 Q F2(ar)2.5 E(g) +-.37 E F0([)2.5 E F2(ar)A 2.5(g.)-.37 G(..)-2.5 E F0(])A -.4(Wi)144 156 +S .752 +(th no options, display the command history list with line numbers.).4 F +.752(Lines listed with a)5.752 F F1(*)3.251 E F0(ha)3.251 E -.15(ve)-.2 +G .38(been modi\214ed.)144 168 R .38(An ar)5.38 F .38(gument of)-.18 F +F2(n)3.24 E F0 .38(lists only the last)3.12 F F2(n)3.24 E F0 2.88 +(lines. If)3.12 F .38(the shell v)2.88 F(ariable)-.25 E/F3 9 +/Times-Bold@0 SF(HISTTIMEFOR-)2.881 E(MA)144 180 Q(T)-.855 E F0 .265 +(is set and not null, it is used as a format string for)2.515 F F2 +(strftime)2.764 E F0 .264(\(3\) to display the time stamp asso-)B 1.019 +(ciated with each displayed history entry)144 192 R 6.019(.N)-.65 G +3.519(oi)-6.019 G(nterv)-3.519 E 1.019 +(ening blank is printed between the formatted)-.15 F .176 +(time stamp and the history line.)144 204 R(If)5.176 E F2(\214lename) +2.676 E F0 .176 +(is supplied, it is used as the name of the history \214le; if)2.676 F +(not, the v)144 216 Q(alue of)-.25 E F3(HISTFILE)2.5 E F0(is used.)2.25 +E(Options, if supplied, ha)5 E .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1<ad63>144 228 Q F0 +(Clear the history list by deleting all the entries.)25.86 E F1<ad64>144 +240 Q F2(of)2.5 E(fset)-.18 E F0(Delete the history entry at position) +180 252 Q F2(of)2.5 E(fset)-.18 E F0(.)A F1<ad61>144 264 Q F0 .598 +(Append the `)25.3 F(`ne)-.74 E(w')-.25 E 3.098('h)-.74 G .598 +(istory lines \(history lines entered since the be)-3.098 F .599 +(ginning of the current)-.15 F F1(bash)180 276 Q F0 +(session\) to the history \214le.)2.5 E F1<ad6e>144 288 Q F0 .854(Read \ +the history lines not already read from the history \214le into the cur\ +rent history list.)24.74 F .772 +(These are lines appended to the history \214le since the be)180 300 R +.773(ginning of the current)-.15 F F1(bash)3.273 E F0(ses-)3.273 E +(sion.)180 312 Q F1<ad72>144 324 Q F0(Read the contents of the history \ +\214le and use them as the current history)25.86 E(.)-.65 E F1<ad77>144 +336 Q F0(Write the current history to the history \214le, o)23.08 E -.15 +(ve)-.15 G(rwriting the history \214le').15 E 2.5(sc)-.55 G(ontents.) +-2.5 E F1<ad70>144 348 Q F0 .626 +(Perform history substitution on the follo)24.74 F(wing)-.25 E F2(ar) +3.125 E(gs)-.37 E F0 .625(and display the result on the standard)3.125 F +2.975(output. Does)180 360 R .475 +(not store the results in the history list.)2.975 F(Each)5.475 E F2(ar) +2.975 E(g)-.37 E F0 .475(must be quoted to disable)2.975 F +(normal history e)180 372 Q(xpansion.)-.15 E F1<ad73>144 384 Q F0 .363 +(Store the)26.41 F F2(ar)3.193 E(gs)-.37 E F0 .363 +(in the history list as a single entry)3.133 F 5.363(.T)-.65 G .362 +(he last command in the history list is)-5.363 F(remo)180 396 Q -.15(ve) +-.15 G 2.5(db).15 G(efore the)-2.5 E F2(ar)2.83 E(gs)-.37 E F0 +(are added.)2.77 E .145(If the)144 412.8 R F3(HISTTIMEFORMA)2.645 E(T) +-.855 E F0 -.25(va)2.395 G .145 +(riable is set, the time stamp information associated with each history) +.25 F .669(entry is written to the history \214le, mark)144 424.8 R .669 +(ed with the history comment character)-.1 F 5.668(.W)-.55 G .668 +(hen the history)-5.668 F .955(\214le is read, lines be)144 436.8 R .956 +(ginning with the history comment character follo)-.15 F .956 +(wed immediately by a digit)-.25 F .416 +(are interpreted as timestamps for the pre)144 448.8 R .416 +(vious history line.)-.25 F .416(The return v)5.416 F .415 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G(lid).25 E .499(option is e\ +ncountered, an error occurs while reading or writing the history \214le\ +, an in)144 460.8 R -.25(va)-.4 G(lid).25 E F2(of)3 E(fset)-.18 E F0(is) +3 E(supplied as an ar)144 472.8 Q(gument to)-.18 E F1<ad64>2.5 E F0 2.5 +(,o)C 2.5(rt)-2.5 G(he history e)-2.5 E(xpansion supplied as an ar)-.15 +E(gument to)-.18 E F1<ad70>2.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(jobs)108 +489.6 Q F0([)2.5 E F1(\255lnprs)A F0 2.5(][)C F2(jobspec)A F0(... ])2.5 +E F1(jobs \255x)108 501.6 Q F2(command)2.5 E F0([)2.5 E F2(ar)2.5 E(gs) +-.37 E F0(... ])2.5 E(The \214rst form lists the acti)144 513.6 Q .3 +-.15(ve j)-.25 H 2.5(obs. The).15 F(options ha)2.5 E .3 -.15(ve t)-.2 H +(he follo).15 E(wing meanings:)-.25 E F1<ad6c>144 525.6 Q F0 +(List process IDs in addition to the normal information.)27.52 E F1 +<ad70>144 537.6 Q F0(List only the process ID of the job')24.74 E 2.5 +(sp)-.55 G(rocess group leader)-2.5 E(.)-.55 E F1<ad6e>144 549.6 Q F0 +.194(Display information only about jobs that ha)24.74 F .494 -.15(ve c) +-.2 H .193(hanged status since the user w).15 F .193(as last noti-)-.1 F +(\214ed of their status.)180 561.6 Q F1<ad72>144 573.6 Q F0 +(Restrict output to running jobs.)25.86 E F1<ad73>144 585.6 Q F0 +(Restrict output to stopped jobs.)26.41 E(If)144 602.4 Q F2(jobspec) +4.553 E F0 .313(is gi)3.123 F -.15(ve)-.25 G .313 +(n, output is restricted to information about that job).15 F 5.314(.T) +-.4 G .314(he return status is 0 unless)-5.314 F(an in)144 614.4 Q -.25 +(va)-.4 G(lid option is encountered or an in).25 E -.25(va)-.4 G(lid).25 +E F2(jobspec)4.24 E F0(is supplied.)2.81 E .395(If the)144 631.2 R F1 +<ad78>2.895 E F0 .394(option is supplied,)2.894 F F1(jobs)2.894 E F0 +.394(replaces an)2.894 F(y)-.15 E F2(jobspec)4.634 E F0 .394(found in) +3.204 F F2(command)3.094 E F0(or)3.664 E F2(ar)3.224 E(gs)-.37 E F0 .394 +(with the corre-)3.164 F(sponding process group ID, and e)144 643.2 Q +-.15(xe)-.15 G(cutes).15 E F2(command)2.7 E F0(passing it)3.27 E F2(ar) +2.5 E(gs)-.37 E F0 2.5(,r).27 G(eturning its e)-2.5 E(xit status.)-.15 E +F1(kill)108 660 Q F0([)2.5 E F1<ad73>A F2(sigspec)2.5 E F0(|)2.5 E F1 +<ad6e>2.5 E F2(signum)2.5 E F0(|)2.5 E F1<ad>2.5 E F2(sigspec)A F0 2.5 +(][)C F2(pid)-2.5 E F0(|)2.5 E F2(jobspec)2.5 E F0 2.5(].)C(..)-2.5 E F1 +(kill \255l)108 672 Q F0([)2.5 E F2(sigspec)A F0(|)2.5 E F2 -.2(ex)2.5 G +(it_status).2 E F0(])A .119(Send the signal named by)144 684 R F2 +(sigspec)2.959 E F0(or)2.929 E F2(signum)2.959 E F0 .119 +(to the processes named by)2.939 F F2(pid)3.87 E F0(or)3.39 E F2 +(jobspec)2.62 E F0(.).31 E F2(sigspec)5.46 E F0(is)2.93 E .319 +(either a case-insensiti)144 696 R .619 -.15(ve s)-.25 H .319 +(ignal name such as).15 F F3(SIGKILL)2.819 E F0 .318 +(\(with or without the)2.569 F F3(SIG)2.818 E F0 .318 +(pre\214x\) or a signal)2.568 F(number;)144 708 Q F2(signum)4.188 E F0 +1.349(is a signal number)4.168 F 6.349(.I)-.55 G(f)-6.349 E F2(sigspec) +4.189 E F0 1.349(is not present, then)4.159 F F3(SIGTERM)3.849 E F0 +1.349(is assumed.)3.599 F(An)6.349 E(ar)144 720 Q .523(gument of)-.18 F +F1<ad6c>3.023 E F0 .523(lists the signal names.)3.023 F .523(If an)5.523 +F 3.023(ya)-.15 G -.18(rg)-3.023 G .523(uments are supplied when).18 F +F1<ad6c>3.023 E F0 .523(is gi)3.023 F -.15(ve)-.25 G .523(n, the names) +.15 F(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(57)185.955 E 0 Cg +EP +%%Page: 58 58 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .28(of the signals corresponding to the ar)144 84 R .28 +(guments are listed, and the return status is 0.)-.18 F(The)5.28 E/F1 10 +/Times-Italic@0 SF -.2(ex)2.78 G(it_status).2 E F0(ar)144 96 Q .378 +(gument to)-.18 F/F2 10/Times-Bold@0 SF<ad6c>2.878 E F0 .378 +(is a number specifying either a signal number or the e)2.878 F .377 +(xit status of a process termi-)-.15 F .593(nated by a signal.)144 108 R +F2(kill)5.593 E F0 .593(returns true if at least one signal w)3.093 F +.593(as successfully sent, or f)-.1 F .594(alse if an error)-.1 F +(occurs or an in)144 120 Q -.25(va)-.4 G(lid option is encountered.).25 +E F2(let)108 136.8 Q F1(ar)2.5 E(g)-.37 E F0([)2.5 E F1(ar)A(g)-.37 E F0 +(...])2.5 E(Each)144 148.8 Q F1(ar)3.027 E(g)-.37 E F0 .197 +(is an arithmetic e)2.917 F .197(xpression to be e)-.15 F -.25(va)-.25 G +.196(luated \(see).25 F/F3 9/Times-Bold@0 SF .196(ARITHMETIC EV)2.696 F +(ALU)-1.215 E -.855(AT)-.54 G(ION).855 E F0(abo)2.446 E -.15(ve)-.15 G +2.696(\). If).15 F(the last)144 160.8 Q F1(ar)2.83 E(g)-.37 E F0 -.25 +(eva)2.72 G(luates to 0,).25 E F2(let)2.5 E F0 +(returns 1; 0 is returned otherwise.)2.5 E F2(local)108 177.6 Q F0([)2.5 +E F1(option)A F0 2.5(][)C F1(name)-2.5 E F0([=)A F1(value)A F0 2.5(].)C +(..])-2.5 E -.15(Fo)144 189.6 S 2.56(re).15 G .06(ach ar)-2.56 F .06 +(gument, a local v)-.18 F .06(ariable named)-.25 F F1(name)2.92 E F0 .06 +(is created, and assigned)2.74 F F1(value)2.56 E F0 5.06(.T).18 G(he) +-5.06 E F1(option)2.56 E F0 .06(can be)2.56 F(an)144 201.6 Q 3.153(yo) +-.15 G 3.153(ft)-3.153 G .653(he options accepted by)-3.153 F F2(declar) +3.153 E(e)-.18 E F0 5.652(.W)C(hen)-5.652 E F2(local)3.152 E F0 .652 +(is used within a function, it causes the v)3.152 F(ari-)-.25 E(able)144 +213.6 Q F1(name)3.72 E F0 .86(to ha)3.54 F 1.16 -.15(ve a v)-.2 H .861 +(isible scope restricted to that function and its children.).15 F -.4 +(Wi)5.861 G .861(th no operands,).4 F F2(local)144 225.6 Q F0 1.165 +(writes a list of local v)3.665 F 1.165 +(ariables to the standard output.)-.25 F 1.165(It is an error to use) +6.165 F F2(local)3.664 E F0 1.164(when not)3.664 F .232 +(within a function.)144 237.6 R .233(The return status is 0 unless)5.232 +F F2(local)2.733 E F0 .233(is used outside a function, an in)2.733 F +-.25(va)-.4 G(lid).25 E F1(name)3.093 E F0(is)2.913 E(supplied, or)144 +249.6 Q F1(name)2.5 E F0(is a readonly v)2.5 E(ariable.)-.25 E F2 +(logout)108 266.4 Q F0(Exit a login shell.)9.33 E F2(map\214le)108 283.2 +Q F0([)2.5 E F2<ad6e>A F1(count)2.5 E F0 2.5(][)C F2<ad4f>-2.5 E F1 +(origin)2.5 E F0 2.5(][)C F2<ad73>-2.5 E F1(count)2.5 E F0 2.5(][)C F2 +<ad74>-2.5 E F0 2.5(][)C F2<ad75>-2.5 E F1(fd)2.5 E F0 2.5(][)C F2<ad43> +-2.5 E F1(callbac)2.5 E(k)-.2 E F0 2.5(][)C F2<ad63>-2.5 E F1(quantum) +2.5 E F0 2.5(][)C F1(arr)-2.5 E(ay)-.15 E F0(])A F2 -.18(re)108 295.2 S +(adarray).18 E F0([)2.5 E F2<ad6e>A F1(count)2.5 E F0 2.5(][)C F2<ad4f> +-2.5 E F1(origin)2.5 E F0 2.5(][)C F2<ad73>-2.5 E F1(count)2.5 E F0 2.5 +(][)C F2<ad74>-2.5 E F0 2.5(][)C F2<ad75>-2.5 E F1(fd)2.5 E F0 2.5(][)C +F2<ad43>-2.5 E F1(callbac)2.5 E(k)-.2 E F0 2.5(][)C F2<ad63>-2.5 E F1 +(quantum)2.5 E F0 2.5(][)C F1(arr)-2.5 E(ay)-.15 E F0(])A .351 +(Read lines from the standard input into the inde)144 307.2 R -.15(xe) +-.15 G 2.851(da).15 G .351(rray v)-2.851 F(ariable)-.25 E F1(arr)2.85 E +(ay)-.15 E F0 2.85(,o).32 G 2.85(rf)-2.85 G .35(rom \214le descriptor) +-2.85 F F1(fd)2.85 E F0 1.248(if the)144 319.2 R F2<ad75>3.748 E F0 +1.248(option is supplied.)3.748 F 1.249(The v)6.249 F(ariable)-.25 E F3 +(MAPFILE)3.749 E F0 1.249(is the def)3.499 F(ault)-.1 E F1(arr)3.749 E +(ay)-.15 E F0 6.249(.O)C 1.249(ptions, if supplied,)-6.249 F(ha)144 +331.2 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F2<ad6e> +144 343.2 Q F0(Cop)24.74 E 2.5(ya)-.1 G 2.5(tm)-2.5 G(ost)-2.5 E F1 +(count)2.7 E F0 2.5(lines. If)3.18 F F1(count)2.5 E F0 +(is 0, all lines are copied.)2.5 E F2<ad4f>144 355.2 Q F0(Be)22.52 E +(gin assigning to)-.15 E F1(arr)2.83 E(ay)-.15 E F0(at inde)2.82 E(x) +-.15 E F1(origin)2.5 E F0 5(.T).24 G(he def)-5 E(ault inde)-.1 E 2.5(xi) +-.15 G 2.5(s0)-2.5 G(.)-2.5 E F2<ad73>144 367.2 Q F0 +(Discard the \214rst)26.41 E F1(count)2.5 E F0(lines read.)2.5 E F2 +<ad74>144 379.2 Q F0(Remo)26.97 E .3 -.15(ve a t)-.15 H(railing ne).15 E +(wline from each line read.)-.25 E F2<ad75>144 391.2 Q F0 +(Read lines from \214le descriptor)24.74 E F1(fd)2.5 E F0 +(instead of the standard input.)2.5 E F2<ad43>144 403.2 Q F0(Ev)23.08 E +(aluate)-.25 E F1(callbac)2.7 E(k)-.2 E F0(each time)3.17 E F1(quantum) +2.5 E F0(lines are read.)2.5 E(The)5 E F2<ad63>2.5 E F0 +(option speci\214es)2.5 E F1(quantum)2.5 E F0(.).32 E F2<ad63>144 415.2 +Q F0(Specify the number of lines read between each call to)25.86 E F1 +(callbac)2.5 E(k)-.2 E F0(.).67 E(If)144 432 Q F2<ad43>2.968 E F0 .467 +(is speci\214ed without)2.967 F F2<ad63>2.967 E F0 2.967(,t)C .467 +(he def)-2.967 F .467(ault quantum is 5000.)-.1 F(When)5.467 E F1 +(callbac)2.967 E(k)-.2 E F0 .467(is e)2.967 F -.25(va)-.25 G .467 +(luated, it is sup-).25 F 1.22(plied the inde)144 444 R 3.72(xo)-.15 G +3.72(ft)-3.72 G 1.22(he ne)-3.72 F 1.22 +(xt array element to be assigned as an additional ar)-.15 F(gument.)-.18 +E F1(callbac)6.22 E(k)-.2 E F0(is)3.72 E -.25(eva)144 456 S +(luated after the line is read b).25 E +(ut before the array element is assigned.)-.2 E +(If not supplied with an e)144 472.8 Q(xplicit origin,)-.15 E F2 +(map\214le)2.5 E F0(will clear)2.5 E F1(arr)2.5 E(ay)-.15 E F0 +(before assigning to it.)2.5 E F2(map\214le)144 489.6 Q F0 1.906 +(returns successfully unless an in)4.406 F -.25(va)-.4 G 1.905 +(lid option or option ar).25 F 1.905(gument is supplied,)-.18 F F1(arr) +4.405 E(ay)-.15 E F0(is)4.405 E(in)144 501.6 Q -.25(va)-.4 G +(lid or unassignable, or if).25 E F1(arr)2.5 E(ay)-.15 E F0 +(is not an inde)2.5 E -.15(xe)-.15 G 2.5(da).15 G(rray)-2.5 E(.)-.65 E +F2(popd)108 518.4 Q F0<5bad>2.5 E F2(n)A F0 2.5(][)C(+)-2.5 E F1(n)A F0 +2.5(][)C<ad>-2.5 E F1(n)A F0(])A(Remo)144 530.4 Q -.15(ve)-.15 G 2.799 +(se).15 G .299(ntries from the directory stack.)-2.799 F -.4(Wi)5.299 G +.299(th no ar).4 F .299(guments, remo)-.18 F -.15(ve)-.15 G 2.799(st).15 +G .3(he top directory from the)-2.799 F 1.479(stack, and performs a)144 +542.4 R F2(cd)3.979 E F0 1.479(to the ne)3.979 F 3.979(wt)-.25 G 1.479 +(op directory)-3.979 F 6.479(.A)-.65 G -.18(rg)-6.479 G 1.478 +(uments, if supplied, ha).18 F 1.778 -.15(ve t)-.2 H 1.478(he follo).15 +F(wing)-.25 E(meanings:)144 554.4 Q F2<ad6e>144 566.4 Q F0 .551 +(Suppresses the normal change of directory when remo)24.74 F .551 +(ving directories from the stack, so)-.15 F +(that only the stack is manipulated.)180 578.4 Q F2(+)144 590.4 Q F1(n)A +F0(Remo)25.3 E -.15(ve)-.15 G 2.64(st).15 G(he)-2.64 E F1(n)2.64 E F0 +.14(th entry counting from the left of the list sho)B .14(wn by)-.25 F +F2(dirs)2.64 E F0 2.64(,s)C .14(tarting with zero.)-2.64 F -.15(Fo)180 +602.4 S 2.5(re).15 G(xample:)-2.65 E/F4 10/Courier@0 SF(popd +0)2.5 E F0 +(remo)2.5 E -.15(ve)-.15 G 2.5(st).15 G(he \214rst directory)-2.5 E(,) +-.65 E F4(popd +1)2.5 E F0(the second.)2.5 E F2<ad>144 614.4 Q F1(n)A F0 +(Remo)25.3 E -.15(ve)-.15 G 3.759(st).15 G(he)-3.759 E F1(n)3.759 E F0 +1.259(th entry counting from the right of the list sho)B 1.26(wn by)-.25 +F F2(dirs)3.76 E F0 3.76(,s)C 1.26(tarting with)-3.76 F 2.5(zero. F)180 +626.4 R(or e)-.15 E(xample:)-.15 E F4(popd -0)2.5 E F0(remo)2.5 E -.15 +(ve)-.15 G 2.5(st).15 G(he last directory)-2.5 E(,)-.65 E F4(popd -1)2.5 +E F0(the ne)2.5 E(xt to last.)-.15 E .644(If the)144 643.2 R F2(popd) +3.144 E F0 .644(command is successful, a)3.144 F F2(dirs)3.143 E F0 .643 +(is performed as well, and the return status is 0.)3.143 F F2(popd)5.643 +E F0 .415(returns f)144 655.2 R .415(alse if an in)-.1 F -.25(va)-.4 G +.415(lid option is encountered, the directory stack is empty).25 F 2.916 +(,an)-.65 G(on-e)-2.916 E .416(xistent direc-)-.15 F +(tory stack entry is speci\214ed, or the directory change f)144 667.2 Q +(ails.)-.1 E F2(printf)108 684 Q F0([)2.5 E F2<ad76>A F1(var)2.5 E F0(]) +A F1(format)2.5 E F0([)2.5 E F1(ar)A(guments)-.37 E F0(])A .372 +(Write the formatted)144 696 R F1(ar)2.872 E(guments)-.37 E F0 .372 +(to the standard output under the control of the)2.872 F F1(format)2.872 +E F0 5.372(.T)C(he)-5.372 E F1(format)2.872 E F0 1.804(is a character s\ +tring which contains three types of objects: plain characters, which ar\ +e simply)144 708 R 1.859 +(copied to standard output, character escape sequences, which are con) +144 720 R -.15(ve)-.4 G 1.858(rted and copied to the).15 F(GNU Bash-4.1) +72 768 Q(2009 December 29)135.965 E(58)185.955 E 0 Cg EP +%%Page: 59 59 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 1.171(standard output, and format speci\214cations, each of whic\ +h causes printing of the ne)144 84 R 1.172(xt successi)-.15 F -.15(ve) +-.25 G/F1 10/Times-Italic@0 SF(ar)144 96 Q(gument)-.37 E F0 6.274(.I)C +3.774(na)-6.274 G 1.274(ddition to the standard)-3.774 F F1(printf)3.774 +E F0 1.274(\(1\) formats,)B/F2 10/Times-Bold@0 SF(%b)3.774 E F0(causes) +3.774 E F2(printf)3.774 E F0 1.273(to e)3.774 F 1.273(xpand backslash) +-.15 F .619(escape sequences in the corresponding)144 108 R F1(ar)3.119 +E(gument)-.37 E F0(\(e)3.119 E .619(xcept that)-.15 F F2(\\c)3.119 E F0 +.62(terminates output, backslashes in)3.119 F F2<5c08>144 120 Q F0(,)A +F2(\\")2.985 E F0 2.985(,a)C(nd)-2.985 E F2(\\?)2.985 E F0 .485 +(are not remo)2.985 F -.15(ve)-.15 G .485(d, and octal escapes be).15 F +.484(ginning with)-.15 F F2(\\0)2.984 E F0 .484 +(may contain up to four digits\),)2.984 F(and)144 132 Q F2(%q)2.567 E F0 +(causes)2.567 E F2(printf)2.567 E F0 .067(to output the corresponding) +2.567 F F1(ar)2.568 E(gument)-.37 E F0 .068 +(in a format that can be reused as shell)2.568 F(input.)144 144 Q(The) +144 168 Q F2<ad76>2.904 E F0 .404 +(option causes the output to be assigned to the v)2.904 F(ariable)-.25 E +F1(var)2.904 E F0 .404(rather than being printed to the)2.904 F +(standard output.)144 180 Q(The)144 204 Q F1(format)3.423 E F0 .923 +(is reused as necessary to consume all of the)3.423 F F1(ar)3.423 E +(guments)-.37 E F0 5.923(.I)C 3.423(ft)-5.923 G(he)-3.423 E F1(format) +3.423 E F0 .924(requires more)3.424 F F1(ar)144 216 Q(guments)-.37 E F0 +.033(than are supplied, the e)2.534 F .033 +(xtra format speci\214cations beha)-.15 F .333 -.15(ve a)-.2 H 2.533(si) +.15 G 2.533(faz)-2.533 G .033(ero v)-2.533 F .033(alue or null string,) +-.25 F(as appropriate, had been supplied.)144 228 Q(The return v)5 E +(alue is zero on success, non-zero on f)-.25 E(ailure.)-.1 E F2(pushd) +108 244.8 Q F0([)2.5 E F2<ad6e>A F0 2.5(][)C(+)-2.5 E F1(n)A F0 2.5(][)C +<ad>-2.5 E F1(n)A F0(])A F2(pushd)108 256.8 Q F0([)2.5 E F2<ad6e>A F0 +2.5(][)C F1(dir)-2.5 E F0(])A .639(Adds a directory to the top of the d\ +irectory stack, or rotates the stack, making the ne)144 268.8 R 3.14(wt) +-.25 G .64(op of the)-3.14 F 1.316(stack the current w)144 280.8 R 1.316 +(orking directory)-.1 F 6.316(.W)-.65 G 1.315(ith no ar)-6.716 F 1.315 +(guments, e)-.18 F 1.315(xchanges the top tw)-.15 F 3.815(od)-.1 G 1.315 +(irectories and)-3.815 F .871 +(returns 0, unless the directory stack is empty)144 292.8 R 5.871(.A) +-.65 G -.18(rg)-5.871 G .872(uments, if supplied, ha).18 F 1.172 -.15 +(ve t)-.2 H .872(he follo).15 F .872(wing mean-)-.25 F(ings:)144 304.8 Q +F2<ad6e>144 316.8 Q F0 .902(Suppresses the normal change of directory w\ +hen adding directories to the stack, so that)24.74 F +(only the stack is manipulated.)180 328.8 Q F2(+)144 340.8 Q F1(n)A F0 +1.267(Rotates the stack so that the)25.3 F F1(n)3.767 E F0 1.268 +(th directory \(counting from the left of the list sho)B 1.268(wn by) +-.25 F F2(dirs)180 352.8 Q F0 2.5(,s)C +(tarting with zero\) is at the top.)-2.5 E F2<ad>144 364.8 Q F1(n)A F0 +.92(Rotates the stack so that the)25.3 F F1(n)3.42 E F0 .92 +(th directory \(counting from the right of the list sho)B .92(wn by)-.25 +F F2(dirs)180 376.8 Q F0 2.5(,s)C(tarting with zero\) is at the top.) +-2.5 E F1(dir)144.35 388.8 Q F0(Adds)23.98 E F1(dir)2.85 E F0 +(to the directory stack at the top, making it the ne)3.23 E 2.5(wc)-.25 +G(urrent w)-2.5 E(orking directory)-.1 E(.)-.65 E .488(If the)144 405.6 +R F2(pushd)2.988 E F0 .488(command is successful, a)2.988 F F2(dirs) +2.988 E F0 .488(is performed as well.)2.988 F .489 +(If the \214rst form is used,)5.488 F F2(pushd)2.989 E F0 1.04 +(returns 0 unless the cd to)144 417.6 R F1(dir)3.89 E F0 -.1(fa)4.27 G +3.539(ils. W).1 F 1.039(ith the second form,)-.4 F F2(pushd)3.539 E F0 +1.039(returns 0 unless the directory)3.539 F .846(stack is empty)144 +429.6 R 3.346(,an)-.65 G(on-e)-3.346 E .847(xistent directory stack ele\ +ment is speci\214ed, or the directory change to the)-.15 F +(speci\214ed ne)144 441.6 Q 2.5(wc)-.25 G(urrent directory f)-2.5 E +(ails.)-.1 E F2(pwd)108 458.4 Q F0([)2.5 E F2(\255LP)A F0(])A .845 +(Print the absolute pathname of the current w)144 470.4 R .845 +(orking directory)-.1 F 5.844(.T)-.65 G .844 +(he pathname printed contains no)-5.844 F .181(symbolic links if the)144 +482.4 R F2<ad50>2.681 E F0 .181(option is supplied or the)2.681 F F2 +.181(\255o ph)2.681 F(ysical)-.15 E F0 .181(option to the)2.681 F F2 +(set)2.681 E F0 -.2(bu)2.681 G .182(iltin command is).2 F 3.264 +(enabled. If)144 494.4 R(the)3.264 E F2<ad4c>3.264 E F0 .763 +(option is used, the pathname printed may contain symbolic links.)3.264 +F .763(The return)5.763 F 1.36(status is 0 unless an error occurs while\ + reading the name of the current directory or an in)144 506.4 R -.25(va) +-.4 G(lid).25 E(option is supplied.)144 518.4 Q F2 -.18(re)108 535.2 S +(ad).18 E F0([)3.817 E F2(\255ers)A F0 3.817(][)C F2<ad61>-3.817 E F1 +(aname)3.817 E F0 3.817(][)C F2<ad64>-3.817 E F1(delim)3.817 E F0 3.817 +(][)C F2<ad69>-3.817 E F1(te)3.817 E(xt)-.2 E F0 3.817(][)C F2<ad6e> +-3.817 E F1(nc)3.816 E(har)-.15 E(s)-.1 E F0 3.816(][)C F2<ad4e>-3.816 E +F1(nc)3.816 E(har)-.15 E(s)-.1 E F0 3.816(][)C F2<ad70>-3.816 E F1(pr) +3.816 E(ompt)-.45 E F0 3.816(][)C F2<ad74>-3.816 E F1(timeout)3.816 E F0 +3.816(][)C F2<ad75>-3.816 E F1(fd)3.816 E F0(])A([)108 547.2 Q F1(name)A +F0(...])2.5 E .516(One line is read from the standard input, or from th\ +e \214le descriptor)144 559.2 R F1(fd)3.016 E F0 .516(supplied as an ar) +3.016 F .516(gument to)-.18 F(the)144 571.2 Q F2<ad75>2.538 E F0 .038 +(option, and the \214rst w)2.538 F .038(ord is assigned to the \214rst) +-.1 F F1(name)2.539 E F0 2.539(,t).18 G .039(he second w)-2.539 F .039 +(ord to the second)-.1 F F1(name)2.539 E F0(,).18 E .42 +(and so on, with lefto)144 583.2 R -.15(ve)-.15 G 2.92(rw).15 G .42 +(ords and their interv)-3.02 F .42 +(ening separators assigned to the last)-.15 F F1(name)2.92 E F0 5.42(.I) +.18 G 2.92(ft)-5.42 G(here)-2.92 E .54(are fe)144 595.2 R .54(wer w)-.25 +F .541(ords read from the input stream than names, the remaining names \ +are assigned empty)-.1 F -.25(va)144 607.2 S 2.511(lues. The).25 F .011 +(characters in)2.511 F/F3 9/Times-Bold@0 SF(IFS)2.511 E F0 .011 +(are used to split the line into w)2.261 F 2.511(ords. The)-.1 F .011 +(backslash character \()2.511 F F2(\\)A F0 2.51(\)m)C(ay)-2.51 E 1.89 +(be used to remo)144 619.2 R 2.19 -.15(ve a)-.15 H 2.19 -.15(ny s).15 H +1.891(pecial meaning for the ne).15 F 1.891 +(xt character read and for line continuation.)-.15 F +(Options, if supplied, ha)144 631.2 Q .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F2<ad61>144 643.2 Q F1(aname)2.5 E F0 1.05(The w) +180 655.2 R 1.049 +(ords are assigned to sequential indices of the array v)-.1 F(ariable) +-.25 E F1(aname)3.549 E F0 3.549(,s).18 G 1.049(tarting at 0.)-3.549 F +F1(aname)180.33 667.2 Q F0(is unset before an)2.68 E 2.5(yn)-.15 G .5 +-.25(ew va)-2.5 H(lues are assigned.).25 E(Other)5 E F1(name)2.5 E F0 +(ar)2.5 E(guments are ignored.)-.18 E F2<ad64>144 679.2 Q F1(delim)2.5 E +F0(The \214rst character of)180 691.2 Q F1(delim)2.5 E F0 +(is used to terminate the input line, rather than ne)2.5 E(wline.)-.25 E +F2<ad65>144 703.2 Q F0 .372 +(If the standard input is coming from a terminal,)25.86 F F2 -.18(re) +2.873 G(adline).18 E F0(\(see)2.873 E F3(READLINE)2.873 E F0(abo)2.623 E +-.15(ve)-.15 G 2.873(\)i).15 G 2.873(su)-2.873 G(sed)-2.873 E .218 +(to obtain the line.)180 715.2 R .218 +(Readline uses the current \(or def)5.218 F .218 +(ault, if line editing w)-.1 F .218(as not pre)-.1 F(viously)-.25 E +(acti)180 727.2 Q -.15(ve)-.25 G 2.5(\)e).15 G(diting settings.)-2.5 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(59)185.955 E 0 Cg EP +%%Page: 60 60 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF<ad69>144 84 Q/F2 10/Times-Italic@0 SF(te) +2.5 E(xt)-.2 E F0(If)10.78 E F1 -.18(re)2.715 G(adline).18 E F0 .216 +(is being used to read the line,)2.715 F F2(te)2.716 E(xt)-.2 E F0 .216 +(is placed into the editing b)2.716 F(uf)-.2 E .216(fer before edit-) +-.25 F(ing be)180 96 Q(gins.)-.15 E F1<ad6e>144 108 Q F2(nc)2.5 E(har) +-.15 E(s)-.1 E F1 -.18(re)180 120 S(ad).18 E F0 1.395 +(returns after reading)3.895 F F2(nc)3.895 E(har)-.15 E(s)-.1 E F0 1.395 +(characters rather than w)3.895 F 1.394(aiting for a complete line of) +-.1 F(input, b)180 132 Q(ut honor a delimiter if fe)-.2 E(wer than)-.25 +E F2(nc)2.5 E(har)-.15 E(s)-.1 E F0 +(characters are read before the delimiter)2.5 E(.)-.55 E F1<ad4e>144 144 +Q F2(nc)2.5 E(har)-.15 E(s)-.1 E F1 -.18(re)180 156 S(ad).18 E F0 1.269 +(returns after reading e)3.769 F(xactly)-.15 E F2(nc)3.769 E(har)-.15 E +(s)-.1 E F0 1.269(characters rather than w)3.769 F 1.27 +(aiting for a complete)-.1 F .275 +(line of input, unless EOF is encountered or)180 168 R F1 -.18(re)2.775 +G(ad).18 E F0 .274(times out.)2.774 F .274(Delimiter characters encoun-) +5.274 F 1.002 +(tered in the input are not treated specially and do not cause)180 180 R +F1 -.18(re)3.503 G(ad).18 E F0 1.003(to return until)3.503 F F2(nc)3.503 +E(har)-.15 E(s)-.1 E F0(characters are read.)180 192 Q F1<ad70>144 204 Q +F2(pr)2.5 E(ompt)-.45 E F0(Display)180 216 Q F2(pr)3.661 E(ompt)-.45 E +F0 1.161(on standard error)3.661 F 3.661(,w)-.4 G 1.161 +(ithout a trailing ne)-3.661 F 1.161(wline, before attempting to read) +-.25 F(an)180 228 Q 2.5(yi)-.15 G 2.5(nput. The)-2.5 F +(prompt is displayed only if input is coming from a terminal.)2.5 E F1 +<ad72>144 240 Q F0 .543(Backslash does not act as an escape character) +25.86 F 5.543(.T)-.55 G .544(he backslash is considered to be part of) +-5.543 F(the line.)180 252 Q(In particular)5 E 2.5(,ab)-.4 G +(ackslash-ne)-2.5 E(wline pair may not be used as a line continuation.) +-.25 E F1<ad73>144 264 Q F0(Silent mode.)26.41 E +(If input is coming from a terminal, characters are not echoed.)5 E F1 +<ad74>144 276 Q F2(timeout)2.5 E F0(Cause)180 288 Q F1 -.18(re)3.549 G +(ad).18 E F0 1.048(to time out and return f)3.549 F 1.048 +(ailure if a complete line of input is not read within)-.1 F F2(timeout) +180 300 Q F0(seconds.)3.496 E F2(timeout)5.996 E F0 .997 +(may be a decimal number with a fractional portion follo)3.496 F(wing) +-.25 E .576(the decimal point.)180 312 R .576(This option is only ef) +5.576 F(fecti)-.25 E .876 -.15(ve i)-.25 H(f).15 E F1 -.18(re)3.076 G +(ad).18 E F0 .576(is reading input from a terminal,)3.076 F .141 +(pipe, or other special \214le; it has no ef)180 324 R .142 +(fect when reading from re)-.25 F .142(gular \214les.)-.15 F(If)5.142 E +F2(timeout)2.642 E F0 .142(is 0,)2.642 F F1 -.18(re)180 336 S(ad).18 E +F0 .113(returns success if input is a)2.614 F -.25(va)-.2 G .113 +(ilable on the speci\214ed \214le descriptor).25 F 2.613(,f)-.4 G .113 +(ailure otherwise.)-2.713 F(The e)180 348 Q +(xit status is greater than 128 if the timeout is e)-.15 E(xceeded.)-.15 +E F1<ad75>144 360 Q F2(fd)2.5 E F0(Read input from \214le descriptor) +14.46 E F2(fd)2.5 E F0(.)A .191(If no)144 376.8 R F2(names)3.051 E F0 +.191(are supplied, the line read is assigned to the v)2.961 F(ariable) +-.25 E/F3 9/Times-Bold@0 SF(REPL)2.692 E(Y)-.828 E/F4 9/Times-Roman@0 SF +(.)A F0 .192(The return code is zero,)4.692 F 1.344 +(unless end-of-\214le is encountered,)144 388.8 R F1 -.18(re)3.844 G(ad) +.18 E F0 1.343 +(times out \(in which case the return code is greater than)3.844 F +(128\), or an in)144 400.8 Q -.25(va)-.4 G +(lid \214le descriptor is supplied as the ar).25 E(gument to)-.18 E F1 +<ad75>2.5 E F0(.)A F1 -.18(re)108 417.6 S(adonly).18 E F0([)2.5 E F1 +(\255aA)A(pf)-.25 E F0 2.5(][)C F2(name)-2.5 E F0([=)A F2(wor)A(d)-.37 E +F0 2.5(].)C(..])-2.5 E .77(The gi)144 429.6 R -.15(ve)-.25 G(n).15 E F2 +(names)3.27 E F0 .77(are mark)3.27 F .77(ed readonly; the v)-.1 F .77 +(alues of these)-.25 F F2(names)3.63 E F0 .77 +(may not be changed by subse-)3.54 F 1.097(quent assignment.)144 441.6 R +1.097(If the)6.097 F F1<ad66>3.597 E F0 1.097 +(option is supplied, the functions corresponding to the)3.597 F F2 +(names)3.596 E F0 1.096(are so)3.596 F(mark)144 453.6 Q 3.334(ed. The) +-.1 F F1<ad61>3.334 E F0 .834(option restricts the v)3.334 F .834 +(ariables to inde)-.25 F -.15(xe)-.15 G 3.334(da).15 G .834(rrays; the) +-3.334 F F1<ad41>3.334 E F0 .834(option restricts the v)3.334 F(ari-) +-.25 E .538(ables to associati)144 465.6 R .838 -.15(ve a)-.25 H 3.038 +(rrays. If).15 F(no)3.038 E F2(name)3.398 E F0(ar)3.218 E .538 +(guments are gi)-.18 F -.15(ve)-.25 G .538(n, or if the).15 F F1<ad70> +3.038 E F0 .537(option is supplied, a list)3.038 F .08 +(of all readonly names is printed.)144 477.6 R(The)5.08 E F1<ad70>2.58 E +F0 .081(option causes output to be displayed in a format that may)2.58 F +1.177(be reused as input.)144 489.6 R 1.177(If a v)6.177 F 1.176 +(ariable name is follo)-.25 F 1.176(wed by =)-.25 F F2(wor)A(d)-.37 E F0 +3.676(,t)C 1.176(he v)-3.676 F 1.176(alue of the v)-.25 F 1.176 +(ariable is set to)-.25 F F2(wor)144 501.6 Q(d)-.37 E F0 6.205(.T)C +1.205(he return status is 0 unless an in)-6.205 F -.25(va)-.4 G 1.206 +(lid option is encountered, one of the).25 F F2(names)4.066 E F0 1.206 +(is not a)3.976 F -.25(va)144 513.6 S(lid shell v).25 E +(ariable name, or)-.25 E F1<ad66>2.5 E F0(is supplied with a)2.5 E F2 +(name)2.86 E F0(that is not a function.)2.68 E F1 -.18(re)108 530.4 S +(tur).18 E(n)-.15 E F0([)2.5 E F2(n)A F0(])A .587 +(Causes a function to e)144 542.4 R .587(xit with the return v)-.15 F +.587(alue speci\214ed by)-.25 F F2(n)3.087 E F0 5.587(.I).24 G(f)-5.587 +E F2(n)3.447 E F0 .586(is omitted, the return status is)3.327 F 1.335 +(that of the last command e)144 554.4 R -.15(xe)-.15 G 1.335 +(cuted in the function body).15 F 6.335(.I)-.65 G 3.835(fu)-6.335 G +1.335(sed outside a function, b)-3.835 F 1.335(ut during)-.2 F -.15(exe) +144 566.4 S .794(cution of a script by the).15 F F1(.)3.294 E F0(\() +5.794 E F1(sour)A(ce)-.18 E F0 3.294(\)c)C .794 +(ommand, it causes the shell to stop e)-3.294 F -.15(xe)-.15 G .794 +(cuting that script).15 F .245(and return either)144 578.4 R F2(n)3.105 +E F0 .246(or the e)2.985 F .246(xit status of the last command e)-.15 F +-.15(xe)-.15 G .246(cuted within the script as the e).15 F .246 +(xit sta-)-.15 F .082(tus of the script.)144 590.4 R .082 +(If used outside a function and not during e)5.082 F -.15(xe)-.15 G .082 +(cution of a script by).15 F F1(.)2.582 E F0 2.581(,t).833 G .081 +(he return sta-)-2.581 F 2.305(tus is f)144 602.4 R 4.805(alse. An)-.1 F +4.805(yc)-.15 G 2.305(ommand associated with the)-4.805 F F1(RETURN) +4.805 E F0 2.306(trap is e)4.806 F -.15(xe)-.15 G 2.306(cuted before e) +.15 F -.15(xe)-.15 G(cution).15 E(resumes after the function or script.) +144 614.4 Q F1(set)108 631.2 Q F0([)2.5 E F1 +(\255\255abefhkmnptuvxBCEHPT)A F0 2.5(][)C F1<ad6f>-2.5 E F2(option)2.5 +E F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0(...])2.5 E F1(set)108 643.2 Q F0 +([)2.5 E F1(+abefhkmnptuvxBCEHPT)A F0 2.5(][)C F1(+o)-2.5 E F2(option) +2.5 E F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0(...])2.5 E -.4(Wi)144 655.2 S +.836(thout options, the name and v).4 F .835(alue of each shell v)-.25 F +.835(ariable are displayed in a format that can be)-.25 F .784 +(reused as input for setting or resetting the currently-set v)144 667.2 +R 3.284(ariables. Read-only)-.25 F -.25(va)3.284 G .784 +(riables cannot be).25 F 2.947(reset. In)144 679.2 R F2 .447(posix mode) +2.947 F F0 2.947(,o)C .447(nly shell v)-2.947 F .447 +(ariables are listed.)-.25 F .447 +(The output is sorted according to the current)5.447 F 3.53 +(locale. When)144 691.2 R 1.031(options are speci\214ed, the)3.53 F +3.531(ys)-.15 G 1.031(et or unset shell attrib)-3.531 F 3.531(utes. An) +-.2 F 3.531(ya)-.15 G -.18(rg)-3.531 G 1.031(uments remaining).18 F +1.624(after option processing are treated as v)144 703.2 R 1.623 +(alues for the positional parameters and are assigned, in)-.25 F(order) +144 715.2 Q 2.5(,t)-.4 G(o)-2.5 E F1($1)2.5 E F0(,)A F1($2)2.5 E F0(,)A +F1 2.5(... $)2.5 F F2(n)A F0 5(.O)C(ptions, if speci\214ed, ha)-5 E .3 +-.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E(GNU Bash-4.1)72 768 +Q(2009 December 29)135.965 E(60)185.955 E 0 Cg EP +%%Page: 61 61 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF<ad61>144 84 Q F0 .539(Automatically mark v) +29.3 F .539 +(ariables and functions which are modi\214ed or created for e)-.25 F .54 +(xport to)-.15 F(the en)184 96 Q(vironment of subsequent commands.)-.4 E +F1<ad62>144 108 Q F0 .132 +(Report the status of terminated background jobs immediately)28.74 F +2.632(,r)-.65 G .131(ather than before the ne)-2.632 F(xt)-.15 E +(primary prompt.)184 120 Q(This is ef)5 E(fecti)-.25 E .3 -.15(ve o)-.25 +H(nly when job control is enabled.).15 E F1<ad65>144 132 Q F0 .51 +(Exit immediately if a)29.86 F/F2 10/Times-Italic@0 SF(pipeline)3.01 E +F0 .511(\(which may consist of a single)3.011 F F2 .511(simple command) +3.011 F F0 3.011(\), a)B F2(sub-)3.011 E(shell)184 144 Q F0 .872 +(command enclosed in parentheses, or one of the commands e)3.373 F -.15 +(xe)-.15 G .872(cuted as part of a).15 F .399 +(command list enclosed by braces \(see)184 156 R/F3 9/Times-Bold@0 SF +.399(SHELL GRAMMAR)2.899 F F0(abo)2.649 E -.15(ve)-.15 G 2.899(\)e).15 G +.399(xits with a non-zero)-3.049 F 3.969(status. The)184 168 R 1.468 +(shell does not e)3.969 F 1.468(xit if the command that f)-.15 F 1.468 +(ails is part of the command list)-.1 F .569(immediately follo)184 180 R +.569(wing a)-.25 F F1(while)3.069 E F0(or)3.069 E F1(until)3.069 E F0 +-.1(ke)3.069 G(yw)-.05 E .569(ord, part of the test follo)-.1 F .57 +(wing the)-.25 F F1(if)3.07 E F0(or)3.07 E F1(elif)3.07 E F0(reserv)184 +192 Q .544(ed w)-.15 F .544(ords, part of an)-.1 F 3.044(yc)-.15 G .544 +(ommand e)-3.044 F -.15(xe)-.15 G .544(cuted in a).15 F F1(&&)3.044 E F0 +(or)3.044 E/F4 10/Symbol SF<efef>3.044 E F0 .544(list e)3.044 F .544 +(xcept the command)-.15 F(follo)184 204 Q 1.23(wing the \214nal)-.25 F +F1(&&)3.73 E F0(or)3.73 E F4<efef>3.73 E F0 3.73(,a)C 1.53 -.15(ny c) +-3.73 H 1.231(ommand in a pipeline b).15 F 1.231 +(ut the last, or if the com-)-.2 F(mand')184 216 Q 3.191(sr)-.55 G .691 +(eturn v)-3.191 F .691(alue is being in)-.25 F -.15(ve)-.4 G .691 +(rted with).15 F F1(!)3.191 E F0 5.691(.A)C .691(trap on)-2.5 F F1(ERR) +3.19 E F0 3.19(,i)C 3.19(fs)-3.19 G .69(et, is e)-3.19 F -.15(xe)-.15 G +.69(cuted before).15 F .686(the shell e)184 228 R 3.186(xits. This)-.15 +F .686(option applies to the shell en)3.186 F .686 +(vironment and each subshell en)-.4 F(viron-)-.4 E .068 +(ment separately \(see)184 240 R F3 .068(COMMAND EXECUTION ENVIR)2.568 F +(ONMENT)-.27 E F0(abo)2.318 E -.15(ve)-.15 G .068(\), and may cause).15 +F(subshells to e)184 252 Q(xit before e)-.15 E -.15(xe)-.15 G +(cuting all the commands in the subshell.).15 E F1<ad66>144 264 Q F0 +(Disable pathname e)30.97 E(xpansion.)-.15 E F1<ad68>144 276 Q F0 2.238 +(Remember the location of commands as the)28.74 F 4.738(ya)-.15 G 2.239 +(re look)-4.738 F 2.239(ed up for e)-.1 F -.15(xe)-.15 G 4.739 +(cution. This).15 F(is)4.739 E(enabled by def)184 288 Q(ault.)-.1 E F1 +<ad6b>144 300 Q F0 .514(All ar)28.74 F .514 +(guments in the form of assignment statements are placed in the en)-.18 +F .513(vironment for a)-.4 F +(command, not just those that precede the command name.)184 312 Q F1 +<ad6d>144 324 Q F0 .148(Monitor mode.)25.97 F .148 +(Job control is enabled.)5.148 F .149(This option is on by def)5.148 F +.149(ault for interacti)-.1 F .449 -.15(ve s)-.25 H(hells).15 E .637 +(on systems that support it \(see)184 336 R F3 .636(JOB CONTR)3.136 F +(OL)-.27 E F0(abo)2.886 E -.15(ve)-.15 G 3.136(\). Background).15 F .636 +(processes run in a)3.136 F .641 +(separate process group and a line containing their e)184 348 R .642 +(xit status is printed upon their com-)-.15 F(pletion.)184 360 Q F1 +<ad6e>144 372 Q F0 .653(Read commands b)28.74 F .653(ut do not e)-.2 F +-.15(xe)-.15 G .653(cute them.).15 F .652 +(This may be used to check a shell script for)5.653 F(syntax errors.)184 +384 Q(This is ignored by interacti)5 E .3 -.15(ve s)-.25 H(hells.).15 E +F1<ad6f>144 396 Q F2(option\255name)2.5 E F0(The)184 408 Q F2 +(option\255name)2.5 E F0(can be one of the follo)2.5 E(wing:)-.25 E F1 +(allexport)184 420 Q F0(Same as)224 432 Q F1<ad61>2.5 E F0(.)A F1 +(braceexpand)184 444 Q F0(Same as)224 456 Q F1<ad42>2.5 E F0(.)A F1 +(emacs)184 468 Q F0 .089(Use an emacs-style command line editing interf) +13.9 F 2.589(ace. This)-.1 F .089(is enabled by def)2.589 F(ault)-.1 E +.95(when the shell is interacti)224 480 R -.15(ve)-.25 G 3.45(,u).15 G +.95(nless the shell is started with the)-3.45 F F1(\255\255noediting) +3.45 E F0 2.5(option. This)224 492 R(also af)2.5 E +(fects the editing interf)-.25 E(ace used for)-.1 E F1 -.18(re)2.5 G +(ad \255e).18 E F0(.)A F1(err)184 504 Q(exit)-.18 E F0(Same as)11.31 E +F1<ad65>2.5 E F0(.)A F1(errtrace)184 516 Q F0(Same as)5.03 E F1<ad45>2.5 +E F0(.)A F1(functrace)184 528 Q F0(Same as)224 540 Q F1<ad54>2.5 E F0(.) +A F1(hashall)184 552 Q F0(Same as)9.43 E F1<ad68>2.5 E F0(.)A F1 +(histexpand)184 564 Q F0(Same as)224 576 Q F1<ad48>2.5 E F0(.)A F1 +(history)184 588 Q F0 .586(Enable command history)10 F 3.087(,a)-.65 G +3.087(sd)-3.087 G .587(escribed abo)-3.087 F .887 -.15(ve u)-.15 H(nder) +.15 E F3(HIST)3.087 E(OR)-.162 E(Y)-.315 E/F5 9/Times-Roman@0 SF(.)A F0 +.587(This option is)5.087 F(on by def)224 600 Q(ault in interacti)-.1 E +.3 -.15(ve s)-.25 H(hells.).15 E F1(ignor)184 612 Q(eeof)-.18 E F0 1.657 +(The ef)224 624 R 1.657(fect is as if the shell command)-.25 F/F6 10 +/Courier@0 SF(IGNOREEOF=10)4.156 E F0 1.656(had been e)4.156 F -.15(xe) +-.15 G(cuted).15 E(\(see)224 636 Q F1(Shell V)2.5 E(ariables)-.92 E F0 +(abo)2.5 E -.15(ve)-.15 G(\).).15 E F1 -.1(ke)184 648 S(yw).1 E(ord)-.1 +E F0(Same as)224 660 Q F1<ad6b>2.5 E F0(.)A F1(monitor)184 672 Q F0 +(Same as)5.56 E F1<ad6d>2.5 E F0(.)A F1(noclob)184 684 Q(ber)-.1 E F0 +(Same as)224 696 Q F1<ad43>2.5 E F0(.)A F1(noexec)184 708 Q F0(Same as) +11.12 E F1<ad6e>2.5 E F0(.)A(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(61)185.955 E 0 Cg EP +%%Page: 62 62 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(noglob)184 84 Q F0(Same as)11.1 E F1<ad66> +2.5 E F0(.)A F1(nolog)184 96 Q F0(Currently ignored.)16.66 E F1(notify) +184 108 Q F0(Same as)15 E F1<ad62>2.5 E F0(.)A F1(nounset)184 120 Q F0 +(Same as)6.66 E F1<ad75>2.5 E F0(.)A F1(onecmd)184 132 Q F0(Same as)6.67 +E F1<ad74>2.5 E F0(.)A F1(ph)184 144 Q(ysical)-.15 E F0(Same as)5.14 E +F1<ad50>2.5 E F0(.)A F1(pipefail)184 156 Q F0 1.029 +(If set, the return v)7.77 F 1.029(alue of a pipeline is the v)-.25 F +1.03(alue of the last \(rightmost\) com-)-.25 F 1.137(mand to e)224 168 +R 1.136 +(xit with a non-zero status, or zero if all commands in the pipeline) +-.15 F -.15(ex)224 180 S(it successfully).15 E 5(.T)-.65 G +(his option is disabled by def)-5 E(ault.)-.1 E F1(posix)184 192 Q F0 +2.09(Change the beha)17.77 F 2.091(vior of)-.2 F F1(bash)4.591 E F0 +2.091(where the def)4.591 F 2.091(ault operation dif)-.1 F 2.091 +(fers from the)-.25 F(POSIX standard to match the standard \()224 204 Q +/F2 10/Times-Italic@0 SF(posix mode)A F0(\).)A F1(pri)184 216 Q(vileged) +-.1 E F0(Same as)224 228 Q F1<ad70>2.5 E F0(.)A F1 -.1(ve)184 240 S +(rbose).1 E F0(Same as)7.33 E F1<ad76>2.5 E F0(.)A F1(vi)184 252 Q F0 +1.466(Use a vi-style command line editing interf)32.22 F 3.965 +(ace. This)-.1 F 1.465(also af)3.965 F 1.465(fects the editing)-.25 F +(interf)224 264 Q(ace used for)-.1 E F1 -.18(re)2.5 G(ad \255e).18 E F0 +(.)A F1(xtrace)184 276 Q F0(Same as)13.35 E F1<ad78>2.5 E F0(.)A(If)184 +294 Q F1<ad6f>3.052 E F0 .552(is supplied with no)3.052 F F2 +(option\255name)3.053 E F0 3.053(,t)C .553(he v)-3.053 F .553 +(alues of the current options are printed.)-.25 F(If)5.553 E F1(+o)184 +306 Q F0 1.072(is supplied with no)3.572 F F2(option\255name)3.572 E F0 +3.572(,a)C 1.071(series of)-.001 F F1(set)3.571 E F0 1.071 +(commands to recreate the current)3.571 F +(option settings is displayed on the standard output.)184 318 Q F1<ad70> +144 330 Q F0 -.45(Tu)28.74 G 1.071(rn on).45 F F2(privile)4.821 E -.1 +(ge)-.4 G(d).1 E F0 3.572(mode. In)4.341 F 1.072(this mode, the)3.572 F +/F3 9/Times-Bold@0 SF($ENV)3.572 E F0(and)3.322 E F3($B)3.572 E(ASH_ENV) +-.27 E F0 1.072(\214les are not pro-)3.322 F 1.501 +(cessed, shell functions are not inherited from the en)184 342 R 1.5 +(vironment, and the)-.4 F F3(SHELLOPTS)4 E/F4 9/Times-Roman@0 SF(,)A F3 +-.27(BA)184 354 S(SHOPTS).27 E F4(,)A F3(CDP)2.774 E -.855(AT)-.666 G(H) +.855 E F4(,)A F0(and)2.774 E F3(GLOBIGNORE)3.024 E F0 -.25(va)2.774 G +.524(riables, if the).25 F 3.025(ya)-.15 G .525(ppear in the en)-3.025 F +(vironment,)-.4 E .38(are ignored.)184 366 R .38 +(If the shell is started with the ef)5.38 F(fecti)-.25 E .679 -.15(ve u) +-.25 H .379(ser \(group\) id not equal to the real).15 F .461 +(user \(group\) id, and the)184 378 R F1<ad70>2.961 E F0 .461 +(option is not supplied, these actions are tak)2.961 F .462 +(en and the ef)-.1 F(fec-)-.25 E(ti)184 390 Q .695 -.15(ve u)-.25 H .395 +(ser id is set to the real user id.).15 F .395(If the)5.395 F F1<ad70> +2.895 E F0 .394(option is supplied at startup, the ef)2.895 F(fecti)-.25 +E -.15(ve)-.25 G .386(user id is not reset.)184 402 R -.45(Tu)5.386 G +.386(rning this option of).45 F 2.886(fc)-.25 G .387(auses the ef)-2.886 +F(fecti)-.25 E .687 -.15(ve u)-.25 H .387(ser and group ids to be).15 F +(set to the real user and group ids.)184 414 Q F1<ad74>144 426 Q F0 +(Exit after reading and e)30.97 E -.15(xe)-.15 G(cuting one command.).15 +E F1<ad75>144 438 Q F0 -.35(Tr)28.74 G .044(eat unset v).35 F .044(aria\ +bles and parameters other than the special parameters "@" and "*" as an) +-.25 F .182(error when performing parameter e)184 450 R 2.682 +(xpansion. If)-.15 F -.15(ex)2.682 G .183 +(pansion is attempted on an unset v).15 F(ari-)-.25 E .746 +(able or parameter)184 462 R 3.246(,t)-.4 G .746 +(he shell prints an error message, and, if not interacti)-3.246 F -.15 +(ve)-.25 G 3.246(,e).15 G .746(xits with a)-3.396 F(non-zero status.)184 +474 Q F1<ad76>144 486 Q F0(Print shell input lines as the)29.3 E 2.5(ya) +-.15 G(re read.)-2.5 E F1<ad78>144 498 Q F0 .315(After e)29.3 F .315 +(xpanding each)-.15 F F2 .315(simple command)2.815 F F0(,)A F1 -.25(fo) +2.815 G(r).25 E F0(command,)2.815 E F1(case)2.815 E F0(command,)2.815 E +F1(select)2.815 E F0(command,)2.815 E 1.236(or arithmetic)184 510 R F1 +-.25(fo)3.736 G(r).25 E F0 1.236(command, display the e)3.736 F 1.236 +(xpanded v)-.15 F 1.236(alue of)-.25 F F3(PS4)3.736 E F4(,)A F0(follo) +3.486 E 1.236(wed by the com-)-.25 F(mand and its e)184 522 Q +(xpanded ar)-.15 E(guments or associated w)-.18 E(ord list.)-.1 E F1 +<ad42>144 534 Q F0 2.578(The shell performs brace e)27.63 F 2.578 +(xpansion \(see)-.15 F F1 2.578(Brace Expansion)5.078 F F0(abo)5.078 E +-.15(ve)-.15 G 5.079(\). This).15 F 2.579(is on by)5.079 F(def)184 546 Q +(ault.)-.1 E F1<ad43>144 558 Q F0 .214(If set,)27.08 F F1(bash)2.714 E +F0 .214(does not o)2.714 F -.15(ve)-.15 G .214(rwrite an e).15 F .214 +(xisting \214le with the)-.15 F F1(>)2.714 E F0(,)A F1(>&)2.714 E F0 +2.713(,a)C(nd)-2.713 E F1(<>)2.713 E F0 .213(redirection opera-)2.713 F +3.053(tors. This)184 570 R .553(may be o)3.053 F -.15(ve)-.15 G .553 +(rridden when creating output \214les by using the redirection opera-) +.15 F(tor)184 582 Q F1(>|)2.5 E F0(instead of)2.5 E F1(>)2.5 E F0(.)A F1 +<ad45>144 594 Q F0 .104(If set, an)27.63 F 2.604(yt)-.15 G .104(rap on) +-2.604 F F1(ERR)2.604 E F0 .103 +(is inherited by shell functions, command substitutions, and com-)2.604 +F .838(mands e)184 606 R -.15(xe)-.15 G .838(cuted in a subshell en).15 +F 3.338(vironment. The)-.4 F F1(ERR)3.338 E F0 .839 +(trap is normally not inherited in)3.339 F(such cases.)184 618 Q F1 +<ad48>144 630 Q F0(Enable)26.52 E F1(!)3.032 E F0 .532 +(style history substitution.)5.532 F .531(This option is on by def)5.532 +F .531(ault when the shell is inter)-.1 F(-)-.2 E(acti)184 642 Q -.15 +(ve)-.25 G(.).15 E F1<ad50>144 654 Q F0 1.164 +(If set, the shell does not follo)28.19 F 3.664(ws)-.25 G 1.164 +(ymbolic links when e)-3.664 F -.15(xe)-.15 G 1.165 +(cuting commands such as).15 F F1(cd)3.665 E F0 2.822 +(that change the current w)184 666 R 2.822(orking directory)-.1 F 7.822 +(.I)-.65 G 5.322(tu)-7.822 G 2.822(ses the ph)-5.322 F 2.821 +(ysical directory structure)-.05 F 2.685(instead. By)184 678 R(def)2.685 +E(ault,)-.1 E F1(bash)2.686 E F0(follo)2.686 E .186 +(ws the logical chain of directories when performing com-)-.25 F +(mands which change the current directory)184 690 Q(.)-.65 E F1<ad54>144 +702 Q F0 .89(If set, an)27.63 F 3.39(yt)-.15 G .89(raps on)-3.39 F F1 +(DEB)3.39 E(UG)-.1 E F0(and)3.39 E F1(RETURN)3.39 E F0 .89 +(are inherited by shell functions, command)3.39 F 1.932 +(substitutions, and commands e)184 714 R -.15(xe)-.15 G 1.932 +(cuted in a subshell en).15 F 4.432(vironment. The)-.4 F F1(DEB)4.432 E +(UG)-.1 E F0(and)4.432 E F1(RETURN)184 726 Q F0 +(traps are normally not inherited in such cases.)2.5 E(GNU Bash-4.1)72 +768 Q(2009 December 29)135.965 E(62)185.955 E 0 Cg EP +%%Page: 63 63 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF<adad>144 84 Q F0 .401(If no ar)28.6 F .401 +(guments follo)-.18 F 2.901(wt)-.25 G .401 +(his option, then the positional parameters are unset.)-2.901 F +(Otherwise,)5.4 E(the positional parameters are set to the)184 96 Q/F2 +10/Times-Italic@0 SF(ar)2.5 E(g)-.37 E F0(s, e)A -.15(ve)-.25 G 2.5(ni) +.15 G 2.5(fs)-2.5 G(ome of them be)-2.5 E(gin with a)-.15 E F1<ad>2.5 E +F0(.)A F1<ad>144 108 Q F0 1.944 +(Signal the end of options, cause all remaining)34.3 F F2(ar)4.444 E(g) +-.37 E F0 4.444(st)C 4.444(ob)-4.444 G 4.445(ea)-4.444 G 1.945 +(ssigned to the positional)-4.445 F 3.446(parameters. The)184 120 R F1 +<ad78>3.446 E F0(and)3.446 E F1<ad76>3.446 E F0 .945 +(options are turned of)3.446 F 3.445(f. If)-.25 F .945(there are no) +3.445 F F2(ar)3.445 E(g)-.37 E F0 .945(s, the positional)B +(parameters remain unchanged.)184 132 Q .425(The options are of)144 +148.8 R 2.925(fb)-.25 G 2.925(yd)-2.925 G(ef)-2.925 E .425 +(ault unless otherwise noted.)-.1 F .425 +(Using + rather than \255 causes these options)5.425 F .178 +(to be turned of)144 160.8 R 2.678(f. The)-.25 F .178 +(options can also be speci\214ed as ar)2.678 F .178(guments to an in) +-.18 F -.2(vo)-.4 G .177(cation of the shell.).2 F(The)5.177 E .066 +(current set of options may be found in)144 172.8 R F1<24ad>2.566 E F0 +5.066(.T)C .066(he return status is al)-5.066 F -.1(wa)-.1 G .066 +(ys true unless an in).1 F -.25(va)-.4 G .067(lid option).25 F +(is encountered.)144 184.8 Q F1(shift)108 201.6 Q F0([)2.5 E F2(n)A F0 +(])A .429(The positional parameters from)144 213.6 R F2(n)2.929 E F0 +.429(+1 ... are renamed to)B F1 .429($1 ....)2.929 F F0 -.15(Pa)5.428 G +.428(rameters represented by the num-).15 F(bers)144 225.6 Q F1($#)2.582 +E F0(do)2.582 E .082(wn to)-.25 F F1($#)2.582 E F0<ad>A F2(n)A F0 .082 +(+1 are unset.)B F2(n)5.442 E F0 .082(must be a non-ne)2.822 F -.05(ga) +-.15 G(ti).05 E .383 -.15(ve n)-.25 H .083(umber less than or equal to) +.15 F F1($#)2.583 E F0 5.083(.I)C(f)-5.083 E F2(n)2.943 E F0 .06 +(is 0, no parameters are changed.)144 237.6 R(If)5.06 E F2(n)2.92 E F0 +.06(is not gi)2.8 F -.15(ve)-.25 G .06(n, it is assumed to be 1.).15 F +(If)5.06 E F2(n)2.92 E F0 .06(is greater than)2.8 F F1($#)2.56 E F0 2.56 +(,t)C(he)-2.56 E .143(positional parameters are not changed.)144 249.6 R +.144(The return status is greater than zero if)5.143 F F2(n)3.004 E F0 +.144(is greater than)2.884 F F1($#)2.644 E F0 +(or less than zero; otherwise 0.)144 261.6 Q F1(shopt)108 278.4 Q F0([) +2.5 E F1(\255pqsu)A F0 2.5(][)C F1<ad6f>-2.5 E F0 2.5(][)C F2(optname) +-2.5 E F0(...])2.5 E -.8(To)144 290.4 S .222(ggle the v).8 F .222 +(alues of v)-.25 F .222(ariables controlling optional shell beha)-.25 F +(vior)-.2 E 5.222(.W)-.55 G .222(ith no options, or with the)-5.622 F F1 +<ad70>2.722 E F0 .721(option, a list of all settable options is display\ +ed, with an indication of whether or not each is set.)144 302.4 R(The) +144 314.4 Q F1<ad70>2.828 E F0 .327(option causes output to be displaye\ +d in a form that may be reused as input.)2.828 F .327(Other options) +5.327 F(ha)144 326.4 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:) +-.25 E F1<ad73>144 338.4 Q F0(Enable \(set\) each)26.41 E F2(optname)2.5 +E F0(.)A F1<ad75>144 350.4 Q F0(Disable \(unset\) each)24.74 E F2 +(optname)2.5 E F0(.)A F1<ad71>144 362.4 Q F0 .003(Suppresses normal out\ +put \(quiet mode\); the return status indicates whether the)24.74 F F2 +(optname)2.504 E F0(is)2.504 E .256(set or unset.)180 374.4 R .256 +(If multiple)5.256 F F2(optname)2.756 E F0(ar)2.756 E .256 +(guments are gi)-.18 F -.15(ve)-.25 G 2.756(nw).15 G(ith)-2.756 E F1 +<ad71>2.756 E F0 2.755(,t)C .255(he return status is zero if)-2.755 F +(all)180 386.4 Q F2(optnames)2.5 E F0(are enabled; non-zero otherwise.) +2.5 E F1<ad6f>144 398.4 Q F0(Restricts the v)25.3 E(alues of)-.25 E F2 +(optname)2.5 E F0(to be those de\214ned for the)2.5 E F1<ad6f>2.5 E F0 +(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E .127 +(If either)144 415.2 R F1<ad73>2.627 E F0(or)2.627 E F1<ad75>2.627 E F0 +.127(is used with no)2.627 F F2(optname)2.627 E F0(ar)2.627 E .127 +(guments, the display is limited to those options which)-.18 F 1.024 +(are set or unset, respecti)144 427.2 R -.15(ve)-.25 G(ly).15 E 6.024 +(.U)-.65 G 1.024(nless otherwise noted, the)-6.024 F F1(shopt)3.523 E F0 +1.023(options are disabled \(unset\) by)3.523 F(def)144 439.2 Q(ault.) +-.1 E 1.544(The return status when listing options is zero if all)144 +456 R F2(optnames)4.044 E F0 1.545(are enabled, non-zero otherwise.) +4.045 F .696 +(When setting or unsetting options, the return status is zero unless an) +144 468 R F2(optname)3.196 E F0 .696(is not a v)3.196 F .695(alid shell) +-.25 F(option.)144 480 Q(The list of)144 496.8 Q F1(shopt)2.5 E F0 +(options is:)2.5 E F1(autocd)144 514.8 Q F0 .199 +(If set, a command name that is the name of a directory is e)11.11 F +-.15(xe)-.15 G .2(cuted as if it were the ar).15 F(gu-)-.18 E +(ment to the)184 526.8 Q F1(cd)2.5 E F0 2.5(command. This)2.5 F +(option is only used by interacti)2.5 E .3 -.15(ve s)-.25 H(hells.).15 E +F1(cdable_v)144 538.8 Q(ars)-.1 E F0 .156(If set, an ar)184 550.8 R .156 +(gument to the)-.18 F F1(cd)2.656 E F0 -.2(bu)2.656 G .155 +(iltin command that is not a directory is assumed to be the).2 F +(name of a v)184 562.8 Q(ariable whose v)-.25 E +(alue is the directory to change to.)-.25 E F1(cdspell)144 574.8 Q F0 +1.055 +(If set, minor errors in the spelling of a directory component in a) +10.55 F F1(cd)3.555 E F0 1.055(command will be)3.555 F 3.988 +(corrected. The)184 586.8 R 1.488(errors check)3.988 F 1.487 +(ed for are transposed characters, a missing character)-.1 F 3.987(,a) +-.4 G(nd)-3.987 E .552(one character too man)184 598.8 R 4.352 -.65 +(y. I)-.15 H 3.052(fac).65 G .552 +(orrection is found, the corrected \214le name is printed, and)-3.052 F +(the command proceeds.)184 610.8 Q +(This option is only used by interacti)5 E .3 -.15(ve s)-.25 H(hells.) +.15 E F1(checkhash)144 622.8 Q F0 2.08(If set,)184 634.8 R F1(bash)4.58 +E F0 2.079(checks that a command found in the hash table e)4.58 F 2.079 +(xists before trying to)-.15 F -.15(exe)184 646.8 S(cute it.).15 E +(If a hashed command no longer e)5 E +(xists, a normal path search is performed.)-.15 E F1(checkjobs)144 658.8 +Q F0 .448(If set,)184 670.8 R F1(bash)2.948 E F0 .448 +(lists the status of an)2.948 F 2.949(ys)-.15 G .449 +(topped and running jobs before e)-2.949 F .449(xiting an interacti)-.15 +F -.15(ve)-.25 G 3.439(shell. If)184 682.8 R(an)3.439 E 3.439(yj)-.15 G +.938(obs are running, this causes the e)-3.439 F .938 +(xit to be deferred until a second e)-.15 F .938(xit is)-.15 F 2.203 +(attempted without an interv)184 694.8 R 2.203(ening command \(see)-.15 +F/F3 9/Times-Bold@0 SF 2.203(JOB CONTR)4.703 F(OL)-.27 E F0(abo)4.453 E +-.15(ve)-.15 G 4.703(\). The).15 F(shell)4.704 E(al)184 706.8 Q -.1(wa) +-.1 G(ys postpones e).1 E(xiting if an)-.15 E 2.5(yj)-.15 G +(obs are stopped.)-2.5 E(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 +E(63)185.955 E 0 Cg EP +%%Page: 64 64 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(checkwinsize)144 84 Q F0 .797(If set,)184 +96 R F1(bash)3.297 E F0 .797(checks the windo)3.297 F 3.297(ws)-.25 G +.796(ize after each command and, if necessary)-3.297 F 3.296(,u)-.65 G +.796(pdates the)-3.296 F -.25(va)184 108 S(lues of).25 E/F2 9 +/Times-Bold@0 SF(LINES)2.5 E F0(and)2.25 E F2(COLUMNS)2.5 E/F3 9 +/Times-Roman@0 SF(.)A F1(cmdhist)144 120 Q F0 1.202(If set,)6.11 F F1 +(bash)3.702 E F0 1.202(attempts to sa)3.702 F 1.502 -.15(ve a)-.2 H +1.202(ll lines of a multiple-line command in the same history).15 F +(entry)184 132 Q 5(.T)-.65 G(his allo)-5 E +(ws easy re-editing of multi-line commands.)-.25 E F1(compat31)144 144 Q +F0 .42(If set,)184 156 R F1(bash)2.92 E F0 .42(changes its beha)2.92 F +.419(vior to that of v)-.2 F .419(ersion 3.1 with respect to quoted ar) +-.15 F(guments)-.18 E(to the conditional command')184 168 Q 2.5(s=)-.55 +G 2.5(~o)-2.5 G(perator)-2.5 E(.)-.55 E F1(compat32)144 180 Q F0 1.409 +(If set,)184 192 R F1(bash)3.909 E F0 1.409(changes its beha)3.909 F +1.409(vior to that of v)-.2 F 1.41 +(ersion 3.2 with respect to locale-speci\214c)-.15 F +(string comparison when using the conditional command')184 204 Q 2.5 +(s<a)-.55 G(nd > operators.)-2.5 E F1(compat40)144 216 Q F0 1.41 +(If set,)184 228 R F1(bash)3.91 E F0 1.41(changes its beha)3.91 F 1.409 +(vior to that of v)-.2 F 1.409 +(ersion 4.0 with respect to locale-speci\214c)-.15 F 1.692 +(string comparison when using the conditional command')184 240 R 4.193 +(s<a)-.55 G 1.693(nd > operators and the)-4.193 F(ef)184 252 Q +(fect of interrupting a command list.)-.25 E F1(dirspell)144 264 Q F0 +.859(If set,)7.77 F F1(bash)3.359 E F0 .858 +(attempts spelling correction on directory names during w)3.359 F .858 +(ord completion if)-.1 F +(the directory name initially supplied does not e)184 276 Q(xist.)-.15 E +F1(dotglob)144 288 Q F0 .165(If set,)7.77 F F1(bash)2.665 E F0 .165 +(includes \214lenames be)2.665 F .165(ginning with a `.)-.15 F 2.665('i) +-.7 G 2.665(nt)-2.665 G .165(he results of pathname e)-2.665 F +(xpansion.)-.15 E F1(execfail)144 300 Q F0 1.387 +(If set, a non-interacti)7.79 F 1.687 -.15(ve s)-.25 H 1.386 +(hell will not e).15 F 1.386(xit if it cannot e)-.15 F -.15(xe)-.15 G +1.386(cute the \214le speci\214ed as an).15 F(ar)184 312 Q +(gument to the)-.18 E F1(exec)2.5 E F0 -.2(bu)2.5 G(iltin command.).2 E +(An interacti)5 E .3 -.15(ve s)-.25 H(hell does not e).15 E(xit if)-.15 +E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(expand_aliases)144 324 Q F0 +.716(If set, aliases are e)184 336 R .717(xpanded as described abo)-.15 +F 1.017 -.15(ve u)-.15 H(nder).15 E F2(ALIASES)3.217 E F3(.)A F0 .717 +(This option is enabled)5.217 F(by def)184 348 Q(ault for interacti)-.1 +E .3 -.15(ve s)-.25 H(hells.).15 E F1(extdeb)144 360 Q(ug)-.2 E F0 +(If set, beha)184 372 Q(vior intended for use by deb)-.2 E +(uggers is enabled:)-.2 E F1(1.)184 384 Q F0(The)28.5 E F1<ad46>4.251 E +F0 1.751(option to the)4.251 F F1(declar)4.251 E(e)-.18 E F0 -.2(bu) +4.251 G 1.751(iltin displays the source \214le name and line).2 F +(number corresponding to each function name supplied as an ar)220 396 Q +(gument.)-.18 E F1(2.)184 408 Q F0 1.667(If the command run by the)28.5 +F F1(DEB)4.167 E(UG)-.1 E F0 1.667(trap returns a non-zero v)4.167 F +1.667(alue, the ne)-.25 F(xt)-.15 E(command is skipped and not e)220 420 +Q -.15(xe)-.15 G(cuted.).15 E F1(3.)184 432 Q F0 .841 +(If the command run by the)28.5 F F1(DEB)3.341 E(UG)-.1 E F0 .841 +(trap returns a v)3.341 F .84(alue of 2, and the shell is)-.25 F -.15 +(exe)220 444 S .488 +(cuting in a subroutine \(a shell function or a shell script e).15 F +-.15(xe)-.15 G .488(cuted by the).15 F F1(.)2.988 E F0(or)2.988 E F1 +(sour)220 456 Q(ce)-.18 E F0 -.2(bu)2.5 G(iltins\), a call to).2 E F1 +-.18(re)2.5 G(tur).18 E(n)-.15 E F0(is simulated.)2.5 E F1(4.)184 468 Q +F2 -.27(BA)28.5 G(SH_ARGC).27 E F0(and)3.154 E F2 -.27(BA)3.404 G +(SH_ARGV).27 E F0 .904(are updated as described in their descriptions) +3.154 F(abo)220 480 Q -.15(ve)-.15 G(.).15 E F1(5.)184 492 Q F0 1.359 +(Function tracing is enabled:)28.5 F 1.359 +(command substitution, shell functions, and sub-)6.359 F(shells in)220 +504 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E/F4 10 +/Times-Italic@0 SF(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1 +(DEB)2.5 E(UG)-.1 E F0(and)2.5 E F1(RETURN)2.5 E F0(traps.)2.5 E F1(6.) +184 516 Q F0 .805(Error tracing is enabled:)28.5 F .804 +(command substitution, shell functions, and subshells)5.805 F(in)220 528 +Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F4 +(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1(ERR)2.5 E(OR)-.3 E F0 +(trap.)2.5 E F1(extglob)144 540 Q F0 .4(If set, the e)8.89 F .4 +(xtended pattern matching features described abo)-.15 F .7 -.15(ve u) +-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 552 Q +F0(are enabled.)2.5 E F1(extquote)144 564 Q F0 2.473(If set,)184 576 R +F1($)4.973 E F0<08>A F4(string)A F0 4.973<0861>C(nd)-4.973 E F1($)4.973 +E F0(")A F4(string)A F0 4.973("q)C 2.473(uoting is performed within) +-4.973 F F1(${)4.973 E F4(par)A(ameter)-.15 E F1(})A F0 -.15(ex)4.973 G +(pansions).15 E(enclosed in double quotes.)184 588 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 600 Q F0 +1.424(If set, patterns which f)7.77 F 1.425 +(ail to match \214lenames during pathname e)-.1 F 1.425 +(xpansion result in an)-.15 F -.15(ex)184 612 S(pansion error).15 E(.) +-.55 E F1 -.25(fo)144 624 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0 +.937(If set, the suf)184 636 R<8c78>-.25 E .936(es speci\214ed by the) +-.15 F F2(FIGNORE)3.436 E F0 .936(shell v)3.186 F .936(ariable cause w) +-.25 F .936(ords to be ignored)-.1 F .32(when performing w)184 648 R .32 +(ord completion e)-.1 F -.15(ve)-.25 G 2.82(ni).15 G 2.82(ft)-2.82 G .32 +(he ignored w)-2.82 F .32(ords are the only possible com-)-.1 F 2.948 +(pletions. See)184 660 R F2 .448(SHELL V)2.948 F(ARIABLES)-1.215 E F0 +(abo)2.698 E .748 -.15(ve f)-.15 H .448(or a description of).15 F F2 +(FIGNORE)2.947 E F3(.)A F0 .447(This option is)4.947 F(enabled by def) +184 672 Q(ault.)-.1 E F1(globstar)144 684 Q F0 .178(If set, the pattern) +5 F F1(**)2.678 E F0 .178(used in a pathname e)2.678 F .178 +(xpansion conte)-.15 F .179(xt will match a \214les and zero or)-.15 F +1.298(more directories and subdirectories.)184 696 R 1.298 +(If the pattern is follo)6.298 F 1.298(wed by a)-.25 F F1(/)3.797 E F0 +3.797(,o)C 1.297(nly directories)-3.797 F(and subdirectories match.)184 +708 Q(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(64)185.955 E 0 Cg +EP +%%Page: 65 65 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(gnu_errfmt)144 84 Q F0(If set, shell error\ + messages are written in the standard GNU error message format.)184 96 Q +F1(histappend)144 108 Q F0 .676 +(If set, the history list is appended to the \214le named by the v)184 +120 R .676(alue of the)-.25 F/F2 9/Times-Bold@0 SF(HISTFILE)3.177 E F0 +-.25(va)2.927 G(ri-).25 E(able when the shell e)184 132 Q +(xits, rather than o)-.15 E -.15(ve)-.15 G(rwriting the \214le.).15 E F1 +(histr)144 144 Q(eedit)-.18 E F0 .576(If set, and)184 156 R F1 -.18(re) +3.076 G(adline).18 E F0 .575(is being used, a user is gi)3.076 F -.15 +(ve)-.25 G 3.075(nt).15 G .575(he opportunity to re-edit a f)-3.075 F +.575(ailed his-)-.1 F(tory substitution.)184 168 Q F1(histv)144 180 Q +(erify)-.1 E F0 .402(If set, and)184 192 R F1 -.18(re)2.903 G(adline).18 +E F0 .403 +(is being used, the results of history substitution are not immediately) +2.903 F .662(passed to the shell parser)184 204 R 5.662(.I)-.55 G .661 +(nstead, the resulting line is loaded into the)-5.662 F F1 -.18(re)3.161 +G(adline).18 E F0(editing)3.161 E -.2(bu)184 216 S -.25(ff).2 G(er).25 E +2.5(,a)-.4 G(llo)-2.5 E(wing further modi\214cation.)-.25 E F1 +(hostcomplete)144 228 Q F0 1.181(If set, and)184 240 R F1 -.18(re)3.681 +G(adline).18 E F0 1.181(is being used,)3.681 F F1(bash)3.682 E F0 1.182 +(will attempt to perform hostname completion)3.682 F 1.381(when a w)184 +252 R 1.381(ord containing a)-.1 F F1(@)3.881 E F0 1.381 +(is being completed \(see)3.881 F F1(Completing)3.88 E F0(under)3.88 E +F2(READLINE)3.88 E F0(abo)184 264 Q -.15(ve)-.15 G 2.5(\). This).15 F +(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 276 Q F0(If set,) +184 288 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0 +(to all jobs when an interacti)2.25 E .3 -.15(ve l)-.25 H(ogin shell e) +.15 E(xits.)-.15 E F1(interacti)144 300 Q -.1(ve)-.1 G(_comments).1 E F0 +.33(If set, allo)184 312 R 2.83(waw)-.25 G .33(ord be)-2.93 F .33 +(ginning with)-.15 F F1(#)2.83 E F0 .33(to cause that w)2.83 F .33 +(ord and all remaining characters on)-.1 F .967 +(that line to be ignored in an interacti)184 324 R 1.267 -.15(ve s)-.25 +H .967(hell \(see).15 F F2(COMMENTS)3.467 E F0(abo)3.217 E -.15(ve)-.15 +G 3.467(\). This).15 F .967(option is)3.467 F(enabled by def)184 336 Q +(ault.)-.1 E F1(lithist)144 348 Q F0 .654(If set, and the)15.55 F F1 +(cmdhist)3.154 E F0 .654(option is enabled, multi-line commands are sa) +3.154 F -.15(ve)-.2 G 3.155(dt).15 G 3.155(ot)-3.155 G .655(he history) +-3.155 F(with embedded ne)184 360 Q +(wlines rather than using semicolon separators where possible.)-.25 E F1 +(login_shell)144 372 Q F0 .486 +(The shell sets this option if it is started as a login shell \(see)184 +384 R F2(INV)2.986 E(OCA)-.405 E(TION)-.855 E F0(abo)2.736 E -.15(ve) +-.15 G 2.986(\). The).15 F -.25(va)184 396 S(lue may not be changed.).25 +E F1(mailwar)144 408 Q(n)-.15 E F0 .814(If set, and a \214le that)184 +420 R F1(bash)3.314 E F0 .815 +(is checking for mail has been accessed since the last time it)3.314 F +-.1(wa)184 432 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E +(`The mail in)-.74 E/F3 10/Times-Italic@0 SF(mail\214le)2.5 E F0 +(has been read')2.5 E 2.5('i)-.74 G 2.5(sd)-2.5 G(isplayed.)-2.5 E F1 +(no_empty_cmd_completion)144 444 Q F0 .325(If set, and)184 456 R F1 -.18 +(re)2.825 G(adline).18 E F0 .325(is being used,)2.825 F F1(bash)2.824 E +F0 .324(will not attempt to search the)2.824 F F2 -.666(PA)2.824 G(TH) +-.189 E F0 .324(for possible)2.574 F +(completions when completion is attempted on an empty line.)184 468 Q F1 +(nocaseglob)144 480 Q F0 .436(If set,)184 492 R F1(bash)2.936 E F0 .436 +(matches \214lenames in a case\255insensiti)2.936 F .737 -.15(ve f)-.25 +H .437(ashion when performing pathname).05 F -.15(ex)184 504 S +(pansion \(see).15 E F1 -.1(Pa)2.5 G(thname Expansion).1 E F0(abo)2.5 E +-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 516 Q F0 1.194(If set,)184 +528 R F1(bash)3.694 E F0 1.194(matches patterns in a case\255insensiti) +3.694 F 1.493 -.15(ve f)-.25 H 1.193(ashion when performing matching).05 +F(while e)184 540 Q -.15(xe)-.15 G(cuting).15 E F1(case)2.5 E F0(or)2.5 +E F1([[)2.5 E F0(conditional commands.)2.5 E F1(nullglob)144 552 Q F0 +.854(If set,)184 564 R F1(bash)3.354 E F0(allo)3.354 E .855 +(ws patterns which match no \214les \(see)-.25 F F1 -.1(Pa)3.355 G .855 +(thname Expansion).1 F F0(abo)3.355 E -.15(ve)-.15 G 3.355(\)t).15 G(o) +-3.355 E -.15(ex)184 576 S(pand to a null string, rather than themselv) +.15 E(es.)-.15 E F1(pr)144 588 Q(ogcomp)-.18 E F0 .677 +(If set, the programmable completion f)184 600 R .677(acilities \(see) +-.1 F F1(Pr)3.176 E .676(ogrammable Completion)-.18 F F0(abo)3.176 E +-.15(ve)-.15 G(\)).15 E(are enabled.)184 612 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(pr)144 624 Q(omptv) +-.18 E(ars)-.1 E F0 1.447(If set, prompt strings under)184 636 R 1.448 +(go parameter e)-.18 F 1.448(xpansion, command substitution, arithmetic) +-.15 F -.15(ex)184 648 S .171(pansion, and quote remo).15 F -.25(va)-.15 +G 2.67(la).25 G .17(fter being e)-2.67 F .17(xpanded as described in) +-.15 F F2(PR)2.67 E(OMPTING)-.27 E F0(abo)2.42 E -.15(ve)-.15 G(.).15 E +(This option is enabled by def)184 660 Q(ault.)-.1 E F1 -.18(re)144 672 +S(stricted_shell).18 E F0 1.069 +(The shell sets this option if it is started in restricted mode \(see) +184 684 R F2 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 696 Q 4.178 +(w\). The)-.25 F -.25(va)4.178 G 1.678(lue may not be changed.).25 F +1.678(This is not reset when the startup \214les are)6.678 F -.15(exe) +184 708 S(cuted, allo).15 E(wing the startup \214les to disco)-.25 E +-.15(ve)-.15 G 2.5(rw).15 G(hether or not a shell is restricted.)-2.5 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(65)185.955 E 0 Cg EP +%%Page: 66 66 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(shift_v)144 84 Q(erbose)-.1 E F0 .501 +(If set, the)184 96 R F1(shift)3.001 E F0 -.2(bu)3.001 G .501 +(iltin prints an error message when the shift count e).2 F .502 +(xceeds the number)-.15 F(of positional parameters.)184 108 Q F1(sour) +144 120 Q(cepath)-.18 E F0 .771(If set, the)184 132 R F1(sour)3.271 E +(ce)-.18 E F0(\()3.271 E F1(.)A F0 3.271(\)b)C .771(uiltin uses the v) +-3.471 F .771(alue of)-.25 F/F2 9/Times-Bold@0 SF -.666(PA)3.27 G(TH) +-.189 E F0 .77(to \214nd the directory containing the)3.02 F +(\214le supplied as an ar)184 144 Q 2.5(gument. This)-.18 F +(option is enabled by def)2.5 E(ault.)-.1 E F1(xpg_echo)144 156 Q F0 +(If set, the)184 168 Q F1(echo)2.5 E F0 -.2(bu)2.5 G(iltin e).2 E +(xpands backslash-escape sequences by def)-.15 E(ault.)-.1 E F1(suspend) +108 180 Q F0([)2.5 E F1<ad66>A F0(])A 1.001(Suspend the e)144 192 R -.15 +(xe)-.15 G 1.001(cution of this shell until it recei).15 F -.15(ve)-.25 +G 3.501(sa).15 G F2(SIGCONT)A F0 3.502(signal. A)3.252 F 1.002 +(login shell cannot be)3.502 F .023(suspended; the)144 204 R F1<ad66> +2.523 E F0 .023(option can be used to o)2.523 F -.15(ve)-.15 G .022 +(rride this and force the suspension.).15 F .022(The return status is) +5.022 F 2.5(0u)144 216 S(nless the shell is a login shell and)-2.5 E F1 +<ad66>2.5 E F0(is not supplied, or if job control is not enabled.)2.5 E +F1(test)108 228 Q/F3 10/Times-Italic@0 SF -.2(ex)2.5 G(pr).2 E F1([)108 +240 Q F3 -.2(ex)2.5 G(pr).2 E F1(])2.5 E F0 1.15 +(Return a status of 0 or 1 depending on the e)6.77 F -.25(va)-.25 G 1.15 +(luation of the conditional e).25 F(xpression)-.15 E F3 -.2(ex)3.65 G +(pr).2 E F0 6.15(.E).73 G(ach)-6.15 E 1.188 +(operator and operand must be a separate ar)144 252 R 3.688 +(gument. Expressions)-.18 F 1.187(are composed of the primaries)3.688 F +1.889(described abo)144 264 R 2.189 -.15(ve u)-.15 H(nder).15 E F2 +(CONDITION)4.389 E 1.889(AL EXPRESSIONS)-.18 F/F4 9/Times-Roman@0 SF(.)A +F1(test)6.389 E F0 1.89(does not accept an)4.389 F 4.39(yo)-.15 G 1.89 +(ptions, nor)-4.39 F(does it accept and ignore an ar)144 276 Q +(gument of)-.18 E F1<adad>2.5 E F0(as signifying the end of options.)2.5 +E .786(Expressions may be combined using the follo)144 294 R .785 +(wing operators, listed in decreasing order of prece-)-.25 F 2.5 +(dence. The)144 306 R -.25(eva)2.5 G +(luation depends on the number of ar).25 E(guments; see belo)-.18 E -.65 +(w.)-.25 G F1(!)144 318 Q F3 -.2(ex)2.5 G(pr).2 E F0 -.35(Tr)12.6 G +(ue if).35 E F3 -.2(ex)2.5 G(pr).2 E F0(is f)3.23 E(alse.)-.1 E F1(\() +144 330 Q F3 -.2(ex)2.5 G(pr).2 E F1(\))2.5 E F0 .26(Returns the v)6.77 +F .26(alue of)-.25 F F3 -.2(ex)2.76 G(pr).2 E F0 5.26(.T)C .26 +(his may be used to o)-5.26 F -.15(ve)-.15 G .26 +(rride the normal precedence of opera-).15 F(tors.)180 342 Q F3 -.2(ex) +144 354 S(pr1).2 E F0<ad>2.5 E F1(a)A F3 -.2(ex)2.5 G(pr2).2 E F0 -.35 +(Tr)180 366 S(ue if both).35 E F3 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 E F3 +-.2(ex)2.5 G(pr2).2 E F0(are true.)2.52 E F3 -.2(ex)144 378 S(pr1).2 E +F0<ad>2.5 E F1(o)A F3 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 390 S +(ue if either).35 E F3 -.2(ex)2.5 G(pr1).2 E F0(or)2.5 E F3 -.2(ex)2.5 G +(pr2).2 E F0(is true.)2.52 E F1(test)144 406.8 Q F0(and)2.5 E F1([)2.5 E +F0 -.25(eva)2.5 G(luate conditional e).25 E +(xpressions using a set of rules based on the number of ar)-.15 E +(guments.)-.18 E 2.5(0a)144 424.8 S -.18(rg)-2.5 G(uments).18 E(The e) +180 436.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(1a)144 448.8 S -.18 +(rg)-2.5 G(ument).18 E(The e)180 460.8 Q +(xpression is true if and only if the ar)-.15 E(gument is not null.)-.18 +E 2.5(2a)144 472.8 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar) +180 484.8 R .37(gument is)-.18 F F1(!)2.87 E F0 2.87(,t)C .37(he e)-2.87 +F .37(xpression is true if and only if the second ar)-.15 F .37 +(gument is null.)-.18 F .379(If the \214rst ar)180 496.8 R .38 +(gument is one of the unary conditional operators listed abo)-.18 F .68 +-.15(ve u)-.15 H(nder).15 E F2(CONDI-)2.88 E(TION)180 508.8 Q .553 +(AL EXPRESSIONS)-.18 F F4(,)A F0 .552(the e)2.802 F .552 +(xpression is true if the unary test is true.)-.15 F .552 +(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 520.8 Q +(alid unary conditional operator)-.25 E 2.5(,t)-.4 G(he e)-2.5 E +(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 532.8 S -.18(rg)-2.5 G +(uments).18 E .023(If the second ar)180 544.8 R .023 +(gument is one of the binary conditional operators listed abo)-.18 F +.324 -.15(ve u)-.15 H(nder).15 E F2(CON-)2.524 E(DITION)180 556.8 Q +1.478(AL EXPRESSIONS)-.18 F F4(,)A F0 1.477(the result of the e)3.727 F +1.477(xpression is the result of the binary test)-.15 F .513 +(using the \214rst and third ar)180 568.8 R .513(guments as operands.) +-.18 F(The)5.513 E F1<ad61>3.013 E F0(and)3.013 E F1<ad6f>3.013 E F0 +.513(operators are considered)3.013 F .972 +(binary operators when there are three ar)180 580.8 R 3.472(guments. If) +-.18 F .972(the \214rst ar)3.472 F .972(gument is)-.18 F F1(!)3.472 E F0 +3.472(,t)C .972(he v)-3.472 F .972(alue is)-.25 F .883(the ne)180 592.8 +R -.05(ga)-.15 G .883(tion of the tw).05 F(o-ar)-.1 E .884 +(gument test using the second and third ar)-.18 F 3.384(guments. If)-.18 +F .884(the \214rst)3.384 F(ar)180 604.8 Q .875(gument is e)-.18 F +(xactly)-.15 E F1(\()3.375 E F0 .875(and the third ar)3.375 F .875 +(gument is e)-.18 F(xactly)-.15 E F1(\))3.375 E F0 3.374(,t)C .874 +(he result is the one-ar)-3.374 F(gument)-.18 E(test of the second ar) +180 616.8 Q 2.5(gument. Otherwise,)-.18 F(the e)2.5 E(xpression is f) +-.15 E(alse.)-.1 E 2.5(4a)144 628.8 S -.18(rg)-2.5 G(uments).18 E .384 +(If the \214rst ar)180 640.8 R .384(gument is)-.18 F F1(!)2.884 E F0 +2.885(,t)C .385(he result is the ne)-2.885 F -.05(ga)-.15 G .385 +(tion of the three-ar).05 F .385(gument e)-.18 F .385(xpression com-) +-.15 F 1.648(posed of the remaining ar)180 652.8 R 4.147 +(guments. Otherwise,)-.18 F 1.647(the e)4.147 F 1.647 +(xpression is parsed and e)-.15 F -.25(va)-.25 G(luated).25 E +(according to precedence using the rules listed abo)180 664.8 Q -.15(ve) +-.15 G(.).15 E 2.5(5o)144 676.8 S 2.5(rm)-2.5 G(ore ar)-2.5 E(guments) +-.18 E 1.635(The e)180 688.8 R 1.635(xpression is parsed and e)-.15 F +-.25(va)-.25 G 1.635 +(luated according to precedence using the rules listed).25 F(abo)180 +700.8 Q -.15(ve)-.15 G(.).15 E F1(times)108 717.6 Q F0 1.229(Print the \ +accumulated user and system times for the shell and for processes run f\ +rom the shell.)13.23 F(The return status is 0.)144 729.6 Q(GNU Bash-4.1) +72 768 Q(2009 December 29)135.965 E(66)185.955 E 0 Cg EP +%%Page: 67 67 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(trap)108 84 Q F0([)2.5 E F1(\255lp)A F0 2.5 +(][)C([)-2.5 E/F2 10/Times-Italic@0 SF(ar)A(g)-.37 E F0(])A F2(sigspec) +2.5 E F0(...])2.5 E .702(The command)144 96 R F2(ar)3.532 E(g)-.37 E F0 +.702(is to be read and e)3.422 F -.15(xe)-.15 G .702 +(cuted when the shell recei).15 F -.15(ve)-.25 G 3.203(ss).15 G +(ignal\(s\))-3.203 E F2(sigspec)3.203 E F0 5.703(.I).31 G(f)-5.703 E F2 +(ar)3.533 E(g)-.37 E F0(is)3.423 E .609(absent \(and there is a single) +144 108 R F2(sigspec)3.108 E F0 3.108(\)o)C(r)-3.108 E F1<ad>3.108 E F0 +3.108(,e)C .608 +(ach speci\214ed signal is reset to its original disposition)-3.108 F +.658(\(the v)144 120 R .658(alue it had upon entrance to the shell\).) +-.25 F(If)5.658 E F2(ar)3.488 E(g)-.37 E F0 .659 +(is the null string the signal speci\214ed by each)3.378 F F2(sigspec) +144.34 132 Q F0 .581(is ignored by the shell and by the commands it in) +3.391 F -.2(vo)-.4 G -.1(ke).2 G 3.08(s. If).1 F F2(ar)3.41 E(g)-.37 E +F0 .58(is not present and)3.3 F F1<ad70>3.08 E F0(has)3.08 E 1.214 +(been supplied, then the trap commands associated with each)144 144 R F2 +(sigspec)4.054 E F0 1.215(are displayed.)4.024 F 1.215(If no ar)6.215 F +(gu-)-.18 E .86(ments are supplied or if only)144 156 R F1<ad70>3.36 E +F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F1(trap)3.36 E F0 .86 +(prints the list of commands associated with each)3.36 F 2.83 +(signal. The)144 168 R F1<ad6c>2.83 E F0 .33(option causes the shell to\ + print a list of signal names and their corresponding num-)2.83 F 4.311 +(bers. Each)144 180 R F2(sigspec)4.651 E F0 1.811 +(is either a signal name de\214ned in <)4.621 F F2(signal.h)A F0 1.81 +(>, or a signal number)B 6.81(.S)-.55 G(ignal)-6.81 E +(names are case insensiti)144 192 Q .3 -.15(ve a)-.25 H +(nd the SIG pre\214x is optional.).15 E 1.648(If a)144 210 R F2(sigspec) +4.488 E F0(is)4.458 E/F3 9/Times-Bold@0 SF(EXIT)4.148 E F0 1.648 +(\(0\) the command)3.898 F F2(ar)4.479 E(g)-.37 E F0 1.649(is e)4.369 F +-.15(xe)-.15 G 1.649(cuted on e).15 F 1.649(xit from the shell.)-.15 F +1.649(If a)6.649 F F2(sigspec)4.489 E F0(is)4.459 E F3(DEB)144 222 Q(UG) +-.09 E/F4 9/Times-Roman@0 SF(,)A F0 1.168(the command)3.418 F F2(ar) +3.998 E(g)-.37 E F0 1.168(is e)3.888 F -.15(xe)-.15 G 1.167 +(cuted before e).15 F -.15(ve)-.25 G(ry).15 E F2 1.167(simple command) +3.667 F F0(,)A F2(for)3.667 E F0(command,)3.667 E F2(case)3.667 E F0 +(com-)3.667 E(mand,)144 234 Q F2(select)2.646 E F0 .146(command, e)2.646 +F -.15(ve)-.25 G .146(ry arithmetic).15 F F2(for)2.646 E F0 .147 +(command, and before the \214rst command e)2.646 F -.15(xe)-.15 G .147 +(cutes in a).15 F .146(shell function \(see)144 246 R F3 .146 +(SHELL GRAMMAR)2.646 F F0(abo)2.396 E -.15(ve)-.15 G 2.646(\). Refer).15 +F .146(to the description of the)2.646 F F1(extdeb)2.645 E(ug)-.2 E F0 +.145(option to)2.645 F(the)144 258 Q F1(shopt)3.2 E F0 -.2(bu)3.2 G .7 +(iltin for details of its ef).2 F .7(fect on the)-.25 F F1(DEB)3.2 E(UG) +-.1 E F0 3.2(trap. If)3.2 F(a)3.2 E F2(sigspec)3.54 E F0(is)3.51 E F3 +(RETURN)3.2 E F4(,)A F0 .701(the com-)2.951 F(mand)144 270 Q F2(ar)3.474 +E(g)-.37 E F0 .644(is e)3.364 F -.15(xe)-.15 G .643 +(cuted each time a shell function or a script e).15 F -.15(xe)-.15 G +.643(cuted with the).15 F F1(.)3.143 E F0(or)3.143 E F1(sour)3.143 E(ce) +-.18 E F0 -.2(bu)3.143 G(iltins).2 E(\214nishes e)144 282 Q -.15(xe)-.15 +G(cuting.).15 E .928(If a)144 300 R F2(sigspec)3.768 E F0(is)3.738 E F3 +(ERR)3.429 E F4(,)A F0 .929(the command)3.179 F F2(ar)3.759 E(g)-.37 E +F0 .929(is e)3.649 F -.15(xe)-.15 G .929(cuted whene).15 F -.15(ve)-.25 +G 3.429(ras).15 G .929(imple command has a non\255zero)-3.429 F -.15(ex) +144 312 S 1.009(it status, subject to the follo).15 F 1.009 +(wing conditions.)-.25 F(The)6.009 E F3(ERR)3.509 E F0 1.009 +(trap is not e)3.259 F -.15(xe)-.15 G 1.008(cuted if the f).15 F 1.008 +(ailed com-)-.1 F .324 +(mand is part of the command list immediately follo)144 324 R .324 +(wing a)-.25 F F1(while)2.824 E F0(or)2.824 E F1(until)2.824 E F0 -.1 +(ke)2.824 G(yw)-.05 E .324(ord, part of the test)-.1 F 1.129(in an)144 +336 R F2(if)3.639 E F0 1.129(statement, part of a command e)5.589 F -.15 +(xe)-.15 G 1.129(cuted in a).15 F F1(&&)3.629 E F0(or)3.629 E/F5 10 +/Symbol SF<efef>3.629 E F0 1.129(list, or if the command')3.629 F 3.628 +(sr)-.55 G(eturn)-3.628 E -.25(va)144 348 S(lue is being in).25 E -.15 +(ve)-.4 G(rted via).15 E F1(!)2.5 E F0 5(.T)C +(hese are the same conditions obe)-5 E(yed by the)-.15 E F1(err)2.5 E +(exit)-.18 E F0(option.)2.5 E 1.095 +(Signals ignored upon entry to the shell cannot be trapped or reset.)144 +366 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662 +(being ignored are reset to their original v)144 378 R .662 +(alues in a subshell or subshell en)-.25 F .661(vironment when one is) +-.4 F 2.5(created. The)144 390 R(return status is f)2.5 E(alse if an)-.1 +E(y)-.15 E F2(sigspec)2.84 E F0(is in)2.81 E -.25(va)-.4 G +(lid; otherwise).25 E F1(trap)2.5 E F0(returns true.)2.5 E F1(type)108 +406.8 Q F0([)2.5 E F1(\255aftpP)A F0(])A F2(name)2.5 E F0([)2.5 E F2 +(name)A F0(...])2.5 E -.4(Wi)144 418.8 S .173 +(th no options, indicate ho).4 F 2.673(we)-.25 G(ach)-2.673 E F2(name) +3.033 E F0 -.1(wo)2.853 G .174 +(uld be interpreted if used as a command name.).1 F .174(If the)5.174 F +F1<ad74>144 430.8 Q F0 .843(option is used,)3.343 F F1(type)3.343 E F0 +.843(prints a string which is one of)3.343 F F2(alias)3.343 E F0(,).27 E +F2 -.1(ke)3.343 G(ywor)-.2 E(d)-.37 E F0(,).77 E F2(function)3.343 E F0 +(,).24 E F2 -.2(bu)3.342 G(iltin).2 E F0 3.342(,o).24 G(r)-3.342 E F2 +(\214le)5.252 E F0(if)3.522 E F2(name)144.36 442.8 Q F0 .086 +(is an alias, shell reserv)2.766 F .086(ed w)-.15 F .086 +(ord, function, b)-.1 F .087(uiltin, or disk \214le, respecti)-.2 F -.15 +(ve)-.25 G(ly).15 E 5.087(.I)-.65 G 2.587(ft)-5.087 G(he)-2.587 E F2 +(name)2.947 E F0 .087(is not)2.767 F .119 +(found, then nothing is printed, and an e)144 454.8 R .118 +(xit status of f)-.15 F .118(alse is returned.)-.1 F .118(If the)5.118 F +F1<ad70>2.618 E F0 .118(option is used,)2.618 F F1(type)2.618 E F0 .855 +(either returns the name of the disk \214le that w)144 466.8 R .855 +(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F2(name)3.715 E F0 +.855(were speci\214ed as a com-)3.535 F .641(mand name, or nothing if) +144 478.8 R/F6 10/Courier@0 SF .641(type -t name)3.141 F F0 -.1(wo)3.141 +G .641(uld not return).1 F F2(\214le)3.14 E F0 5.64(.T).18 G(he)-5.64 E +F1<ad50>3.14 E F0 .64(option forces a)3.14 F F3 -.666(PA)3.14 G(TH)-.189 +E F0 .112(search for each)144 490.8 R F2(name)2.612 E F0 2.612(,e)C -.15 +(ve)-2.862 G 2.613(ni).15 G(f)-2.613 E F6 .113(type -t name)2.613 F F0 +-.1(wo)2.613 G .113(uld not return).1 F F2(\214le)2.613 E F0 5.113(.I) +.18 G 2.613(fac)-5.113 G .113(ommand is hashed,)-2.613 F F1<ad70>2.613 E +F0(and)144 502.8 Q F1<ad50>2.945 E F0 .445(print the hashed v)2.945 F +.444(alue, not necessarily the \214le that appears \214rst in)-.25 F F3 +-.666(PA)2.944 G(TH)-.189 E F4(.)A F0 .444(If the)4.944 F F1<ad61>2.944 +E F0(option)2.944 E .265(is used,)144 514.8 R F1(type)2.765 E F0 .265 +(prints all of the places that contain an e)2.765 F -.15(xe)-.15 G .265 +(cutable named).15 F F2(name)2.765 E F0 5.265(.T).18 G .265 +(his includes aliases)-5.265 F .427(and functions, if and only if the) +144 526.8 R F1<ad70>2.926 E F0 .426(option is not also used.)2.926 F +.426(The table of hashed commands is not)5.426 F .548 +(consulted when using)144 538.8 R F1<ad61>3.048 E F0 5.548(.T)C(he) +-5.548 E F1<ad66>3.048 E F0 .549 +(option suppresses shell function lookup, as with the)3.048 F F1 +(command)3.049 E F0 -.2(bu)144 550.8 S(iltin.).2 E F1(type)5 E F0 +(returns true if all of the ar)2.5 E(guments are found, f)-.18 E +(alse if an)-.1 E 2.5(ya)-.15 G(re not found.)-2.5 E F1(ulimit)108 567.6 +Q F0([)2.5 E F1(\255HST)A(abcde\214lmnpqrstuvx)-.92 E F0([)2.5 E F2 +(limit)A F0(]])A(Pro)144 579.6 Q .244(vides control o)-.15 F -.15(ve) +-.15 G 2.744(rt).15 G .244(he resources a)-2.744 F -.25(va)-.2 G .244 +(ilable to the shell and to processes started by it, on systems).25 F +.943(that allo)144 591.6 R 3.443(ws)-.25 G .943(uch control.)-3.443 F +(The)5.943 E F1<ad48>3.443 E F0(and)3.443 E F1<ad53>3.444 E F0 .944 +(options specify that the hard or soft limit is set for the)3.444 F(gi) +144 603.6 Q -.15(ve)-.25 G 2.709(nr).15 G 2.709(esource. A)-2.709 F .208 +(hard limit cannot be increased by a non-root user once it is set; a so\ +ft limit may)2.709 F .425(be increased up to the v)144 615.6 R .425 +(alue of the hard limit.)-.25 F .426(If neither)5.425 F F1<ad48>2.926 E +F0(nor)2.926 E F1<ad53>2.926 E F0 .426 +(is speci\214ed, both the soft and)2.926 F .139(hard limits are set.)144 +627.6 R .139(The v)5.139 F .139(alue of)-.25 F F2(limit)2.729 E F0 .139 +(can be a number in the unit speci\214ed for the resource or one)3.319 F +.741(of the special v)144 639.6 R(alues)-.25 E F1(hard)3.241 E F0(,)A F1 +(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F1(unlimited)3.241 E F0 3.241(,w) +C .741(hich stand for the current hard limit, the current)-3.241 F .78 +(soft limit, and no limit, respecti)144 651.6 R -.15(ve)-.25 G(ly).15 E +5.78(.I)-.65 G(f)-5.78 E F2(limit)3.37 E F0 .78 +(is omitted, the current v)3.96 F .78(alue of the soft limit of the)-.25 +F .498(resource is printed, unless the)144 663.6 R F1<ad48>2.999 E F0 +.499(option is gi)2.999 F -.15(ve)-.25 G 2.999(n. When).15 F .499 +(more than one resource is speci\214ed, the)2.999 F +(limit name and unit are printed before the v)144 675.6 Q 2.5 +(alue. Other)-.25 F(options are interpreted as follo)2.5 E(ws:)-.25 E F1 +<ad61>144 687.6 Q F0(All current limits are reported)25.3 E F1<ad62>144 +699.6 Q F0(The maximum sock)24.74 E(et b)-.1 E(uf)-.2 E(fer size)-.25 E +F1<ad63>144 711.6 Q F0(The maximum size of core \214les created)25.86 E +(GNU Bash-4.1)72 768 Q(2009 December 29)135.965 E(67)185.955 E 0 Cg EP +%%Page: 68 68 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF<ad64>144 84 Q F0 +(The maximum size of a process')24.74 E 2.5(sd)-.55 G(ata se)-2.5 E +(gment)-.15 E F1<ad65>144 96 Q F0 +(The maximum scheduling priority \("nice"\))25.86 E F1<ad66>144 108 Q F0 +(The maximum size of \214les written by the shell and its children)26.97 +E F1<ad69>144 120 Q F0(The maximum number of pending signals)27.52 E F1 +<ad6c>144 132 Q F0(The maximum size that may be lock)27.52 E +(ed into memory)-.1 E F1<ad6d>144 144 Q F0 +(The maximum resident set size \(man)21.97 E 2.5(ys)-.15 G +(ystems do not honor this limit\))-2.5 E F1<ad6e>144 156 Q F0 .791(The \ +maximum number of open \214le descriptors \(most systems do not allo) +24.74 F 3.29(wt)-.25 G .79(his v)-3.29 F .79(alue to)-.25 F(be set\))180 +168 Q F1<ad70>144 180 Q F0 +(The pipe size in 512-byte blocks \(this may not be set\))24.74 E F1 +<ad71>144 192 Q F0(The maximum number of bytes in POSIX message queues) +24.74 E F1<ad72>144 204 Q F0(The maximum real-time scheduling priority) +25.86 E F1<ad73>144 216 Q F0(The maximum stack size)26.41 E F1<ad74>144 +228 Q F0(The maximum amount of cpu time in seconds)26.97 E F1<ad75>144 +240 Q F0(The maximum number of processes a)24.74 E -.25(va)-.2 G +(ilable to a single user).25 E F1<ad76>144 252 Q F0 +(The maximum amount of virtual memory a)25.3 E -.25(va)-.2 G +(ilable to the shell).25 E F1<ad78>144 264 Q F0 +(The maximum number of \214le locks)25.3 E F1<ad54>144 276 Q F0 +(The maximum number of threads)23.63 E(If)144 292.8 Q/F2 10 +/Times-Italic@0 SF(limit)2.933 E F0 .343(is gi)3.523 F -.15(ve)-.25 G +.343(n, it is the ne).15 F 2.843(wv)-.25 G .343 +(alue of the speci\214ed resource \(the)-3.093 F F1<ad61>2.843 E F0 .343 +(option is display only\).)2.843 F .343(If no)5.343 F .176(option is gi) +144 304.8 R -.15(ve)-.25 G .176(n, then).15 F F1<ad66>2.676 E F0 .175 +(is assumed.)2.676 F -1.11(Va)5.175 G .175 +(lues are in 1024-byte increments, e)1.11 F .175(xcept for)-.15 F F1 +<ad74>2.675 E F0 2.675(,w)C .175(hich is in)-2.675 F(seconds,)144 316.8 +Q F1<ad70>2.515 E F0 2.515(,w)C .015 +(hich is in units of 512-byte blocks, and)-2.515 F F1<ad54>2.516 E F0(,) +A F1<ad62>2.516 E F0(,)A F1<ad6e>2.516 E F0 2.516(,a)C(nd)-2.516 E F1 +<ad75>2.516 E F0 2.516(,w)C .016(hich are unscaled v)-2.516 F(al-)-.25 E +3.788(ues. The)144 328.8 R 1.287(return status is 0 unless an in)3.787 F +-.25(va)-.4 G 1.287(lid option or ar).25 F 1.287 +(gument is supplied, or an error occurs)-.18 F(while setting a ne)144 +340.8 Q 2.5(wl)-.25 G(imit.)-2.5 E F1(umask)108 357.6 Q F0([)2.5 E F1 +<ad70>A F0 2.5(][)C F1<ad53>-2.5 E F0 2.5(][)C F2(mode)-2.5 E F0(])A .2 +(The user \214le-creation mask is set to)144 369.6 R F2(mode)2.7 E F0 +5.2(.I).18 G(f)-5.2 E F2(mode)3.08 E F0(be)2.88 E .2 +(gins with a digit, it is interpreted as an octal)-.15 F .066(number; o\ +therwise it is interpreted as a symbolic mode mask similar to that acce\ +pted by)144 381.6 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144 +393.6 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382 +(alue of the mask is printed.)-.25 F(The)5.382 E F1<ad53>2.882 E F0 .382 +(option causes the mask to be)2.882 F .547 +(printed in symbolic form; the def)144 405.6 R .547 +(ault output is an octal number)-.1 F 5.547(.I)-.55 G 3.047(ft)-5.547 G +(he)-3.047 E F1<ad70>3.047 E F0 .547(option is supplied, and)3.047 F F2 +(mode)144.38 417.6 Q F0 .551 +(is omitted, the output is in a form that may be reused as input.)3.231 +F .552(The return status is 0 if the)5.552 F(mode w)144 429.6 Q +(as successfully changed or if no)-.1 E F2(mode)2.5 E F0(ar)2.5 E +(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E F1 +(unalias)108 446.4 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0 +(...])2.5 E(Remo)144 458.4 Q 1.955 -.15(ve e)-.15 H(ach).15 E F2(name) +4.155 E F0 1.655(from the list of de\214ned aliases.)4.155 F(If)6.655 E +F1<ad61>4.155 E F0 1.655(is supplied, all alias de\214nitions are)4.155 +F(remo)144 470.4 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E +(alue is true unless a supplied)-.25 E F2(name)2.86 E F0 +(is not a de\214ned alias.)2.68 E F1(unset)108 487.2 Q F0<5bad>2.5 E F1 +(fv)A F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E -.15(Fo)144 499.2 S 3.106 +(re).15 G(ach)-3.106 E F2(name)3.106 E F0 3.106(,r).18 G(emo)-3.106 E +.906 -.15(ve t)-.15 H .606(he corresponding v).15 F .607 +(ariable or function.)-.25 F .607(If no options are supplied, or the) +5.607 F F1<ad76>144 511.2 Q F0 .305(option is gi)2.805 F -.15(ve)-.25 G +.305(n, each).15 F F2(name)3.165 E F0 .305(refers to a shell v)2.985 F +2.805(ariable. Read-only)-.25 F -.25(va)2.805 G .304 +(riables may not be unset.).25 F(If)5.304 E F1<ad66>144 523.2 Q F0 .459 +(is speci\214ed, each)2.959 F F2(name)3.319 E F0 .459 +(refers to a shell function, and the function de\214nition is remo)3.139 +F -.15(ve)-.15 G 2.96(d. Each).15 F .903(unset v)144 535.2 R .903 +(ariable or function is remo)-.25 F -.15(ve)-.15 G 3.402(df).15 G .902 +(rom the en)-3.402 F .902(vironment passed to subsequent commands.)-.4 F +(If)5.902 E(an)144 547.2 Q 6.915(yo)-.15 G(f)-6.915 E/F3 9/Times-Bold@0 +SF(COMP_W)6.915 E(ORDBREAKS)-.09 E/F4 9/Times-Roman@0 SF(,)A F3(RANDOM) +6.665 E F4(,)A F3(SECONDS)6.665 E F4(,)A F3(LINENO)6.665 E F4(,)A F3 +(HISTCMD)6.666 E F4(,)A F3(FUNCN)6.666 E(AME)-.18 E F4(,)A F3(GR)144 +559.2 Q(OUPS)-.27 E F4(,)A F0(or)2.523 E F3(DIRST)2.773 E -.495(AC)-.81 +G(K).495 E F0 .272(are unset, the)2.522 F 2.772(yl)-.15 G .272 +(ose their special properties, e)-2.772 F -.15(ve)-.25 G 2.772(ni).15 G +2.772(ft)-2.772 G(he)-2.772 E 2.772(ya)-.15 G .272(re subsequently) +-2.772 F 2.5(reset. The)144 571.2 R -.15(ex)2.5 G +(it status is true unless a).15 E F2(name)2.86 E F0(is readonly)2.68 E +(.)-.65 E F1(wait)108 588 Q F0([)2.5 E F2 2.5(n.)C(..)-2.5 E F0(])A -.8 +(Wa)144 600 S .288 +(it for each speci\214ed process and return its termination status.).8 F +(Each)5.288 E F2(n)3.148 E F0 .288(may be a process ID or a)3.028 F .722 +(job speci\214cation; if a job spec is gi)144 612 R -.15(ve)-.25 G .722 +(n, all processes in that job').15 F 3.222(sp)-.55 G .722(ipeline are w) +-3.222 F .722(aited for)-.1 F 5.722(.I)-.55 G(f)-5.722 E F2(n)3.582 E F0 +(is)3.462 E 1.265(not gi)144 624 R -.15(ve)-.25 G 1.265 +(n, all currently acti).15 F 1.565 -.15(ve c)-.25 H 1.265 +(hild processes are w).15 F 1.265(aited for)-.1 F 3.765(,a)-.4 G 1.266 +(nd the return status is zero.)-3.765 F(If)6.266 E F2(n)4.126 E F0 .457 +(speci\214es a non-e)144 636 R .457 +(xistent process or job, the return status is 127.)-.15 F .457 +(Otherwise, the return status is the)5.457 F -.15(ex)144 648 S +(it status of the last process or job w).15 E(aited for)-.1 E(.)-.55 E +/F5 10.95/Times-Bold@0 SF(RESTRICTED SHELL)72 664.8 Q F0(If)108 676.8 Q +F1(bash)4.396 E F0 1.896(is started with the name)4.396 F F1(rbash)4.397 +E F0 4.397(,o)C 4.397(rt)-4.397 G(he)-4.397 E F1<ad72>4.397 E F0 1.897 +(option is supplied at in)4.397 F -.2(vo)-.4 G 1.897 +(cation, the shell becomes).2 F 3.446(restricted. A)108 688.8 R .945 +(restricted shell is used to set up an en)3.446 F .945 +(vironment more controlled than the standard shell.)-.4 F(It)5.945 E +(beha)108 700.8 Q -.15(ve)-.2 G 2.5(si).15 G(dentically to)-2.5 E F1 +(bash)2.5 E F0(with the e)2.5 E(xception that the follo)-.15 E +(wing are disallo)-.25 E(wed or not performed:)-.25 E 32.5<8363>108 +717.6 S(hanging directories with)-32.5 E F1(cd)2.5 E F0(GNU Bash-4.1)72 +768 Q(2009 December 29)135.965 E(68)185.955 E 0 Cg EP +%%Page: 69 69 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 32.5<8373>108 84 S(etting or unsetting the v)-32.5 E(alues of) +-.25 E/F1 9/Times-Bold@0 SF(SHELL)2.5 E/F2 9/Times-Roman@0 SF(,)A F1 +-.666(PA)2.25 G(TH)-.189 E F2(,)A F1(ENV)2.25 E F2(,)A F0(or)2.25 E F1 +-.27(BA)2.5 G(SH_ENV).27 E F0 32.5<8373>108 100.8 S +(pecifying command names containing)-32.5 E/F3 10/Times-Bold@0 SF(/)2.5 +E F0 32.5<8373>108 117.6 S(pecifying a \214le name containing a)-32.5 E +F3(/)2.5 E F0(as an ar)2.5 E(gument to the)-.18 E F3(.)2.5 E F0 -.2(bu)5 +G(iltin command).2 E 32.5<8353>108 134.4 S .351 +(pecifying a \214lename containing a slash as an ar)-32.5 F .351 +(gument to the)-.18 F F3<ad70>2.851 E F0 .351(option to the)2.851 F F3 +(hash)2.852 E F0 -.2(bu)2.852 G .352(iltin com-).2 F(mand)144 146.4 Q +32.5<8369>108 163.2 S(mporting function de\214nitions from the shell en) +-32.5 E(vironment at startup)-.4 E 32.5<8370>108 180 S(arsing the v) +-32.5 E(alue of)-.25 E F1(SHELLOPTS)2.5 E F0(from the shell en)2.25 E +(vironment at startup)-.4 E 32.5<8372>108 196.8 S(edirecting output usi\ +ng the >, >|, <>, >&, &>, and >> redirection operators)-32.5 E 32.5 +<8375>108 213.6 S(sing the)-32.5 E F3(exec)2.5 E F0 -.2(bu)2.5 G +(iltin command to replace the shell with another command).2 E 32.5<8361> +108 230.4 S(dding or deleting b)-32.5 E(uiltin commands with the)-.2 E +F3<ad66>2.5 E F0(and)2.5 E F3<ad64>2.5 E F0(options to the)2.5 E F3 +(enable)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8355>108 247.2 S +(sing the)-32.5 E F3(enable)2.5 E F0 -.2(bu)2.5 G +(iltin command to enable disabled shell b).2 E(uiltins)-.2 E 32.5<8373> +108 264 S(pecifying the)-32.5 E F3<ad70>2.5 E F0(option to the)2.5 E F3 +(command)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8374>108 280.8 S +(urning of)-32.5 E 2.5(fr)-.25 G(estricted mode with)-2.5 E F3(set +r) +2.5 E F0(or)2.5 E F3(set +o r)2.5 E(estricted)-.18 E F0(.)A +(These restrictions are enforced after an)108 297.6 Q 2.5(ys)-.15 G +(tartup \214les are read.)-2.5 E 1.566 +(When a command that is found to be a shell script is e)108 314.4 R -.15 +(xe)-.15 G 1.566(cuted \(see).15 F F1 1.566(COMMAND EXECUTION)4.066 F F0 +(abo)3.816 E -.15(ve)-.15 G(\),).15 E F3(rbash)108 326.4 Q F0(turns of) +2.5 E 2.5(fa)-.25 G .3 -.15(ny r)-2.5 H(estrictions in the shell spa).15 +E(wned to e)-.15 E -.15(xe)-.15 G(cute the script.).15 E/F4 10.95 +/Times-Bold@0 SF(SEE ALSO)72 343.2 Q/F5 10/Times-Italic@0 SF(Bash Refer) +108 355.2 Q(ence Manual)-.37 E F0 2.5(,B)C(rian F)-2.5 E +(ox and Chet Rame)-.15 E(y)-.15 E F5(The Gnu Readline Libr)108 367.2 Q +(ary)-.15 E F0 2.5(,B)C(rian F)-2.5 E(ox and Chet Rame)-.15 E(y)-.15 E +F5(The Gnu History Libr)108 379.2 Q(ary)-.15 E F0 2.5(,B)C(rian F)-2.5 E +(ox and Chet Rame)-.15 E(y)-.15 E F5 -.8(Po)108 391.2 S(rtable Oper).8 E +(ating System Interface \(POSIX\) P)-.15 E(art 2: Shell and Utilities) +-.8 E F0 2.5(,I)C(EEE)-2.5 E F5(sh)108 403.2 Q F0(\(1\),)A F5(ksh)2.5 E +F0(\(1\),)A F5(csh)2.5 E F0(\(1\))A F5(emacs)108 415.2 Q F0(\(1\),)A F5 +(vi)2.5 E F0(\(1\))A F5 -.37(re)108 427.2 S(adline).37 E F0(\(3\))A F4 +(FILES)72 444 Q F5(/bin/bash)109.666 456 Q F0(The)144 468 Q F3(bash)2.5 +E F0 -.15(exe)2.5 G(cutable).15 E F5(/etc/pr)109.666 480 Q(o\214le)-.45 +E F0(The systemwide initialization \214le, e)144 492 Q -.15(xe)-.15 G +(cuted for login shells).15 E F5(~/.bash_pr)109.666 504 Q(o\214le)-.45 E +F0(The personal initialization \214le, e)144 516 Q -.15(xe)-.15 G +(cuted for login shells).15 E F5(~/.bashr)109.666 528 Q(c)-.37 E F0 +(The indi)144 540 Q(vidual per)-.25 E(-interacti)-.2 E -.15(ve)-.25 G +(-shell startup \214le).15 E F5(~/.bash_lo)109.666 552 Q(gout)-.1 E F0 +(The indi)144 564 Q(vidual login shell cleanup \214le, e)-.25 E -.15(xe) +-.15 G(cuted when a login shell e).15 E(xits)-.15 E F5(~/.inputr)109.666 +576 Q(c)-.37 E F0(Indi)144 588 Q(vidual)-.25 E F5 -.37(re)2.5 G(adline) +.37 E F0(initialization \214le)2.5 E F4 -.548(AU)72 604.8 S(THORS).548 E +F0(Brian F)108 616.8 Q(ox, Free Softw)-.15 E(are F)-.1 E(oundation)-.15 +E(bfox@gnu.or)108 628.8 Q(g)-.18 E(Chet Rame)108 645.6 Q 1.3 -.65(y, C) +-.15 H(ase W).65 E(estern Reserv)-.8 E 2.5(eU)-.15 G(ni)-2.5 E -.15(ve) +-.25 G(rsity).15 E(chet.rame)108 657.6 Q(y@case.edu)-.15 E F4 -.11(BU)72 +674.4 S 2.738(GR).11 G(EPOR)-2.738 E(TS)-.438 E F0 .567 +(If you \214nd a b)108 686.4 R .568(ug in)-.2 F F3(bash,)3.068 E F0 .568 +(you should report it.)3.068 F .568(But \214rst, you should mak)5.568 F +3.068(es)-.1 G .568(ure that it really is a b)-3.068 F .568(ug, and)-.2 +F 5.626(that it appears in the latest v)108 698.4 R 5.625(ersion of)-.15 +F F3(bash)8.125 E F0 10.625(.T)C 5.625(he latest v)-10.625 F 5.625 +(ersion is al)-.15 F -.1(wa)-.1 G 5.625(ys a).1 F -.25(va)-.2 G 5.625 +(ilable from).25 F F5(ftp://ftp.gnu.or)108 710.4 Q(g/pub/bash/)-.37 E F0 +(.)A .41(Once you ha)108 727.2 R .71 -.15(ve d)-.2 H .41 +(etermined that a b).15 F .41(ug actually e)-.2 F .411(xists, use the) +-.15 F F5(bashb)3.181 E(ug)-.2 E F0 .411(command to submit a b)3.131 F +.411(ug report.)-.2 F(If)5.411 E(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(69)185.955 E 0 Cg EP +%%Page: 70 70 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .595(you ha)108 84 R .895 -.15(ve a \214)-.2 H .595 +(x, you are encouraged to mail that as well!).15 F .594 +(Suggestions and `philosophical' b)5.595 F .594(ug reports may)-.2 F +(be mailed to)108 96 Q/F1 10/Times-Italic@0 SF -.2(bu)2.5 G +(g-bash@gnu.or).2 E(g)-.37 E F0(or posted to the Usenet ne)2.5 E +(wsgroup)-.25 E/F2 10/Times-Bold@0 SF(gnu.bash.b)2.5 E(ug)-.2 E F0(.)A +(ALL b)108 112.8 Q(ug reports should include:)-.2 E(The v)108 129.6 Q +(ersion number of)-.15 E F2(bash)2.5 E F0(The hardw)108 141.6 Q +(are and operating system)-.1 E(The compiler used to compile)108 153.6 Q +2.5(Ad)108 165.6 S(escription of the b)-2.5 E(ug beha)-.2 E(viour)-.2 E +2.5(As)108 177.6 S(hort script or `recipe' which e)-2.5 E -.15(xe)-.15 G +(rcises the b).15 E(ug)-.2 E F1(bashb)108.27 194.4 Q(ug)-.2 E F0 +(inserts the \214rst three items automatically into the template it pro) +2.72 E(vides for \214ling a b)-.15 E(ug report.)-.2 E(Comments and b)108 +211.2 Q(ug reports concerning this manual page should be directed to)-.2 +E F1 -.15(ch)2.5 G(et@po.cwru.edu).15 E F0(.).25 E/F3 10.95/Times-Bold@0 +SF -.11(BU)72 228 S(GS).11 E F0(It')108 240 Q 2.5(st)-.55 G +(oo big and too slo)-2.5 E -.65(w.)-.25 G 1.868 +(There are some subtle dif)108 256.8 R 1.868(ferences between)-.25 F F2 +(bash)4.369 E F0 1.869(and traditional v)4.369 F 1.869(ersions of)-.15 F +F2(sh)4.369 E F0 4.369(,m)C 1.869(ostly because of the)-4.369 F/F4 9 +/Times-Bold@0 SF(POSIX)108 268.8 Q F0(speci\214cation.)2.25 E +(Aliases are confusing in some uses.)108 285.6 Q(Shell b)108 302.4 Q +(uiltin commands and functions are not stoppable/restartable.)-.2 E +1.315(Compound commands and command sequences of the form `a ; b ; c' a\ +re not handled gracefully when)108 319.2 R .389 +(process suspension is attempted.)108 331.2 R .389 +(When a process is stopped, the shell immediately e)5.389 F -.15(xe)-.15 +G .39(cutes the ne).15 F .39(xt com-)-.15 F .193(mand in the sequence.) +108 343.2 R .192(It suf)5.193 F .192(\214ces to place the sequence of c\ +ommands between parentheses to force it into a)-.25 F +(subshell, which may be stopped as a unit.)108 355.2 Q(Array v)108 372 Q +(ariables may not \(yet\) be e)-.25 E(xported.)-.15 E +(There may be only one acti)108 388.8 Q .3 -.15(ve c)-.25 H +(oprocess at a time.).15 E(GNU Bash-4.1)72 768 Q(2009 December 29) +135.965 E(70)185.955 E 0 Cg EP +%%Trailer +end +%%EOF diff --git a/doc/bashbug.0 b/doc/bashbug.0 new file mode 100644 index 0000000..41fc1ed --- /dev/null +++ b/doc/bashbug.0 @@ -0,0 +1,50 @@ +BASHBUG(1) BASHBUG(1) + + + +NNAAMMEE + bashbug - report a bug in bash + +SSYYNNOOPPSSIISS + bbaasshhbbuugg [_-_-_v_e_r_s_i_o_n] [_-_-_h_e_l_p] [_e_m_a_i_l_-_a_d_d_r_e_s_s] + +DDEESSCCRRIIPPTTIIOONN + bbaasshhbbuugg is a shell script to help the user compose and mail bug reports + concerning bash in a standard format. bbaasshhbbuugg invokes the editor spec- + ified by the environment variable EEDDIITTOORR on a temporary copy of the bug + report format outline. The user must fill in the appropriate fields and + exit the editor. bbaasshhbbuugg then mails the completed report to _b_u_g_- + _b_a_s_h_@_g_n_u_._o_r_g, or _e_m_a_i_l_-_a_d_d_r_e_s_s. If the report cannot be mailed, it is + saved in the file _d_e_a_d_._b_a_s_h_b_u_g in the invoking user's home directory. + + The bug report format outline consists of several sections. The first + section provides information about the machine, operating system, the + bash version, and the compilation environment. The second section + should be filled in with a description of the bug. The third section + should be a description of how to reproduce the bug. The optional + fourth section is for a proposed fix. Fixes are encouraged. + +EENNVVIIRROONNMMEENNTT + bbaasshhbbuugg will utilize the following environment variables if they exist: + + EEDDIITTOORR Specifies the preferred editor. If EEDDIITTOORR is not set, bbaasshhbbuugg + defaults to eemmaaccss. + + HHOOMMEE Directory in which the failed bug report is saved if the mail + fails. + + TTMMPPDDIIRR Directory in which to create temporary files and directories. + +SSEEEE AALLSSOO + _b_a_s_h(1) + +AAUUTTHHOORRSS + Brian Fox, Free Software Foundation + bfox@gnu.org + + Chet Ramey, Case Western Reserve University + chet@po.cwru.edu + + + +GNU Bash-4.0 1998 July 30 BASHBUG(1) diff --git a/doc/bashbug.1 b/doc/bashbug.1 index 971e4c4..962cb9c 100644 --- a/doc/bashbug.1 +++ b/doc/bashbug.1 @@ -1,8 +1,17 @@ -.TH BASHBUG 1 "1998 July 30" GNU +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet@po.cwru.edu +.\" +.\" Last Change: Tue Apr 3 15:46:30 EDT 2007 +.\" +.TH BASHBUG 1 "1998 July 30" "GNU Bash-4.0" .SH NAME bashbug \- report a bug in bash .SH SYNOPSIS -\fBbashbug\fP [\fIaddress\fP] +\fBbashbug\fP [\fI--version\fP] [\fI--help\fP] [\fIemail-address\fP] .SH DESCRIPTION .B bashbug is a shell script to help the user compose and mail bug reports @@ -15,7 +24,7 @@ on a temporary copy of the bug report format outline. The user must fill in the appropriate fields and exit the editor. .B bashbug then mails the completed report to \fIbug-bash@gnu.org\fP, or -\fIaddress\fP. If the report cannot be mailed, it is saved in the +\fIemail-address\fP. If the report cannot be mailed, it is saved in the file \fIdead.bashbug\fP in the invoking user's home directory. .PP The bug report format outline consists of several sections. The first @@ -39,3 +48,17 @@ defaults to .TP .B HOME Directory in which the failed bug report is saved if the mail fails. +.TP +.B TMPDIR +Directory in which to create temporary files and directories. +.SH "SEE ALSO" +.TP +\fIbash\fP(1) +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet@po.cwru.edu diff --git a/doc/bashbug.ps b/doc/bashbug.ps new file mode 100644 index 0000000..efbcdda --- /dev/null +++ b/doc/bashbug.ps @@ -0,0 +1,284 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Mon Nov 17 17:38:06 2008 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 1 +%%PageOrder: Ascend +%%DocumentMedia: Default 595 842 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron +/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O +/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y +/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE +/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SHB).35 E 347.52(UG\(1\) B)-.1 F +(ASHB)-.35 E(UG\(1\))-.1 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME) +.219 E F0(bashb)108 96 Q(ug \255 report a b)-.2 E(ug in bash)-.2 E F1 +(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(bashb)108 124.8 Q(ug)-.2 E F0 +([)2.5 E/F3 10/Times-Italic@0 SF(--ver)A(sion)-.1 E F0 2.5(][)C F3 +(--help)-2.5 E F0 2.5(][)C F3(email-addr)-2.5 E(ess)-.37 E F0(])A F1 +(DESCRIPTION)72 141.6 Q F2(bashb)108 153.6 Q(ug)-.2 E F0 .446 +(is a shell script to help the user compose and mail b)2.947 F .446 +(ug reports concerning bash in a standard for)-.2 F(-)-.2 E(mat.)108 +165.6 Q F2(bashb)5.961 E(ug)-.2 E F0(in)3.461 E -.2(vo)-.4 G -.1(ke).2 G +3.461(st).1 G .962(he editor speci\214ed by the en)-3.461 F .962 +(vironment v)-.4 F(ariable)-.25 E/F4 9/Times-Bold@0 SF(EDIT)3.462 E(OR) +-.162 E F0 .962(on a temporary cop)3.212 F 3.462(yo)-.1 G(f)-3.462 E +.374(the b)108 177.6 R .374(ug report format outline. The user must \ +\214ll in the appropriate \214elds and e)-.2 F .374(xit the editor)-.15 +F(.)-.55 E F2(bashb)5.373 E(ug)-.2 E F0(then)2.873 E 1.141 +(mails the completed report to)108 189.6 R F3 -.2(bu)3.641 G +(g-bash@gnu.or).2 E(g)-.37 E F0 3.641(,o)C(r)-3.641 E F3(email-addr) +3.641 E(ess)-.37 E F0 6.141(.I)C 3.641(ft)-6.141 G 1.142 +(he report cannot be mailed, it is)-3.641 F(sa)108 201.6 Q -.15(ve)-.2 G +2.5(di).15 G 2.5(nt)-2.5 G(he \214le)-2.5 E F3(dead.bashb)2.5 E(ug)-.2 E +F0(in the in)2.5 E -.2(vo)-.4 G(king user').2 E 2.5(sh)-.55 G +(ome directory)-2.5 E(.)-.65 E .354(The b)108 218.4 R .354 +(ug report format outline consists of se)-.2 F -.15(ve)-.25 G .353 +(ral sections.).15 F .353(The \214rst section pro)5.353 F .353 +(vides information about the)-.15 F .37 +(machine, operating system, the bash v)108 230.4 R .371 +(ersion, and the compilation en)-.15 F 2.871(vironment. The)-.4 F .371 +(second section should)2.871 F .209 +(be \214lled in with a description of the b)108 242.4 R 2.709(ug. The) +-.2 F .208(third section should be a description of ho)2.709 F 2.708(wt) +-.25 G 2.708(or)-2.708 G .208(eproduce the)-2.708 F -.2(bu)108 254.4 S +2.5(g. The).2 F(optional fourth section is for a proposed \214x.)2.5 E +(Fix)5 E(es are encouraged.)-.15 E F1(ENVIR)72 271.2 Q(ONMENT)-.329 E F2 +(bashb)108 283.2 Q(ug)-.2 E F0(will utilize the follo)2.5 E(wing en)-.25 +E(vironment v)-.4 E(ariables if the)-.25 E 2.5(ye)-.15 G(xist:)-2.65 E +F2(EDIT)108 300 Q(OR)-.18 E F0(Speci\214es the preferred editor)144 312 +Q 2.5(.I)-.55 G(f)-2.5 E F4(EDIT)2.5 E(OR)-.162 E F0(is not set,)2.25 E +F2(bashb)2.5 E(ug)-.2 E F0(def)2.5 E(aults to)-.1 E F2(emacs)2.5 E F0(.) +A F2(HOME)108 328.8 Q F0(Directory in which the f)144 340.8 Q(ailed b) +-.1 E(ug report is sa)-.2 E -.15(ve)-.2 G 2.5(di).15 G 2.5(ft)-2.5 G +(he mail f)-2.5 E(ails.)-.1 E F2(TMPDIR)108 357.6 Q F0 +(Directory in which to create temporary \214les and directories.)144 +369.6 Q F1(SEE ALSO)72 386.4 Q F3(bash)108 398.4 Q F0(\(1\))A F1 -.548 +(AU)72 415.2 S(THORS).548 E F0(Brian F)108 427.2 Q(ox, Free Softw)-.15 E +(are F)-.1 E(oundation)-.15 E(bfox@gnu.or)108 439.2 Q(g)-.18 E +(Chet Rame)108 456 Q 1.3 -.65(y, C)-.15 H(ase W).65 E(estern Reserv)-.8 +E 2.5(eU)-.15 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(chet@po.cwru.edu) +108 468 Q(GNU Bash-4.0)72 768 Q(1998 July 30)148.175 E(1)203.165 E 0 Cg +EP +%%Trailer +end +%%EOF diff --git a/doc/builtins.0 b/doc/builtins.0 new file mode 100644 index 0000000..a721e38 --- /dev/null +++ b/doc/builtins.0 @@ -0,0 +1,1579 @@ +BASH_BUILTINS(1) BASH_BUILTINS(1) + + + +NNAAMMEE + bash, :, ., [, alias, bg, bind, break, builtin, caller, cd, command, + compgen, complete, compopt, continue, declare, dirs, disown, echo, + enable, eval, exec, exit, export, false, fc, fg, getopts, hash, help, + history, jobs, kill, let, local, logout, mapfile, popd, printf, pushd, + pwd, read, readonly, return, set, shift, shopt, source, suspend, test, + times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait - + bash built-in commands, see bbaasshh(1) + +BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS + Unless otherwise noted, each builtin command documented in this section + as accepting options preceded by -- accepts ---- to signify the end of the + options. The ::, ttrruuee, ffaallssee, and tteesstt builtins do not accept options + and do not treat ---- specially. The eexxiitt, llooggoouutt, bbrreeaakk, ccoonnttiinnuuee, lleett, + and sshhiifftt builtins accept and process arguments beginning with -- with- + out requiring ----. Other builtins that accept arguments but are not + specified as accepting options interpret arguments beginning with -- as + invalid options and require ---- to prevent this interpretation. + :: [_a_r_g_u_m_e_n_t_s] + No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s + and performing any specified redirections. A zero exit code is + returned. + + .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + Read and execute commands from _f_i_l_e_n_a_m_e in the current shell + environment and return the exit status of the last command exe- + cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, file + names in PPAATTHH are used to find the directory containing _f_i_l_e_- + _n_a_m_e. The file searched for in PPAATTHH need not be executable. + When bbaasshh is not in _p_o_s_i_x _m_o_d_e, the current directory is + searched if no file is found in PPAATTHH. If the ssoouurrcceeppaatthh option + to the sshhoopptt builtin command is turned off, the PPAATTHH is not + searched. If any _a_r_g_u_m_e_n_t_s are supplied, they become the posi- + tional parameters when _f_i_l_e_n_a_m_e is executed. Otherwise the + positional parameters are unchanged. The return status is the + status of the last command exited within the script (0 if no + commands are executed), and false if _f_i_l_e_n_a_m_e is not found or + cannot be read. + + aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + AAlliiaass with no arguments or with the --pp option prints the list of + aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When + arguments are supplied, an alias is defined for each _n_a_m_e whose + _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word + to be checked for alias substitution when the alias is expanded. + For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- + plied, the name and value of the alias is printed. AAlliiaass + returns true unless a _n_a_m_e is given for which no alias has been + defined. + + bbgg [_j_o_b_s_p_e_c ...] + Resume each suspended job _j_o_b_s_p_e_c in the background, as if it + had been started with &&. If _j_o_b_s_p_e_c is not present, the shell's + notion of the _c_u_r_r_e_n_t _j_o_b is used. bbgg _j_o_b_s_p_e_c returns 0 unless + run when job control is disabled or, when run with job control + enabled, any specified _j_o_b_s_p_e_c was not found or was started + without job control. + + bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVV] + bbiinndd [--mm _k_e_y_m_a_p] [--qq _f_u_n_c_t_i_o_n] [--uu _f_u_n_c_t_i_o_n] [--rr _k_e_y_s_e_q] + bbiinndd [--mm _k_e_y_m_a_p] --ff _f_i_l_e_n_a_m_e + bbiinndd [--mm _k_e_y_m_a_p] --xx _k_e_y_s_e_q:_s_h_e_l_l_-_c_o_m_m_a_n_d + bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_f_u_n_c_t_i_o_n_-_n_a_m_e + bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee + variable. Each non-option argument is a command as it would + appear in _._i_n_p_u_t_r_c, but each binding or command must be passed + as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'. + Options, if supplied, have the following meanings: + --mm _k_e_y_m_a_p + Use _k_e_y_m_a_p as the keymap to be affected by the subsequent + bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_- + _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, + and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. + --ll List the names of all rreeaaddlliinnee functions. + --pp Display rreeaaddlliinnee function names and bindings in such a + way that they can be re-read. + --PP List current rreeaaddlliinnee function names and bindings. + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be re- + read. + --SS Display rreeaaddlliinnee key sequences bound to macros and the + strings they output. + --vv Display rreeaaddlliinnee variable names and values in such a way + that they can be re-read. + --VV List current rreeaaddlliinnee variable names and values. + --ff _f_i_l_e_n_a_m_e + Read key bindings from _f_i_l_e_n_a_m_e. + --qq _f_u_n_c_t_i_o_n + Query about which keys invoke the named _f_u_n_c_t_i_o_n. + --uu _f_u_n_c_t_i_o_n + Unbind all keys bound to the named _f_u_n_c_t_i_o_n. + --rr _k_e_y_s_e_q + Remove any current binding for _k_e_y_s_e_q. + --xx _k_e_y_s_e_q::_s_h_e_l_l_-_c_o_m_m_a_n_d + Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is + entered. When _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets + the RREEAADDLLIINNEE__LLIINNEE variable to the contents of the rreeaadd-- + lliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT variable to the + current location of the insertion point. If the executed + command changes the value of RREEAADDLLIINNEE__LLIINNEE or RREEAADD-- + LLIINNEE__PPOOIINNTT, those new values will be reflected in the + editing state. + + The return value is 0 unless an unrecognized option is given or + an error occurred. + + bbrreeaakk [_n] + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are + exited. The return value is 0 unless _n is not greater than or + equal to 1. + + bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] + Execute the specified shell builtin, passing it _a_r_g_u_m_e_n_t_s, and + return its exit status. This is useful when defining a function + whose name is the same as a shell builtin, retaining the func- + tionality of the builtin within the function. The ccdd builtin is + commonly redefined this way. The return status is false if + _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command. + + ccaalllleerr [_e_x_p_r] + Returns the context of any active subroutine call (a shell func- + tion or a script executed with the .. or ssoouurrccee builtins. With- + out _e_x_p_r, ccaalllleerr displays the line number and source filename of + the current subroutine call. If a non-negative integer is sup- + plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, + and source file corresponding to that position in the current + execution call stack. This extra information may be used, for + example, to print a stack trace. The current frame is frame 0. + The return value is 0 unless the shell is not executing a sub- + routine call or _e_x_p_r does not correspond to a valid position in + the call stack. + + ccdd [--LL||--PP] [_d_i_r] + Change the current directory to _d_i_r. The variable HHOOMMEE is the + default _d_i_r. The variable CCDDPPAATTHH defines the search path for + the directory containing _d_i_r. Alternative directory names in + CCDDPPAATTHH are separated by a colon (:). A null directory name in + CCDDPPAATTHH is the same as the current directory, i.e., ``..''. If + _d_i_r begins with a slash (/), then CCDDPPAATTHH is not used. The --PP + option says to use the physical directory structure instead of + following symbolic links (see also the --PP option to the sseett + builtin command); the --LL option forces symbolic links to be fol- + lowed. An argument of -- is equivalent to $$OOLLDDPPWWDD. If a non- + empty directory name from CCDDPPAATTHH is used, or if -- is the first + argument, and the directory change is successful, the absolute + pathname of the new working directory is written to the standard + output. The return value is true if the directory was success- + fully changed; false otherwise. + + ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] + Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function + lookup. Only builtin commands or commands found in the PPAATTHH are + executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is + performed using a default value for PPAATTHH that is guaranteed to + find all of the standard utilities. If either the --VV or --vv + option is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or file name + used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a + more verbose description. If the --VV or --vv option is supplied, + the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If + neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- + not be found, the exit status is 127. Otherwise, the exit sta- + tus of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d. + + ccoommppggeenn [_o_p_t_i_o_n] [_w_o_r_d] + Generate possible completion matches for _w_o_r_d according to the + _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee + builtin with the exception of --pp and --rr, and write the matches + to the standard output. When using the --FF or --CC options, the + various shell variables set by the programmable completion + facilities, while available, will not have useful values. + + The matches will be generated in the same way as if the pro- + grammable completion code had generated them directly from a + completion specification with the same flags. If _w_o_r_d is speci- + fied, only those completions matching _w_o_r_d will be displayed. + + The return value is true unless an invalid option is supplied, + or no matches were generated. + + ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEE] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_- + _p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] + [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.] + ccoommpplleettee --pprr [--DDEE] [_n_a_m_e ...] + Specify how arguments to each _n_a_m_e should be completed. If the + --pp option is supplied, or if no options are supplied, existing + completion specifications are printed in a way that allows them + to be reused as input. The --rr option removes a completion spec- + ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- + pletion specifications. The --DD option indicates that the + remaining options and actions should apply to the ``default'' + command completion; that is, completion attempted on a command + for which no completion has previously been defined. The --EE + option indicates that the remaining options and actions should + apply to ``empty'' command completion; that is, completion + attempted on a blank line. + + The process of applying these completion specifications when + word completion is attempted is described above under PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn. + + Other options, if specified, have the following meanings. The + arguments to the --GG, --WW, and --XX options (and, if necessary, the + --PP and --SS options) should be quoted to protect them from expan- + sion before the ccoommpplleettee builtin is invoked. + --oo _c_o_m_p_-_o_p_t_i_o_n + The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- + spec's behavior beyond the simple generation of comple- + tions. _c_o_m_p_-_o_p_t_i_o_n may be one of: + bbaasshhddeeffaauulltt + Perform the rest of the default bbaasshh completions + if the compspec generates no matches. + ddeeffaauulltt Use readline's default filename completion if + the compspec generates no matches. + ddiirrnnaammeess + Perform directory name completion if the comp- + spec generates no matches. + ffiilleennaammeess + Tell readline that the compspec generates file- + names, so it can perform any filename-specific + processing (like adding a slash to directory + names, quoting special characters, or suppress- + ing trailing spaces). Intended to be used with + shell functions. + nnoossppaaccee Tell readline not to append a space (the + default) to words completed at the end of the + line. + pplluussddiirrss + After any matches defined by the compspec are + generated, directory name completion is + attempted and any matches are added to the + results of the other actions. + --AA _a_c_t_i_o_n + The _a_c_t_i_o_n may be one of the following to generate a + list of possible completions: + aalliiaass Alias names. May also be specified as --aa. + aarrrraayyvvaarr + Array variable names. + bbiinnddiinngg RReeaaddlliinnee key binding names. + bbuuiillttiinn Names of shell builtin commands. May also be + specified as --bb. + ccoommmmaanndd Command names. May also be specified as --cc. + ddiirreeccttoorryy + Directory names. May also be specified as --dd. + ddiissaabblleedd + Names of disabled shell builtins. + eennaabblleedd Names of enabled shell builtins. + eexxppoorrtt Names of exported shell variables. May also be + specified as --ee. + ffiillee File names. May also be specified as --ff. + ffuunnccttiioonn + Names of shell functions. + ggrroouupp Group names. May also be specified as --gg. + hheellppttooppiicc + Help topics as accepted by the hheellpp builtin. + hhoossttnnaammee + Hostnames, as taken from the file specified by + the HHOOSSTTFFIILLEE shell variable. + jjoobb Job names, if job control is active. May also + be specified as --jj. + kkeeyywwoorrdd Shell reserved words. May also be specified as + --kk. + rruunnnniinngg Names of running jobs, if job control is active. + sseerrvviiccee Service names. May also be specified as --ss. + sseettoopptt Valid arguments for the --oo option to the sseett + builtin. + sshhoopptt Shell option names as accepted by the sshhoopptt + builtin. + ssiiggnnaall Signal names. + ssttooppppeedd Names of stopped jobs, if job control is active. + uusseerr User names. May also be specified as --uu. + vvaarriiaabbllee + Names of all shell variables. May also be spec- + ified as --vv. + --GG _g_l_o_b_p_a_t + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + generate the possible completions. + --WW _w_o_r_d_l_i_s_t + The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS + special variable as delimiters, and each resultant word + is expanded. The possible completions are the members + of the resultant list which match the word being com- + pleted. + --CC _c_o_m_m_a_n_d + _c_o_m_m_a_n_d is executed in a subshell environment, and its + output is used as the possible completions. + --FF _f_u_n_c_t_i_o_n + The shell function _f_u_n_c_t_i_o_n is executed in the current + shell environment. When it finishes, the possible com- + pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY + array variable. + --XX _f_i_l_t_e_r_p_a_t + _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. + It is applied to the list of possible completions gener- + ated by the preceding options and arguments, and each + completion matching _f_i_l_t_e_r_p_a_t is removed from the list. + A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this + case, any completion not matching _f_i_l_t_e_r_p_a_t is removed. + --PP _p_r_e_f_i_x + _p_r_e_f_i_x is added at the beginning of each possible com- + pletion after all other options have been applied. + --SS _s_u_f_f_i_x + _s_u_f_f_i_x is appended to each possible completion after all + other options have been applied. + + The return value is true unless an invalid option is supplied, + an option other than --pp or --rr is supplied without a _n_a_m_e argu- + ment, an attempt is made to remove a completion specification + for a _n_a_m_e for which no specification exists, or an error occurs + adding a completion specification. + + ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEE] [++oo _o_p_t_i_o_n] [_n_a_m_e] + Modify completion options for each _n_a_m_e according to the + _o_p_t_i_o_ns, or for the currently-execution completion if no _n_a_m_es + are supplied. If no _o_p_t_i_o_ns are given, display the completion + options for each _n_a_m_e or the current completion. The possible + values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin + described above. The --DD option indicates that the remaining + options should apply to the ``default'' command completion; that + is, completion attempted on a command for which no completion + has previously been defined. The --EE option indicates that the + remaining options should apply to ``empty'' command completion; + that is, completion attempted on a blank line. + + The return value is true unless an invalid option is supplied, an + attempt is made to modify the options for a _n_a_m_e for which no comple- + tion specification exists, or an output error occurs. + + ccoonnttiinnuuee [_n] + Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of + enclosing loops, the last enclosing loop (the ``top-level'' + loop) is resumed. The return value is 0 unless _n is not greater + than or equal to 1. + + ddeeccllaarree [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + ttyyppeesseett [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. The --pp option will + display the attributes and values of each _n_a_m_e. When --pp is used + with _n_a_m_e arguments, additional options are ignored. When --pp is + supplied without _n_a_m_e arguments, it will display the attributes + and values of all variables having the attributes specified by + the additional options. If no other options are supplied with + --pp, ddeeccllaarree will display the attributes and values of all shell + variables. The --ff option will restrict the display to shell + functions. The --FF option inhibits the display of function defi- + nitions; only the function name and attributes are printed. If + the eexxttddeebbuugg shell option is enabled using sshhoopptt, the source + file name and line number where the function is defined are dis- + played as well. The --FF option implies --ff. The following + options can be used to restrict output to variables with the + specified attribute or to give variables attributes: + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss + above). + --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss + above). + --ff Use function names only. + --ii The variable is treated as an integer; arithmetic evalua- + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above) is performed when + the variable is assigned a value. + --ll When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case + attribute is disabled. + --rr Make _n_a_m_es readonly. These names cannot then be assigned + values by subsequent assignment statements or unset. + --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions + inherit the DDEEBBUUGG and RREETTUURRNN traps from the calling + shell. The trace attribute has no special meaning for + variables. + --uu When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case + attribute is disabled. + --xx Mark _n_a_m_es for export to subsequent commands via the + environment. + + Using `+' instead of `-' turns off the attribute instead, with + the exceptions that ++aa may not be used to destroy an array vari- + able and ++rr will not remove the readonly attribute. When used + in a function, makes each _n_a_m_e local, as with the llooccaall command. + If a variable name is followed by =_v_a_l_u_e, the value of the vari- + able is set to _v_a_l_u_e. The return value is 0 unless an invalid + option is encountered, an attempt is made to define a function + using ``-f foo=bar'', an attempt is made to assign a value to a + readonly variable, an attempt is made to assign a value to an + array variable without using the compound assignment syntax (see + AArrrraayyss above), one of the _n_a_m_e_s is not a valid shell variable + name, an attempt is made to turn off readonly status for a read- + only variable, an attempt is made to turn off array status for + an array variable, or an attempt is made to display a non-exis- + tent function with --ff. + + ddiirrss [[++_n]] [[--_n]] [[--ccppllvv]] + Without options, displays the list of currently remembered + directories. The default display is on a single line with + directory names separated by spaces. Directories are added to + the list with the ppuusshhdd command; the ppooppdd command removes + entries from the list. + ++_n Displays the _nth entry counting from the left of the list + shown by ddiirrss when invoked without options, starting with + zero. + --_n Displays the _nth entry counting from the right of the + list shown by ddiirrss when invoked without options, starting + with zero. + --cc Clears the directory stack by deleting all of the + entries. + --ll Produces a longer listing; the default listing format + uses a tilde to denote the home directory. + --pp Print the directory stack with one entry per line. + --vv Print the directory stack with one entry per line, pre- + fixing each entry with its index in the stack. + + The return value is 0 unless an invalid option is supplied or _n + indexes beyond the end of the directory stack. + + ddiissoowwnn [--aarr] [--hh] [_j_o_b_s_p_e_c ...] + Without options, each _j_o_b_s_p_e_c is removed from the table of + active jobs. If _j_o_b_s_p_e_c is not present, and neither --aa nor --rr + is supplied, the shell's notion of the _c_u_r_r_e_n_t _j_o_b is used. If + the --hh option is given, each _j_o_b_s_p_e_c is not removed from the ta- + ble, but is marked so that SSIIGGHHUUPP is not sent to the job if the + shell receives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is present, and neither + the --aa nor the --rr option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. + If no _j_o_b_s_p_e_c is supplied, the --aa option means to remove or mark + all jobs; the --rr option without a _j_o_b_s_p_e_c argument restricts + operation to running jobs. The return value is 0 unless a _j_o_b_- + _s_p_e_c does not specify a valid job. + + eecchhoo [--nneeEE] [_a_r_g ...] + Output the _a_r_gs, separated by spaces, followed by a newline. + The return status is always 0. If --nn is specified, the trailing + newline is suppressed. If the --ee option is given, interpreta- + tion of the following backslash-escaped characters is enabled. + The --EE option disables the interpretation of these escape char- + acters, even on systems where they are interpreted by default. + The xxppgg__eecchhoo shell option may be used to dynamically determine + whether or not eecchhoo expands these escape characters by default. + eecchhoo does not interpret ---- to mean the end of options. eecchhoo + interprets the following escape sequences: + \\aa alert (bell) + \\bb backspace + \\cc suppress further output + \\ee an escape character + \\ff form feed + \\nn new line + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\\\ backslash + \\00_n_n_n the eight-bit character whose value is the octal value + _n_n_n (zero to three octal digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + + eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...] + Enable and disable builtin shell commands. Disabling a builtin + allows a disk command which has the same name as a shell builtin + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are + enabled. For example, to use the tteesstt binary found via the PPAATTHH + instead of the shell builtin version, run ``enable -n test''. + The --ff option means to load the new builtin command _n_a_m_e from + shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading. + The --dd option will delete a builtin previously loaded with --ff. + If no _n_a_m_e arguments are given, or if the --pp option is supplied, + a list of shell builtins is printed. With no other option argu- + ments, the list consists of all enabled shell builtins. If --nn + is supplied, only disabled builtins are printed. If --aa is sup- + plied, the list printed includes all builtins, with an indica- + tion of whether or not each is enabled. If --ss is supplied, the + output is restricted to the POSIX _s_p_e_c_i_a_l builtins. The return + value is 0 unless a _n_a_m_e is not a shell builtin or there is an + error loading a new builtin from a shared object. + + eevvaall [_a_r_g ...] + The _a_r_gs are read and concatenated together into a single com- + mand. This command is then read and executed by the shell, and + its exit status is returned as the value of eevvaall. If there are + no _a_r_g_s, or only null arguments, eevvaall returns 0. + + eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]] + If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process + is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If + the --ll option is supplied, the shell places a dash at the begin- + ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what + _l_o_g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with + an empty environment. If --aa is supplied, the shell passes _n_a_m_e + as the zeroth argument to the executed command. If _c_o_m_m_a_n_d can- + not be executed for some reason, a non-interactive shell exits, + unless the shell option eexxeeccffaaiill is enabled, in which case it + returns failure. An interactive shell returns failure if the + file cannot be executed. If _c_o_m_m_a_n_d is not specified, any redi- + rections take effect in the current shell, and the return status + is 0. If there is a redirection error, the return status is 1. + + eexxiitt [_n] + Cause the shell to exit with a status of _n. If _n is omitted, + the exit status is that of the last command executed. A trap on + EEXXIITT is executed before the shell terminates. + + eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ... + eexxppoorrtt --pp + The supplied _n_a_m_e_s are marked for automatic export to the envi- + ronment of subsequently executed commands. If the --ff option is + given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or + if the --pp option is supplied, a list of all names that are + exported in this shell is printed. The --nn option causes the + export property to be removed from each _n_a_m_e. If a variable + name is followed by =_w_o_r_d, the value of the variable is set to + _w_o_r_d. eexxppoorrtt returns an exit status of 0 unless an invalid + option is encountered, one of the _n_a_m_e_s is not a valid shell + variable name, or --ff is supplied with a _n_a_m_e that is not a func- + tion. + + ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t] + ffcc --ss [_p_a_t=_r_e_p] [_c_m_d] + Fix Command. In the first form, a range of commands from _f_i_r_s_t + to _l_a_s_t is selected from the history list. _F_i_r_s_t and _l_a_s_t may + be specified as a string (to locate the last command beginning + with that string) or as a number (an index into the history + list, where a negative number is used as an offset from the cur- + rent command number). If _l_a_s_t is not specified it is set to the + current command for listing (so that ``fc -l -10'' prints the + last 10 commands) and to _f_i_r_s_t otherwise. If _f_i_r_s_t is not spec- + ified it is set to the previous command for editing and -16 for + listing. + + The --nn option suppresses the command numbers when listing. The + --rr option reverses the order of the commands. If the --ll option + is given, the commands are listed on standard output. Other- + wise, the editor given by _e_n_a_m_e is invoked on a file containing + those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT + variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. + If neither variable is set, is used. When editing is complete, + the edited commands are echoed and executed. + + In the second form, _c_o_m_m_a_n_d is re-executed after each instance + of _p_a_t is replaced by _r_e_p. A useful alias to use with this is + ``r="fc -s"'', so that typing ``r cc'' runs the last command + beginning with ``cc'' and typing ``r'' re-executes the last com- + mand. + + If the first form is used, the return value is 0 unless an + invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history + lines out of range. If the --ee option is supplied, the return + value is the value of the last command executed or failure if an + error occurs with the temporary file of commands. If the second + form is used, the return status is that of the command re-exe- + cuted, unless _c_m_d does not specify a valid history line, in + which case ffcc returns failure. + + ffgg [_j_o_b_s_p_e_c] + Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. + If _j_o_b_s_p_e_c is not present, the shell's notion of the _c_u_r_r_e_n_t _j_o_b + is used. The return value is that of the command placed into + the foreground, or failure if run when job control is disabled + or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec- + ify a valid job or _j_o_b_s_p_e_c specifies a job that was started + without job control. + + ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g_s] + ggeettooppttss is used by shell procedures to parse positional parame- + ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- + nized; if a character is followed by a colon, the option is + expected to have an argument, which should be separated from it + by white space. The colon and question mark characters may not + be used as option characters. Each time it is invoked, ggeettooppttss + places the next option in the shell variable _n_a_m_e, initializing + _n_a_m_e if it does not exist, and the index of the next argument to + be processed into the variable OOPPTTIINNDD. OOPPTTIINNDD is initialized to + 1 each time the shell or a shell script is invoked. When an + option requires an argument, ggeettooppttss places that argument into + the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automati- + cally; it must be manually reset between multiple calls to + ggeettooppttss within the same shell invocation if a new set of parame- + ters is to be used. + + When the end of options is encountered, ggeettooppttss exits with a + return value greater than zero. OOPPTTIINNDD is set to the index of + the first non-option argument, and nnaammee is set to ?. + + ggeettooppttss normally parses the positional parameters, but if more + arguments are given in _a_r_g_s, ggeettooppttss parses those instead. + + ggeettooppttss can report errors in two ways. If the first character + of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In + normal operation diagnostic messages are printed when invalid + options or missing option arguments are encountered. If the + variable OOPPTTEERRRR is set to 0, no error messages will be dis- + played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. + + If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if + not silent, prints an error message and unsets OOPPTTAARRGG. If + ggeettooppttss is silent, the option character found is placed in + OOPPTTAARRGG and no diagnostic message is printed. + + If a required argument is not found, and ggeettooppttss is not silent, + a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a + diagnostic message is printed. If ggeettooppttss is silent, then a + colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option + character found. + + ggeettooppttss returns true if an option, specified or unspecified, is + found. It returns false if the end of options is encountered or + an error occurs. + + hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e] + For each _n_a_m_e, the full file name of the command is determined + by searching the directories in $$PPAATTHH and remembered. If the --pp + option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e is + used as the full file name of the command. The --rr option causes + the shell to forget all remembered locations. The --dd option + causes the shell to forget the remembered location of each _n_a_m_e. + If the --tt option is supplied, the full pathname to which each + _n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are + supplied with --tt, the _n_a_m_e is printed before the hashed full + pathname. The --ll option causes output to be displayed in a for- + mat that may be reused as input. If no arguments are given, or + if only --ll is supplied, information about remembered commands is + printed. The return status is true unless a _n_a_m_e is not found + or an invalid option is supplied. + + hheellpp [--ddmmss] [_p_a_t_t_e_r_n] + Display helpful information about builtin commands. If _p_a_t_t_e_r_n + is specified, hheellpp gives detailed help on all commands matching + _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control + structures is printed. + --dd Display a short description of each _p_a_t_t_e_r_n + --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like + format + --ss Display only a short usage synopsis for each _p_a_t_t_e_r_n + The return status is 0 unless no command matches _p_a_t_t_e_r_n. + + hhiissttoorryy [[_n]] + hhiissttoorryy --cc + hhiissttoorryy --dd _o_f_f_s_e_t + hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e] + hhiissttoorryy --pp _a_r_g [_a_r_g _._._.] + hhiissttoorryy --ss _a_r_g [_a_r_g _._._.] + With no options, display the command history list with line num- + bers. Lines listed with a ** have been modified. An argument of + _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. No intervening blank is printed between + the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is + supplied, it is used as the name of the history file; if not, + the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the + following meanings: + --cc Clear the history list by deleting all the entries. + --dd _o_f_f_s_e_t + Delete the history entry at position _o_f_f_s_e_t. + --aa Append the ``new'' history lines (history lines entered + since the beginning of the current bbaasshh session) to the + history file. + --nn Read the history lines not already read from the history + file into the current history list. These are lines + appended to the history file since the beginning of the + current bbaasshh session. + --rr Read the contents of the history file and use them as the + current history. + --ww Write the current history to the history file, overwrit- + ing the history file's contents. + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output. Does not + store the results in the history list. Each _a_r_g must be + quoted to disable normal history expansion. + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before + the _a_r_g_s are added. + + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- + tion associated with each history entry is written to the his- + tory file, marked with the history comment character. When the + history file is read, lines beginning with the history comment + character followed immediately by a digit are interpreted as + timestamps for the previous history line. The return value is 0 + unless an invalid option is encountered, an error occurs while + reading or writing the history file, an invalid _o_f_f_s_e_t is sup- + plied as an argument to --dd, or the history expansion supplied as + an argument to --pp fails. + + jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ] + jjoobbss --xx _c_o_m_m_a_n_d [ _a_r_g_s ... ] + The first form lists the active jobs. The options have the fol- + lowing meanings: + --ll List process IDs in addition to the normal information. + --pp List only the process ID of the job's process group + leader. + --nn Display information only about jobs that have changed + status since the user was last notified of their status. + --rr Restrict output to running jobs. + --ss Restrict output to stopped jobs. + + If _j_o_b_s_p_e_c is given, output is restricted to information about + that job. The return status is 0 unless an invalid option is + encountered or an invalid _j_o_b_s_p_e_c is supplied. + + If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in + _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and + executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status. + + kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ... + kkiillll --ll [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] + Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive + signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or + a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not + present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the + signal names. If any arguments are supplied when --ll is given, + the names of the signals corresponding to the arguments are + listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. kkiillll returns true + if at least one signal was successfully sent, or false if an + error occurs or an invalid option is encountered. + + lleett _a_r_g [_a_r_g ...] + Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- + MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett + returns 1; 0 is returned otherwise. + + llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ...] + For each argument, a local variable named _n_a_m_e is created, and + assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted + by ddeeccllaarree. When llooccaall is used within a function, it causes the + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. With no operands, llooccaall writes a list of + local variables to the standard output. It is an error to use + llooccaall when not within a function. The return status is 0 unless + llooccaall is used outside a function, an invalid _n_a_m_e is supplied, + or _n_a_m_e is a readonly variable. + + llooggoouutt Exit a login shell. + + mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + Read lines from the standard input into the indexed array vari- + able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- + plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + supplied, have the following meanings: + --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are + copied. + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + index is 0. + --ss Discard the first _c_o_u_n_t lines read. + --tt Remove a trailing newline from each line read. + --uu Read lines from file descriptor _f_d instead of the stan- + dard input. + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --cc option specifies _q_u_a_n_t_u_m. + --cc Specify the number of lines read between each call to + _c_a_l_l_b_a_c_k. + + If --CC is specified without --cc, the default quantum is 5000. + When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next + array element to be assigned as an additional argument. _c_a_l_l_- + _b_a_c_k is evaluated after the line is read but before the array + element is assigned. + + If not supplied with an explicit origin, mmaappffiillee will clear + _a_r_r_a_y before assigning to it. + + mmaappffiillee returns successfully unless an invalid option or option + argument is supplied, _a_r_r_a_y is invalid or unassignable, or if + _a_r_r_a_y is not an indexed array. + + ppooppdd [-nn] [+_n] [-_n] + Removes entries from the directory stack. With no arguments, + removes the top directory from the stack, and performs a ccdd to + the new top directory. Arguments, if supplied, have the follow- + ing meanings: + --nn Suppresses the normal change of directory when removing + directories from the stack, so that only the stack is + manipulated. + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero. For example: ``popd + +0'' removes the first directory, ``popd +1'' the second. + --_n Removes the _nth entry counting from the right of the list + shown by ddiirrss, starting with zero. For example: ``popd + -0'' removes the last directory, ``popd -1'' the next to + last. + + If the ppooppdd command is successful, a ddiirrss is performed as well, + and the return status is 0. ppooppdd returns false if an invalid + option is encountered, the directory stack is empty, a non-exis- + tent directory stack entry is specified, or the directory change + fails. + + pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which + contains three types of objects: plain characters, which are + simply copied to standard output, character escape sequences, + which are converted and copied to the standard output, and for- + mat specifications, each of which causes printing of the next + successive _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(1) for- + mats, %%bb causes pprriinnttff to expand backslash escape sequences in + the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output, + backslashes in \\'', \\"", and \\?? are not removed, and octal escapes + beginning with \\00 may contain up to four digits), and %%qq causes + pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a format that can + be reused as shell input. + + The --vv option causes the output to be assigned to the variable + _v_a_r rather than being printed to the standard output. + + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, + the extra format specifications behave as if a zero value or + null string, as appropriate, had been supplied. The return + value is zero on success, non-zero on failure. + + ppuusshhdd [--nn] [+_n] [-_n] + ppuusshhdd [--nn] [_d_i_r] + Adds a directory to the top of the directory stack, or rotates + the stack, making the new top of the stack the current working + directory. With no arguments, exchanges the top two directories + and returns 0, unless the directory stack is empty. Arguments, + if supplied, have the following meanings: + --nn Suppresses the normal change of directory when adding + directories to the stack, so that only the stack is + manipulated. + ++_n Rotates the stack so that the _nth directory (counting + from the left of the list shown by ddiirrss, starting with + zero) is at the top. + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with + zero) is at the top. + _d_i_r Adds _d_i_r to the directory stack at the top, making it the + new current working directory. + + If the ppuusshhdd command is successful, a ddiirrss is performed as well. + If the first form is used, ppuusshhdd returns 0 unless the cd to _d_i_r + fails. With the second form, ppuusshhdd returns 0 unless the direc- + tory stack is empty, a non-existent directory stack element is + specified, or the directory change to the specified new current + directory fails. + + ppwwdd [--LLPP] + Print the absolute pathname of the current working directory. + The pathname printed contains no symbolic links if the --PP option + is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command + is enabled. If the --LL option is used, the pathname printed may + contain symbolic links. The return status is 0 unless an error + occurs while reading the name of the current directory or an + invalid option is supplied. + + rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp + _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] + One line is read from the standard input, or from the file + descriptor _f_d supplied as an argument to the --uu option, and the + first word is assigned to the first _n_a_m_e, the second word to the + second _n_a_m_e, and so on, with leftover words and their interven- + ing separators assigned to the last _n_a_m_e. If there are fewer + words read from the input stream than names, the remaining names + are assigned empty values. The characters in IIFFSS are used to + split the line into words. The backslash character (\\) may be + used to remove any special meaning for the next character read + and for line continuation. Options, if supplied, have the fol- + lowing meanings: + --aa _a_n_a_m_e + The words are assigned to sequential indices of the array + variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any + new values are assigned. Other _n_a_m_e arguments are + ignored. + --dd _d_e_l_i_m + The first character of _d_e_l_i_m is used to terminate the + input line, rather than newline. + --ee If the standard input is coming from a terminal, rreeaaddlliinnee + (see RREEAADDLLIINNEE above) is used to obtain the line. Read- + line uses the current (or default, if line editing was + not previously active) editing settings. + --ii _t_e_x_t + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + placed into the editing buffer before editing begins. + --nn _n_c_h_a_r_s + rreeaadd returns after reading _n_c_h_a_r_s characters rather than + waiting for a complete line of input, but honor a delim- + iter if fewer than _n_c_h_a_r_s characters are read before the + delimiter. + --NN _n_c_h_a_r_s + rreeaadd returns after reading exactly _n_c_h_a_r_s characters + rather than waiting for a complete line of input, unless + EOF is encountered or rreeaadd times out. Delimiter charac- + ters encountered in the input are not treated specially + and do not cause rreeaadd to return until _n_c_h_a_r_s characters + are read. + --pp _p_r_o_m_p_t + Display _p_r_o_m_p_t on standard error, without a trailing new- + line, before attempting to read any input. The prompt is + displayed only if input is coming from a terminal. + --rr Backslash does not act as an escape character. The back- + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not be used as a line + continuation. + --ss Silent mode. If input is coming from a terminal, charac- + ters are not echoed. + --tt _t_i_m_e_o_u_t + Cause rreeaadd to time out and return failure if a complete + line of input is not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_- + _o_u_t may be a decimal number with a fractional portion + following the decimal point. This option is only effec- + tive if rreeaadd is reading input from a terminal, pipe, or + other special file; it has no effect when reading from + regular files. If _t_i_m_e_o_u_t is 0, rreeaadd returns success if + input is available on the specified file descriptor, + failure otherwise. The exit status is greater than 128 + if the timeout is exceeded. + --uu _f_d Read input from file descriptor _f_d. + + If no _n_a_m_e_s are supplied, the line read is assigned to the vari- + able RREEPPLLYY. The return code is zero, unless end-of-file is + encountered, rreeaadd times out (in which case the return code is + greater than 128), or an invalid file descriptor is supplied as + the argument to --uu. + + rreeaaddoonnllyy [--aaAAppff] [_n_a_m_e[=_w_o_r_d] ...] + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + may not be changed by subsequent assignment. If the --ff option + is supplied, the functions corresponding to the _n_a_m_e_s are so + marked. The --aa option restricts the variables to indexed + arrays; the --AA option restricts the variables to associative + arrays. If no _n_a_m_e arguments are given, or if the --pp option is + supplied, a list of all readonly names is printed. The --pp + option causes output to be displayed in a format that may be + reused as input. If a variable name is followed by =_w_o_r_d, the + value of the variable is set to _w_o_r_d. The return status is 0 + unless an invalid option is encountered, one of the _n_a_m_e_s is not + a valid shell variable name, or --ff is supplied with a _n_a_m_e that + is not a function. + + rreettuurrnn [_n] + Causes a function to exit with the return value specified by _n. + If _n is omitted, the return status is that of the last command + executed in the function body. If used outside a function, but + during execution of a script by the .. (ssoouurrccee) command, it + causes the shell to stop executing that script and return either + _n or the exit status of the last command executed within the + script as the exit status of the script. If used outside a + function and not during execution of a script by .., the return + status is false. Any command associated with the RREETTUURRNN trap is + executed before execution resumes after the function or script. + + sseett [----aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n] [_a_r_g ...] + sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n] [_a_r_g ...] + Without options, the name and value of each shell variable are + displayed in a format that can be reused as input for setting or + resetting the currently-set variables. Read-only variables can- + not be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. + The output is sorted according to the current locale. When + options are specified, they set or unset shell attributes. Any + arguments remaining after option processing are treated as val- + ues for the positional parameters and are assigned, in order, to + $$11, $$22, ...... $$_n. Options, if specified, have the following + meanings: + --aa Automatically mark variables and functions which are + modified or created for export to the environment of + subsequent commands. + --bb Report the status of terminated background jobs immedi- + ately, rather than before the next primary prompt. This + is effective only when job control is enabled. + --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a + single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _s_u_b_s_h_e_l_l command enclosed in + parentheses, or one of the commands executed as part of + a command list enclosed by braces (see SSHHEELLLL GGRRAAMMMMAARR + above) exits with a non-zero status. The shell does not + exit if the command that fails is part of the command + list immediately following a wwhhiillee or uunnttiill keyword, + part of the test following the iiff or eelliiff reserved + words, part of any command executed in a &&&& or |||| list + except the command following the final &&&& or ||||, any + command in a pipeline but the last, or if the command's + return value is being inverted with !!. A trap on EERRRR, + if set, is executed before the shell exits. This option + applies to the shell environment and each subshell envi- + ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + above), and may cause subshells to exit before executing + all the commands in the subshell. + --ff Disable pathname expansion. + --hh Remember the location of commands as they are looked up + for execution. This is enabled by default. + --kk All arguments in the form of assignment statements are + placed in the environment for a command, not just those + that precede the command name. + --mm Monitor mode. Job control is enabled. This option is + on by default for interactive shells on systems that + support it (see JJOOBB CCOONNTTRROOLL above). Background pro- + cesses run in a separate process group and a line con- + taining their exit status is printed upon their comple- + tion. + --nn Read commands but do not execute them. This may be used + to check a shell script for syntax errors. This is + ignored by interactive shells. + --oo _o_p_t_i_o_n_-_n_a_m_e + The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: + aalllleexxppoorrtt + Same as --aa. + bbrraacceeeexxppaanndd + Same as --BB. + eemmaaccss Use an emacs-style command line editing inter- + face. This is enabled by default when the shell + is interactive, unless the shell is started with + the ----nnooeeddiittiinngg option. This also affects the + editing interface used for rreeaadd --ee. + eerrrreexxiitt Same as --ee. + eerrrrttrraaccee + Same as --EE. + ffuunnccttrraaccee + Same as --TT. + hhaasshhaallll Same as --hh. + hhiisstteexxppaanndd + Same as --HH. + hhiissttoorryy Enable command history, as described above under + HHIISSTTOORRYY. This option is on by default in inter- + active shells. + iiggnnoorreeeeooff + The effect is as if the shell command + ``IGNOREEOF=10'' had been executed (see SShheellll + VVaarriiaabblleess above). + kkeeyywwoorrdd Same as --kk. + mmoonniittoorr Same as --mm. + nnoocclloobbbbeerr + Same as --CC. + nnooeexxeecc Same as --nn. + nnoogglloobb Same as --ff. + nnoolloogg Currently ignored. + nnoottiiffyy Same as --bb. + nnoouunnsseett Same as --uu. + oonneeccmmdd Same as --tt. + pphhyyssiiccaall + Same as --PP. + ppiippeeffaaiill + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option + is disabled by default. + ppoossiixx Change the behavior of bbaasshh where the default + operation differs from the POSIX standard to + match the standard (_p_o_s_i_x _m_o_d_e). + pprriivviilleeggeedd + Same as --pp. + vveerrbboossee Same as --vv. + vvii Use a vi-style command line editing interface. + This also affects the editing interface used for + rreeaadd --ee. + xxttrraaccee Same as --xx. + If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, the values of the + current options are printed. If ++oo is supplied with no + _o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the + current option settings is displayed on the standard + output. + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear in the environment, are ignored. If the shell is + started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not sup- + plied, these actions are taken and the effective user id + is set to the real user id. If the --pp option is sup- + plied at startup, the effective user id is not reset. + Turning this option off causes the effective user and + group ids to be set to the real user and group ids. + --tt Exit after reading and executing one command. + --uu Treat unset variables and parameters other than the spe- + cial parameters "@" and "*" as an error when performing + parameter expansion. If expansion is attempted on an + unset variable or parameter, the shell prints an error + message, and, if not interactive, exits with a non-zero + status. + --vv Print shell input lines as they are read. + --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee + command, sseelleecctt command, or arithmetic ffoorr command, dis- + play the expanded value of PPSS44, followed by the command + and its expanded arguments or associated word list. + --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn + above). This is on by default. + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. This may be + overridden when creating output files by using the redi- + rection operator >>|| instead of >>. + --EE If set, any trap on EERRRR is inherited by shell functions, + command substitutions, and commands executed in a sub- + shell environment. The EERRRR trap is normally not inher- + ited in such cases. + --HH Enable !! style history substitution. This option is on + by default when the shell is interactive. + --PP If set, the shell does not follow symbolic links when + executing commands such as ccdd that change the current + working directory. It uses the physical directory + structure instead. By default, bbaasshh follows the logical + chain of directories when performing commands which + change the current directory. + --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by + shell functions, command substitutions, and commands + executed in a subshell environment. The DDEEBBUUGG and + RREETTUURRNN traps are normally not inherited in such cases. + ---- If no arguments follow this option, then the positional + parameters are unset. Otherwise, the positional parame- + ters are set to the _a_r_gs, even if some of them begin + with a --. + -- Signal the end of options, cause all remaining _a_r_gs to + be assigned to the positional parameters. The --xx and --vv + options are turned off. If there are no _a_r_gs, the posi- + tional parameters remain unchanged. + + The options are off by default unless otherwise noted. Using + + rather than - causes these options to be turned off. The + options can also be specified as arguments to an invocation of + the shell. The current set of options may be found in $$--. The + return status is always true unless an invalid option is encoun- + tered. + + sshhiifftt [_n] + The positional parameters from _n+1 ... are renamed to $$11 ........ + Parameters represented by the numbers $$## down to $$##-_n+1 are + unset. _n must be a non-negative number less than or equal to + $$##. If _n is 0, no parameters are changed. If _n is not given, + it is assumed to be 1. If _n is greater than $$##, the positional + parameters are not changed. The return status is greater than + zero if _n is greater than $$## or less than zero; otherwise 0. + + sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...] + Toggle the values of variables controlling optional shell behav- + ior. With no options, or with the --pp option, a list of all set- + table options is displayed, with an indication of whether or not + each is set. The --pp option causes output to be displayed in a + form that may be reused as input. Other options have the fol- + lowing meanings: + --ss Enable (set) each _o_p_t_n_a_m_e. + --uu Disable (unset) each _o_p_t_n_a_m_e. + --qq Suppresses normal output (quiet mode); the return status + indicates whether the _o_p_t_n_a_m_e is set or unset. If multi- + ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- + tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- + wise. + --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for + the --oo option to the sseett builtin. + + If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, the dis- + play is limited to those options which are set or unset, respec- + tively. Unless otherwise noted, the sshhoopptt options are disabled + (unset) by default. + + The return status when listing options is zero if all _o_p_t_n_a_m_e_s + are enabled, non-zero otherwise. When setting or unsetting + options, the return status is zero unless an _o_p_t_n_a_m_e is not a + valid shell option. + + The list of sshhoopptt options is: + + aauuttooccdd If set, a command name that is the name of a directory + is executed as if it were the argument to the ccdd com- + mand. This option is only used by interactive shells. + ccddaabbllee__vvaarrss + If set, an argument to the ccdd builtin command that is + not a directory is assumed to be the name of a variable + whose value is the directory to change to. + ccddssppeellll If set, minor errors in the spelling of a directory com- + ponent in a ccdd command will be corrected. The errors + checked for are transposed characters, a missing charac- + ter, and one character too many. If a correction is + found, the corrected file name is printed, and the com- + mand proceeds. This option is only used by interactive + shells. + cchheecckkhhaasshh + If set, bbaasshh checks that a command found in the hash ta- + ble exists before trying to execute it. If a hashed + command no longer exists, a normal path search is per- + formed. + cchheecckkjjoobbss + If set, bbaasshh lists the status of any stopped and running + jobs before exiting an interactive shell. If any jobs + are running, this causes the exit to be deferred until a + second exit is attempted without an intervening command + (see JJOOBB CCOONNTTRROOLL above). The shell always postpones + exiting if any jobs are stopped. + cchheecckkwwiinnssiizzee + If set, bbaasshh checks the window size after each command + and, if necessary, updates the values of LLIINNEESS and CCOOLL-- + UUMMNNSS. + ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- + line command in the same history entry. This allows + easy re-editing of multi-line commands. + ccoommppaatt3311 + If set, bbaasshh changes its behavior to that of version 3.1 + with respect to quoted arguments to the conditional com- + mand's =~ operator. + ccoommppaatt3322 + If set, bbaasshh changes its behavior to that of version 3.2 + with respect to locale-specific string comparison when + using the conditional command's < and > operators. + ccoommppaatt4400 + If set, bbaasshh changes its behavior to that of version 4.0 + with respect to locale-specific string comparison when + using the conditional command's < and > operators and + the effect of interrupting a command list. + ddiirrssppeellll + If set, bbaasshh attempts spelling correction on directory + names during word completion if the directory name ini- + tially supplied does not exist. + ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in + the results of pathname expansion. + eexxeeccffaaiill + If set, a non-interactive shell will not exit if it can- + not execute the file specified as an argument to the + eexxeecc builtin command. An interactive shell does not + exit if eexxeecc fails. + eexxppaanndd__aalliiaasseess + If set, aliases are expanded as described above under + AALLIIAASSEESS. This option is enabled by default for interac- + tive shells. + eexxttddeebbuugg + If set, behavior intended for use by debuggers is + enabled: + 11.. The --FF option to the ddeeccllaarree builtin displays the + source file name and line number corresponding to + each function name supplied as an argument. + 22.. If the command run by the DDEEBBUUGG trap returns a + non-zero value, the next command is skipped and + not executed. + 33.. If the command run by the DDEEBBUUGG trap returns a + value of 2, and the shell is executing in a sub- + routine (a shell function or a shell script exe- + cuted by the .. or ssoouurrccee builtins), a call to + rreettuurrnn is simulated. + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + in their descriptions above. + 55.. Function tracing is enabled: command substitu- + tion, shell functions, and subshells invoked with + (( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps. + 66.. Error tracing is enabled: command substitution, + shell functions, and subshells invoked with (( + _c_o_m_m_a_n_d )) inherit the EERRRROORR trap. + eexxttgglloobb If set, the extended pattern matching features described + above under PPaatthhnnaammee EExxppaannssiioonn are enabled. + eexxttqquuoottee + If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed + within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double + quotes. This option is enabled by default. + ffaaiillgglloobb + If set, patterns which fail to match filenames during + pathname expansion result in an expansion error. + ffoorrccee__ffiiggnnoorree + If set, the suffixes specified by the FFIIGGNNOORREE shell + variable cause words to be ignored when performing word + completion even if the ignored words are the only possi- + ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a + description of FFIIGGNNOORREE. This option is enabled by + default. + gglloobbssttaarr + If set, the pattern **** used in a pathname expansion con- + text will match a files and zero or more directories and + subdirectories. If the pattern is followed by a //, only + directories and subdirectories match. + ggnnuu__eerrrrffmmtt + If set, shell error messages are written in the standard + GNU error message format. + hhiissttaappppeenndd + If set, the history list is appended to the file named + by the value of the HHIISSTTFFIILLEE variable when the shell + exits, rather than overwriting the file. + hhiissttrreeeeddiitt + If set, and rreeaaddlliinnee is being used, a user is given the + opportunity to re-edit a failed history substitution. + hhiissttvveerriiffyy + If set, and rreeaaddlliinnee is being used, the results of his- + tory substitution are not immediately passed to the + shell parser. Instead, the resulting line is loaded + into the rreeaaddlliinnee editing buffer, allowing further modi- + fication. + hhoossttccoommpplleettee + If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to + perform hostname completion when a word containing a @@ + is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE + above). This is enabled by default. + hhuuppoonneexxiitt + If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter- + active login shell exits. + iinntteerraaccttiivvee__ccoommmmeennttss + If set, allow a word beginning with ## to cause that word + and all remaining characters on that line to be ignored + in an interactive shell (see CCOOMMMMEENNTTSS above). This + option is enabled by default. + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + commands are saved to the history with embedded newlines + rather than using semicolon separators where possible. + llooggiinn__sshheellll + The shell sets this option if it is started as a login + shell (see IINNVVOOCCAATTIIOONN above). The value may not be + changed. + mmaaiillwwaarrnn + If set, and a file that bbaasshh is checking for mail has + been accessed since the last time it was checked, the + message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- + played. + nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn + If set, and rreeaaddlliinnee is being used, bbaasshh will not + attempt to search the PPAATTHH for possible completions when + completion is attempted on an empty line. + nnooccaasseegglloobb + If set, bbaasshh matches filenames in a case-insensitive + fashion when performing pathname expansion (see PPaatthhnnaammee + EExxppaannssiioonn above). + nnooccaasseemmaattcchh + If set, bbaasshh matches patterns in a case-insensitive + fashion when performing matching while executing ccaassee or + [[[[ conditional commands. + nnuullllgglloobb + If set, bbaasshh allows patterns which match no files (see + PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string, + rather than themselves. + pprrooggccoommpp + If set, the programmable completion facilities (see PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn above) are enabled. This option is + enabled by default. + pprroommppttvvaarrss + If set, prompt strings undergo parameter expansion, com- + mand substitution, arithmetic expansion, and quote + removal after being expanded as described in PPRROOMMPPTTIINNGG + above. This option is enabled by default. + rreessttrriicctteedd__sshheellll + The shell sets this option if it is started in + restricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value + may not be changed. This is not reset when the startup + files are executed, allowing the startup files to dis- + cover whether or not a shell is restricted. + sshhiifftt__vveerrbboossee + If set, the sshhiifftt builtin prints an error message when + the shift count exceeds the number of positional parame- + ters. + ssoouurrcceeppaatthh + If set, the ssoouurrccee (..) builtin uses the value of PPAATTHH to + find the directory containing the file supplied as an + argument. This option is enabled by default. + xxppgg__eecchhoo + If set, the eecchhoo builtin expands backslash-escape + sequences by default. + ssuussppeenndd [--ff] + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell cannot be suspended; the --ff option can be + used to override this and force the suspension. The return sta- + tus is 0 unless the shell is a login shell and --ff is not sup- + plied, or if job control is not enabled. + tteesstt _e_x_p_r + [[ _e_x_p_r ]] + Return a status of 0 or 1 depending on the evaluation of the + conditional expression _e_x_p_r. Each operator and operand must be + a separate argument. Expressions are composed of the primaries + described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. tteesstt does not + accept any options, nor does it accept and ignore an argument of + ---- as signifying the end of options. + + Expressions may be combined using the following operators, + listed in decreasing order of precedence. The evaluation + depends on the number of arguments; see below. + !! _e_x_p_r True if _e_x_p_r is false. + (( _e_x_p_r )) + Returns the value of _e_x_p_r. This may be used to override + the normal precedence of operators. + _e_x_p_r_1 -aa _e_x_p_r_2 + True if both _e_x_p_r_1 and _e_x_p_r_2 are true. + _e_x_p_r_1 -oo _e_x_p_r_2 + True if either _e_x_p_r_1 or _e_x_p_r_2 is true. + + tteesstt and [[ evaluate conditional expressions using a set of rules + based on the number of arguments. + + 0 arguments + The expression is false. + 1 argument + The expression is true if and only if the argument is not + null. + 2 arguments + If the first argument is !!, the expression is true if and + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed + above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + true if the unary test is true. If the first argument is + not a valid unary conditional operator, the expression is + false. + 3 arguments + If the second argument is one of the binary conditional + operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the + result of the expression is the result of the binary test + using the first and third arguments as operands. The --aa + and --oo operators are considered binary operators when + there are three arguments. If the first argument is !!, + the value is the negation of the two-argument test using + the second and third arguments. If the first argument is + exactly (( and the third argument is exactly )), the result + is the one-argument test of the second argument. Other- + wise, the expression is false. + 4 arguments + If the first argument is !!, the result is the negation of + the three-argument expression composed of the remaining + arguments. Otherwise, the expression is parsed and eval- + uated according to precedence using the rules listed + above. + 5 or more arguments + The expression is parsed and evaluated according to + precedence using the rules listed above. + + ttiimmeess Print the accumulated user and system times for the shell and + for processes run from the shell. The return status is 0. + + ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...] + The command _a_r_g is to be read and executed when the shell + receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_r_g is the null string the signal specified by each + _s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes. + If _a_r_g is not present and --pp has been supplied, then the trap + commands associated with each _s_i_g_s_p_e_c are displayed. If no + arguments are supplied or if only --pp is given, ttrraapp prints the + list of commands associated with each signal. The --ll option + causes the shell to print a list of signal names and their cor- + responding numbers. Each _s_i_g_s_p_e_c is either a signal name + defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are + case insensitive and the SIG prefix is optional. + + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe- + cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, + _s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the + first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR + above). Refer to the description of the eexxttddeebbuugg option to the + sshhoopptt builtin for details of its effect on the DDEEBBUUGG trap. If a + _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is executed each time a shell + function or a script executed with the .. or ssoouurrccee builtins fin- + ishes executing. + + If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a sim- + ple command has a non-zero exit status, subject to the following + conditions. The EERRRR trap is not executed if the failed command + is part of the command list immediately following a wwhhiillee or + uunnttiill keyword, part of the test in an _i_f statement, part of a + command executed in a &&&& or |||| list, or if the command's return + value is being inverted via !!. These are the same conditions + obeyed by the eerrrreexxiitt option. + + Signals ignored upon entry to the shell cannot be trapped or + reset. Trapped signals that are not being ignored are reset to + their original values in a subshell or subshell environment when + one is created. The return status is false if any _s_i_g_s_p_e_c is + invalid; otherwise ttrraapp returns true. + + ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] + With no options, indicate how each _n_a_m_e would be interpreted if + used as a command name. If the --tt option is used, ttyyppee prints a + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or disk file, respectively. If the _n_a_m_e is not found, + then nothing is printed, and an exit status of false is + returned. If the --pp option is used, ttyyppee either returns the + name of the disk file that would be executed if _n_a_m_e were speci- + fied as a command name, or nothing if ``type -t name'' would not + return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e, + even if ``type -t name'' would not return _f_i_l_e. If a command is + hashed, --pp and --PP print the hashed value, not necessarily the + file that appears first in PPAATTHH. If the --aa option is used, ttyyppee + prints all of the places that contain an executable named _n_a_m_e. + This includes aliases and functions, if and only if the --pp + option is not also used. The table of hashed commands is not + consulted when using --aa. The --ff option suppresses shell func- + tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if + all of the arguments are found, false if any are not found. + + uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_l_i_m_i_t]] + Provides control over the resources available to the shell and + to processes started by it, on systems that allow such control. + The --HH and --SS options specify that the hard or soft limit is set + for the given resource. A hard limit cannot be increased by a + non-root user once it is set; a soft limit may be increased up + to the value of the hard limit. If neither --HH nor --SS is speci- + fied, both the soft and hard limits are set. The value of _l_i_m_i_t + can be a number in the unit specified for the resource or one of + the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the + current hard limit, the current soft limit, and no limit, + respectively. If _l_i_m_i_t is omitted, the current value of the + soft limit of the resource is printed, unless the --HH option is + given. When more than one resource is specified, the limit name + and unit are printed before the value. Other options are inter- + preted as follows: + --aa All current limits are reported + --bb The maximum socket buffer size + --cc The maximum size of core files created + --dd The maximum size of a process's data segment + --ee The maximum scheduling priority ("nice") + --ff The maximum size of files written by the shell and its + children + --ii The maximum number of pending signals + --ll The maximum size that may be locked into memory + --mm The maximum resident set size (many systems do not honor + this limit) + --nn The maximum number of open file descriptors (most systems + do not allow this value to be set) + --pp The pipe size in 512-byte blocks (this may not be set) + --qq The maximum number of bytes in POSIX message queues + --rr The maximum real-time scheduling priority + --ss The maximum stack size + --tt The maximum amount of cpu time in seconds + --uu The maximum number of processes available to a single + user + --vv The maximum amount of virtual memory available to the + shell + --xx The maximum number of file locks + --TT The maximum number of threads + + If _l_i_m_i_t is given, it is the new value of the specified resource + (the --aa option is display only). If no option is given, then --ff + is assumed. Values are in 1024-byte increments, except for --tt, + which is in seconds, --pp, which is in units of 512-byte blocks, + and --TT, --bb, --nn, and --uu, which are unscaled values. The return + status is 0 unless an invalid option or argument is supplied, or + an error occurs while setting a new limit. + + uummaasskk [--pp] [--SS] [_m_o_d_e] + The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp + option is supplied, and _m_o_d_e is omitted, the output is in a form + that may be reused as input. The return status is 0 if the mode + was successfully changed or if no _m_o_d_e argument was supplied, + and false otherwise. + + uunnaalliiaass [-aa] [_n_a_m_e ...] + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value + is true unless a supplied _n_a_m_e is not a defined alias. + + uunnsseett [-ffvv] [_n_a_m_e ...] + For each _n_a_m_e, remove the corresponding variable or function. + If no options are supplied, or the --vv option is given, each _n_a_m_e + refers to a shell variable. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. Each unset vari- + able or function is removed from the environment passed to sub- + sequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANNDDOOMM, SSEECCOONNDDSS, + LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they + lose their special properties, even if they are subsequently + reset. The exit status is true unless a _n_a_m_e is readonly. + + wwaaiitt [_n _._._.] + Wait for each specified process and return its termination sta- + tus. Each _n may be a process ID or a job specification; if a + job spec is given, all processes in that job's pipeline are + waited for. If _n is not given, all currently active child pro- + cesses are waited for, and the return status is zero. If _n + specifies a non-existent process or job, the return status is + 127. Otherwise, the return status is the exit status of the + last process or job waited for. + +SSEEEE AALLSSOO + bash(1), sh(1) + + + +GNU Bash-4.0 2004 Apr 20 BASH_BUILTINS(1) diff --git a/doc/builtins.1 b/doc/builtins.1 index 6a0b248..bf8bfec 100644 --- a/doc/builtins.1 +++ b/doc/builtins.1 @@ -1,12 +1,14 @@ .\" This is a hack to force bash builtins into the whatis database .\" and to get the list of builtins to come up with the man command. -.TH BASH_BUILTINS 1 "2004 Apr 20" "GNU Bash-3.0" +.TH BASH_BUILTINS 1 "2004 Apr 20" "GNU Bash-4.0" .SH NAME -bash, :, ., [, alias, bg, bind, break, builtin, cd, command, compgen, complete, -continue, declare, dirs, disown, echo, enable, eval, exec, exit, -export, fc, fg, getopts, hash, help, history, jobs, kill, -let, local, logout, popd, printf, pushd, pwd, read, readonly, return, set, -shift, shopt, source, suspend, test, times, trap, type, typeset, +bash, :, ., [, alias, bg, bind, break, builtin, caller, +cd, command, compgen, complete, +compopt, continue, declare, dirs, disown, echo, enable, eval, exec, exit, +export, false, fc, fg, getopts, hash, help, history, jobs, kill, +let, local, logout, mapfile, popd, printf, pushd, pwd, read, +readonly, return, set, +shift, shopt, source, suspend, test, times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1) .SH BASH BUILTIN COMMANDS .nr zZ 1 diff --git a/doc/builtins.ps b/doc/builtins.ps new file mode 100644 index 0000000..539dfb0 --- /dev/null +++ b/doc/builtins.ps @@ -0,0 +1,2651 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Wed Dec 30 13:07:37 2009 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%+ font Symbol +%%+ font Courier +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 21 +%%PageOrder: Ascend +%%DocumentMedia: Default 595 842 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +%%IncludeResource: font Symbol +%%IncludeResource: font Courier +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron +/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O +/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y +/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Courier@0 ENC0/Courier RE/Times-Italic@0 ENC0/Times-Italic RE +/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10.95 +/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0 1.325 +(bash, :, ., [, alias, bg, bind, break, b)108 96 R 1.325(uiltin, caller) +-.2 F 3.825(,c)-.4 G 1.324 +(d, command, compgen, complete, compopt, continue,)-3.825 F .903 +(declare, dirs, diso)108 108 R .903(wn, echo, enable, e)-.25 F -.25(va) +-.25 G .904(l, e).25 F -.15(xe)-.15 G .904(c, e).15 F .904(xit, e)-.15 F +.904(xport, f)-.15 F .904(alse, fc, fg, getopts, hash, help, history)-.1 +F 3.404(,j)-.65 G(obs,)-3.404 E .133(kill, let, local, logout, map\214l\ +e, popd, printf, pushd, pwd, read, readonly)108 120 R 2.633(,r)-.65 G +.133(eturn, set, shift, shopt, source, sus-)-2.633 F .279(pend, test, t\ +imes, trap, true, type, typeset, ulimit, umask, unalias, unset, w)108 +132 R .279(ait \255 bash b)-.1 F .279(uilt-in commands, see)-.2 F/F2 10 +/Times-Bold@0 SF(bash)108 144 Q F0(\(1\))A F1 -.329(BA)72 160.8 S(SH B) +.329 E(UIL)-.11 E(TIN COMMANDS)-1.007 E F0 .063 +(Unless otherwise noted, each b)108 172.8 R .062(uiltin command documen\ +ted in this section as accepting options preceded by)-.2 F F2<ad>108 +184.8 Q F0(accepts)2.533 E F2<adad>2.533 E F0 .034 +(to signify the end of the options.)2.533 F(The)5.034 E F2(:)2.534 E F0 +(,)A F2(true)2.534 E F0(,)A F2(false)2.534 E F0 2.534(,a)C(nd)-2.534 E +F2(test)2.534 E F0 -.2(bu)2.534 G .034(iltins do not accept options and) +.2 F .078(do not treat)108 196.8 R F2<adad>2.577 E F0(specially)2.577 E +5.077(.T)-.65 G(he)-5.077 E F2(exit)2.577 E F0(,)A F2(logout)2.577 E F0 +(,)A F2(br)2.577 E(eak)-.18 E F0(,)A F2(continue)2.577 E F0(,)A F2(let) +2.577 E F0 2.577(,a)C(nd)-2.577 E F2(shift)2.577 E F0 -.2(bu)2.577 G +.077(iltins accept and process ar).2 F(gu-)-.18 E .319(ments be)108 +208.8 R .319(ginning with)-.15 F F2<ad>2.819 E F0 .319 +(without requiring)2.819 F F2<adad>2.819 E F0 5.319(.O)C .319(ther b) +-5.319 F .319(uiltins that accept ar)-.2 F .32(guments b)-.18 F .32 +(ut are not speci\214ed as)-.2 F 1.144(accepting options interpret ar) +108 220.8 R 1.144(guments be)-.18 F 1.144(ginning with)-.15 F F2<ad> +3.643 E F0 1.143(as in)3.643 F -.25(va)-.4 G 1.143 +(lid options and require).25 F F2<adad>3.643 E F0 1.143(to pre)3.643 F +-.15(ve)-.25 G 1.143(nt this).15 F(interpretation.)108 232.8 Q F2(:)108 +250.8 Q F0([)2.5 E/F3 10/Times-Italic@0 SF(ar)A(guments)-.37 E F0(])A +.451(No ef)144 262.8 R .451(fect; the command does nothing be)-.25 F +.452(yond e)-.15 F(xpanding)-.15 E F3(ar)3.282 E(guments)-.37 E F0 .452 +(and performing an)3.222 F 2.952(ys)-.15 G(peci\214ed)-2.952 E 2.5 +(redirections. A)144 274.8 R(zero e)2.5 E(xit code is returned.)-.15 E +F2(.)110.5 291.6 Q F3(\214lename)6.666 E F0([)2.5 E F3(ar)A(guments)-.37 +E F0(])A F2(sour)108 303.6 Q(ce)-.18 E F3(\214lename)2.5 E F0([)2.5 E F3 +(ar)A(guments)-.37 E F0(])A 1.02(Read and e)144 315.6 R -.15(xe)-.15 G +1.02(cute commands from).15 F F3(\214lename)5.43 E F0 1.02 +(in the current shell en)3.7 F 1.02(vironment and return the e)-.4 F +(xit)-.15 E 1.68(status of the last command e)144 327.6 R -.15(xe)-.15 G +1.68(cuted from).15 F F3(\214lename)4.18 E F0 6.68(.I).18 G(f)-6.68 E F3 +(\214lename)6.09 E F0 1.68(does not contain a slash, \214le)4.36 F .608 +(names in)144 339.6 R/F4 9/Times-Bold@0 SF -.666(PA)3.108 G(TH)-.189 E +F0 .608(are used to \214nd the directory containing)2.858 F F3 +(\214lename)3.108 E F0 5.608(.T).18 G .608(he \214le searched for in) +-5.608 F F4 -.666(PA)3.108 G(TH)-.189 E F0 .832(need not be e)144 351.6 +R -.15(xe)-.15 G 3.332(cutable. When).15 F F2(bash)3.332 E F0 .832 +(is not in)3.332 F F3 .832(posix mode)3.332 F F0 3.332(,t)C .833 +(he current directory is searched if no)-3.332 F .982 +(\214le is found in)144 363.6 R F4 -.666(PA)3.481 G(TH)-.189 E/F5 9 +/Times-Roman@0 SF(.)A F0 .981(If the)5.481 F F2(sour)3.481 E(cepath)-.18 +E F0 .981(option to the)3.481 F F2(shopt)3.481 E F0 -.2(bu)3.481 G .981 +(iltin command is turned of).2 F .981(f, the)-.25 F F4 -.666(PA)144 +375.6 S(TH)-.189 E F0 .112(is not searched.)2.362 F .112(If an)5.112 F +(y)-.15 E F3(ar)2.612 E(guments)-.37 E F0 .112(are supplied, the)2.612 F +2.612(yb)-.15 G .112(ecome the positional parameters when)-2.612 F F3 +(\214lename)144 387.6 Q F0 .342(is e)2.842 F -.15(xe)-.15 G 2.842 +(cuted. Otherwise).15 F .342(the positional parameters are unchanged.) +2.842 F .341(The return status is the)5.341 F .716 +(status of the last command e)144 399.6 R .716 +(xited within the script \(0 if no commands are e)-.15 F -.15(xe)-.15 G +.716(cuted\), and f).15 F .716(alse if)-.1 F F3(\214lename)145.91 411.6 +Q F0(is not found or cannot be read.)2.68 E F2(alias)108 428.4 Q F0([) +2.5 E F2<ad70>A F0 2.5(][)C F3(name)-2.5 E F0([=)A F3(value)A F0 2.5(].) +C(..])-2.5 E F2(Alias)144 440.4 Q F0 2.725(with no ar)5.225 F 2.724 +(guments or with the)-.18 F F2<ad70>5.224 E F0 2.724 +(option prints the list of aliases in the form)5.224 F F2(alias)5.224 E +F3(name)144 452.4 Q F0(=)A F3(value)A F0 .58(on standard output.)3.08 F +.58(When ar)5.58 F .58 +(guments are supplied, an alias is de\214ned for each)-.18 F F3(name) +3.08 E F0(whose)144 464.4 Q F3(value)2.895 E F0 .395(is gi)2.895 F -.15 +(ve)-.25 G 2.895(n. A).15 F .395(trailing space in)2.895 F F3(value) +5.395 E F0 .395(causes the ne)2.895 F .395(xt w)-.15 F .395 +(ord to be check)-.1 F .395(ed for alias sub-)-.1 F .054 +(stitution when the alias is e)144 476.4 R 2.554(xpanded. F)-.15 F .054 +(or each)-.15 F F3(name)2.554 E F0 .054(in the ar)2.554 F .054 +(gument list for which no)-.18 F F3(value)2.554 E F0 .054(is sup-)2.554 +F 1.314(plied, the name and v)144 488.4 R 1.314 +(alue of the alias is printed.)-.25 F F2(Alias)6.314 E F0 1.314 +(returns true unless a)3.814 F F3(name)3.814 E F0 1.313(is gi)3.814 F +-.15(ve)-.25 G 3.813(nf).15 G(or)-3.813 E +(which no alias has been de\214ned.)144 500.4 Q F2(bg)108 517.2 Q F0([) +2.5 E F3(jobspec)A F0(...])2.5 E .744(Resume each suspended job)144 +529.2 R F3(jobspec)3.244 E F0 .745 +(in the background, as if it had been started with)3.244 F F2(&)3.245 E +F0 5.745(.I)C(f)-5.745 E F3(job-)4.985 E(spec)144 541.2 Q F0 .672 +(is not present, the shell')3.482 F 3.172(sn)-.55 G .672(otion of the) +-3.172 F F3(curr)3.172 E .672(ent job)-.37 F F0 .672(is used.)3.172 F F2 +(bg)5.671 E F3(jobspec)4.911 E F0 .671(returns 0 unless run)3.481 F .418 +(when job control is disabled or)144 553.2 R 2.919(,w)-.4 G .419 +(hen run with job control enabled, an)-2.919 F 2.919(ys)-.15 G +(peci\214ed)-2.919 E F3(jobspec)2.919 E F0 -.1(wa)2.919 G 2.919(sn).1 G +(ot)-2.919 E(found or w)144 565.2 Q(as started without job control.)-.1 +E F2(bind)108 582 Q F0([)2.5 E F2<ad6d>A F3 -.1(ke)2.5 G(ymap)-.2 E F0 +2.5(][)C F2(\255lpsvPSV)-2.5 E F0(])A F2(bind)108 594 Q F0([)2.5 E F2 +<ad6d>A F3 -.1(ke)2.5 G(ymap)-.2 E F0 2.5(][)C F2<ad71>-2.5 E F3 +(function)2.5 E F0 2.5(][)C F2<ad75>-2.5 E F3(function)2.5 E F0 2.5(][)C +F2<ad72>-2.5 E F3 -.1(ke)2.5 G(yseq)-.2 E F0(])A F2(bind)108 606 Q F0([) +2.5 E F2<ad6d>A F3 -.1(ke)2.5 G(ymap)-.2 E F0(])A F2<ad66>2.5 E F3 +(\214lename)2.5 E F2(bind)108 618 Q F0([)2.5 E F2<ad6d>A F3 -.1(ke)2.5 G +(ymap)-.2 E F0(])A F2<ad78>2.5 E F3 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F3 +(shell\255command)A F2(bind)108 630 Q F0([)2.5 E F2<ad6d>A F3 -.1(ke)2.5 +G(ymap)-.2 E F0(])A F3 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F3 +(function\255name)A F2(bind)108 642 Q F3 -.37(re)2.5 G +(adline\255command).37 E F0 .239(Display current)144 654 R F2 -.18(re) +2.739 G(adline).18 E F0 -.1(ke)2.739 G 2.739(ya)-.05 G .239 +(nd function bindings, bind a k)-2.739 F .539 -.15(ey s)-.1 H .238 +(equence to a).15 F F2 -.18(re)2.738 G(adline).18 E F0 .238(function or) +2.738 F .475(macro, or set a)144 666 R F2 -.18(re)2.975 G(adline).18 E +F0 -.25(va)2.975 G 2.975(riable. Each).25 F .476(non-option ar)2.976 F +.476(gument is a command as it w)-.18 F .476(ould appear in)-.1 F F3 +(.inputr)144 678 Q(c)-.37 E F0 2.984(,b).31 G .484 +(ut each binding or command must be passed as a separate ar)-3.184 F +.483(gument; e.g., '"\\C\255x\\C\255r":)-.18 F 2.5 +(re\255read\255init\255\214le'. Options,)144 690 R(if supplied, ha)2.5 E +.3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F2<ad6d>144 702 +Q F3 -.1(ke)2.5 G(ymap)-.2 E F0(Use)180 714 Q F3 -.1(ke)5.158 G(ymap)-.2 +E F0 2.658(as the k)5.348 F -.15(ey)-.1 G 2.658(map to be af).15 F 2.659 +(fected by the subsequent bindings.)-.25 F(Acceptable)7.659 E F3 -.1(ke) +180 726 S(ymap)-.2 E F0 3.193(names are)5.883 F F3 3.193 +(emacs, emacs\255standar)5.693 F 3.192 +(d, emacs\255meta, emacs\255ctlx, vi, vi\255mo)-.37 F(ve)-.1 E(,)-.1 E +F0(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(1)203.725 E 0 Cg EP +%%Page: 2 2 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Italic@0 SF(vi\255command)180 84 Q F0 4.429(,a)C(nd)-4.429 E F1 +(vi\255insert)4.429 E F0(.).68 E F1(vi)6.929 E F0 1.929(is equi)4.429 F +-.25(va)-.25 G 1.929(lent to).25 F F1(vi\255command)4.429 E F0(;)A F1 +(emacs)4.429 E F0 1.929(is equi)4.429 F -.25(va)-.25 G 1.93(lent to).25 +F F1(emacs\255standar)180 96 Q(d)-.37 E F0(.)A/F2 10/Times-Bold@0 SF +<ad6c>144 108 Q F0(List the names of all)27.52 E F2 -.18(re)2.5 G +(adline).18 E F0(functions.)2.5 E F2<ad70>144 120 Q F0(Display)24.74 E +F2 -.18(re)2.5 G(adline).18 E F0 +(function names and bindings in such a w)2.5 E(ay that the)-.1 E 2.5(yc) +-.15 G(an be re-read.)-2.5 E F2<ad50>144 132 Q F0(List current)24.19 E +F2 -.18(re)2.5 G(adline).18 E F0(function names and bindings.)2.5 E F2 +<ad73>144 144 Q F0(Display)26.41 E F2 -.18(re)3.655 G(adline).18 E F0 +-.1(ke)3.655 G 3.655(ys)-.05 G 1.155 +(equences bound to macros and the strings the)-3.655 F 3.655(yo)-.15 G +1.155(utput in such a)-3.655 F -.1(wa)180 156 S 2.5(yt).1 G(hat the)-2.5 +E 2.5(yc)-.15 G(an be re-read.)-2.5 E F2<ad53>144 168 Q F0(Display)24.74 +E F2 -.18(re)2.5 G(adline).18 E F0 -.1(ke)2.5 G 2.5(ys)-.05 G +(equences bound to macros and the strings the)-2.5 E 2.5(yo)-.15 G +(utput.)-2.5 E F2<ad76>144 180 Q F0(Display)25.3 E F2 -.18(re)2.5 G +(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E +(alues in such a w)-.25 E(ay that the)-.1 E 2.5(yc)-.15 G +(an be re-read.)-2.5 E F2<ad56>144 192 Q F0(List current)23.08 E F2 -.18 +(re)2.5 G(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E(alues.) +-.25 E F2<ad66>144 204 Q F1(\214lename)2.5 E F0(Read k)180 216 Q .3 -.15 +(ey b)-.1 H(indings from).15 E F1(\214lename)2.5 E F0(.)A F2<ad71>144 +228 Q F1(function)2.5 E F0(Query about which k)180 240 Q -.15(ey)-.1 G +2.5(si).15 G -1.9 -.4(nv o)-2.5 H .2 -.1(ke t).4 H(he named).1 E F1 +(function)2.5 E F0(.)A F2<ad75>144 252 Q F1(function)2.5 E F0 +(Unbind all k)180 264 Q -.15(ey)-.1 G 2.5(sb).15 G(ound to the named) +-2.5 E F1(function)2.5 E F0(.)A F2<ad72>144 276 Q F1 -.1(ke)2.5 G(yseq) +-.2 E F0(Remo)180 288 Q .3 -.15(ve a)-.15 H .3 -.15(ny c).15 H +(urrent binding for).15 E F1 -.1(ke)2.5 G(yseq)-.2 E F0(.)A F2<ad78>144 +300 Q F1 -.1(ke)2.5 G(yseq)-.2 E F2(:)A F1(shell\255command)A F0(Cause) +180 312 Q F1(shell\255command)4.325 E F0 1.825(to be e)4.325 F -.15(xe) +-.15 G 1.825(cuted whene).15 F -.15(ve)-.25 G(r).15 E F1 -.1(ke)4.325 G +(yseq)-.2 E F0 1.825(is entered.)4.325 F(When)6.825 E F1(shell\255com-) +4.325 E(mand)180 324 Q F0 1.765(is e)4.265 F -.15(xe)-.15 G 1.765 +(cuted, the shell sets the).15 F/F3 9/Times-Bold@0 SF(READLINE_LINE) +4.265 E F0 -.25(va)4.015 G 1.765(riable to the contents of the).25 F F2 +-.18(re)180 336 S(adline).18 E F0 1.353(line b)3.852 F(uf)-.2 E 1.353 +(fer and the)-.25 F F3(READLINE_POINT)3.853 E F0 -.25(va)3.603 G 1.353 +(riable to the current location of the).25 F 2.012(insertion point.)180 +348 R 2.011(If the e)7.012 F -.15(xe)-.15 G 2.011 +(cuted command changes the v).15 F 2.011(alue of)-.25 F F3 +(READLINE_LINE)4.511 E F0(or)4.261 E F3(READLINE_POINT)180 360 Q/F4 9 +/Times-Roman@0 SF(,)A F0(those ne)2.25 E 2.5(wv)-.25 G +(alues will be re\215ected in the editing state.)-2.75 E(The return v) +144 376.8 Q(alue is 0 unless an unrecognized option is gi)-.25 E -.15 +(ve)-.25 G 2.5(no).15 G 2.5(ra)-2.5 G 2.5(ne)-2.5 G(rror occurred.)-2.5 +E F2(br)108 393.6 Q(eak)-.18 E F0([)2.5 E F1(n)A F0(])A .054 +(Exit from within a)144 405.6 R F2 -.25(fo)2.554 G(r).25 E F0(,)A F2 +(while)2.554 E F0(,)A F2(until)2.555 E F0 2.555(,o)C(r)-2.555 E F2 +(select)2.555 E F0 2.555(loop. If)2.555 F F1(n)2.555 E F0 .055 +(is speci\214ed, break)2.555 F F1(n)2.555 E F0(le)2.555 E -.15(ve)-.25 G +(ls.).15 E F1(n)5.415 E F0 .055(must be)2.795 F/F5 10/Symbol SF<b3>2.555 +E F0(1.)2.555 E(If)144 417.6 Q F1(n)3.075 E F0 .215(is greater than the\ + number of enclosing loops, all enclosing loops are e)2.955 F 2.714 +(xited. The)-.15 F .214(return v)2.714 F(alue)-.25 E(is 0 unless)144 +429.6 Q F1(n)2.5 E F0(is not greater than or equal to 1.)2.5 E F2 -.2 +(bu)108 446.4 S(iltin).2 E F1(shell\255b)2.5 E(uiltin)-.2 E F0([)2.5 E +F1(ar)A(guments)-.37 E F0(])A(Ex)144 458.4 Q .792 +(ecute the speci\214ed shell b)-.15 F .792(uiltin, passing it)-.2 F F1 +(ar)3.293 E(guments)-.37 E F0 3.293(,a).27 G .793(nd return its e)-3.293 +F .793(xit status.)-.15 F .793(This is useful)5.793 F .616 +(when de\214ning a function whose name is the same as a shell b)144 +470.4 R .615(uiltin, retaining the functionality of)-.2 F .57(the b)144 +482.4 R .57(uiltin within the function.)-.2 F(The)5.57 E F2(cd)3.07 E F0 +-.2(bu)3.07 G .57(iltin is commonly rede\214ned this w).2 F(ay)-.1 E +5.57(.T)-.65 G .57(he return status)-5.57 F(is f)144 494.4 Q(alse if)-.1 +E F1(shell\255b)2.84 E(uiltin)-.2 E F0(is not a shell b)2.74 E +(uiltin command.)-.2 E F2(caller)108 511.2 Q F0([)2.5 E F1 -.2(ex)C(pr) +.2 E F0(])A .254(Returns the conte)144 523.2 R .254(xt of an)-.15 F +2.754(ya)-.15 G(cti)-2.754 E .554 -.15(ve s)-.25 H .254 +(ubroutine call \(a shell function or a script e).15 F -.15(xe)-.15 G +.254(cuted with the).15 F F2(.)2.753 E F0(or)2.753 E F2(sour)144 535.2 Q +(ce)-.18 E F0 -.2(bu)3.062 G 3.062(iltins. W).2 F(ithout)-.4 E F1 -.2 +(ex)3.062 G(pr).2 E F0(,)A F2(caller)3.062 E F0 .562 +(displays the line number and source \214lename of the current)3.062 F +.254(subroutine call.)144 547.2 R .254(If a non-ne)5.254 F -.05(ga)-.15 +G(ti).05 E .554 -.15(ve i)-.25 H(nte).15 E .253(ger is supplied as)-.15 +F F1 -.2(ex)2.753 G(pr).2 E F0(,)A F2(caller)2.753 E F0 .253 +(displays the line number)2.753 F 2.753(,s)-.4 G(ub-)-2.753 E 1.327(rou\ +tine name, and source \214le corresponding to that position in the curr\ +ent e)144 559.2 R -.15(xe)-.15 G 1.328(cution call stack.).15 F .001 +(This e)144 571.2 R .001(xtra information may be used, for e)-.15 F .001 +(xample, to print a stack trace.)-.15 F(The current frame is frame)5 E +3.019(0. The)144 583.2 R .519(return v)3.019 F .519 +(alue is 0 unless the shell is not e)-.25 F -.15(xe)-.15 G .52 +(cuting a subroutine call or).15 F F1 -.2(ex)3.02 G(pr).2 E F0 .52 +(does not corre-)3.02 F(spond to a v)144 595.2 Q +(alid position in the call stack.)-.25 E F2(cd)108 612 Q F0([)2.5 E F2 +(\255L|-P)A F0 2.5(][)C F1(dir)-2.5 E F0(])A .21 +(Change the current directory to)144 624 R F1(dir)2.71 E F0 5.21(.T)C +.21(he v)-5.21 F(ariable)-.25 E F3(HOME)2.71 E F0 .21(is the def)2.46 F +(ault)-.1 E F1(dir)2.71 E F0 5.21(.T).73 G .21(he v)-5.21 F(ariable)-.25 +E F3(CDP)2.71 E -.855(AT)-.666 G(H).855 E F0 .776 +(de\214nes the search path for the directory containing)144 636 R F1 +(dir)3.276 E F0 5.777(.A).73 G(lternati)-5.777 E 1.077 -.15(ve d)-.25 H +.777(irectory names in).15 F F3(CDP)3.277 E -.855(AT)-.666 G(H).855 E F0 +.764(are separated by a colon \(:\).)144 648 R 3.264(An)5.764 G .764 +(ull directory name in)-3.264 F F3(CDP)3.264 E -.855(AT)-.666 G(H).855 E +F0 .764(is the same as the current direc-)3.014 F(tory)144 660 Q 2.973 +(,i)-.65 G .473(.e., `)-2.973 F(`)-.74 E F2(.)A F0 -.74('')C 5.473(.I) +.74 G(f)-5.473 E F1(dir)3.323 E F0(be)3.703 E .474 +(gins with a slash \(/\), then)-.15 F F3(CDP)2.974 E -.855(AT)-.666 G(H) +.855 E F0 .474(is not used. The)2.724 F F2<ad50>2.974 E F0 .474 +(option says to use)2.974 F .58(the ph)144 672 R .58 +(ysical directory structure instead of follo)-.05 F .579 +(wing symbolic links \(see also the)-.25 F F2<ad50>3.079 E F0 .579 +(option to the)3.079 F F2(set)144 684 Q F0 -.2(bu)3.383 G .883 +(iltin command\); the).2 F F2<ad4c>3.383 E F0 .884 +(option forces symbolic links to be follo)3.384 F 3.384(wed. An)-.25 F +(ar)3.384 E .884(gument of)-.18 F F2<ad>3.384 E F0(is)3.384 E(equi)144 +696 Q -.25(va)-.25 G .316(lent to).25 F F3($OLDPWD)2.816 E F4(.)A F0 +.316(If a non-empty directory name from)4.816 F F3(CDP)2.815 E -.855(AT) +-.666 G(H).855 E F0 .315(is used, or if)2.565 F F2<ad>2.815 E F0 .315 +(is the \214rst)2.815 F(ar)144 708 Q .116(gument, and the directory cha\ +nge is successful, the absolute pathname of the ne)-.18 F 2.616(ww)-.25 +G .116(orking direc-)-2.716 F 1.165 +(tory is written to the standard output.)144 720 R 1.164(The return v) +6.164 F 1.164(alue is true if the directory w)-.25 F 1.164 +(as successfully)-.1 F(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(2) +203.725 E 0 Cg EP +%%Page: 3 3 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E(changed; f) +144 84 Q(alse otherwise.)-.1 E/F1 10/Times-Bold@0 SF(command)108 100.8 Q +F0([)2.5 E F1(\255pVv)A F0(])A/F2 10/Times-Italic@0 SF(command)2.5 E F0 +([)2.5 E F2(ar)A(g)-.37 E F0(...])2.5 E(Run)144 112.8 Q F2(command)2.956 +E F0(with)3.527 E F2(ar)3.087 E(gs)-.37 E F0 .257 +(suppressing the normal shell function lookup. Only b)3.027 F .257 +(uiltin commands or)-.2 F .502(commands found in the)144 124.8 R/F3 9 +/Times-Bold@0 SF -.666(PA)3.002 G(TH)-.189 E F0 .502(are e)2.752 F -.15 +(xe)-.15 G 3.002(cuted. If).15 F(the)3.002 E F1<ad70>3.002 E F0 .502 +(option is gi)3.002 F -.15(ve)-.25 G .501(n, the search for).15 F F2 +(command)3.201 E F0(is)3.771 E .399(performed using a def)144 136.8 R +.399(ault v)-.1 F .399(alue for)-.25 F F3 -.666(PA)2.899 G(TH)-.189 E F0 +.4(that is guaranteed to \214nd all of the standard utilities.)2.649 F +(If)5.4 E .175(either the)144 148.8 R F1<ad56>2.675 E F0(or)2.675 E F1 +<ad76>2.675 E F0 .175(option is supplied, a description of)2.675 F F2 +(command)2.875 E F0 .174(is printed.)3.445 F(The)5.174 E F1<ad76>2.674 E +F0 .174(option causes)2.674 F 3.11(as)144 160.8 S .61(ingle w)-3.11 F +.61(ord indicating the command or \214le name used to in)-.1 F -.2(vo) +-.4 G -.1(ke).2 G F2(command)3.41 E F0 .61(to be displayed; the)3.88 F +F1<ad56>144 172.8 Q F0 .25(option produces a more v)2.75 F .25 +(erbose description.)-.15 F .249(If the)5.25 F F1<ad56>2.749 E F0(or) +2.749 E F1<ad76>2.749 E F0 .249(option is supplied, the e)2.749 F .249 +(xit status)-.15 F 1.004(is 0 if)144 184.8 R F2(command)3.704 E F0 -.1 +(wa)4.274 G 3.504(sf).1 G 1.005(ound, and 1 if not.)-3.504 F 1.005 +(If neither option is supplied and an error occurred or)6.005 F F2 +(command)144.2 196.8 Q F0 1.599(cannot be found, the e)4.869 F 1.599 +(xit status is 127.)-.15 F 1.599(Otherwise, the e)6.599 F 1.598 +(xit status of the)-.15 F F1(command)4.098 E F0 -.2(bu)144 208.8 S +(iltin is the e).2 E(xit status of)-.15 E F2(command)2.5 E F0(.).77 E F1 +(compgen)108 225.6 Q F0([)2.5 E F2(option)A F0 2.5(][)C F2(wor)-2.5 E(d) +-.37 E F0(])A .012(Generate possible completion matches for)144 237.6 R +F2(wor)2.513 E(d)-.37 E F0 .013(according to the)2.513 F F2(option)2.513 +E F0 .013(s, which may be an)B 2.513(yo)-.15 G(ption)-2.513 E .982 +(accepted by the)144 249.6 R F1(complete)3.482 E F0 -.2(bu)3.481 G .981 +(iltin with the e).2 F .981(xception of)-.15 F F1<ad70>3.481 E F0(and) +3.481 E F1<ad72>3.481 E F0 3.481(,a)C .981(nd write the matches to the) +-3.481 F 1.415(standard output.)144 261.6 R 1.415(When using the)6.415 F +F1<ad46>3.915 E F0(or)3.915 E F1<ad43>3.915 E F0 1.415(options, the v) +3.915 F 1.415(arious shell v)-.25 F 1.415(ariables set by the pro-)-.25 +F(grammable completion f)144 273.6 Q(acilities, while a)-.1 E -.25(va) +-.2 G(ilable, will not ha).25 E .3 -.15(ve u)-.2 H(seful v).15 E(alues.) +-.25 E .352(The matches will be generated in the same w)144 297.6 R .352 +(ay as if the programmable completion code had gen-)-.1 F .02(erated th\ +em directly from a completion speci\214cation with the same \215ags.)144 +309.6 R(If)5.02 E F2(wor)2.52 E(d)-.37 E F0 .02(is speci\214ed, only) +2.52 F(those completions matching)144 321.6 Q F2(wor)2.5 E(d)-.37 E F0 +(will be displayed.)2.5 E(The return v)144 345.6 Q +(alue is true unless an in)-.25 E -.25(va)-.4 G +(lid option is supplied, or no matches were generated.).25 E F1 +(complete)108 362.4 Q F0([)3.729 E F1(\255abcdefgjksuv)A F0 3.729(][)C +F1<ad6f>-3.729 E F2(comp-option)3.729 E F0 3.729(][)C F1(\255DE)-3.729 E +F0 3.728(][)C F1<ad41>-3.728 E F2(action)3.728 E F0 3.728(][)C F1<ad47> +-3.728 E F2(globpat)3.728 E F0 3.728(][)C F1<ad57>-3.728 E F2(wor)3.728 +E(dlist)-.37 E F0 3.728(][)C F1<ad46>-3.728 E F2(func-)3.728 E(tion)108 +374.4 Q F0 2.5(][)C F1<ad43>-2.5 E F2(command)2.5 E F0(])A([)144 386.4 Q +F1<ad58>A F2(\214lterpat)2.5 E F0 2.5(][)C F1<ad50>-2.5 E F2(pr)2.5 E +(e\214x)-.37 E F0 2.5(][)C F1<ad53>-2.5 E F2(suf)2.5 E<8c78>-.18 E F0(]) +A F2(name)2.5 E F0([)2.5 E F2(name ...)A F0(])A F1(complete \255pr)108 +398.4 Q F0([)2.5 E F1(\255DE)A F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E +.634(Specify ho)144 410.4 R 3.134(wa)-.25 G -.18(rg)-3.134 G .634 +(uments to each).18 F F2(name)3.134 E F0 .634(should be completed.)3.134 +F .633(If the)5.634 F F1<ad70>3.133 E F0 .633 +(option is supplied, or if no)3.133 F .139(options are supplied, e)144 +422.4 R .139(xisting completion speci\214cations are printed in a w)-.15 +F .14(ay that allo)-.1 F .14(ws them to be)-.25 F .31(reused as input.) +144 434.4 R(The)5.31 E F1<ad72>2.81 E F0 .31(option remo)2.81 F -.15(ve) +-.15 G 2.81(sac).15 G .31(ompletion speci\214cation for each)-2.81 F F2 +(name)2.81 E F0 2.81(,o)C 1.11 -.4(r, i)-2.81 H 2.81(fn).4 G(o)-2.81 E +F2(name)2.81 E F0(s)A 1.346 +(are supplied, all completion speci\214cations.)144 446.4 R(The)6.347 E +F1<ad44>3.847 E F0 1.347(option indicates that the remaining options) +3.847 F .5(and actions should apply to the `)144 458.4 R(`def)-.74 E +(ault')-.1 E 3('c)-.74 G .5 +(ommand completion; that is, completion attempted on)-3 F 3.455(ac)144 +470.4 S .955(ommand for which no completion has pre)-3.455 F .955 +(viously been de\214ned.)-.25 F(The)5.955 E F1<ad45>3.455 E F0 .955 +(option indicates that)3.455 F .065 +(the remaining options and actions should apply to `)144 482.4 R +(`empty')-.74 E 2.564('c)-.74 G .064 +(ommand completion; that is, comple-)-2.564 F +(tion attempted on a blank line.)144 494.4 Q 1.437 +(The process of applying these completion speci\214cations when w)144 +518.4 R 1.438(ord completion is attempted is)-.1 F(described abo)144 +530.4 Q .3 -.15(ve u)-.15 H(nder).15 E F1(Pr)2.5 E +(ogrammable Completion)-.18 E F0(.)A .556 +(Other options, if speci\214ed, ha)144 554.4 R .856 -.15(ve t)-.2 H .555 +(he follo).15 F .555(wing meanings.)-.25 F .555(The ar)5.555 F .555 +(guments to the)-.18 F F1<ad47>3.055 E F0(,)A F1<ad57>3.055 E F0 3.055 +(,a)C(nd)-3.055 E F1<ad58>3.055 E F0 .722(options \(and, if necessary) +144 566.4 R 3.222(,t)-.65 G(he)-3.222 E F1<ad50>3.222 E F0(and)3.222 E +F1<ad53>3.222 E F0 .723 +(options\) should be quoted to protect them from e)3.222 F(xpan-)-.15 E +(sion before the)144 578.4 Q F1(complete)2.5 E F0 -.2(bu)2.5 G +(iltin is in).2 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E F1<ad6f>144 590.4 Q +F2(comp-option)2.5 E F0(The)184 602.4 Q F2(comp-option)2.791 E F0 .291 +(controls se)2.791 F -.15(ve)-.25 G .291(ral aspects of the compspec') +.15 F 2.791(sb)-.55 G(eha)-2.791 E .291(vior be)-.2 F .291 +(yond the simple)-.15 F(generation of completions.)184 614.4 Q F2 +(comp-option)5 E F0(may be one of:)2.5 E F1(bashdefault)184 626.4 Q F0 +.281(Perform the rest of the def)224 638.4 R(ault)-.1 E F1(bash)2.781 E +F0 .281(completions if the compspec generates no)2.781 F(matches.)224 +650.4 Q F1(default)184 662.4 Q F0 2.876(Use readline')10 F 5.376(sd)-.55 +G(ef)-5.376 E 2.875 +(ault \214lename completion if the compspec generates no)-.1 F(matches.) +224 674.4 Q F1(dir)184 686.4 Q(names)-.15 E F0(Perform directory name c\ +ompletion if the compspec generates no matches.)224 698.4 Q +(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(3)203.725 E 0 Cg EP +%%Page: 4 4 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(\214lenames)184 84 Q F0 -.7(Te)224 96 S .137(ll readli\ +ne that the compspec generates \214lenames, so it can perform an).7 F +2.637<798c>-.15 G(le-)-2.637 E .134(name\255speci\214c processing \(lik) +224 108 R 2.634(ea)-.1 G .134 +(dding a slash to directory names, quoting spe-)-2.634 F .45 +(cial characters, or suppressing trailing spaces\).)224 120 R .45 +(Intended to be used with shell)5.45 F(functions.)224 132 Q F1(nospace) +184 144 Q F0 -.7(Te)6.11 G .22 +(ll readline not to append a space \(the def).7 F .22(ault\) to w)-.1 F +.22(ords completed at the end)-.1 F(of the line.)224 156 Q F1(plusdirs) +184 168 Q F0 1.985(After an)5.54 F 4.485(ym)-.15 G 1.985 +(atches de\214ned by the compspec are generated, directory name)-4.485 F +.584(completion is attempted and an)224 180 R 3.084(ym)-.15 G .584 +(atches are added to the results of the other)-3.084 F(actions.)224 192 +Q F1<ad41>144 204 Q/F2 10/Times-Italic@0 SF(action)2.5 E F0(The)184 216 +Q F2(action)2.5 E F0(may be one of the follo)2.5 E +(wing to generate a list of possible completions:)-.25 E F1(alias)184 +228 Q F0(Alias names.)20.55 E(May also be speci\214ed as)5 E F1<ad61>2.5 +E F0(.)A F1(arrayv)184 240 Q(ar)-.1 E F0(Array v)224 252 Q +(ariable names.)-.25 E F1 4.7(binding Readline)184 264 R F0 -.1(ke)2.5 G +2.5(yb)-.05 G(inding names.)-2.5 E F1 -.2(bu)184 276 S(iltin).2 E F0 +(Names of shell b)11.85 E(uiltin commands.)-.2 E +(May also be speci\214ed as)5 E F1<ad62>2.5 E F0(.)A F1(command)184 288 +Q F0(Command names.)224 300 Q(May also be speci\214ed as)5 E F1<ad63>2.5 +E F0(.)A F1(dir)184 312 Q(ectory)-.18 E F0(Directory names.)224 324 Q +(May also be speci\214ed as)5 E F1<ad64>2.5 E F0(.)A F1(disabled)184 336 +Q F0(Names of disabled shell b)224 348 Q(uiltins.)-.2 E F1(enabled)184 +360 Q F0(Names of enabled shell b)6.66 E(uiltins.)-.2 E F1(export)184 +372 Q F0(Names of e)12.23 E(xported shell v)-.15 E 2.5(ariables. May) +-.25 F(also be speci\214ed as)2.5 E F1<ad65>2.5 E F0(.)A F1(\214le)184 +384 Q F0(File names.)27.22 E(May also be speci\214ed as)5 E F1<ad66>2.5 +E F0(.)A F1(function)184 396 Q F0(Names of shell functions.)224 408 Q F1 +(gr)184 420 Q(oup)-.18 E F0(Group names.)14.62 E +(May also be speci\214ed as)5 E F1<ad67>2.5 E F0(.)A F1(helptopic)184 +432 Q F0(Help topics as accepted by the)224 444 Q F1(help)2.5 E F0 -.2 +(bu)2.5 G(iltin.).2 E F1(hostname)184 456 Q F0(Hostnames, as tak)224 468 +Q(en from the \214le speci\214ed by the)-.1 E/F3 9/Times-Bold@0 SF +(HOSTFILE)2.5 E F0(shell v)2.25 E(ariable.)-.25 E F1(job)184 480 Q F0 +(Job names, if job control is acti)26.11 E -.15(ve)-.25 G 5(.M).15 G +(ay also be speci\214ed as)-5 E F1<ad6a>2.5 E F0(.)A F1 -.1(ke)184 492 S +(yw).1 E(ord)-.1 E F0(Shell reserv)224 504 Q(ed w)-.15 E 2.5(ords. May) +-.1 F(also be speci\214ed as)2.5 E F1<ad6b>2.5 E F0(.)A F1(running)184 +516 Q F0(Names of running jobs, if job control is acti)5.54 E -.15(ve) +-.25 G(.).15 E F1(ser)184 528 Q(vice)-.1 E F0(Service names.)10.67 E +(May also be speci\214ed as)5 E F1<ad73>2.5 E F0(.)A F1(setopt)184 540 Q +F0 -1.11(Va)14.45 G(lid ar)1.11 E(guments for the)-.18 E F1<ad6f>2.5 E +F0(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1 +(shopt)184 552 Q F0(Shell option names as accepted by the)16.66 E F1 +(shopt)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1(signal)184 564 Q F0 +(Signal names.)14.99 E F1(stopped)184 576 Q F0 +(Names of stopped jobs, if job control is acti)6.66 E -.15(ve)-.25 G(.) +.15 E F1(user)184 588 Q F0(User names.)21.67 E +(May also be speci\214ed as)5 E F1<ad75>2.5 E F0(.)A F1 -.1(va)184 600 S +(riable).1 E F0(Names of all shell v)5.1 E 2.5(ariables. May)-.25 F +(also be speci\214ed as)2.5 E F1<ad76>2.5 E F0(.)A F1<ad47>144 612 Q F2 +(globpat)2.5 E F0 1.007(The pathname e)184 624 R 1.007(xpansion pattern) +-.15 F F2(globpat)3.507 E F0 1.007(is e)3.507 F 1.008 +(xpanded to generate the possible comple-)-.15 F(tions.)184 636 Q F1 +<ad57>144 648 Q F2(wor)2.5 E(dlist)-.37 E F0(The)184 660 Q F2(wor)3.64 E +(dlist)-.37 E F0 1.14(is split using the characters in the)3.64 F F3 +(IFS)3.64 E F0 1.139(special v)3.39 F 1.139(ariable as delimiters, and) +-.25 F 2.007(each resultant w)184 672 R 2.007(ord is e)-.1 F 4.507 +(xpanded. The)-.15 F 2.008(possible completions are the members of the) +4.507 F(resultant list which match the w)184 684 Q(ord being completed.) +-.1 E F1<ad43>144 696 Q F2(command)2.5 E(command)184 708 Q F0 1.056 +(is e)3.556 F -.15(xe)-.15 G 1.056(cuted in a subshell en).15 F 1.056 +(vironment, and its output is used as the possible)-.4 F(completions.) +184 720 Q(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(4)203.725 E 0 Cg +EP +%%Page: 5 5 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF<ad46>144 84 Q/F2 10/Times-Italic@0 SF(function)2.5 E F0 +1.18(The shell function)184 96 R F2(function)3.68 E F0 1.181(is e)3.681 +F -.15(xe)-.15 G 1.181(cuted in the current shell en).15 F 3.681 +(vironment. When)-.4 F 1.181(it \214n-)3.681 F .932 +(ishes, the possible completions are retrie)184 108 R -.15(ve)-.25 G +3.432(df).15 G .932(rom the v)-3.432 F .932(alue of the)-.25 F/F3 9 +/Times-Bold@0 SF(COMPREPL)3.431 E(Y)-.828 E F0(array)3.181 E -.25(va)184 +120 S(riable.).25 E F1<ad58>144 132 Q F2(\214lterpat)2.5 E(\214lterpat) +184 144 Q F0 .455(is a pattern as used for pathname e)2.955 F 2.956 +(xpansion. It)-.15 F .456(is applied to the list of possible)2.956 F +1.596(completions generated by the preceding options and ar)184 156 R +1.596(guments, and each completion)-.18 F(matching)184 168 Q F2 +(\214lterpat)3.204 E F0 .704(is remo)3.204 F -.15(ve)-.15 G 3.204(df).15 +G .704(rom the list.)-3.204 F 3.204(Al)5.704 G(eading)-3.204 E F1(!) +3.204 E F0(in)3.204 E F2(\214lterpat)3.205 E F0(ne)3.205 E -.05(ga)-.15 +G .705(tes the pattern;).05 F(in this case, an)184 180 Q 2.5(yc)-.15 G +(ompletion not matching)-2.5 E F2(\214lterpat)2.5 E F0(is remo)2.5 E +-.15(ve)-.15 G(d.).15 E F1<ad50>144 192 Q F2(pr)2.5 E(e\214x)-.37 E(pr) +184 204 Q(e\214x)-.37 E F0 .535(is added at the be)3.035 F .534 +(ginning of each possible completion after all other options ha)-.15 F +-.15(ve)-.2 G(been applied.)184 216 Q F1<ad53>144 228 Q F2(suf)2.5 E +2.81(\214x suf)-.18 F<8c78>-.18 E F0 +(is appended to each possible completion after all other options ha)2.5 +E .3 -.15(ve b)-.2 H(een applied.).15 E .466(The return v)144 244.8 R +.466(alue is true unless an in)-.25 F -.25(va)-.4 G .466 +(lid option is supplied, an option other than).25 F F1<ad70>2.967 E F0 +(or)2.967 E F1<ad72>2.967 E F0 .467(is sup-)2.967 F 1.362 +(plied without a)144 256.8 R F2(name)3.862 E F0(ar)3.862 E 1.361 +(gument, an attempt is made to remo)-.18 F 1.661 -.15(ve a c)-.15 H +1.361(ompletion speci\214cation for a).15 F F2(name)144 268.8 Q F0 +(for which no speci\214cation e)2.5 E +(xists, or an error occurs adding a completion speci\214cation.)-.15 E +F1(compopt)108 285.6 Q F0([)2.5 E F1<ad6f>A F2(option)2.5 E F0 2.5(][)C +F1(\255DE)-2.5 E F0 2.5(][)C F1(+o)-2.5 E F2(option)2.5 E F0 2.5(][)C F2 +(name)-2.5 E F0(])A .447(Modify completion options for each)144 297.6 R +F2(name)2.947 E F0 .447(according to the)2.947 F F2(option)2.947 E F0 +.447(s, or for the currently-e)B -.15(xe)-.15 G(cution).15 E .726 +(completion if no)144 309.6 R F2(name)3.226 E F0 3.226(sa)C .726 +(re supplied.)-3.226 F .725(If no)5.725 F F2(option)3.225 E F0 3.225(sa) +C .725(re gi)-3.225 F -.15(ve)-.25 G .725 +(n, display the completion options for).15 F(each)144 321.6 Q F2(name) +3.223 E F0 .723(or the current completion.)3.223 F .724(The possible v) +5.724 F .724(alues of)-.25 F F2(option)3.224 E F0 .724(are those v)3.224 +F .724(alid for the)-.25 F F1(com-)3.224 E(plete)144 333.6 Q F0 -.2(bu) +2.798 G .298(iltin described abo).2 F -.15(ve)-.15 G 5.297(.T).15 G(he) +-5.297 E F1<ad44>2.797 E F0 .297 +(option indicates that the remaining options should apply to)2.797 F +1.227(the `)144 345.6 R(`def)-.74 E(ault')-.1 E 3.727('c)-.74 G 1.228(o\ +mmand completion; that is, completion attempted on a command for which \ +no)-3.727 F 2.178(completion has pre)144 357.6 R 2.178 +(viously been de\214ned.)-.25 F(The)7.178 E F1<ad45>4.678 E F0 2.177 +(option indicates that the remaining options)4.677 F(should apply to `) +144 369.6 Q(`empty')-.74 E 2.5('c)-.74 G +(ommand completion; that is, completion attempted on a blank line.)-2.5 +E .327(The return v)108 386.4 R .327(alue is true unless an in)-.25 F +-.25(va)-.4 G .327 +(lid option is supplied, an attempt is made to modify the options for a) +.25 F F2(name)108 398.4 Q F0(for which no completion speci\214cation e) +2.5 E(xists, or an output error occurs.)-.15 E F1(continue)108 415.2 Q +F0([)2.5 E F2(n)A F0(])A 1.754(Resume the ne)144 427.2 R 1.754 +(xt iteration of the enclosing)-.15 F F1 -.25(fo)4.254 G(r).25 E F0(,)A +F1(while)4.254 E F0(,)A F1(until)4.254 E F0 4.254(,o)C(r)-4.254 E F1 +(select)4.254 E F0 4.253(loop. If)4.254 F F2(n)4.613 E F0 1.753 +(is speci\214ed,)4.493 F 1.208(resume at the)144 439.2 R F2(n)3.709 E F0 +1.209(th enclosing loop.)B F2(n)6.569 E F0 1.209(must be)3.949 F/F4 10 +/Symbol SF<b3>3.709 E F0 3.709(1. If)3.709 F F2(n)4.069 E F0 1.209 +(is greater than the number of enclosing)3.949 F .514 +(loops, the last enclosing loop \(the `)144 451.2 R(`top-le)-.74 E -.15 +(ve)-.25 G(l').15 E 3.014('l)-.74 G .514(oop\) is resumed.)-3.014 F .513 +(The return v)5.513 F .513(alue is 0 unless)-.25 F F2(n)3.013 E F0(is) +3.013 E(not greater than or equal to 1.)144 463.2 Q F1(declar)108 480 Q +(e)-.18 E F0([)2.5 E F1(\255aAfFilrtux)A F0 2.5(][)C F1<ad70>-2.5 E F0 +2.5(][)C F2(name)-2.5 E F0([=)A F2(value)A F0 2.5(].)C(..])-2.5 E F1 +(typeset)108 492 Q F0([)2.5 E F1(\255aAfFilrtux)A F0 2.5(][)C F1<ad70> +-2.5 E F0 2.5(][)C F2(name)-2.5 E F0([=)A F2(value)A F0 2.5(].)C(..]) +-2.5 E 1.264(Declare v)144 504 R 1.264(ariables and/or gi)-.25 F 1.564 +-.15(ve t)-.25 H 1.264(hem attrib).15 F 3.765(utes. If)-.2 F(no)3.765 E +F2(name)3.765 E F0 3.765(sa)C 1.265(re gi)-3.765 F -.15(ve)-.25 G 3.765 +(nt).15 G 1.265(hen display the v)-3.765 F 1.265(alues of)-.25 F -.25 +(va)144 516 S 3.483(riables. The).25 F F1<ad70>3.483 E F0 .983 +(option will display the attrib)3.483 F .983(utes and v)-.2 F .982 +(alues of each)-.25 F F2(name)3.482 E F0 5.982(.W).18 G(hen)-5.982 E F1 +<ad70>3.482 E F0 .982(is used)3.482 F(with)144 528 Q F2(name)3.579 E F0 +(ar)3.579 E 1.079(guments, additional options are ignored.)-.18 F(When) +6.079 E F1<ad70>3.579 E F0 1.079(is supplied without)3.579 F F2(name) +3.58 E F0(ar)3.58 E(gu-)-.18 E .151(ments, it will display the attrib) +144 540 R .151(utes and v)-.2 F .151(alues of all v)-.25 F .15 +(ariables ha)-.25 F .15(ving the attrib)-.2 F .15 +(utes speci\214ed by the)-.2 F .046(additional options.)144 552 R .046 +(If no other options are supplied with)5.046 F F1<ad70>2.547 E F0(,)A F1 +(declar)2.547 E(e)-.18 E F0 .047(will display the attrib)2.547 F .047 +(utes and)-.2 F -.25(va)144 564 S 1.363(lues of all shell v).25 F 3.863 +(ariables. The)-.25 F F1<ad66>3.863 E F0 1.362 +(option will restrict the display to shell functions.)3.863 F(The)6.362 +E F1<ad46>3.862 E F0 2.422(option inhibits the display of function de\ +\214nitions; only the function name and attrib)144 576 R 2.423(utes are) +-.2 F 2.664(printed. If)144 588 R(the)2.664 E F1(extdeb)2.664 E(ug)-.2 E +F0 .164(shell option is enabled using)2.664 F F1(shopt)2.664 E F0 2.664 +(,t)C .163(he source \214le name and line number)-2.664 F 1.382 +(where the function is de\214ned are displayed as well.)144 600 R(The) +6.382 E F1<ad46>3.882 E F0 1.382(option implies)3.882 F F1<ad66>3.882 E +F0 6.382(.T)C 1.382(he follo)-6.382 F(wing)-.25 E .794 +(options can be used to restrict output to v)144 612 R .794 +(ariables with the speci\214ed attrib)-.25 F .793(ute or to gi)-.2 F +1.093 -.15(ve v)-.25 H(ariables)-.1 E(attrib)144 624 Q(utes:)-.2 E F1 +<ad61>144 636 Q F0(Each)25.3 E F2(name)2.5 E F0(is an inde)2.5 E -.15 +(xe)-.15 G 2.5(da).15 G(rray v)-2.5 E(ariable \(see)-.25 E F1(Arrays)2.5 +E F0(abo)2.5 E -.15(ve)-.15 G(\).).15 E F1<ad41>144 648 Q F0(Each)23.08 +E F2(name)2.5 E F0(is an associati)2.5 E .3 -.15(ve a)-.25 H(rray v).15 +E(ariable \(see)-.25 E F1(Arrays)2.5 E F0(abo)2.5 E -.15(ve)-.15 G(\).) +.15 E F1<ad66>144 660 Q F0(Use function names only)26.97 E(.)-.65 E F1 +<ad69>144 672 Q F0 .557(The v)27.52 F .558 +(ariable is treated as an inte)-.25 F .558(ger; arithmetic e)-.15 F -.25 +(va)-.25 G .558(luation \(see).25 F F3 .558(ARITHMETIC EV)3.058 F(ALU) +-1.215 E(A-)-.54 E(TION)180 684 Q F0(abo)2.25 E -.15(ve)-.15 G 2.5(\)i) +.15 G 2.5(sp)-2.5 G(erformed when the v)-2.5 E(ariable is assigned a v) +-.25 E(alue.)-.25 E F1<ad6c>144 696 Q F0 .91(When the v)27.52 F .909 +(ariable is assigned a v)-.25 F .909(alue, all upper)-.25 F .909 +(-case characters are con)-.2 F -.15(ve)-.4 G .909(rted to lo).15 F(wer) +-.25 E(-)-.2 E 2.5(case. The)180 708 R(upper)2.5 E(-case attrib)-.2 E +(ute is disabled.)-.2 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(5) +203.725 E 0 Cg EP +%%Page: 6 6 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF<ad72>144 84 Q F0(Mak)25.86 E(e)-.1 E/F2 10 +/Times-Italic@0 SF(name)5.046 E F0 5.046(sr)C(eadonly)-5.046 E 7.546(.T) +-.65 G 2.546(hese names cannot then be assigned v)-7.546 F 2.547 +(alues by subsequent)-.25 F(assignment statements or unset.)180 96 Q F1 +<ad74>144 108 Q F0(Gi)26.97 E .73 -.15(ve e)-.25 H(ach).15 E F2(name) +2.93 E F0(the)2.929 E F2(tr)2.929 E(ace)-.15 E F0(attrib)2.929 E 2.929 +(ute. T)-.2 F .429(raced functions inherit the)-.35 F F1(DEB)2.929 E(UG) +-.1 E F0(and)2.929 E F1(RETURN)2.929 E F0(traps from the calling shell.) +180 120 Q(The trace attrib)5 E(ute has no special meaning for v)-.2 E +(ariables.)-.25 E F1<ad75>144 132 Q F0 .909(When the v)24.74 F .909 +(ariable is assigned a v)-.25 F .909(alue, all lo)-.25 F(wer)-.25 E .909 +(-case characters are con)-.2 F -.15(ve)-.4 G .91(rted to upper).15 F(-) +-.2 E 2.5(case. The)180 144 R(lo)2.5 E(wer)-.25 E(-case attrib)-.2 E +(ute is disabled.)-.2 E F1<ad78>144 156 Q F0(Mark)25.3 E F2(name)2.5 E +F0 2.5(sf)C(or e)-2.5 E(xport to subsequent commands via the en)-.15 E +(vironment.)-.4 E .121(Using `+' instead of `\255' turns of)144 172.8 R +2.621(ft)-.25 G .121(he attrib)-2.621 F .121(ute instead, with the e)-.2 +F .12(xceptions that)-.15 F F1(+a)2.62 E F0 .12(may not be used)2.62 F +.644(to destro)144 184.8 R 3.144(ya)-.1 G 3.144(na)-3.144 G .644(rray v) +-3.144 F .644(ariable and)-.25 F F1(+r)3.145 E F0 .645(will not remo) +3.145 F .945 -.15(ve t)-.15 H .645(he readonly attrib).15 F 3.145 +(ute. When)-.2 F .645(used in a func-)3.145 F 1.945(tion, mak)144 196.8 +R 1.945(es each)-.1 F F2(name)4.445 E F0 1.945(local, as with the)4.445 +F F1(local)4.444 E F0 4.444(command. If)4.444 F 4.444(av)4.444 G 1.944 +(ariable name is follo)-4.694 F 1.944(wed by)-.25 F(=)144 208.8 Q F2 +(value)A F0 3.238(,t)C .738(he v)-3.238 F .738(alue of the v)-.25 F .738 +(ariable is set to)-.25 F F2(value)3.238 E F0 5.738(.T)C .738 +(he return v)-5.738 F .739(alue is 0 unless an in)-.25 F -.25(va)-.4 G +.739(lid option is).25 F .603 +(encountered, an attempt is made to de\214ne a function using)144 220.8 +R/F3 10/Courier@0 SF .603(\255f foo=bar)3.103 F F0 3.103(,a)C 3.103(na) +-3.103 G .603(ttempt is made to)-3.103 F 1.242(assign a v)144 232.8 R +1.242(alue to a readonly v)-.25 F 1.242 +(ariable, an attempt is made to assign a v)-.25 F 1.243 +(alue to an array v)-.25 F(ariable)-.25 E 1.386 +(without using the compound assignment syntax \(see)144 244.8 R F1 +(Arrays)3.886 E F0(abo)3.886 E -.15(ve)-.15 G 1.386(\), one of the).15 F +F2(names)3.886 E F0 1.386(is not a)3.886 F -.25(va)144 256.8 S .171 +(lid shell v).25 F .171(ariable name, an attempt is made to turn of)-.25 +F 2.671(fr)-.25 G .171(eadonly status for a readonly v)-2.671 F .172 +(ariable, an)-.25 F .96(attempt is made to turn of)144 268.8 R 3.46(fa) +-.25 G .96(rray status for an array v)-3.46 F .96 +(ariable, or an attempt is made to display a)-.25 F(non-e)144 280.8 Q +(xistent function with)-.15 E F1<ad66>2.5 E F0(.)A F1(dirs [+)108 297.6 +Q F2(n)A F1 2.5(][)C<ad>-2.5 E F2(n)A F1 2.5(][)C(\255cplv])-2.5 E F0 +-.4(Wi)144 309.6 S .328 +(thout options, displays the list of currently remembered directories.) +.4 F .329(The def)5.329 F .329(ault display is on a)-.1 F 1.238 +(single line with directory names separated by spaces.)144 321.6 R 1.238 +(Directories are added to the list with the)6.238 F F1(pushd)144 333.6 Q +F0(command; the)2.5 E F1(popd)2.5 E F0(command remo)2.5 E -.15(ve)-.15 G +2.5(se).15 G(ntries from the list.)-2.5 E F1(+)144 345.6 Q F2(n)A F0 +1.564(Displays the)25.3 F F2(n)4.064 E F0 1.565 +(th entry counting from the left of the list sho)B 1.565(wn by)-.25 F F1 +(dirs)4.065 E F0 1.565(when in)4.065 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 357.6 Q F1<ad>144 369.6 Q F2 +(n)A F0 1.194(Displays the)25.3 F F2(n)3.694 E F0 1.194 +(th entry counting from the right of the list sho)B 1.194(wn by)-.25 F +F1(dirs)3.694 E F0 1.194(when in)3.694 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 381.6 Q F1<ad63>144 393.6 Q F0 +(Clears the directory stack by deleting all of the entries.)25.86 E F1 +<ad6c>144 405.6 Q F0 .324(Produces a longer listing; the def)27.52 F +.324(ault listing format uses a tilde to denote the home direc-)-.1 F +(tory)180 417.6 Q(.)-.65 E F1<ad70>144 429.6 Q F0 +(Print the directory stack with one entry per line.)24.74 E F1<ad76>144 +441.6 Q F0 .273(Print the directory stack with one entry per line, pre\ +\214xing each entry with its inde)25.3 F 2.772(xi)-.15 G 2.772(nt)-2.772 +G(he)-2.772 E(stack.)180 453.6 Q .257(The return v)144 470.4 R .258 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G .258 +(lid option is supplied or).25 F F2(n)2.758 E F0(inde)2.758 E -.15(xe) +-.15 G 2.758(sb).15 G -.15(ey)-2.758 G .258(ond the end of the direc-) +.15 F(tory stack.)144 482.4 Q F1(diso)108 499.2 Q(wn)-.1 E F0([)2.5 E F1 +(\255ar)A F0 2.5(][)C F1<ad68>-2.5 E F0 2.5(][)C F2(jobspec)-2.5 E F0 +(...])2.5 E -.4(Wi)144 511.2 S .295(thout options, each).4 F F2(jobspec) +4.535 E F0 .295(is remo)3.105 F -.15(ve)-.15 G 2.795(df).15 G .295 +(rom the table of acti)-2.795 F .595 -.15(ve j)-.25 H 2.795(obs. If).15 +F F2(jobspec)4.535 E F0 .295(is not present,)3.105 F .422(and neither) +144 523.2 R F1<ad61>2.922 E F0(nor)2.922 E F1<ad72>2.922 E F0 .422 +(is supplied, the shell')2.922 F 2.922(sn)-.55 G .422(otion of the) +-2.922 F F2(curr)2.923 E .423(ent job)-.37 F F0 .423(is used.)2.923 F +.423(If the)5.423 F F1<ad68>2.923 E F0 .423(option is)2.923 F(gi)144 +535.2 Q -.15(ve)-.25 G .141(n, each).15 F F2(jobspec)4.381 E F0 .141 +(is not remo)2.951 F -.15(ve)-.15 G 2.641(df).15 G .141 +(rom the table, b)-2.641 F .141(ut is mark)-.2 F .141(ed so that)-.1 F +/F4 9/Times-Bold@0 SF(SIGHUP)2.641 E F0 .14(is not sent to the)2.39 F +.004(job if the shell recei)144 547.2 R -.15(ve)-.25 G 2.504(sa).15 G F4 +(SIGHUP)A/F5 9/Times-Roman@0 SF(.)A F0 .004(If no)4.504 F F2(jobspec) +4.244 E F0 .004(is present, and neither the)2.814 F F1<ad61>2.504 E F0 +.005(nor the)2.504 F F1<ad72>2.505 E F0 .005(option is)2.505 F 1.229 +(supplied, the)144 559.2 R F2(curr)3.729 E 1.229(ent job)-.37 F F0 1.229 +(is used.)3.729 F 1.229(If no)6.229 F F2(jobspec)5.469 E F0 1.229 +(is supplied, the)4.039 F F1<ad61>3.729 E F0 1.228(option means to remo) +3.729 F 1.528 -.15(ve o)-.15 H(r).15 E .656(mark all jobs; the)144 571.2 +R F1<ad72>3.156 E F0 .657(option without a)3.156 F F2(jobspec)4.897 E F0 +(ar)3.467 E .657(gument restricts operation to running jobs.)-.18 F(The) +5.657 E(return v)144 583.2 Q(alue is 0 unless a)-.25 E F2(jobspec)4.24 E +F0(does not specify a v)2.81 E(alid job)-.25 E(.)-.4 E F1(echo)108 600 Q +F0([)2.5 E F1(\255neE)A F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0(...])2.5 E +.395(Output the)144 612 R F2(ar)2.895 E(g)-.37 E F0 .395 +(s, separated by spaces, follo)B .395(wed by a ne)-.25 F 2.895 +(wline. The)-.25 F .394(return status is al)2.895 F -.1(wa)-.1 G .394 +(ys 0.).1 F(If)5.394 E F1<ad6e>2.894 E F0 .548 +(is speci\214ed, the trailing ne)144 624 R .548(wline is suppressed.) +-.25 F .548(If the)5.548 F F1<ad65>3.048 E F0 .548(option is gi)3.048 F +-.15(ve)-.25 G .548(n, interpretation of the fol-).15 F(lo)144 636 Q +.053(wing backslash-escaped characters is enabled.)-.25 F(The)5.053 E F1 +<ad45>2.553 E F0 .052(option disables the interpretation of these)2.552 +F 1.502(escape characters, e)144 648 R -.15(ve)-.25 G 4.002(no).15 G +4.002(ns)-4.002 G 1.502(ystems where the)-4.002 F 4.002(ya)-.15 G 1.502 +(re interpreted by def)-4.002 F 4.003(ault. The)-.1 F F1(xpg_echo)4.003 +E F0(shell)4.003 E .009 +(option may be used to dynamically determine whether or not)144 660 R F1 +(echo)2.509 E F0 -.15(ex)2.509 G .009(pands these escape characters).15 +F .659(by def)144 672 R(ault.)-.1 E F1(echo)5.659 E F0 .659 +(does not interpret)3.159 F F1<adad>3.159 E F0 .659 +(to mean the end of options.)3.159 F F1(echo)5.66 E F0 .66 +(interprets the follo)3.16 F(wing)-.25 E(escape sequences:)144 684 Q F1 +(\\a)144 696 Q F0(alert \(bell\))28.22 E F1(\\b)144 708 Q F0(backspace) +27.66 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(6)203.725 E 0 Cg EP +%%Page: 7 7 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(\\c)144 84 Q F0(suppress further output)28.78 E F1(\\e) +144 96 Q F0(an escape character)28.78 E F1(\\f)144 108 Q F0(form feed) +29.89 E F1(\\n)144 120 Q F0(ne)27.66 E 2.5(wl)-.25 G(ine)-2.5 E F1(\\r) +144 132 Q F0(carriage return)28.78 E F1(\\t)144 144 Q F0(horizontal tab) +29.89 E F1(\\v)144 156 Q F0 -.15(ve)28.22 G(rtical tab).15 E F1(\\\\)144 +168 Q F0(backslash)30.44 E F1(\\0)144 180 Q/F2 10/Times-Italic@0 SF(nnn) +A F0(the eight-bit character whose v)13.22 E(alue is the octal v)-.25 E +(alue)-.25 E F2(nnn)2.5 E F0(\(zero to three octal digits\))2.5 E F1 +(\\x)144 192 Q F2(HH)A F0(the eight-bit character whose v)13.78 E +(alue is the he)-.25 E(xadecimal v)-.15 E(alue)-.25 E F2(HH)2.5 E F0 +(\(one or tw)2.5 E 2.5(oh)-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E F1 +(enable)108 208.8 Q F0([)2.5 E F1<ad61>A F0 2.5(][)C F1(\255dnps)-2.5 E +F0 2.5(][)C F1<ad66>-2.5 E F2(\214lename)2.5 E F0 2.5(][)C F2(name)-2.5 +E F0(...])2.5 E .278(Enable and disable b)144 220.8 R .278 +(uiltin shell commands.)-.2 F .278(Disabling a b)5.278 F .278 +(uiltin allo)-.2 F .278(ws a disk command which has)-.25 F .833 +(the same name as a shell b)144 232.8 R .834(uiltin to be e)-.2 F -.15 +(xe)-.15 G .834(cuted without specifying a full pathname, e).15 F -.15 +(ve)-.25 G 3.334(nt).15 G(hough)-3.334 E .99 +(the shell normally searches for b)144 244.8 R .989 +(uiltins before disk commands.)-.2 F(If)5.989 E F1<ad6e>3.489 E F0 .989 +(is used, each)3.489 F F2(name)3.489 E F0 .989(is dis-)3.489 F 1.581 +(abled; otherwise,)144 256.8 R F2(names)4.082 E F0 1.582(are enabled.) +4.082 F -.15(Fo)6.582 G 4.082(re).15 G 1.582(xample, to use the)-4.232 F +F1(test)4.082 E F0 1.582(binary found via the)4.082 F/F3 9/Times-Bold@0 +SF -.666(PA)4.082 G(TH)-.189 E F0 .081(instead of the shell b)144 268.8 +R .081(uiltin v)-.2 F .081(ersion, run)-.15 F/F4 10/Courier@0 SF .081 +(enable -n test)2.581 F F0 5.081(.T)C(he)-5.081 E F1<ad66>2.58 E F0 .08 +(option means to load the ne)2.58 F(w)-.25 E -.2(bu)144 280.8 S 1.524 +(iltin command).2 F F2(name)4.384 E F0 1.524(from shared object)4.204 F +F2(\214lename)4.024 E F0 4.024(,o).18 G 4.024(ns)-4.024 G 1.524 +(ystems that support dynamic loading.)-4.024 F(The)144 292.8 Q F1<ad64> +2.867 E F0 .367(option will delete a b)2.867 F .367(uiltin pre)-.2 F +.367(viously loaded with)-.25 F F1<ad66>2.866 E F0 5.366(.I)C 2.866(fn) +-5.366 G(o)-2.866 E F2(name)2.866 E F0(ar)2.866 E .366(guments are gi) +-.18 F -.15(ve)-.25 G .366(n, or).15 F .398(if the)144 304.8 R F1<ad70> +2.898 E F0 .399(option is supplied, a list of shell b)2.899 F .399 +(uiltins is printed.)-.2 F -.4(Wi)5.399 G .399(th no other option ar).4 +F .399(guments, the)-.18 F .099(list consists of all enabled shell b)144 +316.8 R 2.598(uiltins. If)-.2 F F1<ad6e>2.598 E F0 .098 +(is supplied, only disabled b)2.598 F .098(uiltins are printed.)-.2 F +(If)5.098 E F1<ad61>2.598 E F0 1.916 +(is supplied, the list printed includes all b)144 328.8 R 1.916 +(uiltins, with an indication of whether or not each is)-.2 F 2.879 +(enabled. If)144 340.8 R F1<ad73>2.879 E F0 .379 +(is supplied, the output is restricted to the POSIX)2.879 F F2(special) +2.879 E F0 -.2(bu)2.878 G 2.878(iltins. The).2 F .378(return v)2.878 F +(alue)-.25 E .994(is 0 unless a)144 352.8 R F2(name)3.854 E F0 .994 +(is not a shell b)3.674 F .994(uiltin or there is an error loading a ne) +-.2 F 3.495(wb)-.25 G .995(uiltin from a shared)-3.695 F(object.)144 +364.8 Q F1 -2.3 -.15(ev a)108 381.6 T(l).15 E F0([)2.5 E F2(ar)A(g)-.37 +E F0(...])2.5 E(The)144 393.6 Q F2(ar)3.171 E(g)-.37 E F0 3.171(sa)C +.671(re read and concatenated together into a single command.)-3.171 F +.67(This command is then read)5.67 F .495(and e)144 405.6 R -.15(xe)-.15 +G .495(cuted by the shell, and its e).15 F .495 +(xit status is returned as the v)-.15 F .495(alue of)-.25 F F1 -2.3 -.15 +(ev a)2.995 H(l).15 E F0 5.495(.I)C 2.995(ft)-5.495 G .495(here are no) +-2.995 F F2(ar)2.995 E(gs)-.37 E F0(,).27 E(or only null ar)144 417.6 Q +(guments,)-.18 E F1 -2.3 -.15(ev a)2.5 H(l).15 E F0(returns 0.)2.5 E F1 +(exec)108 434.4 Q F0([)2.5 E F1(\255cl)A F0 2.5(][)C F1<ad61>-2.5 E F2 +(name)2.5 E F0 2.5(][)C F2(command)-2.5 E F0([)2.5 E F2(ar)A(guments) +-.37 E F0(]])A(If)144 446.4 Q F2(command)3.006 E F0 .306 +(is speci\214ed, it replaces the shell.)3.576 F .305(No ne)5.305 F 2.805 +(wp)-.25 G .305(rocess is created.)-2.805 F(The)5.305 E F2(ar)3.135 E +(guments)-.37 E F0(become)3.075 E .176(the ar)144 458.4 R .176 +(guments to)-.18 F F2(command)2.676 E F0 5.176(.I)C 2.676(ft)-5.176 G +(he)-2.676 E F1<ad6c>2.676 E F0 .176 +(option is supplied, the shell places a dash at the be)2.676 F .177 +(ginning of)-.15 F .5(the zeroth ar)144 470.4 R .5(gument passed to)-.18 +F F2(command)3 E F0 5.499(.T).77 G .499(his is what)-5.499 F F2(lo)2.999 +E(gin)-.1 E F0 .499(\(1\) does.).24 F(The)5.499 E F1<ad63>2.999 E F0 +.499(option causes)2.999 F F2(com-)3.199 E(mand)144 482.4 Q F0 .638 +(to be e)3.908 F -.15(xe)-.15 G .638(cuted with an empty en).15 F 3.138 +(vironment. If)-.4 F F1<ad61>3.138 E F0 .638 +(is supplied, the shell passes)3.138 F F2(name)3.499 E F0 .639(as the) +3.319 F 1.078(zeroth ar)144 494.4 R 1.077(gument to the e)-.18 F -.15 +(xe)-.15 G 1.077(cuted command.).15 F(If)6.077 E F2(command)3.777 E F0 +1.077(cannot be e)4.347 F -.15(xe)-.15 G 1.077(cuted for some reason, a) +.15 F(non-interacti)144 506.4 Q .617 -.15(ve s)-.25 H .317(hell e).15 F +.317(xits, unless the shell option)-.15 F F1(execfail)2.817 E F0 .318 +(is enabled, in which case it returns f)2.817 F(ail-)-.1 E 2.505 +(ure. An)144 518.4 R(interacti)2.505 E .305 -.15(ve s)-.25 H .005 +(hell returns f).15 F .005(ailure if the \214le cannot be e)-.1 F -.15 +(xe)-.15 G 2.505(cuted. If).15 F F2(command)2.705 E F0 .005 +(is not speci\214ed,)3.275 F(an)144 530.4 Q 3.036(yr)-.15 G .536 +(edirections tak)-3.036 F 3.036(ee)-.1 G -.25(ff)-3.036 G .536 +(ect in the current shell, and the return status is 0.).25 F .536 +(If there is a redirection)5.536 F(error)144 542.4 Q 2.5(,t)-.4 G +(he return status is 1.)-2.5 E F1(exit)108 559.2 Q F0([)2.5 E F2(n)A F0 +6.29(]C)C .096(ause the shell to e)-6.29 F .096(xit with a status of) +-.15 F F2(n)2.596 E F0 5.096(.I)C(f)-5.096 E F2(n)2.955 E F0 .095 +(is omitted, the e)2.835 F .095(xit status is that of the last command) +-.15 F -.15(exe)144 571.2 S 2.5(cuted. A).15 F(trap on)2.5 E F3(EXIT)2.5 +E F0(is e)2.25 E -.15(xe)-.15 G(cuted before the shell terminates.).15 E +F1(export)108 588 Q F0([)2.5 E F1(\255fn)A F0 2.5(][).833 G F2(name)-2.5 +E F0([=)A F2(wor)A(d)-.37 E F0(]] ...)A F1(export \255p)108 600 Q F0 +.256(The supplied)144 612 R F2(names)3.117 E F0 .257(are mark)3.027 F +.257(ed for automatic e)-.1 F .257(xport to the en)-.15 F .257 +(vironment of subsequently e)-.4 F -.15(xe)-.15 G(cuted).15 E 2.627 +(commands. If)144 624 R(the)2.627 E F1<ad66>2.627 E F0 .127 +(option is gi)2.627 F -.15(ve)-.25 G .127(n, the).15 F F2(names)2.987 E +F0 .127(refer to functions.)2.897 F .127(If no)5.127 F F2(names)2.987 E +F0 .127(are gi)2.897 F -.15(ve)-.25 G .126(n, or if the).15 F F1<ad70> +144 636 Q F0 .659(option is supplied, a list of all names that are e) +3.159 F .66(xported in this shell is printed.)-.15 F(The)5.66 E F1<ad6e> +3.16 E F0(option)3.16 E 1.587(causes the e)144 648 R 1.587 +(xport property to be remo)-.15 F -.15(ve)-.15 G 4.086(df).15 G 1.586 +(rom each)-4.086 F F2(name)4.086 E F0 6.586(.I)C 4.086(fav)-6.586 G +1.586(ariable name is follo)-4.336 F 1.586(wed by)-.25 F(=)144 660 Q F2 +(wor)A(d)-.37 E F0 2.803(,t)C .303(he v)-2.803 F .303(alue of the v)-.25 +F .304(ariable is set to)-.25 F F2(wor)2.804 E(d)-.37 E F0(.)A F1 +(export)5.304 E F0 .304(returns an e)2.804 F .304 +(xit status of 0 unless an in)-.15 F -.25(va)-.4 G(lid).25 E .294 +(option is encountered, one of the)144 672 R F2(names)2.793 E F0 .293 +(is not a v)2.793 F .293(alid shell v)-.25 F .293(ariable name, or)-.25 +F F1<ad66>2.793 E F0 .293(is supplied with a)2.793 F F2(name)144.36 684 +Q F0(that is not a function.)2.68 E F1(fc)108 700.8 Q F0([)2.5 E F1 +<ad65>A F2(ename)2.5 E F0 2.5(][)C F1(\255lnr)-2.5 E F0 2.5(][)C F2 +<8c72>-2.5 E(st)-.1 E F0 2.5(][)C F2(last)-2.5 E F0(])A(GNU Bash-4.0)72 +768 Q(2004 Apr 20)148.735 E(7)203.725 E 0 Cg EP +%%Page: 8 8 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(fc \255s)108 84 Q F0([)2.5 E/F2 10/Times-Italic@0 SF +(pat)A F0(=)A F2 -.37(re)C(p).37 E F0 2.5(][)C F2(cmd)-2.5 E F0(])A .477 +(Fix Command.)144 96 R .478 +(In the \214rst form, a range of commands from)5.477 F F2<8c72>4.888 E +(st)-.1 E F0(to)3.658 E F2(last)3.068 E F0 .478 +(is selected from the his-)3.658 F .882(tory list.)144 108 R F2 -.45(Fi) +5.882 G -.1(rs).45 G(t).1 E F0(and)4.062 E F2(last)3.472 E F0 .882 +(may be speci\214ed as a string \(to locate the last command be)4.062 F +.881(ginning with)-.15 F .797(that string\) or as a number \(an inde)144 +120 R 3.297(xi)-.15 G .797(nto the history list, where a ne)-3.297 F +-.05(ga)-.15 G(ti).05 E 1.097 -.15(ve n)-.25 H .797(umber is used as an) +.15 F(of)144 132 Q .277(fset from the current command number\).)-.25 F +(If)5.277 E F2(last)2.867 E F0 .276 +(is not speci\214ed it is set to the current command)3.457 F .092 +(for listing \(so that)144 144 R/F3 10/Courier@0 SF .092 +(fc \255l \25510)2.592 F F0 .092(prints the last 10 commands\) and to) +2.592 F F2<8c72>4.502 E(st)-.1 E F0 2.592(otherwise. If)3.272 F F2<8c72> +4.502 E(st)-.1 E F0 .093(is not)3.273 F +(speci\214ed it is set to the pre)144 156 Q +(vious command for editing and \25516 for listing.)-.25 E(The)144 180 Q +F1<ad6e>2.522 E F0 .022 +(option suppresses the command numbers when listing.)2.522 F(The)5.022 E +F1<ad72>2.522 E F0 .022(option re)2.522 F -.15(ve)-.25 G .022 +(rses the order of).15 F .438(the commands.)144 192 R .438(If the)5.438 +F F1<ad6c>2.938 E F0 .438(option is gi)2.938 F -.15(ve)-.25 G .438 +(n, the commands are listed on standard output.).15 F(Otherwise,)5.438 E +.335(the editor gi)144 204 R -.15(ve)-.25 G 2.835(nb).15 G(y)-2.835 E F2 +(ename)3.025 E F0 .335(is in)3.015 F -.2(vo)-.4 G -.1(ke).2 G 2.835(do) +.1 G 2.835(na\214)-2.835 G .335(le containing those commands.)-2.835 F +(If)5.334 E F2(ename)3.024 E F0 .334(is not gi)3.014 F -.15(ve)-.25 G +(n,).15 E .63(the v)144 216 R .63(alue of the)-.25 F/F4 9/Times-Bold@0 +SF(FCEDIT)3.13 E F0 -.25(va)2.88 G .631(riable is used, and the v).25 F +.631(alue of)-.25 F F4(EDIT)3.131 E(OR)-.162 E F0(if)2.881 E F4(FCEDIT) +3.131 E F0 .631(is not set.)2.881 F .631(If nei-)5.631 F 1.884(ther v) +144 228 R 1.884(ariable is set, is used.)-.25 F 1.884 +(When editing is complete, the edited commands are echoed and)6.884 F +-.15(exe)144 240 S(cuted.).15 E .039(In the second form,)144 264 R F2 +(command)2.539 E F0 .039(is re-e)2.539 F -.15(xe)-.15 G .039 +(cuted after each instance of).15 F F2(pat)2.54 E F0 .04(is replaced by) +2.54 F F2 -.37(re)2.54 G(p).37 E F0 5.04(.A)C(useful)-2.5 E .406 +(alias to use with this is)144 276 R F3 .406(r='fc \255s')2.906 F F0 +2.906(,s)C 2.906(ot)-2.906 G .406(hat typing)-2.906 F F3 6.406(rc)2.906 +G(c)-6.406 E F0 .406(runs the last command be)2.906 F .406(ginning with) +-.15 F F3(cc)144 288 Q F0(and typing)2.5 E F3(r)2.5 E F0(re-e)2.5 E -.15 +(xe)-.15 G(cutes the last command.).15 E .142 +(If the \214rst form is used, the return v)144 312 R .142 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G .142 +(lid option is encountered or).25 F F2<8c72>4.552 E(st)-.1 E F0(or)3.322 +E F2(last)2.732 E F0 .455(specify history lines out of range.)144 324 R +.454(If the)5.454 F F1<ad65>2.954 E F0 .454 +(option is supplied, the return v)2.954 F .454(alue is the v)-.25 F .454 +(alue of the)-.25 F .787(last command e)144 336 R -.15(xe)-.15 G .787 +(cuted or f).15 F .788 +(ailure if an error occurs with the temporary \214le of commands.)-.1 F +.788(If the)5.788 F 1.136 +(second form is used, the return status is that of the command re-e)144 +348 R -.15(xe)-.15 G 1.135(cuted, unless).15 F F2(cmd)3.835 E F0 1.135 +(does not)4.405 F(specify a v)144 360 Q +(alid history line, in which case)-.25 E F1(fc)2.5 E F0(returns f)2.5 E +(ailure.)-.1 E F1(fg)108 376.8 Q F0([)2.5 E F2(jobspec)A F0(])A(Resume) +144 388.8 Q F2(jobspec)5.653 E F0 1.413(in the fore)4.223 F 1.413 +(ground, and mak)-.15 F 3.913(ei)-.1 G 3.913(tt)-3.913 G 1.413 +(he current job)-3.913 F 6.413(.I)-.4 G(f)-6.413 E F2(jobspec)5.653 E F0 +1.414(is not present, the)4.223 F(shell')144 400.8 Q 3.117(sn)-.55 G +.617(otion of the)-3.117 F F2(curr)3.117 E .617(ent job)-.37 F F0 .617 +(is used.)3.117 F .617(The return v)5.617 F .616 +(alue is that of the command placed into the)-.25 F(fore)144 412.8 Q +.362(ground, or f)-.15 F .362 +(ailure if run when job control is disabled or)-.1 F 2.862(,w)-.4 G .363 +(hen run with job control enabled, if)-2.862 F F2(jobspec)145.74 424.8 Q +F0 .004(does not specify a v)2.815 F .004(alid job or)-.25 F F2(jobspec) +4.244 E F0 .004(speci\214es a job that w)2.814 F .004 +(as started without job control.)-.1 F F1(getopts)108 441.6 Q F2 +(optstring name)2.5 E F0([)2.5 E F2(ar)A(gs)-.37 E F0(])A F1(getopts)144 +453.6 Q F0 .793 +(is used by shell procedures to parse positional parameters.)3.293 F F2 +(optstring)6.023 E F0 .793(contains the option)3.513 F .15 +(characters to be recognized; if a character is follo)144 465.6 R .149 +(wed by a colon, the option is e)-.25 F .149(xpected to ha)-.15 F .449 +-.15(ve a)-.2 H(n).15 E(ar)144 477.6 Q .578 +(gument, which should be separated from it by white space.)-.18 F .579 +(The colon and question mark char)5.579 F(-)-.2 E 1.665 +(acters may not be used as option characters.)144 489.6 R 1.665 +(Each time it is in)6.665 F -.2(vo)-.4 G -.1(ke).2 G(d,).1 E F1(getopts) +4.165 E F0 1.665(places the ne)4.165 F(xt)-.15 E .796 +(option in the shell v)144 501.6 R(ariable)-.25 E F2(name)3.296 E F0 +3.296(,i).18 G(nitializing)-3.296 E F2(name)3.657 E F0 .797 +(if it does not e)3.477 F .797(xist, and the inde)-.15 F 3.297(xo)-.15 G +3.297(ft)-3.297 G .797(he ne)-3.297 F(xt)-.15 E(ar)144 513.6 Q .085 +(gument to be processed into the v)-.18 F(ariable)-.25 E F4(OPTIND)2.585 +E/F5 9/Times-Roman@0 SF(.)A F4(OPTIND)4.585 E F0 .085 +(is initialized to 1 each time the shell)2.335 F .845 +(or a shell script is in)144 525.6 R -.2(vo)-.4 G -.1(ke).2 G 3.345 +(d. When).1 F .845(an option requires an ar)3.345 F(gument,)-.18 E F1 +(getopts)3.346 E F0 .846(places that ar)3.346 F(gument)-.18 E .804 +(into the v)144 537.6 R(ariable)-.25 E F4(OPT)3.304 E(ARG)-.81 E F5(.)A +F0 .803(The shell does not reset)5.304 F F4(OPTIND)3.303 E F0 .803 +(automatically; it must be manually)3.053 F .293 +(reset between multiple calls to)144 549.6 R F1(getopts)2.793 E F0 .293 +(within the same shell in)2.793 F -.2(vo)-.4 G .293(cation if a ne).2 F +2.793(ws)-.25 G .294(et of parameters)-2.793 F(is to be used.)144 561.6 +Q 2.044(When the end of options is encountered,)144 585.6 R F1(getopts) +4.543 E F0 -.15(ex)4.543 G 2.043(its with a return v).15 F 2.043 +(alue greater than zero.)-.25 F F4(OPTIND)144 597.6 Q F0 +(is set to the inde)2.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G +(he \214rst non-option ar)-2.5 E(gument, and)-.18 E F1(name)2.5 E F0 +(is set to ?.)2.5 E F1(getopts)144 621.6 Q F0 2.392 +(normally parses the positional parameters, b)4.892 F 2.392 +(ut if more ar)-.2 F 2.393(guments are gi)-.18 F -.15(ve)-.25 G 4.893 +(ni).15 G(n)-4.893 E F2(ar)4.893 E(gs)-.37 E F0(,).27 E F1(getopts)144 +633.6 Q F0(parses those instead.)2.5 E F1(getopts)144 657.6 Q F0 1.166 +(can report errors in tw)3.666 F 3.665(ow)-.1 G 3.665(ays. If)-3.765 F +1.165(the \214rst character of)3.665 F F2(optstring)3.895 E F0 1.165 +(is a colon,)3.885 F F2(silent)4.005 E F0(error)4.345 E 1.263 +(reporting is used.)144 669.6 R 1.263 +(In normal operation diagnostic messages are printed when in)6.263 F +-.25(va)-.4 G 1.263(lid options or).25 F .394(missing option ar)144 +681.6 R .394(guments are encountered.)-.18 F .394(If the v)5.394 F +(ariable)-.25 E F4(OPTERR)2.894 E F0 .394 +(is set to 0, no error messages)2.644 F(will be displayed, e)144 693.6 Q +-.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he \214rst character of)-2.5 E +F2(optstring)2.73 E F0(is not a colon.)2.72 E .666(If an in)144 717.6 R +-.25(va)-.4 G .666(lid option is seen,).25 F F1(getopts)3.166 E F0 .667 +(places ? into)3.167 F F2(name)3.527 E F0 .667 +(and, if not silent, prints an error message)3.347 F .4(and unsets)144 +729.6 R F4(OPT)2.9 E(ARG)-.81 E F5(.)A F0(If)4.899 E F1(getopts)2.899 E +F0 .399(is silent, the option character found is placed in)2.899 F F4 +(OPT)2.899 E(ARG)-.81 E F0 .399(and no)2.649 F(GNU Bash-4.0)72 768 Q +(2004 Apr 20)148.735 E(8)203.725 E 0 Cg EP +%%Page: 9 9 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E +(diagnostic message is printed.)144 84 Q 1.241(If a required ar)144 108 +R 1.241(gument is not found, and)-.18 F/F1 10/Times-Bold@0 SF(getopts) +3.741 E F0 1.241(is not silent, a question mark \()3.741 F F1(?).833 E +F0 3.742(\)i).833 G 3.742(sp)-3.742 G 1.242(laced in)-3.742 F/F2 10 +/Times-Italic@0 SF(name)144 120 Q F0(,).18 E/F3 9/Times-Bold@0 SF(OPT) +2.735 E(ARG)-.81 E F0 .234 +(is unset, and a diagnostic message is printed.)2.485 F(If)5.234 E F1 +(getopts)2.734 E F0 .234(is silent, then a colon \()2.734 F F1(:).833 E +F0(\)).833 E(is placed in)144 132 Q F2(name)2.86 E F0(and)2.68 E F3(OPT) +2.5 E(ARG)-.81 E F0(is set to the option character found.)2.25 E F1 +(getopts)144 156 Q F0 .902 +(returns true if an option, speci\214ed or unspeci\214ed, is found.) +3.401 F .902(It returns f)5.902 F .902(alse if the end of)-.1 F +(options is encountered or an error occurs.)144 168 Q F1(hash)108 184.8 +Q F0([)2.5 E F1(\255lr)A F0 2.5(][)C F1<ad70>-2.5 E F2(\214lename)2.5 E +F0 2.5(][)C F1(\255dt)-2.5 E F0 2.5(][)C F2(name)-2.5 E F0(])A -.15(Fo) +144 196.8 S 3.555(re).15 G(ach)-3.555 E F2(name)3.555 E F0 3.555(,t).18 +G 1.054(he full \214le name of the command is determined by searching t\ +he directories in)-3.555 F F1($P)144 208.8 Q -.95(AT)-.74 G(H).95 E F0 +.349(and remembered.)2.849 F .349(If the)5.349 F F1<ad70>2.849 E F0 .349 +(option is supplied, no path search is performed, and)2.849 F F2 +(\214lename)4.76 E F0 .452 +(is used as the full \214le name of the command.)144 220.8 R(The)5.452 E +F1<ad72>2.952 E F0 .452(option causes the shell to for)2.952 F .452 +(get all remem-)-.18 F .592(bered locations.)144 232.8 R(The)5.592 E F1 +<ad64>3.092 E F0 .593(option causes the shell to for)3.092 F .593 +(get the remembered location of each)-.18 F F2(name)3.093 E F0(.)A .021 +(If the)144 244.8 R F1<ad74>2.521 E F0 .021 +(option is supplied, the full pathname to which each)2.521 F F2(name) +2.52 E F0 .02(corresponds is printed.)2.52 F .02(If multi-)5.02 F(ple) +144 256.8 Q F2(name)3.703 E F0(ar)3.703 E 1.203 +(guments are supplied with)-.18 F F1<ad74>3.703 E F0 3.703(,t)C(he) +-3.703 E F2(name)3.703 E F0 1.204 +(is printed before the hashed full pathname.)3.703 F(The)144 268.8 Q F1 +<ad6c>3.216 E F0 .715(option causes output to be displayed in a format \ +that may be reused as input.)3.216 F .715(If no ar)5.715 F(gu-)-.18 E +1.183(ments are gi)144 280.8 R -.15(ve)-.25 G 1.183(n, or if only).15 F +F1<ad6c>3.683 E F0 1.184 +(is supplied, information about remembered commands is printed.)3.684 F +(The return status is true unless a)144 292.8 Q F2(name)2.86 E F0 +(is not found or an in)2.68 E -.25(va)-.4 G(lid option is supplied.).25 +E F1(help)108 309.6 Q F0([)2.5 E F1(\255dms)A F0 2.5(][)C F2(pattern) +-2.5 E F0(])A .867(Display helpful information about b)144 321.6 R .867 +(uiltin commands.)-.2 F(If)5.867 E F2(pattern)4.617 E F0 .866 +(is speci\214ed,)3.607 F F1(help)3.366 E F0(gi)3.366 E -.15(ve)-.25 G +3.366(sd).15 G(etailed)-3.366 E .306(help on all commands matching)144 +333.6 R F2(pattern)2.806 E F0 2.807(;o).24 G .307 +(therwise help for all the b)-2.807 F .307 +(uiltins and shell control struc-)-.2 F(tures is printed.)144 345.6 Q F1 +<ad64>144 357.6 Q F0(Display a short description of each)24.74 E F2 +(pattern)2.5 E F1<ad6d>144 369.6 Q F0(Display the description of each) +21.97 E F2(pattern)2.5 E F0(in a manpage-lik)2.5 E 2.5(ef)-.1 G(ormat) +-2.5 E F1<ad73>144 381.6 Q F0 +(Display only a short usage synopsis for each)26.41 E F2(pattern)2.5 E +F0(The return status is 0 unless no command matches)108 393.6 Q F2 +(pattern)2.5 E F0(.).24 E F1(history [)108 410.4 Q F2(n)A F1(])A +(history \255c)108 422.4 Q(history \255d)108 434.4 Q F2(of)2.5 E(fset) +-.18 E F1(history \255anrw)108 446.4 Q F0([)2.5 E F2(\214lename)A F0(])A +F1(history \255p)108 458.4 Q F2(ar)2.5 E(g)-.37 E F0([)2.5 E F2(ar)A 2.5 +(g.)-.37 G(..)-2.5 E F0(])A F1(history \255s)108 470.4 Q F2(ar)2.5 E(g) +-.37 E F0([)2.5 E F2(ar)A 2.5(g.)-.37 G(..)-2.5 E F0(])A -.4(Wi)144 +482.4 S .752 +(th no options, display the command history list with line numbers.).4 F +.752(Lines listed with a)5.752 F F1(*)3.251 E F0(ha)3.251 E -.15(ve)-.2 +G .38(been modi\214ed.)144 494.4 R .38(An ar)5.38 F .38(gument of)-.18 F +F2(n)3.24 E F0 .38(lists only the last)3.12 F F2(n)3.24 E F0 2.88 +(lines. If)3.12 F .38(the shell v)2.88 F(ariable)-.25 E F3(HISTTIMEFOR-) +2.881 E(MA)144 506.4 Q(T)-.855 E F0 .265 +(is set and not null, it is used as a format string for)2.515 F F2 +(strftime)2.764 E F0 .264(\(3\) to display the time stamp asso-)B 1.019 +(ciated with each displayed history entry)144 518.4 R 6.019(.N)-.65 G +3.519(oi)-6.019 G(nterv)-3.519 E 1.019 +(ening blank is printed between the formatted)-.15 F .176 +(time stamp and the history line.)144 530.4 R(If)5.176 E F2(\214lename) +2.676 E F0 .176 +(is supplied, it is used as the name of the history \214le; if)2.676 F +(not, the v)144 542.4 Q(alue of)-.25 E F3(HISTFILE)2.5 E F0(is used.) +2.25 E(Options, if supplied, ha)5 E .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1<ad63>144 554.4 Q F0 +(Clear the history list by deleting all the entries.)25.86 E F1<ad64>144 +566.4 Q F2(of)2.5 E(fset)-.18 E F0(Delete the history entry at position) +180 578.4 Q F2(of)2.5 E(fset)-.18 E F0(.)A F1<ad61>144 590.4 Q F0 .598 +(Append the `)25.3 F(`ne)-.74 E(w')-.25 E 3.098('h)-.74 G .598 +(istory lines \(history lines entered since the be)-3.098 F .599 +(ginning of the current)-.15 F F1(bash)180 602.4 Q F0 +(session\) to the history \214le.)2.5 E F1<ad6e>144 614.4 Q F0 .854(Rea\ +d the history lines not already read from the history \214le into the c\ +urrent history list.)24.74 F .772 +(These are lines appended to the history \214le since the be)180 626.4 R +.773(ginning of the current)-.15 F F1(bash)3.273 E F0(ses-)3.273 E +(sion.)180 638.4 Q F1<ad72>144 650.4 Q F0(Read the contents of the hist\ +ory \214le and use them as the current history)25.86 E(.)-.65 E F1<ad77> +144 662.4 Q F0(Write the current history to the history \214le, o)23.08 +E -.15(ve)-.15 G(rwriting the history \214le').15 E 2.5(sc)-.55 G +(ontents.)-2.5 E F1<ad70>144 674.4 Q F0 .626 +(Perform history substitution on the follo)24.74 F(wing)-.25 E F2(ar) +3.125 E(gs)-.37 E F0 .625(and display the result on the standard)3.125 F +2.975(output. Does)180 686.4 R .475 +(not store the results in the history list.)2.975 F(Each)5.475 E F2(ar) +2.975 E(g)-.37 E F0 .475(must be quoted to disable)2.975 F +(normal history e)180 698.4 Q(xpansion.)-.15 E F1<ad73>144 710.4 Q F0 +.363(Store the)26.41 F F2(ar)3.193 E(gs)-.37 E F0 .363 +(in the history list as a single entry)3.133 F 5.363(.T)-.65 G .362 +(he last command in the history list is)-5.363 F(remo)180 722.4 Q -.15 +(ve)-.15 G 2.5(db).15 G(efore the)-2.5 E F2(ar)2.83 E(gs)-.37 E F0 +(are added.)2.77 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(9)203.725 +E 0 Cg EP +%%Page: 10 10 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E .145(If the) +144 84 R/F1 9/Times-Bold@0 SF(HISTTIMEFORMA)2.645 E(T)-.855 E F0 -.25 +(va)2.395 G .145 +(riable is set, the time stamp information associated with each history) +.25 F .669(entry is written to the history \214le, mark)144 96 R .669 +(ed with the history comment character)-.1 F 5.668(.W)-.55 G .668 +(hen the history)-5.668 F .955(\214le is read, lines be)144 108 R .956 +(ginning with the history comment character follo)-.15 F .956 +(wed immediately by a digit)-.25 F .416 +(are interpreted as timestamps for the pre)144 120 R .416 +(vious history line.)-.25 F .416(The return v)5.416 F .415 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G(lid).25 E .499(option is e\ +ncountered, an error occurs while reading or writing the history \214le\ +, an in)144 132 R -.25(va)-.4 G(lid).25 E/F2 10/Times-Italic@0 SF(of)3 E +(fset)-.18 E F0(is)3 E(supplied as an ar)144 144 Q(gument to)-.18 E/F3 +10/Times-Bold@0 SF<ad64>2.5 E F0 2.5(,o)C 2.5(rt)-2.5 G(he history e) +-2.5 E(xpansion supplied as an ar)-.15 E(gument to)-.18 E F3<ad70>2.5 E +F0 -.1(fa)2.5 G(ils.).1 E F3(jobs)108 160.8 Q F0([)2.5 E F3(\255lnprs)A +F0 2.5(][)C F2(jobspec)A F0(... ])2.5 E F3(jobs \255x)108 172.8 Q F2 +(command)2.5 E F0([)2.5 E F2(ar)2.5 E(gs)-.37 E F0(... ])2.5 E +(The \214rst form lists the acti)144 184.8 Q .3 -.15(ve j)-.25 H 2.5 +(obs. The).15 F(options ha)2.5 E .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F3<ad6c>144 196.8 Q F0 +(List process IDs in addition to the normal information.)27.52 E F3 +<ad70>144 208.8 Q F0(List only the process ID of the job')24.74 E 2.5 +(sp)-.55 G(rocess group leader)-2.5 E(.)-.55 E F3<ad6e>144 220.8 Q F0 +.194(Display information only about jobs that ha)24.74 F .494 -.15(ve c) +-.2 H .193(hanged status since the user w).15 F .193(as last noti-)-.1 F +(\214ed of their status.)180 232.8 Q F3<ad72>144 244.8 Q F0 +(Restrict output to running jobs.)25.86 E F3<ad73>144 256.8 Q F0 +(Restrict output to stopped jobs.)26.41 E(If)144 273.6 Q F2(jobspec) +4.553 E F0 .313(is gi)3.123 F -.15(ve)-.25 G .313 +(n, output is restricted to information about that job).15 F 5.314(.T) +-.4 G .314(he return status is 0 unless)-5.314 F(an in)144 285.6 Q -.25 +(va)-.4 G(lid option is encountered or an in).25 E -.25(va)-.4 G(lid).25 +E F2(jobspec)4.24 E F0(is supplied.)2.81 E .395(If the)144 302.4 R F3 +<ad78>2.895 E F0 .394(option is supplied,)2.894 F F3(jobs)2.894 E F0 +.394(replaces an)2.894 F(y)-.15 E F2(jobspec)4.634 E F0 .394(found in) +3.204 F F2(command)3.094 E F0(or)3.664 E F2(ar)3.224 E(gs)-.37 E F0 .394 +(with the corre-)3.164 F(sponding process group ID, and e)144 314.4 Q +-.15(xe)-.15 G(cutes).15 E F2(command)2.7 E F0(passing it)3.27 E F2(ar) +2.5 E(gs)-.37 E F0 2.5(,r).27 G(eturning its e)-2.5 E(xit status.)-.15 E +F3(kill)108 331.2 Q F0([)2.5 E F3<ad73>A F2(sigspec)2.5 E F0(|)2.5 E F3 +<ad6e>2.5 E F2(signum)2.5 E F0(|)2.5 E F3<ad>2.5 E F2(sigspec)A F0 2.5 +(][)C F2(pid)-2.5 E F0(|)2.5 E F2(jobspec)2.5 E F0 2.5(].)C(..)-2.5 E F3 +(kill \255l)108 343.2 Q F0([)2.5 E F2(sigspec)A F0(|)2.5 E F2 -.2(ex)2.5 +G(it_status).2 E F0(])A .119(Send the signal named by)144 355.2 R F2 +(sigspec)2.959 E F0(or)2.929 E F2(signum)2.959 E F0 .119 +(to the processes named by)2.939 F F2(pid)3.87 E F0(or)3.39 E F2 +(jobspec)2.62 E F0(.).31 E F2(sigspec)5.46 E F0(is)2.93 E .319 +(either a case-insensiti)144 367.2 R .619 -.15(ve s)-.25 H .319 +(ignal name such as).15 F F1(SIGKILL)2.819 E F0 .318 +(\(with or without the)2.569 F F1(SIG)2.818 E F0 .318 +(pre\214x\) or a signal)2.568 F(number;)144 379.2 Q F2(signum)4.188 E F0 +1.349(is a signal number)4.168 F 6.349(.I)-.55 G(f)-6.349 E F2(sigspec) +4.189 E F0 1.349(is not present, then)4.159 F F1(SIGTERM)3.849 E F0 +1.349(is assumed.)3.599 F(An)6.349 E(ar)144 391.2 Q .523(gument of)-.18 +F F3<ad6c>3.023 E F0 .523(lists the signal names.)3.023 F .523(If an) +5.523 F 3.023(ya)-.15 G -.18(rg)-3.023 G .523(uments are supplied when) +.18 F F3<ad6c>3.023 E F0 .523(is gi)3.023 F -.15(ve)-.25 G .523 +(n, the names).15 F .28(of the signals corresponding to the ar)144 403.2 +R .28(guments are listed, and the return status is 0.)-.18 F(The)5.28 E +F2 -.2(ex)2.78 G(it_status).2 E F0(ar)144 415.2 Q .378(gument to)-.18 F +F3<ad6c>2.878 E F0 .378 +(is a number specifying either a signal number or the e)2.878 F .377 +(xit status of a process termi-)-.15 F .593(nated by a signal.)144 427.2 +R F3(kill)5.593 E F0 .593(returns true if at least one signal w)3.093 F +.593(as successfully sent, or f)-.1 F .594(alse if an error)-.1 F +(occurs or an in)144 439.2 Q -.25(va)-.4 G(lid option is encountered.) +.25 E F3(let)108 456 Q F2(ar)2.5 E(g)-.37 E F0([)2.5 E F2(ar)A(g)-.37 E +F0(...])2.5 E(Each)144 468 Q F2(ar)3.027 E(g)-.37 E F0 .197 +(is an arithmetic e)2.917 F .197(xpression to be e)-.15 F -.25(va)-.25 G +.196(luated \(see).25 F F1 .196(ARITHMETIC EV)2.696 F(ALU)-1.215 E -.855 +(AT)-.54 G(ION).855 E F0(abo)2.446 E -.15(ve)-.15 G 2.696(\). If).15 F +(the last)144 480 Q F2(ar)2.83 E(g)-.37 E F0 -.25(eva)2.72 G +(luates to 0,).25 E F3(let)2.5 E F0(returns 1; 0 is returned otherwise.) +2.5 E F3(local)108 496.8 Q F0([)2.5 E F2(option)A F0 2.5(][)C F2(name) +-2.5 E F0([=)A F2(value)A F0 2.5(].)C(..])-2.5 E -.15(Fo)144 508.8 S +2.56(re).15 G .06(ach ar)-2.56 F .06(gument, a local v)-.18 F .06 +(ariable named)-.25 F F2(name)2.92 E F0 .06(is created, and assigned) +2.74 F F2(value)2.56 E F0 5.06(.T).18 G(he)-5.06 E F2(option)2.56 E F0 +.06(can be)2.56 F(an)144 520.8 Q 3.153(yo)-.15 G 3.153(ft)-3.153 G .653 +(he options accepted by)-3.153 F F3(declar)3.153 E(e)-.18 E F0 5.652(.W) +C(hen)-5.652 E F3(local)3.152 E F0 .652 +(is used within a function, it causes the v)3.152 F(ari-)-.25 E(able)144 +532.8 Q F2(name)3.72 E F0 .86(to ha)3.54 F 1.16 -.15(ve a v)-.2 H .861 +(isible scope restricted to that function and its children.).15 F -.4 +(Wi)5.861 G .861(th no operands,).4 F F3(local)144 544.8 Q F0 1.165 +(writes a list of local v)3.665 F 1.165 +(ariables to the standard output.)-.25 F 1.165(It is an error to use) +6.165 F F3(local)3.664 E F0 1.164(when not)3.664 F .232 +(within a function.)144 556.8 R .233(The return status is 0 unless)5.232 +F F3(local)2.733 E F0 .233(is used outside a function, an in)2.733 F +-.25(va)-.4 G(lid).25 E F2(name)3.093 E F0(is)2.913 E(supplied, or)144 +568.8 Q F2(name)2.5 E F0(is a readonly v)2.5 E(ariable.)-.25 E F3 +(logout)108 585.6 Q F0(Exit a login shell.)9.33 E F3(map\214le)108 602.4 +Q F0([)2.5 E F3<ad6e>A F2(count)2.5 E F0 2.5(][)C F3<ad4f>-2.5 E F2 +(origin)2.5 E F0 2.5(][)C F3<ad73>-2.5 E F2(count)2.5 E F0 2.5(][)C F3 +<ad74>-2.5 E F0 2.5(][)C F3<ad75>-2.5 E F2(fd)2.5 E F0 2.5(][)C F3<ad43> +-2.5 E F2(callbac)2.5 E(k)-.2 E F0 2.5(][)C F3<ad63>-2.5 E F2(quantum) +2.5 E F0 2.5(][)C F2(arr)-2.5 E(ay)-.15 E F0(])A F3 -.18(re)108 614.4 S +(adarray).18 E F0([)2.5 E F3<ad6e>A F2(count)2.5 E F0 2.5(][)C F3<ad4f> +-2.5 E F2(origin)2.5 E F0 2.5(][)C F3<ad73>-2.5 E F2(count)2.5 E F0 2.5 +(][)C F3<ad74>-2.5 E F0 2.5(][)C F3<ad75>-2.5 E F2(fd)2.5 E F0 2.5(][)C +F3<ad43>-2.5 E F2(callbac)2.5 E(k)-.2 E F0 2.5(][)C F3<ad63>-2.5 E F2 +(quantum)2.5 E F0 2.5(][)C F2(arr)-2.5 E(ay)-.15 E F0(])A .351 +(Read lines from the standard input into the inde)144 626.4 R -.15(xe) +-.15 G 2.851(da).15 G .351(rray v)-2.851 F(ariable)-.25 E F2(arr)2.85 E +(ay)-.15 E F0 2.85(,o).32 G 2.85(rf)-2.85 G .35(rom \214le descriptor) +-2.85 F F2(fd)2.85 E F0 1.248(if the)144 638.4 R F3<ad75>3.748 E F0 +1.248(option is supplied.)3.748 F 1.249(The v)6.249 F(ariable)-.25 E F1 +(MAPFILE)3.749 E F0 1.249(is the def)3.499 F(ault)-.1 E F2(arr)3.749 E +(ay)-.15 E F0 6.249(.O)C 1.249(ptions, if supplied,)-6.249 F(ha)144 +650.4 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F3<ad6e> +144 662.4 Q F0(Cop)24.74 E 2.5(ya)-.1 G 2.5(tm)-2.5 G(ost)-2.5 E F2 +(count)2.7 E F0 2.5(lines. If)3.18 F F2(count)2.5 E F0 +(is 0, all lines are copied.)2.5 E F3<ad4f>144 674.4 Q F0(Be)22.52 E +(gin assigning to)-.15 E F2(arr)2.83 E(ay)-.15 E F0(at inde)2.82 E(x) +-.15 E F2(origin)2.5 E F0 5(.T).24 G(he def)-5 E(ault inde)-.1 E 2.5(xi) +-.15 G 2.5(s0)-2.5 G(.)-2.5 E F3<ad73>144 686.4 Q F0 +(Discard the \214rst)26.41 E F2(count)2.5 E F0(lines read.)2.5 E F3 +<ad74>144 698.4 Q F0(Remo)26.97 E .3 -.15(ve a t)-.15 H(railing ne).15 E +(wline from each line read.)-.25 E F3<ad75>144 710.4 Q F0 +(Read lines from \214le descriptor)24.74 E F2(fd)2.5 E F0 +(instead of the standard input.)2.5 E(GNU Bash-4.0)72 768 Q(2004 Apr 20) +148.735 E(10)198.725 E 0 Cg EP +%%Page: 11 11 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF<ad43>144 84 Q F0(Ev)23.08 E(aluate)-.25 E/F2 10 +/Times-Italic@0 SF(callbac)2.7 E(k)-.2 E F0(each time)3.17 E F2(quantum) +2.5 E F0(lines are read.)2.5 E(The)5 E F1<ad63>2.5 E F0 +(option speci\214es)2.5 E F2(quantum)2.5 E F0(.).32 E F1<ad63>144 96 Q +F0(Specify the number of lines read between each call to)25.86 E F2 +(callbac)2.5 E(k)-.2 E F0(.).67 E(If)144 112.8 Q F1<ad43>2.968 E F0 .467 +(is speci\214ed without)2.967 F F1<ad63>2.967 E F0 2.967(,t)C .467 +(he def)-2.967 F .467(ault quantum is 5000.)-.1 F(When)5.467 E F2 +(callbac)2.967 E(k)-.2 E F0 .467(is e)2.967 F -.25(va)-.25 G .467 +(luated, it is sup-).25 F 1.22(plied the inde)144 124.8 R 3.72(xo)-.15 G +3.72(ft)-3.72 G 1.22(he ne)-3.72 F 1.22 +(xt array element to be assigned as an additional ar)-.15 F(gument.)-.18 +E F2(callbac)6.22 E(k)-.2 E F0(is)3.72 E -.25(eva)144 136.8 S +(luated after the line is read b).25 E +(ut before the array element is assigned.)-.2 E +(If not supplied with an e)144 153.6 Q(xplicit origin,)-.15 E F1 +(map\214le)2.5 E F0(will clear)2.5 E F2(arr)2.5 E(ay)-.15 E F0 +(before assigning to it.)2.5 E F1(map\214le)144 170.4 Q F0 1.906 +(returns successfully unless an in)4.406 F -.25(va)-.4 G 1.905 +(lid option or option ar).25 F 1.905(gument is supplied,)-.18 F F2(arr) +4.405 E(ay)-.15 E F0(is)4.405 E(in)144 182.4 Q -.25(va)-.4 G +(lid or unassignable, or if).25 E F2(arr)2.5 E(ay)-.15 E F0 +(is not an inde)2.5 E -.15(xe)-.15 G 2.5(da).15 G(rray)-2.5 E(.)-.65 E +F1(popd)108 199.2 Q F0<5bad>2.5 E F1(n)A F0 2.5(][)C(+)-2.5 E F2(n)A F0 +2.5(][)C<ad>-2.5 E F2(n)A F0(])A(Remo)144 211.2 Q -.15(ve)-.15 G 2.799 +(se).15 G .299(ntries from the directory stack.)-2.799 F -.4(Wi)5.299 G +.299(th no ar).4 F .299(guments, remo)-.18 F -.15(ve)-.15 G 2.799(st).15 +G .3(he top directory from the)-2.799 F 1.479(stack, and performs a)144 +223.2 R F1(cd)3.979 E F0 1.479(to the ne)3.979 F 3.979(wt)-.25 G 1.479 +(op directory)-3.979 F 6.479(.A)-.65 G -.18(rg)-6.479 G 1.478 +(uments, if supplied, ha).18 F 1.778 -.15(ve t)-.2 H 1.478(he follo).15 +F(wing)-.25 E(meanings:)144 235.2 Q F1<ad6e>144 247.2 Q F0 .551 +(Suppresses the normal change of directory when remo)24.74 F .551 +(ving directories from the stack, so)-.15 F +(that only the stack is manipulated.)180 259.2 Q F1(+)144 271.2 Q F2(n)A +F0(Remo)25.3 E -.15(ve)-.15 G 2.64(st).15 G(he)-2.64 E F2(n)2.64 E F0 +.14(th entry counting from the left of the list sho)B .14(wn by)-.25 F +F1(dirs)2.64 E F0 2.64(,s)C .14(tarting with zero.)-2.64 F -.15(Fo)180 +283.2 S 2.5(re).15 G(xample:)-2.65 E/F3 10/Courier@0 SF(popd +0)2.5 E F0 +(remo)2.5 E -.15(ve)-.15 G 2.5(st).15 G(he \214rst directory)-2.5 E(,) +-.65 E F3(popd +1)2.5 E F0(the second.)2.5 E F1<ad>144 295.2 Q F2(n)A F0 +(Remo)25.3 E -.15(ve)-.15 G 3.759(st).15 G(he)-3.759 E F2(n)3.759 E F0 +1.259(th entry counting from the right of the list sho)B 1.26(wn by)-.25 +F F1(dirs)3.76 E F0 3.76(,s)C 1.26(tarting with)-3.76 F 2.5(zero. F)180 +307.2 R(or e)-.15 E(xample:)-.15 E F3(popd -0)2.5 E F0(remo)2.5 E -.15 +(ve)-.15 G 2.5(st).15 G(he last directory)-2.5 E(,)-.65 E F3(popd -1)2.5 +E F0(the ne)2.5 E(xt to last.)-.15 E .644(If the)144 324 R F1(popd)3.144 +E F0 .644(command is successful, a)3.144 F F1(dirs)3.143 E F0 .643 +(is performed as well, and the return status is 0.)3.143 F F1(popd)5.643 +E F0 .415(returns f)144 336 R .415(alse if an in)-.1 F -.25(va)-.4 G +.415(lid option is encountered, the directory stack is empty).25 F 2.916 +(,an)-.65 G(on-e)-2.916 E .416(xistent direc-)-.15 F +(tory stack entry is speci\214ed, or the directory change f)144 348 Q +(ails.)-.1 E F1(printf)108 364.8 Q F0([)2.5 E F1<ad76>A F2(var)2.5 E F0 +(])A F2(format)2.5 E F0([)2.5 E F2(ar)A(guments)-.37 E F0(])A .372 +(Write the formatted)144 376.8 R F2(ar)2.872 E(guments)-.37 E F0 .372 +(to the standard output under the control of the)2.872 F F2(format)2.872 +E F0 5.372(.T)C(he)-5.372 E F2(format)2.872 E F0 1.804(is a character s\ +tring which contains three types of objects: plain characters, which ar\ +e simply)144 388.8 R .159 +(copied to standard output, character escape sequences, which are con) +144 400.8 R -.15(ve)-.4 G .158(rted and copied to the stan-).15 F .499(\ +dard output, and format speci\214cations, each of which causes printing\ + of the ne)144 412.8 R .5(xt successi)-.15 F -.15(ve)-.25 G F2(ar)3.15 E +(gu-)-.37 E(ment)144 424.8 Q F0 5.424(.I)C 2.924(na)-5.424 G .424 +(ddition to the standard)-2.924 F F2(printf)2.924 E F0 .424 +(\(1\) formats,)B F1(%b)2.924 E F0(causes)2.923 E F1(printf)2.923 E F0 +.423(to e)2.923 F .423(xpand backslash escape)-.15 F .976 +(sequences in the corresponding)144 436.8 R F2(ar)3.476 E(gument)-.37 E +F0(\(e)3.476 E .976(xcept that)-.15 F F1(\\c)3.476 E F0 .976 +(terminates output, backslashes in)3.476 F F1<5c08>3.477 E F0(,)A F1 +(\\")3.477 E F0(,)A(and)144 448.8 Q F1(\\?)3.422 E F0 .922(are not remo) +3.422 F -.15(ve)-.15 G .922(d, and octal escapes be).15 F .922 +(ginning with)-.15 F F1(\\0)3.422 E F0 .921 +(may contain up to four digits\), and)3.422 F F1(%q)144 460.8 Q F0 +(causes)3.63 E F1(printf)3.63 E F0 1.13(to output the corresponding)3.63 +F F2(ar)3.631 E(gument)-.37 E F0 1.131 +(in a format that can be reused as shell)3.631 F(input.)144 472.8 Q(The) +144 496.8 Q F1<ad76>2.904 E F0 .404 +(option causes the output to be assigned to the v)2.904 F(ariable)-.25 E +F2(var)2.904 E F0 .404(rather than being printed to the)2.904 F +(standard output.)144 508.8 Q(The)144 532.8 Q F2(format)3.423 E F0 .923 +(is reused as necessary to consume all of the)3.423 F F2(ar)3.423 E +(guments)-.37 E F0 5.923(.I)C 3.423(ft)-5.923 G(he)-3.423 E F2(format) +3.423 E F0 .924(requires more)3.424 F F2(ar)144 544.8 Q(guments)-.37 E +F0 .033(than are supplied, the e)2.534 F .033 +(xtra format speci\214cations beha)-.15 F .333 -.15(ve a)-.2 H 2.533(si) +.15 G 2.533(faz)-2.533 G .033(ero v)-2.533 F .033(alue or null string,) +-.25 F(as appropriate, had been supplied.)144 556.8 Q(The return v)5 E +(alue is zero on success, non-zero on f)-.25 E(ailure.)-.1 E F1(pushd) +108 573.6 Q F0([)2.5 E F1<ad6e>A F0 2.5(][)C(+)-2.5 E F2(n)A F0 2.5(][)C +<ad>-2.5 E F2(n)A F0(])A F1(pushd)108 585.6 Q F0([)2.5 E F1<ad6e>A F0 +2.5(][)C F2(dir)-2.5 E F0(])A .639(Adds a directory to the top of the d\ +irectory stack, or rotates the stack, making the ne)144 597.6 R 3.14(wt) +-.25 G .64(op of the)-3.14 F 1.316(stack the current w)144 609.6 R 1.316 +(orking directory)-.1 F 6.316(.W)-.65 G 1.315(ith no ar)-6.716 F 1.315 +(guments, e)-.18 F 1.315(xchanges the top tw)-.15 F 3.815(od)-.1 G 1.315 +(irectories and)-3.815 F .871 +(returns 0, unless the directory stack is empty)144 621.6 R 5.871(.A) +-.65 G -.18(rg)-5.871 G .872(uments, if supplied, ha).18 F 1.172 -.15 +(ve t)-.2 H .872(he follo).15 F .872(wing mean-)-.25 F(ings:)144 633.6 Q +F1<ad6e>144 645.6 Q F0 .902(Suppresses the normal change of directory w\ +hen adding directories to the stack, so that)24.74 F +(only the stack is manipulated.)180 657.6 Q F1(+)144 669.6 Q F2(n)A F0 +1.267(Rotates the stack so that the)25.3 F F2(n)3.767 E F0 1.268 +(th directory \(counting from the left of the list sho)B 1.268(wn by) +-.25 F F1(dirs)180 681.6 Q F0 2.5(,s)C +(tarting with zero\) is at the top.)-2.5 E F1<ad>144 693.6 Q F2(n)A F0 +.92(Rotates the stack so that the)25.3 F F2(n)3.42 E F0 .92 +(th directory \(counting from the right of the list sho)B .92(wn by)-.25 +F F1(dirs)180 705.6 Q F0 2.5(,s)C(tarting with zero\) is at the top.) +-2.5 E F2(dir)144.35 717.6 Q F0(Adds)23.98 E F2(dir)2.85 E F0 +(to the directory stack at the top, making it the ne)3.23 E 2.5(wc)-.25 +G(urrent w)-2.5 E(orking directory)-.1 E(.)-.65 E(GNU Bash-4.0)72 768 Q +(2004 Apr 20)148.735 E(11)198.725 E 0 Cg EP +%%Page: 12 12 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E .488(If the) +144 84 R/F1 10/Times-Bold@0 SF(pushd)2.988 E F0 .488 +(command is successful, a)2.988 F F1(dirs)2.988 E F0 .488 +(is performed as well.)2.988 F .489(If the \214rst form is used,)5.488 F +F1(pushd)2.989 E F0 1.04(returns 0 unless the cd to)144 96 R/F2 10 +/Times-Italic@0 SF(dir)3.89 E F0 -.1(fa)4.27 G 3.539(ils. W).1 F 1.039 +(ith the second form,)-.4 F F1(pushd)3.539 E F0 1.039 +(returns 0 unless the directory)3.539 F .846(stack is empty)144 108 R +3.346(,an)-.65 G(on-e)-3.346 E .847(xistent directory stack element is \ +speci\214ed, or the directory change to the)-.15 F(speci\214ed ne)144 +120 Q 2.5(wc)-.25 G(urrent directory f)-2.5 E(ails.)-.1 E F1(pwd)108 +136.8 Q F0([)2.5 E F1(\255LP)A F0(])A .845 +(Print the absolute pathname of the current w)144 148.8 R .845 +(orking directory)-.1 F 5.844(.T)-.65 G .844 +(he pathname printed contains no)-5.844 F .181(symbolic links if the)144 +160.8 R F1<ad50>2.681 E F0 .181(option is supplied or the)2.681 F F1 +.181(\255o ph)2.681 F(ysical)-.15 E F0 .181(option to the)2.681 F F1 +(set)2.681 E F0 -.2(bu)2.681 G .182(iltin command is).2 F 3.264 +(enabled. If)144 172.8 R(the)3.264 E F1<ad4c>3.264 E F0 .763 +(option is used, the pathname printed may contain symbolic links.)3.264 +F .763(The return)5.763 F 1.36(status is 0 unless an error occurs while\ + reading the name of the current directory or an in)144 184.8 R -.25(va) +-.4 G(lid).25 E(option is supplied.)144 196.8 Q F1 -.18(re)108 213.6 S +(ad).18 E F0([)3.817 E F1(\255ers)A F0 3.817(][)C F1<ad61>-3.817 E F2 +(aname)3.817 E F0 3.817(][)C F1<ad64>-3.817 E F2(delim)3.817 E F0 3.817 +(][)C F1<ad69>-3.817 E F2(te)3.817 E(xt)-.2 E F0 3.817(][)C F1<ad6e> +-3.817 E F2(nc)3.816 E(har)-.15 E(s)-.1 E F0 3.816(][)C F1<ad4e>-3.816 E +F2(nc)3.816 E(har)-.15 E(s)-.1 E F0 3.816(][)C F1<ad70>-3.816 E F2(pr) +3.816 E(ompt)-.45 E F0 3.816(][)C F1<ad74>-3.816 E F2(timeout)3.816 E F0 +3.816(][)C F1<ad75>-3.816 E F2(fd)3.816 E F0(])A([)108 225.6 Q F2(name)A +F0(...])2.5 E .516(One line is read from the standard input, or from th\ +e \214le descriptor)144 237.6 R F2(fd)3.016 E F0 .516(supplied as an ar) +3.016 F .516(gument to)-.18 F(the)144 249.6 Q F1<ad75>2.538 E F0 .038 +(option, and the \214rst w)2.538 F .038(ord is assigned to the \214rst) +-.1 F F2(name)2.539 E F0 2.539(,t).18 G .039(he second w)-2.539 F .039 +(ord to the second)-.1 F F2(name)2.539 E F0(,).18 E .42 +(and so on, with lefto)144 261.6 R -.15(ve)-.15 G 2.92(rw).15 G .42 +(ords and their interv)-3.02 F .42 +(ening separators assigned to the last)-.15 F F2(name)2.92 E F0 5.42(.I) +.18 G 2.92(ft)-5.42 G(here)-2.92 E .54(are fe)144 273.6 R .54(wer w)-.25 +F .541(ords read from the input stream than names, the remaining names \ +are assigned empty)-.1 F -.25(va)144 285.6 S 2.511(lues. The).25 F .011 +(characters in)2.511 F/F3 9/Times-Bold@0 SF(IFS)2.511 E F0 .011 +(are used to split the line into w)2.261 F 2.511(ords. The)-.1 F .011 +(backslash character \()2.511 F F1(\\)A F0 2.51(\)m)C(ay)-2.51 E 1.89 +(be used to remo)144 297.6 R 2.19 -.15(ve a)-.15 H 2.19 -.15(ny s).15 H +1.891(pecial meaning for the ne).15 F 1.891 +(xt character read and for line continuation.)-.15 F +(Options, if supplied, ha)144 309.6 Q .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1<ad61>144 321.6 Q F2(aname)2.5 E F0 1.05(The w) +180 333.6 R 1.049 +(ords are assigned to sequential indices of the array v)-.1 F(ariable) +-.25 E F2(aname)3.549 E F0 3.549(,s).18 G 1.049(tarting at 0.)-3.549 F +F2(aname)180.33 345.6 Q F0(is unset before an)2.68 E 2.5(yn)-.15 G .5 +-.25(ew va)-2.5 H(lues are assigned.).25 E(Other)5 E F2(name)2.5 E F0 +(ar)2.5 E(guments are ignored.)-.18 E F1<ad64>144 357.6 Q F2(delim)2.5 E +F0(The \214rst character of)180 369.6 Q F2(delim)2.5 E F0 +(is used to terminate the input line, rather than ne)2.5 E(wline.)-.25 E +F1<ad65>144 381.6 Q F0 .372 +(If the standard input is coming from a terminal,)25.86 F F1 -.18(re) +2.873 G(adline).18 E F0(\(see)2.873 E F3(READLINE)2.873 E F0(abo)2.623 E +-.15(ve)-.15 G 2.873(\)i).15 G 2.873(su)-2.873 G(sed)-2.873 E .218 +(to obtain the line.)180 393.6 R .218 +(Readline uses the current \(or def)5.218 F .218 +(ault, if line editing w)-.1 F .218(as not pre)-.1 F(viously)-.25 E +(acti)180 405.6 Q -.15(ve)-.25 G 2.5(\)e).15 G(diting settings.)-2.5 E +F1<ad69>144 417.6 Q F2(te)2.5 E(xt)-.2 E F0(If)10.78 E F1 -.18(re)2.715 +G(adline).18 E F0 .216(is being used to read the line,)2.715 F F2(te) +2.716 E(xt)-.2 E F0 .216(is placed into the editing b)2.716 F(uf)-.2 E +.216(fer before edit-)-.25 F(ing be)180 429.6 Q(gins.)-.15 E F1<ad6e>144 +441.6 Q F2(nc)2.5 E(har)-.15 E(s)-.1 E F1 -.18(re)180 453.6 S(ad).18 E +F0 1.395(returns after reading)3.895 F F2(nc)3.895 E(har)-.15 E(s)-.1 E +F0 1.395(characters rather than w)3.895 F 1.394 +(aiting for a complete line of)-.1 F(input, b)180 465.6 Q +(ut honor a delimiter if fe)-.2 E(wer than)-.25 E F2(nc)2.5 E(har)-.15 E +(s)-.1 E F0(characters are read before the delimiter)2.5 E(.)-.55 E F1 +<ad4e>144 477.6 Q F2(nc)2.5 E(har)-.15 E(s)-.1 E F1 -.18(re)180 489.6 S +(ad).18 E F0 1.269(returns after reading e)3.769 F(xactly)-.15 E F2(nc) +3.769 E(har)-.15 E(s)-.1 E F0 1.269(characters rather than w)3.769 F +1.27(aiting for a complete)-.1 F .275 +(line of input, unless EOF is encountered or)180 501.6 R F1 -.18(re) +2.775 G(ad).18 E F0 .274(times out.)2.774 F .274 +(Delimiter characters encoun-)5.274 F 1.002 +(tered in the input are not treated specially and do not cause)180 513.6 +R F1 -.18(re)3.503 G(ad).18 E F0 1.003(to return until)3.503 F F2(nc) +3.503 E(har)-.15 E(s)-.1 E F0(characters are read.)180 525.6 Q F1<ad70> +144 537.6 Q F2(pr)2.5 E(ompt)-.45 E F0(Display)180 549.6 Q F2(pr)3.661 E +(ompt)-.45 E F0 1.161(on standard error)3.661 F 3.661(,w)-.4 G 1.161 +(ithout a trailing ne)-3.661 F 1.161(wline, before attempting to read) +-.25 F(an)180 561.6 Q 2.5(yi)-.15 G 2.5(nput. The)-2.5 F +(prompt is displayed only if input is coming from a terminal.)2.5 E F1 +<ad72>144 573.6 Q F0 .543(Backslash does not act as an escape character) +25.86 F 5.543(.T)-.55 G .544(he backslash is considered to be part of) +-5.543 F(the line.)180 585.6 Q(In particular)5 E 2.5(,ab)-.4 G +(ackslash-ne)-2.5 E(wline pair may not be used as a line continuation.) +-.25 E F1<ad73>144 597.6 Q F0(Silent mode.)26.41 E +(If input is coming from a terminal, characters are not echoed.)5 E F1 +<ad74>144 609.6 Q F2(timeout)2.5 E F0(Cause)180 621.6 Q F1 -.18(re)3.549 +G(ad).18 E F0 1.048(to time out and return f)3.549 F 1.048 +(ailure if a complete line of input is not read within)-.1 F F2(timeout) +180 633.6 Q F0(seconds.)3.496 E F2(timeout)5.996 E F0 .997 +(may be a decimal number with a fractional portion follo)3.496 F(wing) +-.25 E .576(the decimal point.)180 645.6 R .576(This option is only ef) +5.576 F(fecti)-.25 E .876 -.15(ve i)-.25 H(f).15 E F1 -.18(re)3.076 G +(ad).18 E F0 .576(is reading input from a terminal,)3.076 F .141 +(pipe, or other special \214le; it has no ef)180 657.6 R .142 +(fect when reading from re)-.25 F .142(gular \214les.)-.15 F(If)5.142 E +F2(timeout)2.642 E F0 .142(is 0,)2.642 F F1 -.18(re)180 669.6 S(ad).18 E +F0 .113(returns success if input is a)2.614 F -.25(va)-.2 G .113 +(ilable on the speci\214ed \214le descriptor).25 F 2.613(,f)-.4 G .113 +(ailure otherwise.)-2.713 F(The e)180 681.6 Q +(xit status is greater than 128 if the timeout is e)-.15 E(xceeded.)-.15 +E F1<ad75>144 693.6 Q F2(fd)2.5 E F0(Read input from \214le descriptor) +14.46 E F2(fd)2.5 E F0(.)A .191(If no)144 710.4 R F2(names)3.051 E F0 +.191(are supplied, the line read is assigned to the v)2.961 F(ariable) +-.25 E F3(REPL)2.692 E(Y)-.828 E/F4 9/Times-Roman@0 SF(.)A F0 .192 +(The return code is zero,)4.692 F 1.344 +(unless end-of-\214le is encountered,)144 722.4 R F1 -.18(re)3.844 G(ad) +.18 E F0 1.343 +(times out \(in which case the return code is greater than)3.844 F +(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(12)198.725 E 0 Cg EP +%%Page: 13 13 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E +(128\), or an in)144 84 Q -.25(va)-.4 G +(lid \214le descriptor is supplied as the ar).25 E(gument to)-.18 E/F1 +10/Times-Bold@0 SF<ad75>2.5 E F0(.)A F1 -.18(re)108 100.8 S(adonly).18 E +F0([)2.5 E F1(\255aA)A(pf)-.25 E F0 2.5(][)C/F2 10/Times-Italic@0 SF +(name)-2.5 E F0([=)A F2(wor)A(d)-.37 E F0 2.5(].)C(..])-2.5 E .77 +(The gi)144 112.8 R -.15(ve)-.25 G(n).15 E F2(names)3.27 E F0 .77 +(are mark)3.27 F .77(ed readonly; the v)-.1 F .77(alues of these)-.25 F +F2(names)3.63 E F0 .77(may not be changed by subse-)3.54 F 1.097 +(quent assignment.)144 124.8 R 1.097(If the)6.097 F F1<ad66>3.597 E F0 +1.097(option is supplied, the functions corresponding to the)3.597 F F2 +(names)3.596 E F0 1.096(are so)3.596 F(mark)144 136.8 Q 3.334(ed. The) +-.1 F F1<ad61>3.334 E F0 .834(option restricts the v)3.334 F .834 +(ariables to inde)-.25 F -.15(xe)-.15 G 3.334(da).15 G .834(rrays; the) +-3.334 F F1<ad41>3.334 E F0 .834(option restricts the v)3.334 F(ari-) +-.25 E .538(ables to associati)144 148.8 R .838 -.15(ve a)-.25 H 3.038 +(rrays. If).15 F(no)3.038 E F2(name)3.398 E F0(ar)3.218 E .538 +(guments are gi)-.18 F -.15(ve)-.25 G .538(n, or if the).15 F F1<ad70> +3.038 E F0 .537(option is supplied, a list)3.038 F .08 +(of all readonly names is printed.)144 160.8 R(The)5.08 E F1<ad70>2.58 E +F0 .081(option causes output to be displayed in a format that may)2.58 F +1.177(be reused as input.)144 172.8 R 1.177(If a v)6.177 F 1.176 +(ariable name is follo)-.25 F 1.176(wed by =)-.25 F F2(wor)A(d)-.37 E F0 +3.676(,t)C 1.176(he v)-3.676 F 1.176(alue of the v)-.25 F 1.176 +(ariable is set to)-.25 F F2(wor)144 184.8 Q(d)-.37 E F0 6.205(.T)C +1.205(he return status is 0 unless an in)-6.205 F -.25(va)-.4 G 1.206 +(lid option is encountered, one of the).25 F F2(names)4.066 E F0 1.206 +(is not a)3.976 F -.25(va)144 196.8 S(lid shell v).25 E +(ariable name, or)-.25 E F1<ad66>2.5 E F0(is supplied with a)2.5 E F2 +(name)2.86 E F0(that is not a function.)2.68 E F1 -.18(re)108 213.6 S +(tur).18 E(n)-.15 E F0([)2.5 E F2(n)A F0(])A .587 +(Causes a function to e)144 225.6 R .587(xit with the return v)-.15 F +.587(alue speci\214ed by)-.25 F F2(n)3.087 E F0 5.587(.I).24 G(f)-5.587 +E F2(n)3.447 E F0 .586(is omitted, the return status is)3.327 F 1.335 +(that of the last command e)144 237.6 R -.15(xe)-.15 G 1.335 +(cuted in the function body).15 F 6.335(.I)-.65 G 3.835(fu)-6.335 G +1.335(sed outside a function, b)-3.835 F 1.335(ut during)-.2 F -.15(exe) +144 249.6 S .794(cution of a script by the).15 F F1(.)3.294 E F0(\() +5.794 E F1(sour)A(ce)-.18 E F0 3.294(\)c)C .794 +(ommand, it causes the shell to stop e)-3.294 F -.15(xe)-.15 G .794 +(cuting that script).15 F .245(and return either)144 261.6 R F2(n)3.105 +E F0 .246(or the e)2.985 F .246(xit status of the last command e)-.15 F +-.15(xe)-.15 G .246(cuted within the script as the e).15 F .246 +(xit sta-)-.15 F .082(tus of the script.)144 273.6 R .082 +(If used outside a function and not during e)5.082 F -.15(xe)-.15 G .082 +(cution of a script by).15 F F1(.)2.582 E F0 2.581(,t).833 G .081 +(he return sta-)-2.581 F 2.305(tus is f)144 285.6 R 4.805(alse. An)-.1 F +4.805(yc)-.15 G 2.305(ommand associated with the)-4.805 F F1(RETURN) +4.805 E F0 2.306(trap is e)4.806 F -.15(xe)-.15 G 2.306(cuted before e) +.15 F -.15(xe)-.15 G(cution).15 E(resumes after the function or script.) +144 297.6 Q F1(set)108 314.4 Q F0([)2.5 E F1 +(\255\255abefhkmnptuvxBCEHPT)A F0 2.5(][)C F1<ad6f>-2.5 E F2(option)2.5 +E F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0(...])2.5 E F1(set)108 326.4 Q F0 +([)2.5 E F1(+abefhkmnptuvxBCEHPT)A F0 2.5(][)C F1(+o)-2.5 E F2(option) +2.5 E F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0(...])2.5 E -.4(Wi)144 338.4 S +.836(thout options, the name and v).4 F .835(alue of each shell v)-.25 F +.835(ariable are displayed in a format that can be)-.25 F .784 +(reused as input for setting or resetting the currently-set v)144 350.4 +R 3.284(ariables. Read-only)-.25 F -.25(va)3.284 G .784 +(riables cannot be).25 F 2.947(reset. In)144 362.4 R F2 .447(posix mode) +2.947 F F0 2.947(,o)C .447(nly shell v)-2.947 F .447 +(ariables are listed.)-.25 F .447 +(The output is sorted according to the current)5.447 F 3.53 +(locale. When)144 374.4 R 1.031(options are speci\214ed, the)3.53 F +3.531(ys)-.15 G 1.031(et or unset shell attrib)-3.531 F 3.531(utes. An) +-.2 F 3.531(ya)-.15 G -.18(rg)-3.531 G 1.031(uments remaining).18 F +1.624(after option processing are treated as v)144 386.4 R 1.623 +(alues for the positional parameters and are assigned, in)-.25 F(order) +144 398.4 Q 2.5(,t)-.4 G(o)-2.5 E F1($1)2.5 E F0(,)A F1($2)2.5 E F0(,)A +F1 2.5(... $)2.5 F F2(n)A F0 5(.O)C(ptions, if speci\214ed, ha)-5 E .3 +-.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F1<ad61>144 410.4 Q +F0 .539(Automatically mark v)29.3 F .539 +(ariables and functions which are modi\214ed or created for e)-.25 F .54 +(xport to)-.15 F(the en)184 422.4 Q(vironment of subsequent commands.) +-.4 E F1<ad62>144 434.4 Q F0 .132 +(Report the status of terminated background jobs immediately)28.74 F +2.632(,r)-.65 G .131(ather than before the ne)-2.632 F(xt)-.15 E +(primary prompt.)184 446.4 Q(This is ef)5 E(fecti)-.25 E .3 -.15(ve o) +-.25 H(nly when job control is enabled.).15 E F1<ad65>144 458.4 Q F0 .51 +(Exit immediately if a)29.86 F F2(pipeline)3.01 E F0 .511 +(\(which may consist of a single)3.011 F F2 .511(simple command)3.011 F +F0 3.011(\), a)B F2(sub-)3.011 E(shell)184 470.4 Q F0 .872 +(command enclosed in parentheses, or one of the commands e)3.373 F -.15 +(xe)-.15 G .872(cuted as part of a).15 F .399 +(command list enclosed by braces \(see)184 482.4 R/F3 9/Times-Bold@0 SF +.399(SHELL GRAMMAR)2.899 F F0(abo)2.649 E -.15(ve)-.15 G 2.899(\)e).15 G +.399(xits with a non-zero)-3.049 F 3.969(status. The)184 494.4 R 1.468 +(shell does not e)3.969 F 1.468(xit if the command that f)-.15 F 1.468 +(ails is part of the command list)-.1 F .569(immediately follo)184 506.4 +R .569(wing a)-.25 F F1(while)3.069 E F0(or)3.069 E F1(until)3.069 E F0 +-.1(ke)3.069 G(yw)-.05 E .569(ord, part of the test follo)-.1 F .57 +(wing the)-.25 F F1(if)3.07 E F0(or)3.07 E F1(elif)3.07 E F0(reserv)184 +518.4 Q .544(ed w)-.15 F .544(ords, part of an)-.1 F 3.044(yc)-.15 G +.544(ommand e)-3.044 F -.15(xe)-.15 G .544(cuted in a).15 F F1(&&)3.044 +E F0(or)3.044 E/F4 10/Symbol SF<efef>3.044 E F0 .544(list e)3.044 F .544 +(xcept the command)-.15 F(follo)184 530.4 Q 1.23(wing the \214nal)-.25 F +F1(&&)3.73 E F0(or)3.73 E F4<efef>3.73 E F0 3.73(,a)C 1.53 -.15(ny c) +-3.73 H 1.231(ommand in a pipeline b).15 F 1.231 +(ut the last, or if the com-)-.2 F(mand')184 542.4 Q 3.191(sr)-.55 G +.691(eturn v)-3.191 F .691(alue is being in)-.25 F -.15(ve)-.4 G .691 +(rted with).15 F F1(!)3.191 E F0 5.691(.A)C .691(trap on)-2.5 F F1(ERR) +3.19 E F0 3.19(,i)C 3.19(fs)-3.19 G .69(et, is e)-3.19 F -.15(xe)-.15 G +.69(cuted before).15 F .686(the shell e)184 554.4 R 3.186(xits. This) +-.15 F .686(option applies to the shell en)3.186 F .686 +(vironment and each subshell en)-.4 F(viron-)-.4 E .068 +(ment separately \(see)184 566.4 R F3 .068(COMMAND EXECUTION ENVIR)2.568 +F(ONMENT)-.27 E F0(abo)2.318 E -.15(ve)-.15 G .068(\), and may cause).15 +F(subshells to e)184 578.4 Q(xit before e)-.15 E -.15(xe)-.15 G +(cuting all the commands in the subshell.).15 E F1<ad66>144 590.4 Q F0 +(Disable pathname e)30.97 E(xpansion.)-.15 E F1<ad68>144 602.4 Q F0 +2.238(Remember the location of commands as the)28.74 F 4.738(ya)-.15 G +2.239(re look)-4.738 F 2.239(ed up for e)-.1 F -.15(xe)-.15 G 4.739 +(cution. This).15 F(is)4.739 E(enabled by def)184 614.4 Q(ault.)-.1 E F1 +<ad6b>144 626.4 Q F0 .514(All ar)28.74 F .514 +(guments in the form of assignment statements are placed in the en)-.18 +F .513(vironment for a)-.4 F +(command, not just those that precede the command name.)184 638.4 Q F1 +<ad6d>144 650.4 Q F0 .148(Monitor mode.)25.97 F .148 +(Job control is enabled.)5.148 F .149(This option is on by def)5.148 F +.149(ault for interacti)-.1 F .449 -.15(ve s)-.25 H(hells).15 E .637 +(on systems that support it \(see)184 662.4 R F3 .636(JOB CONTR)3.136 F +(OL)-.27 E F0(abo)2.886 E -.15(ve)-.15 G 3.136(\). Background).15 F .636 +(processes run in a)3.136 F .641 +(separate process group and a line containing their e)184 674.4 R .642 +(xit status is printed upon their com-)-.15 F(pletion.)184 686.4 Q F1 +<ad6e>144 698.4 Q F0 .653(Read commands b)28.74 F .653(ut do not e)-.2 F +-.15(xe)-.15 G .653(cute them.).15 F .652 +(This may be used to check a shell script for)5.653 F(syntax errors.)184 +710.4 Q(This is ignored by interacti)5 E .3 -.15(ve s)-.25 H(hells.).15 +E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(13)198.725 E 0 Cg EP +%%Page: 14 14 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF<ad6f>144 84 Q/F2 10/Times-Italic@0 SF(option\255name) +2.5 E F0(The)184 96 Q F2(option\255name)2.5 E F0 +(can be one of the follo)2.5 E(wing:)-.25 E F1(allexport)184 108 Q F0 +(Same as)224 120 Q F1<ad61>2.5 E F0(.)A F1(braceexpand)184 132 Q F0 +(Same as)224 144 Q F1<ad42>2.5 E F0(.)A F1(emacs)184 156 Q F0 .089 +(Use an emacs-style command line editing interf)13.9 F 2.589(ace. This) +-.1 F .089(is enabled by def)2.589 F(ault)-.1 E .95 +(when the shell is interacti)224 168 R -.15(ve)-.25 G 3.45(,u).15 G .95 +(nless the shell is started with the)-3.45 F F1(\255\255noediting)3.45 E +F0 2.5(option. This)224 180 R(also af)2.5 E(fects the editing interf) +-.25 E(ace used for)-.1 E F1 -.18(re)2.5 G(ad \255e).18 E F0(.)A F1(err) +184 192 Q(exit)-.18 E F0(Same as)11.31 E F1<ad65>2.5 E F0(.)A F1 +(errtrace)184 204 Q F0(Same as)5.03 E F1<ad45>2.5 E F0(.)A F1(functrace) +184 216 Q F0(Same as)224 228 Q F1<ad54>2.5 E F0(.)A F1(hashall)184 240 Q +F0(Same as)9.43 E F1<ad68>2.5 E F0(.)A F1(histexpand)184 252 Q F0 +(Same as)224 264 Q F1<ad48>2.5 E F0(.)A F1(history)184 276 Q F0 .586 +(Enable command history)10 F 3.087(,a)-.65 G 3.087(sd)-3.087 G .587 +(escribed abo)-3.087 F .887 -.15(ve u)-.15 H(nder).15 E/F3 9 +/Times-Bold@0 SF(HIST)3.087 E(OR)-.162 E(Y)-.315 E/F4 9/Times-Roman@0 SF +(.)A F0 .587(This option is)5.087 F(on by def)224 288 Q +(ault in interacti)-.1 E .3 -.15(ve s)-.25 H(hells.).15 E F1(ignor)184 +300 Q(eeof)-.18 E F0 1.657(The ef)224 312 R 1.657 +(fect is as if the shell command)-.25 F/F5 10/Courier@0 SF(IGNOREEOF=10) +4.156 E F0 1.656(had been e)4.156 F -.15(xe)-.15 G(cuted).15 E(\(see)224 +324 Q F1(Shell V)2.5 E(ariables)-.92 E F0(abo)2.5 E -.15(ve)-.15 G(\).) +.15 E F1 -.1(ke)184 336 S(yw).1 E(ord)-.1 E F0(Same as)224 348 Q F1 +<ad6b>2.5 E F0(.)A F1(monitor)184 360 Q F0(Same as)5.56 E F1<ad6d>2.5 E +F0(.)A F1(noclob)184 372 Q(ber)-.1 E F0(Same as)224 384 Q F1<ad43>2.5 E +F0(.)A F1(noexec)184 396 Q F0(Same as)11.12 E F1<ad6e>2.5 E F0(.)A F1 +(noglob)184 408 Q F0(Same as)11.1 E F1<ad66>2.5 E F0(.)A F1(nolog)184 +420 Q F0(Currently ignored.)16.66 E F1(notify)184 432 Q F0(Same as)15 E +F1<ad62>2.5 E F0(.)A F1(nounset)184 444 Q F0(Same as)6.66 E F1<ad75>2.5 +E F0(.)A F1(onecmd)184 456 Q F0(Same as)6.67 E F1<ad74>2.5 E F0(.)A F1 +(ph)184 468 Q(ysical)-.15 E F0(Same as)5.14 E F1<ad50>2.5 E F0(.)A F1 +(pipefail)184 480 Q F0 1.029(If set, the return v)7.77 F 1.029 +(alue of a pipeline is the v)-.25 F 1.03 +(alue of the last \(rightmost\) com-)-.25 F 1.137(mand to e)224 492 R +1.136 +(xit with a non-zero status, or zero if all commands in the pipeline) +-.15 F -.15(ex)224 504 S(it successfully).15 E 5(.T)-.65 G +(his option is disabled by def)-5 E(ault.)-.1 E F1(posix)184 516 Q F0 +2.09(Change the beha)17.77 F 2.091(vior of)-.2 F F1(bash)4.591 E F0 +2.091(where the def)4.591 F 2.091(ault operation dif)-.1 F 2.091 +(fers from the)-.25 F(POSIX standard to match the standard \()224 528 Q +F2(posix mode)A F0(\).)A F1(pri)184 540 Q(vileged)-.1 E F0(Same as)224 +552 Q F1<ad70>2.5 E F0(.)A F1 -.1(ve)184 564 S(rbose).1 E F0(Same as) +7.33 E F1<ad76>2.5 E F0(.)A F1(vi)184 576 Q F0 1.466 +(Use a vi-style command line editing interf)32.22 F 3.965(ace. This)-.1 +F 1.465(also af)3.965 F 1.465(fects the editing)-.25 F(interf)224 588 Q +(ace used for)-.1 E F1 -.18(re)2.5 G(ad \255e).18 E F0(.)A F1(xtrace)184 +600 Q F0(Same as)13.35 E F1<ad78>2.5 E F0(.)A(If)184 618 Q F1<ad6f>3.052 +E F0 .552(is supplied with no)3.052 F F2(option\255name)3.053 E F0 3.053 +(,t)C .553(he v)-3.053 F .553(alues of the current options are printed.) +-.25 F(If)5.553 E F1(+o)184 630 Q F0 1.072(is supplied with no)3.572 F +F2(option\255name)3.572 E F0 3.572(,a)C 1.071(series of)-.001 F F1(set) +3.571 E F0 1.071(commands to recreate the current)3.571 F +(option settings is displayed on the standard output.)184 642 Q F1<ad70> +144 654 Q F0 -.45(Tu)28.74 G 1.071(rn on).45 F F2(privile)4.821 E -.1 +(ge)-.4 G(d).1 E F0 3.572(mode. In)4.341 F 1.072(this mode, the)3.572 F +F3($ENV)3.572 E F0(and)3.322 E F3($B)3.572 E(ASH_ENV)-.27 E F0 1.072 +(\214les are not pro-)3.322 F 1.501 +(cessed, shell functions are not inherited from the en)184 666 R 1.5 +(vironment, and the)-.4 F F3(SHELLOPTS)4 E F4(,)A F3 -.27(BA)184 678 S +(SHOPTS).27 E F4(,)A F3(CDP)2.774 E -.855(AT)-.666 G(H).855 E F4(,)A F0 +(and)2.774 E F3(GLOBIGNORE)3.024 E F0 -.25(va)2.774 G .524 +(riables, if the).25 F 3.025(ya)-.15 G .525(ppear in the en)-3.025 F +(vironment,)-.4 E .38(are ignored.)184 690 R .38 +(If the shell is started with the ef)5.38 F(fecti)-.25 E .679 -.15(ve u) +-.25 H .379(ser \(group\) id not equal to the real).15 F .461 +(user \(group\) id, and the)184 702 R F1<ad70>2.961 E F0 .461 +(option is not supplied, these actions are tak)2.961 F .462 +(en and the ef)-.1 F(fec-)-.25 E(ti)184 714 Q .695 -.15(ve u)-.25 H .395 +(ser id is set to the real user id.).15 F .395(If the)5.395 F F1<ad70> +2.895 E F0 .394(option is supplied at startup, the ef)2.895 F(fecti)-.25 +E -.15(ve)-.25 G .386(user id is not reset.)184 726 R -.45(Tu)5.386 G +.386(rning this option of).45 F 2.886(fc)-.25 G .387(auses the ef)-2.886 +F(fecti)-.25 E .687 -.15(ve u)-.25 H .387(ser and group ids to be).15 F +(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(14)198.725 E 0 Cg EP +%%Page: 15 15 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E +(set to the real user and group ids.)184 84 Q/F1 10/Times-Bold@0 SF +<ad74>144 96 Q F0(Exit after reading and e)30.97 E -.15(xe)-.15 G +(cuting one command.).15 E F1<ad75>144 108 Q F0 -.35(Tr)28.74 G .044 +(eat unset v).35 F .044(ariables and parameters other than the special \ +parameters "@" and "*" as an)-.25 F .182 +(error when performing parameter e)184 120 R 2.682(xpansion. If)-.15 F +-.15(ex)2.682 G .183(pansion is attempted on an unset v).15 F(ari-)-.25 +E .746(able or parameter)184 132 R 3.246(,t)-.4 G .746 +(he shell prints an error message, and, if not interacti)-3.246 F -.15 +(ve)-.25 G 3.246(,e).15 G .746(xits with a)-3.396 F(non-zero status.)184 +144 Q F1<ad76>144 156 Q F0(Print shell input lines as the)29.3 E 2.5(ya) +-.15 G(re read.)-2.5 E F1<ad78>144 168 Q F0 .315(After e)29.3 F .315 +(xpanding each)-.15 F/F2 10/Times-Italic@0 SF .315(simple command)2.815 +F F0(,)A F1 -.25(fo)2.815 G(r).25 E F0(command,)2.815 E F1(case)2.815 E +F0(command,)2.815 E F1(select)2.815 E F0(command,)2.815 E 1.236 +(or arithmetic)184 180 R F1 -.25(fo)3.736 G(r).25 E F0 1.236 +(command, display the e)3.736 F 1.236(xpanded v)-.15 F 1.236(alue of) +-.25 F/F3 9/Times-Bold@0 SF(PS4)3.736 E/F4 9/Times-Roman@0 SF(,)A F0 +(follo)3.486 E 1.236(wed by the com-)-.25 F(mand and its e)184 192 Q +(xpanded ar)-.15 E(guments or associated w)-.18 E(ord list.)-.1 E F1 +<ad42>144 204 Q F0 2.578(The shell performs brace e)27.63 F 2.578 +(xpansion \(see)-.15 F F1 2.578(Brace Expansion)5.078 F F0(abo)5.078 E +-.15(ve)-.15 G 5.079(\). This).15 F 2.579(is on by)5.079 F(def)184 216 Q +(ault.)-.1 E F1<ad43>144 228 Q F0 .214(If set,)27.08 F F1(bash)2.714 E +F0 .214(does not o)2.714 F -.15(ve)-.15 G .214(rwrite an e).15 F .214 +(xisting \214le with the)-.15 F F1(>)2.714 E F0(,)A F1(>&)2.714 E F0 +2.713(,a)C(nd)-2.713 E F1(<>)2.713 E F0 .213(redirection opera-)2.713 F +3.053(tors. This)184 240 R .553(may be o)3.053 F -.15(ve)-.15 G .553 +(rridden when creating output \214les by using the redirection opera-) +.15 F(tor)184 252 Q F1(>|)2.5 E F0(instead of)2.5 E F1(>)2.5 E F0(.)A F1 +<ad45>144 264 Q F0 .104(If set, an)27.63 F 2.604(yt)-.15 G .104(rap on) +-2.604 F F1(ERR)2.604 E F0 .103 +(is inherited by shell functions, command substitutions, and com-)2.604 +F .838(mands e)184 276 R -.15(xe)-.15 G .838(cuted in a subshell en).15 +F 3.338(vironment. The)-.4 F F1(ERR)3.338 E F0 .839 +(trap is normally not inherited in)3.339 F(such cases.)184 288 Q F1 +<ad48>144 300 Q F0(Enable)26.52 E F1(!)3.032 E F0 .532 +(style history substitution.)5.532 F .531(This option is on by def)5.532 +F .531(ault when the shell is inter)-.1 F(-)-.2 E(acti)184 312 Q -.15 +(ve)-.25 G(.).15 E F1<ad50>144 324 Q F0 1.164 +(If set, the shell does not follo)28.19 F 3.664(ws)-.25 G 1.164 +(ymbolic links when e)-3.664 F -.15(xe)-.15 G 1.165 +(cuting commands such as).15 F F1(cd)3.665 E F0 2.822 +(that change the current w)184 336 R 2.822(orking directory)-.1 F 7.822 +(.I)-.65 G 5.322(tu)-7.822 G 2.822(ses the ph)-5.322 F 2.821 +(ysical directory structure)-.05 F 2.685(instead. By)184 348 R(def)2.685 +E(ault,)-.1 E F1(bash)2.686 E F0(follo)2.686 E .186 +(ws the logical chain of directories when performing com-)-.25 F +(mands which change the current directory)184 360 Q(.)-.65 E F1<ad54>144 +372 Q F0 .89(If set, an)27.63 F 3.39(yt)-.15 G .89(raps on)-3.39 F F1 +(DEB)3.39 E(UG)-.1 E F0(and)3.39 E F1(RETURN)3.39 E F0 .89 +(are inherited by shell functions, command)3.39 F 1.932 +(substitutions, and commands e)184 384 R -.15(xe)-.15 G 1.932 +(cuted in a subshell en).15 F 4.432(vironment. The)-.4 F F1(DEB)4.432 E +(UG)-.1 E F0(and)4.432 E F1(RETURN)184 396 Q F0 +(traps are normally not inherited in such cases.)2.5 E F1<adad>144 408 Q +F0 .401(If no ar)28.6 F .401(guments follo)-.18 F 2.901(wt)-.25 G .401 +(his option, then the positional parameters are unset.)-2.901 F +(Otherwise,)5.4 E(the positional parameters are set to the)184 420 Q F2 +(ar)2.5 E(g)-.37 E F0(s, e)A -.15(ve)-.25 G 2.5(ni).15 G 2.5(fs)-2.5 G +(ome of them be)-2.5 E(gin with a)-.15 E F1<ad>2.5 E F0(.)A F1<ad>144 +432 Q F0 1.944(Signal the end of options, cause all remaining)34.3 F F2 +(ar)4.444 E(g)-.37 E F0 4.444(st)C 4.444(ob)-4.444 G 4.445(ea)-4.444 G +1.945(ssigned to the positional)-4.445 F 3.446(parameters. The)184 444 R +F1<ad78>3.446 E F0(and)3.446 E F1<ad76>3.446 E F0 .945 +(options are turned of)3.446 F 3.445(f. If)-.25 F .945(there are no) +3.445 F F2(ar)3.445 E(g)-.37 E F0 .945(s, the positional)B +(parameters remain unchanged.)184 456 Q .425(The options are of)144 +472.8 R 2.925(fb)-.25 G 2.925(yd)-2.925 G(ef)-2.925 E .425 +(ault unless otherwise noted.)-.1 F .425 +(Using + rather than \255 causes these options)5.425 F .178 +(to be turned of)144 484.8 R 2.678(f. The)-.25 F .178 +(options can also be speci\214ed as ar)2.678 F .178(guments to an in) +-.18 F -.2(vo)-.4 G .177(cation of the shell.).2 F(The)5.177 E .066 +(current set of options may be found in)144 496.8 R F1<24ad>2.566 E F0 +5.066(.T)C .066(he return status is al)-5.066 F -.1(wa)-.1 G .066 +(ys true unless an in).1 F -.25(va)-.4 G .067(lid option).25 F +(is encountered.)144 508.8 Q F1(shift)108 525.6 Q F0([)2.5 E F2(n)A F0 +(])A .429(The positional parameters from)144 537.6 R F2(n)2.929 E F0 +.429(+1 ... are renamed to)B F1 .429($1 ....)2.929 F F0 -.15(Pa)5.428 G +.428(rameters represented by the num-).15 F(bers)144 549.6 Q F1($#)2.582 +E F0(do)2.582 E .082(wn to)-.25 F F1($#)2.582 E F0<ad>A F2(n)A F0 .082 +(+1 are unset.)B F2(n)5.442 E F0 .082(must be a non-ne)2.822 F -.05(ga) +-.15 G(ti).05 E .383 -.15(ve n)-.25 H .083(umber less than or equal to) +.15 F F1($#)2.583 E F0 5.083(.I)C(f)-5.083 E F2(n)2.943 E F0 .06 +(is 0, no parameters are changed.)144 561.6 R(If)5.06 E F2(n)2.92 E F0 +.06(is not gi)2.8 F -.15(ve)-.25 G .06(n, it is assumed to be 1.).15 F +(If)5.06 E F2(n)2.92 E F0 .06(is greater than)2.8 F F1($#)2.56 E F0 2.56 +(,t)C(he)-2.56 E .143(positional parameters are not changed.)144 573.6 R +.144(The return status is greater than zero if)5.143 F F2(n)3.004 E F0 +.144(is greater than)2.884 F F1($#)2.644 E F0 +(or less than zero; otherwise 0.)144 585.6 Q F1(shopt)108 602.4 Q F0([) +2.5 E F1(\255pqsu)A F0 2.5(][)C F1<ad6f>-2.5 E F0 2.5(][)C F2(optname) +-2.5 E F0(...])2.5 E -.8(To)144 614.4 S .222(ggle the v).8 F .222 +(alues of v)-.25 F .222(ariables controlling optional shell beha)-.25 F +(vior)-.2 E 5.222(.W)-.55 G .222(ith no options, or with the)-5.622 F F1 +<ad70>2.722 E F0 .721(option, a list of all settable options is display\ +ed, with an indication of whether or not each is set.)144 626.4 R(The) +144 638.4 Q F1<ad70>2.828 E F0 .327(option causes output to be displaye\ +d in a form that may be reused as input.)2.828 F .327(Other options) +5.327 F(ha)144 650.4 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:) +-.25 E F1<ad73>144 662.4 Q F0(Enable \(set\) each)26.41 E F2(optname)2.5 +E F0(.)A F1<ad75>144 674.4 Q F0(Disable \(unset\) each)24.74 E F2 +(optname)2.5 E F0(.)A F1<ad71>144 686.4 Q F0 .003(Suppresses normal out\ +put \(quiet mode\); the return status indicates whether the)24.74 F F2 +(optname)2.504 E F0(is)2.504 E .256(set or unset.)180 698.4 R .256 +(If multiple)5.256 F F2(optname)2.756 E F0(ar)2.756 E .256 +(guments are gi)-.18 F -.15(ve)-.25 G 2.756(nw).15 G(ith)-2.756 E F1 +<ad71>2.756 E F0 2.755(,t)C .255(he return status is zero if)-2.755 F +(all)180 710.4 Q F2(optnames)2.5 E F0(are enabled; non-zero otherwise.) +2.5 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(15)198.725 E 0 Cg EP +%%Page: 16 16 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF<ad6f>144 84 Q F0(Restricts the v)25.3 E(alues of)-.25 E +/F2 10/Times-Italic@0 SF(optname)2.5 E F0(to be those de\214ned for the) +2.5 E F1<ad6f>2.5 E F0(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G +(iltin.).2 E .127(If either)144 100.8 R F1<ad73>2.627 E F0(or)2.627 E F1 +<ad75>2.627 E F0 .127(is used with no)2.627 F F2(optname)2.627 E F0(ar) +2.627 E .127(guments, the display is limited to those options which)-.18 +F 1.024(are set or unset, respecti)144 112.8 R -.15(ve)-.25 G(ly).15 E +6.024(.U)-.65 G 1.024(nless otherwise noted, the)-6.024 F F1(shopt)3.523 +E F0 1.023(options are disabled \(unset\) by)3.523 F(def)144 124.8 Q +(ault.)-.1 E 1.544 +(The return status when listing options is zero if all)144 141.6 R F2 +(optnames)4.044 E F0 1.545(are enabled, non-zero otherwise.)4.045 F .696 +(When setting or unsetting options, the return status is zero unless an) +144 153.6 R F2(optname)3.196 E F0 .696(is not a v)3.196 F .695 +(alid shell)-.25 F(option.)144 165.6 Q(The list of)144 182.4 Q F1(shopt) +2.5 E F0(options is:)2.5 E F1(autocd)144 200.4 Q F0 .199 +(If set, a command name that is the name of a directory is e)11.11 F +-.15(xe)-.15 G .2(cuted as if it were the ar).15 F(gu-)-.18 E +(ment to the)184 212.4 Q F1(cd)2.5 E F0 2.5(command. This)2.5 F +(option is only used by interacti)2.5 E .3 -.15(ve s)-.25 H(hells.).15 E +F1(cdable_v)144 224.4 Q(ars)-.1 E F0 .156(If set, an ar)184 236.4 R .156 +(gument to the)-.18 F F1(cd)2.656 E F0 -.2(bu)2.656 G .155 +(iltin command that is not a directory is assumed to be the).2 F +(name of a v)184 248.4 Q(ariable whose v)-.25 E +(alue is the directory to change to.)-.25 E F1(cdspell)144 260.4 Q F0 +1.055 +(If set, minor errors in the spelling of a directory component in a) +10.55 F F1(cd)3.555 E F0 1.055(command will be)3.555 F 3.988 +(corrected. The)184 272.4 R 1.488(errors check)3.988 F 1.487 +(ed for are transposed characters, a missing character)-.1 F 3.987(,a) +-.4 G(nd)-3.987 E .552(one character too man)184 284.4 R 4.352 -.65 +(y. I)-.15 H 3.052(fac).65 G .552 +(orrection is found, the corrected \214le name is printed, and)-3.052 F +(the command proceeds.)184 296.4 Q +(This option is only used by interacti)5 E .3 -.15(ve s)-.25 H(hells.) +.15 E F1(checkhash)144 308.4 Q F0 2.08(If set,)184 320.4 R F1(bash)4.58 +E F0 2.079(checks that a command found in the hash table e)4.58 F 2.079 +(xists before trying to)-.15 F -.15(exe)184 332.4 S(cute it.).15 E +(If a hashed command no longer e)5 E +(xists, a normal path search is performed.)-.15 E F1(checkjobs)144 344.4 +Q F0 .448(If set,)184 356.4 R F1(bash)2.948 E F0 .448 +(lists the status of an)2.948 F 2.949(ys)-.15 G .449 +(topped and running jobs before e)-2.949 F .449(xiting an interacti)-.15 +F -.15(ve)-.25 G 3.439(shell. If)184 368.4 R(an)3.439 E 3.439(yj)-.15 G +.938(obs are running, this causes the e)-3.439 F .938 +(xit to be deferred until a second e)-.15 F .938(xit is)-.15 F 2.203 +(attempted without an interv)184 380.4 R 2.203(ening command \(see)-.15 +F/F3 9/Times-Bold@0 SF 2.203(JOB CONTR)4.703 F(OL)-.27 E F0(abo)4.453 E +-.15(ve)-.15 G 4.703(\). The).15 F(shell)4.704 E(al)184 392.4 Q -.1(wa) +-.1 G(ys postpones e).1 E(xiting if an)-.15 E 2.5(yj)-.15 G +(obs are stopped.)-2.5 E F1(checkwinsize)144 404.4 Q F0 .797(If set,)184 +416.4 R F1(bash)3.297 E F0 .797(checks the windo)3.297 F 3.297(ws)-.25 G +.796(ize after each command and, if necessary)-3.297 F 3.296(,u)-.65 G +.796(pdates the)-3.296 F -.25(va)184 428.4 S(lues of).25 E F3(LINES)2.5 +E F0(and)2.25 E F3(COLUMNS)2.5 E/F4 9/Times-Roman@0 SF(.)A F1(cmdhist) +144 440.4 Q F0 1.202(If set,)6.11 F F1(bash)3.702 E F0 1.202 +(attempts to sa)3.702 F 1.502 -.15(ve a)-.2 H 1.202 +(ll lines of a multiple-line command in the same history).15 F(entry)184 +452.4 Q 5(.T)-.65 G(his allo)-5 E +(ws easy re-editing of multi-line commands.)-.25 E F1(compat31)144 464.4 +Q F0 .42(If set,)184 476.4 R F1(bash)2.92 E F0 .42(changes its beha)2.92 +F .419(vior to that of v)-.2 F .419 +(ersion 3.1 with respect to quoted ar)-.15 F(guments)-.18 E +(to the conditional command')184 488.4 Q 2.5(s=)-.55 G 2.5(~o)-2.5 G +(perator)-2.5 E(.)-.55 E F1(compat32)144 500.4 Q F0 1.409(If set,)184 +512.4 R F1(bash)3.909 E F0 1.409(changes its beha)3.909 F 1.409 +(vior to that of v)-.2 F 1.41 +(ersion 3.2 with respect to locale-speci\214c)-.15 F +(string comparison when using the conditional command')184 524.4 Q 2.5 +(s<a)-.55 G(nd > operators.)-2.5 E F1(compat40)144 536.4 Q F0 1.41 +(If set,)184 548.4 R F1(bash)3.91 E F0 1.41(changes its beha)3.91 F +1.409(vior to that of v)-.2 F 1.409 +(ersion 4.0 with respect to locale-speci\214c)-.15 F 1.692 +(string comparison when using the conditional command')184 560.4 R 4.193 +(s<a)-.55 G 1.693(nd > operators and the)-4.193 F(ef)184 572.4 Q +(fect of interrupting a command list.)-.25 E F1(dirspell)144 584.4 Q F0 +.859(If set,)7.77 F F1(bash)3.359 E F0 .858 +(attempts spelling correction on directory names during w)3.359 F .858 +(ord completion if)-.1 F +(the directory name initially supplied does not e)184 596.4 Q(xist.)-.15 +E F1(dotglob)144 608.4 Q F0 .165(If set,)7.77 F F1(bash)2.665 E F0 .165 +(includes \214lenames be)2.665 F .165(ginning with a `.)-.15 F 2.665('i) +-.7 G 2.665(nt)-2.665 G .165(he results of pathname e)-2.665 F +(xpansion.)-.15 E F1(execfail)144 620.4 Q F0 1.387 +(If set, a non-interacti)7.79 F 1.687 -.15(ve s)-.25 H 1.386 +(hell will not e).15 F 1.386(xit if it cannot e)-.15 F -.15(xe)-.15 G +1.386(cute the \214le speci\214ed as an).15 F(ar)184 632.4 Q +(gument to the)-.18 E F1(exec)2.5 E F0 -.2(bu)2.5 G(iltin command.).2 E +(An interacti)5 E .3 -.15(ve s)-.25 H(hell does not e).15 E(xit if)-.15 +E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(expand_aliases)144 644.4 Q +F0 .716(If set, aliases are e)184 656.4 R .717(xpanded as described abo) +-.15 F 1.017 -.15(ve u)-.15 H(nder).15 E F3(ALIASES)3.217 E F4(.)A F0 +.717(This option is enabled)5.217 F(by def)184 668.4 Q +(ault for interacti)-.1 E .3 -.15(ve s)-.25 H(hells.).15 E F1(extdeb)144 +680.4 Q(ug)-.2 E F0(If set, beha)184 692.4 Q +(vior intended for use by deb)-.2 E(uggers is enabled:)-.2 E F1(1.)184 +704.4 Q F0(The)28.5 E F1<ad46>4.251 E F0 1.751(option to the)4.251 F F1 +(declar)4.251 E(e)-.18 E F0 -.2(bu)4.251 G 1.751 +(iltin displays the source \214le name and line).2 F +(number corresponding to each function name supplied as an ar)220 716.4 +Q(gument.)-.18 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(16)198.725 +E 0 Cg EP +%%Page: 17 17 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(2.)184 84 Q F0 1.667(If the command run by the)28.5 F +F1(DEB)4.167 E(UG)-.1 E F0 1.667(trap returns a non-zero v)4.167 F 1.667 +(alue, the ne)-.25 F(xt)-.15 E(command is skipped and not e)220 96 Q +-.15(xe)-.15 G(cuted.).15 E F1(3.)184 108 Q F0 .841 +(If the command run by the)28.5 F F1(DEB)3.341 E(UG)-.1 E F0 .841 +(trap returns a v)3.341 F .84(alue of 2, and the shell is)-.25 F -.15 +(exe)220 120 S .488 +(cuting in a subroutine \(a shell function or a shell script e).15 F +-.15(xe)-.15 G .488(cuted by the).15 F F1(.)2.988 E F0(or)2.988 E F1 +(sour)220 132 Q(ce)-.18 E F0 -.2(bu)2.5 G(iltins\), a call to).2 E F1 +-.18(re)2.5 G(tur).18 E(n)-.15 E F0(is simulated.)2.5 E F1(4.)184 144 Q +/F2 9/Times-Bold@0 SF -.27(BA)28.5 G(SH_ARGC).27 E F0(and)3.154 E F2 +-.27(BA)3.404 G(SH_ARGV).27 E F0 .904 +(are updated as described in their descriptions)3.154 F(abo)220 156 Q +-.15(ve)-.15 G(.).15 E F1(5.)184 168 Q F0 1.359 +(Function tracing is enabled:)28.5 F 1.359 +(command substitution, shell functions, and sub-)6.359 F(shells in)220 +180 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E/F3 10 +/Times-Italic@0 SF(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1 +(DEB)2.5 E(UG)-.1 E F0(and)2.5 E F1(RETURN)2.5 E F0(traps.)2.5 E F1(6.) +184 192 Q F0 .805(Error tracing is enabled:)28.5 F .804 +(command substitution, shell functions, and subshells)5.805 F(in)220 204 +Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F3 +(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1(ERR)2.5 E(OR)-.3 E F0 +(trap.)2.5 E F1(extglob)144 216 Q F0 .4(If set, the e)8.89 F .4 +(xtended pattern matching features described abo)-.15 F .7 -.15(ve u) +-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 228 Q +F0(are enabled.)2.5 E F1(extquote)144 240 Q F0 2.473(If set,)184 252 R +F1($)4.973 E F0<08>A F3(string)A F0 4.973<0861>C(nd)-4.973 E F1($)4.973 +E F0(")A F3(string)A F0 4.973("q)C 2.473(uoting is performed within) +-4.973 F F1(${)4.973 E F3(par)A(ameter)-.15 E F1(})A F0 -.15(ex)4.973 G +(pansions).15 E(enclosed in double quotes.)184 264 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 276 Q F0 +1.424(If set, patterns which f)7.77 F 1.425 +(ail to match \214lenames during pathname e)-.1 F 1.425 +(xpansion result in an)-.15 F -.15(ex)184 288 S(pansion error).15 E(.) +-.55 E F1 -.25(fo)144 300 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0 +.937(If set, the suf)184 312 R<8c78>-.25 E .936(es speci\214ed by the) +-.15 F F2(FIGNORE)3.436 E F0 .936(shell v)3.186 F .936(ariable cause w) +-.25 F .936(ords to be ignored)-.1 F .32(when performing w)184 324 R .32 +(ord completion e)-.1 F -.15(ve)-.25 G 2.82(ni).15 G 2.82(ft)-2.82 G .32 +(he ignored w)-2.82 F .32(ords are the only possible com-)-.1 F 2.948 +(pletions. See)184 336 R F2 .448(SHELL V)2.948 F(ARIABLES)-1.215 E F0 +(abo)2.698 E .748 -.15(ve f)-.15 H .448(or a description of).15 F F2 +(FIGNORE)2.947 E/F4 9/Times-Roman@0 SF(.)A F0 .447(This option is)4.947 +F(enabled by def)184 348 Q(ault.)-.1 E F1(globstar)144 360 Q F0 .178 +(If set, the pattern)5 F F1(**)2.678 E F0 .178(used in a pathname e) +2.678 F .178(xpansion conte)-.15 F .179 +(xt will match a \214les and zero or)-.15 F 1.298 +(more directories and subdirectories.)184 372 R 1.298 +(If the pattern is follo)6.298 F 1.298(wed by a)-.25 F F1(/)3.797 E F0 +3.797(,o)C 1.297(nly directories)-3.797 F(and subdirectories match.)184 +384 Q F1(gnu_errfmt)144 396 Q F0(If set, shell error messages are writt\ +en in the standard GNU error message format.)184 408 Q F1(histappend)144 +420 Q F0 .676 +(If set, the history list is appended to the \214le named by the v)184 +432 R .676(alue of the)-.25 F F2(HISTFILE)3.177 E F0 -.25(va)2.927 G +(ri-).25 E(able when the shell e)184 444 Q(xits, rather than o)-.15 E +-.15(ve)-.15 G(rwriting the \214le.).15 E F1(histr)144 456 Q(eedit)-.18 +E F0 .576(If set, and)184 468 R F1 -.18(re)3.076 G(adline).18 E F0 .575 +(is being used, a user is gi)3.076 F -.15(ve)-.25 G 3.075(nt).15 G .575 +(he opportunity to re-edit a f)-3.075 F .575(ailed his-)-.1 F +(tory substitution.)184 480 Q F1(histv)144 492 Q(erify)-.1 E F0 .402 +(If set, and)184 504 R F1 -.18(re)2.903 G(adline).18 E F0 .403 +(is being used, the results of history substitution are not immediately) +2.903 F .662(passed to the shell parser)184 516 R 5.662(.I)-.55 G .661 +(nstead, the resulting line is loaded into the)-5.662 F F1 -.18(re)3.161 +G(adline).18 E F0(editing)3.161 E -.2(bu)184 528 S -.25(ff).2 G(er).25 E +2.5(,a)-.4 G(llo)-2.5 E(wing further modi\214cation.)-.25 E F1 +(hostcomplete)144 540 Q F0 1.181(If set, and)184 552 R F1 -.18(re)3.681 +G(adline).18 E F0 1.181(is being used,)3.681 F F1(bash)3.682 E F0 1.182 +(will attempt to perform hostname completion)3.682 F 1.381(when a w)184 +564 R 1.381(ord containing a)-.1 F F1(@)3.881 E F0 1.381 +(is being completed \(see)3.881 F F1(Completing)3.88 E F0(under)3.88 E +F2(READLINE)3.88 E F0(abo)184 576 Q -.15(ve)-.15 G 2.5(\). This).15 F +(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 588 Q F0(If set,) +184 600 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0 +(to all jobs when an interacti)2.25 E .3 -.15(ve l)-.25 H(ogin shell e) +.15 E(xits.)-.15 E F1(interacti)144 612 Q -.1(ve)-.1 G(_comments).1 E F0 +.33(If set, allo)184 624 R 2.83(waw)-.25 G .33(ord be)-2.93 F .33 +(ginning with)-.15 F F1(#)2.83 E F0 .33(to cause that w)2.83 F .33 +(ord and all remaining characters on)-.1 F .967 +(that line to be ignored in an interacti)184 636 R 1.267 -.15(ve s)-.25 +H .967(hell \(see).15 F F2(COMMENTS)3.467 E F0(abo)3.217 E -.15(ve)-.15 +G 3.467(\). This).15 F .967(option is)3.467 F(enabled by def)184 648 Q +(ault.)-.1 E F1(lithist)144 660 Q F0 .654(If set, and the)15.55 F F1 +(cmdhist)3.154 E F0 .654(option is enabled, multi-line commands are sa) +3.154 F -.15(ve)-.2 G 3.155(dt).15 G 3.155(ot)-3.155 G .655(he history) +-3.155 F(with embedded ne)184 672 Q +(wlines rather than using semicolon separators where possible.)-.25 E F1 +(login_shell)144 684 Q F0 .486 +(The shell sets this option if it is started as a login shell \(see)184 +696 R F2(INV)2.986 E(OCA)-.405 E(TION)-.855 E F0(abo)2.736 E -.15(ve) +-.15 G 2.986(\). The).15 F -.25(va)184 708 S(lue may not be changed.).25 +E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(17)198.725 E 0 Cg EP +%%Page: 18 18 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(mailwar)144 84 Q(n)-.15 E F0 .814 +(If set, and a \214le that)184 96 R F1(bash)3.314 E F0 .815 +(is checking for mail has been accessed since the last time it)3.314 F +-.1(wa)184 108 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E +(`The mail in)-.74 E/F2 10/Times-Italic@0 SF(mail\214le)2.5 E F0 +(has been read')2.5 E 2.5('i)-.74 G 2.5(sd)-2.5 G(isplayed.)-2.5 E F1 +(no_empty_cmd_completion)144 120 Q F0 .325(If set, and)184 132 R F1 -.18 +(re)2.825 G(adline).18 E F0 .325(is being used,)2.825 F F1(bash)2.824 E +F0 .324(will not attempt to search the)2.824 F/F3 9/Times-Bold@0 SF +-.666(PA)2.824 G(TH)-.189 E F0 .324(for possible)2.574 F +(completions when completion is attempted on an empty line.)184 144 Q F1 +(nocaseglob)144 156 Q F0 .436(If set,)184 168 R F1(bash)2.936 E F0 .436 +(matches \214lenames in a case\255insensiti)2.936 F .737 -.15(ve f)-.25 +H .437(ashion when performing pathname).05 F -.15(ex)184 180 S +(pansion \(see).15 E F1 -.1(Pa)2.5 G(thname Expansion).1 E F0(abo)2.5 E +-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 192 Q F0 1.194(If set,)184 +204 R F1(bash)3.694 E F0 1.194(matches patterns in a case\255insensiti) +3.694 F 1.493 -.15(ve f)-.25 H 1.193(ashion when performing matching).05 +F(while e)184 216 Q -.15(xe)-.15 G(cuting).15 E F1(case)2.5 E F0(or)2.5 +E F1([[)2.5 E F0(conditional commands.)2.5 E F1(nullglob)144 228 Q F0 +.854(If set,)184 240 R F1(bash)3.354 E F0(allo)3.354 E .855 +(ws patterns which match no \214les \(see)-.25 F F1 -.1(Pa)3.355 G .855 +(thname Expansion).1 F F0(abo)3.355 E -.15(ve)-.15 G 3.355(\)t).15 G(o) +-3.355 E -.15(ex)184 252 S(pand to a null string, rather than themselv) +.15 E(es.)-.15 E F1(pr)144 264 Q(ogcomp)-.18 E F0 .677 +(If set, the programmable completion f)184 276 R .677(acilities \(see) +-.1 F F1(Pr)3.176 E .676(ogrammable Completion)-.18 F F0(abo)3.176 E +-.15(ve)-.15 G(\)).15 E(are enabled.)184 288 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(pr)144 300 Q(omptv) +-.18 E(ars)-.1 E F0 1.447(If set, prompt strings under)184 312 R 1.448 +(go parameter e)-.18 F 1.448(xpansion, command substitution, arithmetic) +-.15 F -.15(ex)184 324 S .171(pansion, and quote remo).15 F -.25(va)-.15 +G 2.67(la).25 G .17(fter being e)-2.67 F .17(xpanded as described in) +-.15 F F3(PR)2.67 E(OMPTING)-.27 E F0(abo)2.42 E -.15(ve)-.15 G(.).15 E +(This option is enabled by def)184 336 Q(ault.)-.1 E F1 -.18(re)144 348 +S(stricted_shell).18 E F0 1.069 +(The shell sets this option if it is started in restricted mode \(see) +184 360 R F3 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 372 Q 4.178 +(w\). The)-.25 F -.25(va)4.178 G 1.678(lue may not be changed.).25 F +1.678(This is not reset when the startup \214les are)6.678 F -.15(exe) +184 384 S(cuted, allo).15 E(wing the startup \214les to disco)-.25 E +-.15(ve)-.15 G 2.5(rw).15 G(hether or not a shell is restricted.)-2.5 E +F1(shift_v)144 396 Q(erbose)-.1 E F0 .501(If set, the)184 408 R F1 +(shift)3.001 E F0 -.2(bu)3.001 G .501 +(iltin prints an error message when the shift count e).2 F .502 +(xceeds the number)-.15 F(of positional parameters.)184 420 Q F1(sour) +144 432 Q(cepath)-.18 E F0 .771(If set, the)184 444 R F1(sour)3.271 E +(ce)-.18 E F0(\()3.271 E F1(.)A F0 3.271(\)b)C .771(uiltin uses the v) +-3.471 F .771(alue of)-.25 F F3 -.666(PA)3.27 G(TH)-.189 E F0 .77 +(to \214nd the directory containing the)3.02 F(\214le supplied as an ar) +184 456 Q 2.5(gument. This)-.18 F(option is enabled by def)2.5 E(ault.) +-.1 E F1(xpg_echo)144 468 Q F0(If set, the)184 480 Q F1(echo)2.5 E F0 +-.2(bu)2.5 G(iltin e).2 E(xpands backslash-escape sequences by def)-.15 +E(ault.)-.1 E F1(suspend)108 492 Q F0([)2.5 E F1<ad66>A F0(])A 1.001 +(Suspend the e)144 504 R -.15(xe)-.15 G 1.001 +(cution of this shell until it recei).15 F -.15(ve)-.25 G 3.501(sa).15 G +F3(SIGCONT)A F0 3.502(signal. A)3.252 F 1.002(login shell cannot be) +3.502 F .023(suspended; the)144 516 R F1<ad66>2.523 E F0 .023 +(option can be used to o)2.523 F -.15(ve)-.15 G .022 +(rride this and force the suspension.).15 F .022(The return status is) +5.022 F 2.5(0u)144 528 S(nless the shell is a login shell and)-2.5 E F1 +<ad66>2.5 E F0(is not supplied, or if job control is not enabled.)2.5 E +F1(test)108 540 Q F2 -.2(ex)2.5 G(pr).2 E F1([)108 552 Q F2 -.2(ex)2.5 G +(pr).2 E F1(])2.5 E F0 1.15 +(Return a status of 0 or 1 depending on the e)6.77 F -.25(va)-.25 G 1.15 +(luation of the conditional e).25 F(xpression)-.15 E F2 -.2(ex)3.65 G +(pr).2 E F0 6.15(.E).73 G(ach)-6.15 E 1.188 +(operator and operand must be a separate ar)144 564 R 3.688 +(gument. Expressions)-.18 F 1.187(are composed of the primaries)3.688 F +1.889(described abo)144 576 R 2.189 -.15(ve u)-.15 H(nder).15 E F3 +(CONDITION)4.389 E 1.889(AL EXPRESSIONS)-.18 F/F4 9/Times-Roman@0 SF(.)A +F1(test)6.389 E F0 1.89(does not accept an)4.389 F 4.39(yo)-.15 G 1.89 +(ptions, nor)-4.39 F(does it accept and ignore an ar)144 588 Q +(gument of)-.18 E F1<adad>2.5 E F0(as signifying the end of options.)2.5 +E .786(Expressions may be combined using the follo)144 606 R .785 +(wing operators, listed in decreasing order of prece-)-.25 F 2.5 +(dence. The)144 618 R -.25(eva)2.5 G +(luation depends on the number of ar).25 E(guments; see belo)-.18 E -.65 +(w.)-.25 G F1(!)144 630 Q F2 -.2(ex)2.5 G(pr).2 E F0 -.35(Tr)12.6 G +(ue if).35 E F2 -.2(ex)2.5 G(pr).2 E F0(is f)3.23 E(alse.)-.1 E F1(\() +144 642 Q F2 -.2(ex)2.5 G(pr).2 E F1(\))2.5 E F0 .26(Returns the v)6.77 +F .26(alue of)-.25 F F2 -.2(ex)2.76 G(pr).2 E F0 5.26(.T)C .26 +(his may be used to o)-5.26 F -.15(ve)-.15 G .26 +(rride the normal precedence of opera-).15 F(tors.)180 654 Q F2 -.2(ex) +144 666 S(pr1).2 E F0<ad>2.5 E F1(a)A F2 -.2(ex)2.5 G(pr2).2 E F0 -.35 +(Tr)180 678 S(ue if both).35 E F2 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 E F2 +-.2(ex)2.5 G(pr2).2 E F0(are true.)2.52 E F2 -.2(ex)144 690 S(pr1).2 E +F0<ad>2.5 E F1(o)A F2 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 702 S +(ue if either).35 E F2 -.2(ex)2.5 G(pr1).2 E F0(or)2.5 E F2 -.2(ex)2.5 G +(pr2).2 E F0(is true.)2.52 E F1(test)144 718.8 Q F0(and)2.5 E F1([)2.5 E +F0 -.25(eva)2.5 G(luate conditional e).25 E +(xpressions using a set of rules based on the number of ar)-.15 E +(guments.)-.18 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(18)198.725 +E 0 Cg EP +%%Page: 19 19 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E 2.5(0a)144 +84 S -.18(rg)-2.5 G(uments).18 E(The e)180 96 Q(xpression is f)-.15 E +(alse.)-.1 E 2.5(1a)144 108 S -.18(rg)-2.5 G(ument).18 E(The e)180 120 Q +(xpression is true if and only if the ar)-.15 E(gument is not null.)-.18 +E 2.5(2a)144 132 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar)180 +144 R .37(gument is)-.18 F/F1 10/Times-Bold@0 SF(!)2.87 E F0 2.87(,t)C +.37(he e)-2.87 F .37(xpression is true if and only if the second ar)-.15 +F .37(gument is null.)-.18 F .379(If the \214rst ar)180 156 R .38 +(gument is one of the unary conditional operators listed abo)-.18 F .68 +-.15(ve u)-.15 H(nder).15 E/F2 9/Times-Bold@0 SF(CONDI-)2.88 E(TION)180 +168 Q .553(AL EXPRESSIONS)-.18 F/F3 9/Times-Roman@0 SF(,)A F0 .552 +(the e)2.802 F .552(xpression is true if the unary test is true.)-.15 F +.552(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 180 Q +(alid unary conditional operator)-.25 E 2.5(,t)-.4 G(he e)-2.5 E +(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 192 S -.18(rg)-2.5 G +(uments).18 E .023(If the second ar)180 204 R .023 +(gument is one of the binary conditional operators listed abo)-.18 F +.324 -.15(ve u)-.15 H(nder).15 E F2(CON-)2.524 E(DITION)180 216 Q 1.478 +(AL EXPRESSIONS)-.18 F F3(,)A F0 1.477(the result of the e)3.727 F 1.477 +(xpression is the result of the binary test)-.15 F .513 +(using the \214rst and third ar)180 228 R .513(guments as operands.)-.18 +F(The)5.513 E F1<ad61>3.013 E F0(and)3.013 E F1<ad6f>3.013 E F0 .513 +(operators are considered)3.013 F .972 +(binary operators when there are three ar)180 240 R 3.472(guments. If) +-.18 F .972(the \214rst ar)3.472 F .972(gument is)-.18 F F1(!)3.472 E F0 +3.472(,t)C .972(he v)-3.472 F .972(alue is)-.25 F .883(the ne)180 252 R +-.05(ga)-.15 G .883(tion of the tw).05 F(o-ar)-.1 E .884 +(gument test using the second and third ar)-.18 F 3.384(guments. If)-.18 +F .884(the \214rst)3.384 F(ar)180 264 Q .875(gument is e)-.18 F(xactly) +-.15 E F1(\()3.375 E F0 .875(and the third ar)3.375 F .875(gument is e) +-.18 F(xactly)-.15 E F1(\))3.375 E F0 3.374(,t)C .874 +(he result is the one-ar)-3.374 F(gument)-.18 E(test of the second ar) +180 276 Q 2.5(gument. Otherwise,)-.18 F(the e)2.5 E(xpression is f)-.15 +E(alse.)-.1 E 2.5(4a)144 288 S -.18(rg)-2.5 G(uments).18 E .384 +(If the \214rst ar)180 300 R .384(gument is)-.18 F F1(!)2.884 E F0 2.885 +(,t)C .385(he result is the ne)-2.885 F -.05(ga)-.15 G .385 +(tion of the three-ar).05 F .385(gument e)-.18 F .385(xpression com-) +-.15 F 1.648(posed of the remaining ar)180 312 R 4.147 +(guments. Otherwise,)-.18 F 1.647(the e)4.147 F 1.647 +(xpression is parsed and e)-.15 F -.25(va)-.25 G(luated).25 E +(according to precedence using the rules listed abo)180 324 Q -.15(ve) +-.15 G(.).15 E 2.5(5o)144 336 S 2.5(rm)-2.5 G(ore ar)-2.5 E(guments)-.18 +E 1.635(The e)180 348 R 1.635(xpression is parsed and e)-.15 F -.25(va) +-.25 G 1.635(luated according to precedence using the rules listed).25 F +(abo)180 360 Q -.15(ve)-.15 G(.).15 E F1(times)108 376.8 Q F0 1.229(Pri\ +nt the accumulated user and system times for the shell and for processe\ +s run from the shell.)13.23 F(The return status is 0.)144 388.8 Q F1 +(trap)108 405.6 Q F0([)2.5 E F1(\255lp)A F0 2.5(][)C([)-2.5 E/F4 10 +/Times-Italic@0 SF(ar)A(g)-.37 E F0(])A F4(sigspec)2.5 E F0(...])2.5 E +.702(The command)144 417.6 R F4(ar)3.532 E(g)-.37 E F0 .702 +(is to be read and e)3.422 F -.15(xe)-.15 G .702 +(cuted when the shell recei).15 F -.15(ve)-.25 G 3.203(ss).15 G +(ignal\(s\))-3.203 E F4(sigspec)3.203 E F0 5.703(.I).31 G(f)-5.703 E F4 +(ar)3.533 E(g)-.37 E F0(is)3.423 E .609(absent \(and there is a single) +144 429.6 R F4(sigspec)3.108 E F0 3.108(\)o)C(r)-3.108 E F1<ad>3.108 E +F0 3.108(,e)C .608 +(ach speci\214ed signal is reset to its original disposition)-3.108 F +.658(\(the v)144 441.6 R .658(alue it had upon entrance to the shell\).) +-.25 F(If)5.658 E F4(ar)3.488 E(g)-.37 E F0 .659 +(is the null string the signal speci\214ed by each)3.378 F F4(sigspec) +144.34 453.6 Q F0 .581 +(is ignored by the shell and by the commands it in)3.391 F -.2(vo)-.4 G +-.1(ke).2 G 3.08(s. If).1 F F4(ar)3.41 E(g)-.37 E F0 .58 +(is not present and)3.3 F F1<ad70>3.08 E F0(has)3.08 E 1.214 +(been supplied, then the trap commands associated with each)144 465.6 R +F4(sigspec)4.054 E F0 1.215(are displayed.)4.024 F 1.215(If no ar)6.215 +F(gu-)-.18 E .86(ments are supplied or if only)144 477.6 R F1<ad70>3.36 +E F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F1(trap)3.36 E F0 .86 +(prints the list of commands associated with each)3.36 F 2.83 +(signal. The)144 489.6 R F1<ad6c>2.83 E F0 .33(option causes the shell \ +to print a list of signal names and their corresponding num-)2.83 F +4.311(bers. Each)144 501.6 R F4(sigspec)4.651 E F0 1.811 +(is either a signal name de\214ned in <)4.621 F F4(signal.h)A F0 1.81 +(>, or a signal number)B 6.81(.S)-.55 G(ignal)-6.81 E +(names are case insensiti)144 513.6 Q .3 -.15(ve a)-.25 H +(nd the SIG pre\214x is optional.).15 E 1.648(If a)144 531.6 R F4 +(sigspec)4.488 E F0(is)4.458 E F2(EXIT)4.148 E F0 1.648 +(\(0\) the command)3.898 F F4(ar)4.479 E(g)-.37 E F0 1.649(is e)4.369 F +-.15(xe)-.15 G 1.649(cuted on e).15 F 1.649(xit from the shell.)-.15 F +1.649(If a)6.649 F F4(sigspec)4.489 E F0(is)4.459 E F2(DEB)144 543.6 Q +(UG)-.09 E F3(,)A F0 1.168(the command)3.418 F F4(ar)3.998 E(g)-.37 E F0 +1.168(is e)3.888 F -.15(xe)-.15 G 1.167(cuted before e).15 F -.15(ve) +-.25 G(ry).15 E F4 1.167(simple command)3.667 F F0(,)A F4(for)3.667 E F0 +(command,)3.667 E F4(case)3.667 E F0(com-)3.667 E(mand,)144 555.6 Q F4 +(select)2.646 E F0 .146(command, e)2.646 F -.15(ve)-.25 G .146 +(ry arithmetic).15 F F4(for)2.646 E F0 .147 +(command, and before the \214rst command e)2.646 F -.15(xe)-.15 G .147 +(cutes in a).15 F .146(shell function \(see)144 567.6 R F2 .146 +(SHELL GRAMMAR)2.646 F F0(abo)2.396 E -.15(ve)-.15 G 2.646(\). Refer).15 +F .146(to the description of the)2.646 F F1(extdeb)2.645 E(ug)-.2 E F0 +.145(option to)2.645 F(the)144 579.6 Q F1(shopt)3.2 E F0 -.2(bu)3.2 G .7 +(iltin for details of its ef).2 F .7(fect on the)-.25 F F1(DEB)3.2 E(UG) +-.1 E F0 3.2(trap. If)3.2 F(a)3.2 E F4(sigspec)3.54 E F0(is)3.51 E F2 +(RETURN)3.2 E F3(,)A F0 .701(the com-)2.951 F(mand)144 591.6 Q F4(ar) +3.474 E(g)-.37 E F0 .644(is e)3.364 F -.15(xe)-.15 G .643 +(cuted each time a shell function or a script e).15 F -.15(xe)-.15 G +.643(cuted with the).15 F F1(.)3.143 E F0(or)3.143 E F1(sour)3.143 E(ce) +-.18 E F0 -.2(bu)3.143 G(iltins).2 E(\214nishes e)144 603.6 Q -.15(xe) +-.15 G(cuting.).15 E .928(If a)144 621.6 R F4(sigspec)3.768 E F0(is) +3.738 E F2(ERR)3.429 E F3(,)A F0 .929(the command)3.179 F F4(ar)3.759 E +(g)-.37 E F0 .929(is e)3.649 F -.15(xe)-.15 G .929(cuted whene).15 F +-.15(ve)-.25 G 3.429(ras).15 G .929(imple command has a non\255zero) +-3.429 F -.15(ex)144 633.6 S 1.009(it status, subject to the follo).15 F +1.009(wing conditions.)-.25 F(The)6.009 E F2(ERR)3.509 E F0 1.009 +(trap is not e)3.259 F -.15(xe)-.15 G 1.008(cuted if the f).15 F 1.008 +(ailed com-)-.1 F .324 +(mand is part of the command list immediately follo)144 645.6 R .324 +(wing a)-.25 F F1(while)2.824 E F0(or)2.824 E F1(until)2.824 E F0 -.1 +(ke)2.824 G(yw)-.05 E .324(ord, part of the test)-.1 F 1.129(in an)144 +657.6 R F4(if)3.639 E F0 1.129(statement, part of a command e)5.589 F +-.15(xe)-.15 G 1.129(cuted in a).15 F F1(&&)3.629 E F0(or)3.629 E/F5 10 +/Symbol SF<efef>3.629 E F0 1.129(list, or if the command')3.629 F 3.628 +(sr)-.55 G(eturn)-3.628 E -.25(va)144 669.6 S(lue is being in).25 E -.15 +(ve)-.4 G(rted via).15 E F1(!)2.5 E F0 5(.T)C +(hese are the same conditions obe)-5 E(yed by the)-.15 E F1(err)2.5 E +(exit)-.18 E F0(option.)2.5 E 1.095 +(Signals ignored upon entry to the shell cannot be trapped or reset.)144 +687.6 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662 +(being ignored are reset to their original v)144 699.6 R .662 +(alues in a subshell or subshell en)-.25 F .661(vironment when one is) +-.4 F 2.5(created. The)144 711.6 R(return status is f)2.5 E(alse if an) +-.1 E(y)-.15 E F4(sigspec)2.84 E F0(is in)2.81 E -.25(va)-.4 G +(lid; otherwise).25 E F1(trap)2.5 E F0(returns true.)2.5 E(GNU Bash-4.0) +72 768 Q(2004 Apr 20)148.735 E(19)198.725 E 0 Cg EP +%%Page: 20 20 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(type)108 84 Q F0([)2.5 E F1(\255aftpP)A F0(])A/F2 10 +/Times-Italic@0 SF(name)2.5 E F0([)2.5 E F2(name)A F0(...])2.5 E -.4(Wi) +144 96 S .173(th no options, indicate ho).4 F 2.673(we)-.25 G(ach)-2.673 +E F2(name)3.033 E F0 -.1(wo)2.853 G .174 +(uld be interpreted if used as a command name.).1 F .174(If the)5.174 F +F1<ad74>144 108 Q F0 .843(option is used,)3.343 F F1(type)3.343 E F0 +.843(prints a string which is one of)3.343 F F2(alias)3.343 E F0(,).27 E +F2 -.1(ke)3.343 G(ywor)-.2 E(d)-.37 E F0(,).77 E F2(function)3.343 E F0 +(,).24 E F2 -.2(bu)3.342 G(iltin).2 E F0 3.342(,o).24 G(r)-3.342 E F2 +(\214le)5.252 E F0(if)3.522 E F2(name)144.36 120 Q F0 .086 +(is an alias, shell reserv)2.766 F .086(ed w)-.15 F .086 +(ord, function, b)-.1 F .087(uiltin, or disk \214le, respecti)-.2 F -.15 +(ve)-.25 G(ly).15 E 5.087(.I)-.65 G 2.587(ft)-5.087 G(he)-2.587 E F2 +(name)2.947 E F0 .087(is not)2.767 F .119 +(found, then nothing is printed, and an e)144 132 R .118 +(xit status of f)-.15 F .118(alse is returned.)-.1 F .118(If the)5.118 F +F1<ad70>2.618 E F0 .118(option is used,)2.618 F F1(type)2.618 E F0 .855 +(either returns the name of the disk \214le that w)144 144 R .855 +(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F2(name)3.715 E F0 +.855(were speci\214ed as a com-)3.535 F .641(mand name, or nothing if) +144 156 R/F3 10/Courier@0 SF .641(type -t name)3.141 F F0 -.1(wo)3.141 G +.641(uld not return).1 F F2(\214le)3.14 E F0 5.64(.T).18 G(he)-5.64 E F1 +<ad50>3.14 E F0 .64(option forces a)3.14 F/F4 9/Times-Bold@0 SF -.666 +(PA)3.14 G(TH)-.189 E F0 .112(search for each)144 168 R F2(name)2.612 E +F0 2.612(,e)C -.15(ve)-2.862 G 2.613(ni).15 G(f)-2.613 E F3 .113 +(type -t name)2.613 F F0 -.1(wo)2.613 G .113(uld not return).1 F F2 +(\214le)2.613 E F0 5.113(.I).18 G 2.613(fac)-5.113 G .113 +(ommand is hashed,)-2.613 F F1<ad70>2.613 E F0(and)144 180 Q F1<ad50> +2.945 E F0 .445(print the hashed v)2.945 F .444 +(alue, not necessarily the \214le that appears \214rst in)-.25 F F4 +-.666(PA)2.944 G(TH)-.189 E/F5 9/Times-Roman@0 SF(.)A F0 .444(If the) +4.944 F F1<ad61>2.944 E F0(option)2.944 E .265(is used,)144 192 R F1 +(type)2.765 E F0 .265(prints all of the places that contain an e)2.765 F +-.15(xe)-.15 G .265(cutable named).15 F F2(name)2.765 E F0 5.265(.T).18 +G .265(his includes aliases)-5.265 F .427 +(and functions, if and only if the)144 204 R F1<ad70>2.926 E F0 .426 +(option is not also used.)2.926 F .426 +(The table of hashed commands is not)5.426 F .548(consulted when using) +144 216 R F1<ad61>3.048 E F0 5.548(.T)C(he)-5.548 E F1<ad66>3.048 E F0 +.549(option suppresses shell function lookup, as with the)3.048 F F1 +(command)3.049 E F0 -.2(bu)144 228 S(iltin.).2 E F1(type)5 E F0 +(returns true if all of the ar)2.5 E(guments are found, f)-.18 E +(alse if an)-.1 E 2.5(ya)-.15 G(re not found.)-2.5 E F1(ulimit)108 244.8 +Q F0([)2.5 E F1(\255HST)A(abcde\214lmnpqrstuvx)-.92 E F0([)2.5 E F2 +(limit)A F0(]])A(Pro)144 256.8 Q .244(vides control o)-.15 F -.15(ve) +-.15 G 2.744(rt).15 G .244(he resources a)-2.744 F -.25(va)-.2 G .244 +(ilable to the shell and to processes started by it, on systems).25 F +.943(that allo)144 268.8 R 3.443(ws)-.25 G .943(uch control.)-3.443 F +(The)5.943 E F1<ad48>3.443 E F0(and)3.443 E F1<ad53>3.444 E F0 .944 +(options specify that the hard or soft limit is set for the)3.444 F(gi) +144 280.8 Q -.15(ve)-.25 G 2.709(nr).15 G 2.709(esource. A)-2.709 F .208 +(hard limit cannot be increased by a non-root user once it is set; a so\ +ft limit may)2.709 F .425(be increased up to the v)144 292.8 R .425 +(alue of the hard limit.)-.25 F .426(If neither)5.425 F F1<ad48>2.926 E +F0(nor)2.926 E F1<ad53>2.926 E F0 .426 +(is speci\214ed, both the soft and)2.926 F .139(hard limits are set.)144 +304.8 R .139(The v)5.139 F .139(alue of)-.25 F F2(limit)2.729 E F0 .139 +(can be a number in the unit speci\214ed for the resource or one)3.319 F +.741(of the special v)144 316.8 R(alues)-.25 E F1(hard)3.241 E F0(,)A F1 +(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F1(unlimited)3.241 E F0 3.241(,w) +C .741(hich stand for the current hard limit, the current)-3.241 F .78 +(soft limit, and no limit, respecti)144 328.8 R -.15(ve)-.25 G(ly).15 E +5.78(.I)-.65 G(f)-5.78 E F2(limit)3.37 E F0 .78 +(is omitted, the current v)3.96 F .78(alue of the soft limit of the)-.25 +F .498(resource is printed, unless the)144 340.8 R F1<ad48>2.999 E F0 +.499(option is gi)2.999 F -.15(ve)-.25 G 2.999(n. When).15 F .499 +(more than one resource is speci\214ed, the)2.999 F +(limit name and unit are printed before the v)144 352.8 Q 2.5 +(alue. Other)-.25 F(options are interpreted as follo)2.5 E(ws:)-.25 E F1 +<ad61>144 364.8 Q F0(All current limits are reported)25.3 E F1<ad62>144 +376.8 Q F0(The maximum sock)24.74 E(et b)-.1 E(uf)-.2 E(fer size)-.25 E +F1<ad63>144 388.8 Q F0(The maximum size of core \214les created)25.86 E +F1<ad64>144 400.8 Q F0(The maximum size of a process')24.74 E 2.5(sd) +-.55 G(ata se)-2.5 E(gment)-.15 E F1<ad65>144 412.8 Q F0 +(The maximum scheduling priority \("nice"\))25.86 E F1<ad66>144 424.8 Q +F0(The maximum size of \214les written by the shell and its children) +26.97 E F1<ad69>144 436.8 Q F0(The maximum number of pending signals) +27.52 E F1<ad6c>144 448.8 Q F0(The maximum size that may be lock)27.52 E +(ed into memory)-.1 E F1<ad6d>144 460.8 Q F0 +(The maximum resident set size \(man)21.97 E 2.5(ys)-.15 G +(ystems do not honor this limit\))-2.5 E F1<ad6e>144 472.8 Q F0 .791(Th\ +e maximum number of open \214le descriptors \(most systems do not allo) +24.74 F 3.29(wt)-.25 G .79(his v)-3.29 F .79(alue to)-.25 F(be set\))180 +484.8 Q F1<ad70>144 496.8 Q F0 +(The pipe size in 512-byte blocks \(this may not be set\))24.74 E F1 +<ad71>144 508.8 Q F0 +(The maximum number of bytes in POSIX message queues)24.74 E F1<ad72>144 +520.8 Q F0(The maximum real-time scheduling priority)25.86 E F1<ad73>144 +532.8 Q F0(The maximum stack size)26.41 E F1<ad74>144 544.8 Q F0 +(The maximum amount of cpu time in seconds)26.97 E F1<ad75>144 556.8 Q +F0(The maximum number of processes a)24.74 E -.25(va)-.2 G +(ilable to a single user).25 E F1<ad76>144 568.8 Q F0 +(The maximum amount of virtual memory a)25.3 E -.25(va)-.2 G +(ilable to the shell).25 E F1<ad78>144 580.8 Q F0 +(The maximum number of \214le locks)25.3 E F1<ad54>144 592.8 Q F0 +(The maximum number of threads)23.63 E(If)144 609.6 Q F2(limit)2.933 E +F0 .343(is gi)3.523 F -.15(ve)-.25 G .343(n, it is the ne).15 F 2.843 +(wv)-.25 G .343(alue of the speci\214ed resource \(the)-3.093 F F1<ad61> +2.843 E F0 .343(option is display only\).)2.843 F .343(If no)5.343 F +.176(option is gi)144 621.6 R -.15(ve)-.25 G .176(n, then).15 F F1<ad66> +2.676 E F0 .175(is assumed.)2.676 F -1.11(Va)5.175 G .175 +(lues are in 1024-byte increments, e)1.11 F .175(xcept for)-.15 F F1 +<ad74>2.675 E F0 2.675(,w)C .175(hich is in)-2.675 F(seconds,)144 633.6 +Q F1<ad70>2.515 E F0 2.515(,w)C .015 +(hich is in units of 512-byte blocks, and)-2.515 F F1<ad54>2.516 E F0(,) +A F1<ad62>2.516 E F0(,)A F1<ad6e>2.516 E F0 2.516(,a)C(nd)-2.516 E F1 +<ad75>2.516 E F0 2.516(,w)C .016(hich are unscaled v)-2.516 F(al-)-.25 E +3.788(ues. The)144 645.6 R 1.287(return status is 0 unless an in)3.787 F +-.25(va)-.4 G 1.287(lid option or ar).25 F 1.287 +(gument is supplied, or an error occurs)-.18 F(while setting a ne)144 +657.6 Q 2.5(wl)-.25 G(imit.)-2.5 E F1(umask)108 674.4 Q F0([)2.5 E F1 +<ad70>A F0 2.5(][)C F1<ad53>-2.5 E F0 2.5(][)C F2(mode)-2.5 E F0(])A .2 +(The user \214le-creation mask is set to)144 686.4 R F2(mode)2.7 E F0 +5.2(.I).18 G(f)-5.2 E F2(mode)3.08 E F0(be)2.88 E .2 +(gins with a digit, it is interpreted as an octal)-.15 F .066(number; o\ +therwise it is interpreted as a symbolic mode mask similar to that acce\ +pted by)144 698.4 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144 +710.4 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382 +(alue of the mask is printed.)-.25 F(The)5.382 E F1<ad53>2.882 E F0 .382 +(option causes the mask to be)2.882 F .547 +(printed in symbolic form; the def)144 722.4 R .547 +(ault output is an octal number)-.1 F 5.547(.I)-.55 G 3.047(ft)-5.547 G +(he)-3.047 E F1<ad70>3.047 E F0 .547(option is supplied, and)3.047 F +(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(20)198.725 E 0 Cg EP +%%Page: 21 21 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Italic@0 SF(mode)144.38 84 Q F0 .551 +(is omitted, the output is in a form that may be reused as input.)3.231 +F .552(The return status is 0 if the)5.552 F(mode w)144 96 Q +(as successfully changed or if no)-.1 E F1(mode)2.5 E F0(ar)2.5 E +(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E/F2 10 +/Times-Bold@0 SF(unalias)108 112.8 Q F0<5bad>2.5 E F2(a)A F0 2.5(][)C F1 +(name)-2.5 E F0(...])2.5 E(Remo)144 124.8 Q 1.955 -.15(ve e)-.15 H(ach) +.15 E F1(name)4.155 E F0 1.655(from the list of de\214ned aliases.)4.155 +F(If)6.655 E F2<ad61>4.155 E F0 1.655 +(is supplied, all alias de\214nitions are)4.155 F(remo)144 136.8 Q -.15 +(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E +(alue is true unless a supplied)-.25 E F1(name)2.86 E F0 +(is not a de\214ned alias.)2.68 E F2(unset)108 153.6 Q F0<5bad>2.5 E F2 +(fv)A F0 2.5(][)C F1(name)-2.5 E F0(...])2.5 E -.15(Fo)144 165.6 S 3.106 +(re).15 G(ach)-3.106 E F1(name)3.106 E F0 3.106(,r).18 G(emo)-3.106 E +.906 -.15(ve t)-.15 H .606(he corresponding v).15 F .607 +(ariable or function.)-.25 F .607(If no options are supplied, or the) +5.607 F F2<ad76>144 177.6 Q F0 .305(option is gi)2.805 F -.15(ve)-.25 G +.305(n, each).15 F F1(name)3.165 E F0 .305(refers to a shell v)2.985 F +2.805(ariable. Read-only)-.25 F -.25(va)2.805 G .304 +(riables may not be unset.).25 F(If)5.304 E F2<ad66>144 189.6 Q F0 .459 +(is speci\214ed, each)2.959 F F1(name)3.319 E F0 .459 +(refers to a shell function, and the function de\214nition is remo)3.139 +F -.15(ve)-.15 G 2.96(d. Each).15 F .903(unset v)144 201.6 R .903 +(ariable or function is remo)-.25 F -.15(ve)-.15 G 3.402(df).15 G .902 +(rom the en)-3.402 F .902(vironment passed to subsequent commands.)-.4 F +(If)5.902 E(an)144 213.6 Q 6.915(yo)-.15 G(f)-6.915 E/F3 9/Times-Bold@0 +SF(COMP_W)6.915 E(ORDBREAKS)-.09 E/F4 9/Times-Roman@0 SF(,)A F3(RANDOM) +6.665 E F4(,)A F3(SECONDS)6.665 E F4(,)A F3(LINENO)6.665 E F4(,)A F3 +(HISTCMD)6.666 E F4(,)A F3(FUNCN)6.666 E(AME)-.18 E F4(,)A F3(GR)144 +225.6 Q(OUPS)-.27 E F4(,)A F0(or)2.523 E F3(DIRST)2.773 E -.495(AC)-.81 +G(K).495 E F0 .272(are unset, the)2.522 F 2.772(yl)-.15 G .272 +(ose their special properties, e)-2.772 F -.15(ve)-.25 G 2.772(ni).15 G +2.772(ft)-2.772 G(he)-2.772 E 2.772(ya)-.15 G .272(re subsequently) +-2.772 F 2.5(reset. The)144 237.6 R -.15(ex)2.5 G +(it status is true unless a).15 E F1(name)2.86 E F0(is readonly)2.68 E +(.)-.65 E F2(wait)108 254.4 Q F0([)2.5 E F1 2.5(n.)C(..)-2.5 E F0(])A +-.8(Wa)144 266.4 S .288 +(it for each speci\214ed process and return its termination status.).8 F +(Each)5.288 E F1(n)3.148 E F0 .288(may be a process ID or a)3.028 F .722 +(job speci\214cation; if a job spec is gi)144 278.4 R -.15(ve)-.25 G +.722(n, all processes in that job').15 F 3.222(sp)-.55 G .722 +(ipeline are w)-3.222 F .722(aited for)-.1 F 5.722(.I)-.55 G(f)-5.722 E +F1(n)3.582 E F0(is)3.462 E 1.265(not gi)144 290.4 R -.15(ve)-.25 G 1.265 +(n, all currently acti).15 F 1.565 -.15(ve c)-.25 H 1.265 +(hild processes are w).15 F 1.265(aited for)-.1 F 3.765(,a)-.4 G 1.266 +(nd the return status is zero.)-3.765 F(If)6.266 E F1(n)4.126 E F0 .457 +(speci\214es a non-e)144 302.4 R .457 +(xistent process or job, the return status is 127.)-.15 F .457 +(Otherwise, the return status is the)5.457 F -.15(ex)144 314.4 S +(it status of the last process or job w).15 E(aited for)-.1 E(.)-.55 E +/F5 10.95/Times-Bold@0 SF(SEE ALSO)72 331.2 Q F0(bash\(1\), sh\(1\))108 +343.2 Q(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP +%%Trailer +end +%%EOF diff --git a/doc/fdl.texi b/doc/fdl.texi index 47ead9f..8805f1a 100644 --- a/doc/fdl.texi +++ b/doc/fdl.texi @@ -1,13 +1,12 @@ +@c The GNU Free Documentation License. +@center Version 1.3, 3 November 2008 -@node GNU Free Documentation License -@appendixsec GNU Free Documentation License - -@cindex FDL, GNU Free Documentation License -@center Version 1.2, November 2002 +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. @display -Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307, USA +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -112,6 +111,9 @@ formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a @@ -344,7 +346,7 @@ and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. -When the Document is included an aggregate, this License does not +When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. @@ -380,13 +382,30 @@ title. @item TERMINATION -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. @item FUTURE REVISIONS OF THIS LICENSE @@ -404,11 +423,46 @@ following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + @end enumerate @page -@appendixsubsec ADDENDUM: How to use this License for your documents +@heading ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and @@ -418,16 +472,16 @@ license notices just after the title page: @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 + under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. - A copy of the license is included in the section entitled ``GNU + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, -replace the ``with...Texts.'' line with this: +replace the ``with@dots{}Texts.'' line with this: @smallexample @group diff --git a/doc/fdl.txt b/doc/fdl.txt index daa2dd4..2f7e03c 100644 --- a/doc/fdl.txt +++ b/doc/fdl.txt @@ -1,13 +1,13 @@ - GNU Free Documentation License - Version 1.2, November 2002 + GNU Free Documentation License + Version 1.3, 3 November 2008 - Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other @@ -50,11 +50,11 @@ modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall subject -(or to related matters) and contains nothing that could fall directly -within that overall subject. (Thus, if the Document is in part a -textbook of mathematics, a Secondary Section may not explain any -mathematics.) The relationship could be a matter of historical +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. @@ -103,6 +103,9 @@ formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. +The "publisher" means any person or entity that distributes copies of +the Document to the public. + A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a @@ -118,14 +121,13 @@ License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. - 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough @@ -169,8 +171,9 @@ Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. 4. MODIFICATIONS @@ -285,16 +288,18 @@ Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. 7. AGGREGATION WITH INDEPENDENT WORKS @@ -304,7 +309,7 @@ and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. -When the Document is included an aggregate, this License does not +When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. @@ -340,21 +345,38 @@ title. 9. TERMINATION -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. See +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. @@ -364,7 +386,39 @@ following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +11. RELICENSING + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. ADDENDUM: How to use this License for your documents @@ -375,7 +429,7 @@ license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 + under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU diff --git a/doc/rbash.0 b/doc/rbash.0 new file mode 100644 index 0000000..eb06220 --- /dev/null +++ b/doc/rbash.0 @@ -0,0 +1,59 @@ +RBASH(1) RBASH(1) + + + +NNAAMMEE + rbash - restricted bash, see bbaasshh(1) + +RREESSTTRRIICCTTEEDD SSHHEELLLL + If bbaasshh is started with the name rrbbaasshh, or the --rr option is supplied at + invocation, the shell becomes restricted. A restricted shell is used + to set up an environment more controlled than the standard shell. It + behaves identically to bbaasshh with the exception that the following are + disallowed or not performed: + + +o changing directories with ccdd + + +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, EENNVV, or BBAASSHH__EENNVV + + +o specifying command names containing // + + +o specifying a file name containing a // as an argument to the .. + builtin command + + +o Specifying a filename containing a slash as an argument to the + --pp option to the hhaasshh builtin command + + +o importing function definitions from the shell environment at + startup + + +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at + startup + + +o redirecting output using the >, >|, <>, >&, &>, and >> redirect- + ion operators + + +o using the eexxeecc builtin command to replace the shell with another + command + + +o adding or deleting builtin commands with the --ff and --dd options + to the eennaabbllee builtin command + + +o Using the eennaabbllee builtin command to enable disabled shell + builtins + + +o specifying the --pp option to the ccoommmmaanndd builtin command + + +o turning off restricted mode with sseett ++rr or sseett ++oo rreessttrriicctteedd. + + These restrictions are enforced after any startup files are read. + + When a command that is found to be a shell script is executed, rrbbaasshh + turns off any restrictions in the shell spawned to execute the script. + +SSEEEE AALLSSOO + bash(1) + + + +GNU Bash-4.0 2004 Apr 20 RBASH(1) diff --git a/doc/rbash.1 b/doc/rbash.1 index c148abf..56e38fd 100644 --- a/doc/rbash.1 +++ b/doc/rbash.1 @@ -1,4 +1,4 @@ -.TH RBASH 1 "2004 Apr 20" "GNU Bash-3.0" +.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.0" .SH NAME rbash \- restricted bash, see \fBbash\fR(1) .SH RESTRICTED SHELL diff --git a/doc/rbash.ps b/doc/rbash.ps new file mode 100644 index 0000000..518087d --- /dev/null +++ b/doc/rbash.ps @@ -0,0 +1,280 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Wed Dec 30 13:07:37 2009 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 1 +%%PageOrder: Ascend +%%DocumentMedia: Default 595 842 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron +/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O +/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y +/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(RB)72 48 Q 376.2(ASH\(1\) RB)-.35 F(ASH\(1\)) +-.35 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0 +(rbash \255 restricted bash, see)108 96 Q/F2 10/Times-Bold@0 SF(bash)2.5 +E F0(\(1\))A F1(RESTRICTED SHELL)72 112.8 Q F0(If)108 124.8 Q F2(bash) +4.397 E F0 1.897(is started with the name)4.397 F F2(rbash)4.397 E F0 +4.397(,o)C 4.397(rt)-4.397 G(he)-4.397 E F2<ad72>4.397 E F0 1.896 +(option is supplied at in)4.397 F -.2(vo)-.4 G 1.896 +(cation, the shell becomes).2 F 3.445(restricted. A)108 136.8 R .945 +(restricted shell is used to set up an en)3.445 F .946 +(vironment more controlled than the standard shell.)-.4 F(It)5.946 E +(beha)108 148.8 Q -.15(ve)-.2 G 2.5(si).15 G(dentically to)-2.5 E F2 +(bash)2.5 E F0(with the e)2.5 E(xception that the follo)-.15 E +(wing are disallo)-.25 E(wed or not performed:)-.25 E 32.5<8363>108 +165.6 S(hanging directories with)-32.5 E F2(cd)2.5 E F0 32.5<8373>108 +182.4 S(etting or unsetting the v)-32.5 E(alues of)-.25 E/F3 9 +/Times-Bold@0 SF(SHELL)2.5 E/F4 9/Times-Roman@0 SF(,)A F3 -.666(PA)2.25 +G(TH)-.189 E F4(,)A F3(ENV)2.25 E F4(,)A F0(or)2.25 E F3 -.27(BA)2.5 G +(SH_ENV).27 E F0 32.5<8373>108 199.2 S +(pecifying command names containing)-32.5 E F2(/)2.5 E F0 32.5<8373>108 +216 S(pecifying a \214le name containing a)-32.5 E F2(/)2.5 E F0 +(as an ar)2.5 E(gument to the)-.18 E F2(.)2.5 E F0 -.2(bu)5 G +(iltin command).2 E 32.5<8353>108 232.8 S .351 +(pecifying a \214lename containing a slash as an ar)-32.5 F .351 +(gument to the)-.18 F F2<ad70>2.851 E F0 .351(option to the)2.851 F F2 +(hash)2.851 E F0 -.2(bu)2.851 G .351(iltin com-).2 F(mand)144 244.8 Q +32.5<8369>108 261.6 S(mporting function de\214nitions from the shell en) +-32.5 E(vironment at startup)-.4 E 32.5<8370>108 278.4 S(arsing the v) +-32.5 E(alue of)-.25 E F3(SHELLOPTS)2.5 E F0(from the shell en)2.25 E +(vironment at startup)-.4 E 32.5<8372>108 295.2 S(edirecting output usi\ +ng the >, >|, <>, >&, &>, and >> redirection operators)-32.5 E 32.5 +<8375>108 312 S(sing the)-32.5 E F2(exec)2.5 E F0 -.2(bu)2.5 G +(iltin command to replace the shell with another command).2 E 32.5<8361> +108 328.8 S(dding or deleting b)-32.5 E(uiltin commands with the)-.2 E +F2<ad66>2.5 E F0(and)2.5 E F2<ad64>2.5 E F0(options to the)2.5 E F2 +(enable)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8355>108 345.6 S +(sing the)-32.5 E F2(enable)2.5 E F0 -.2(bu)2.5 G +(iltin command to enable disabled shell b).2 E(uiltins)-.2 E 32.5<8373> +108 362.4 S(pecifying the)-32.5 E F2<ad70>2.5 E F0(option to the)2.5 E +F2(command)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8374>108 379.2 +S(urning of)-32.5 E 2.5(fr)-.25 G(estricted mode with)-2.5 E F2(set +r) +2.5 E F0(or)2.5 E F2(set +o r)2.5 E(estricted)-.18 E F0(.)A +(These restrictions are enforced after an)108 396 Q 2.5(ys)-.15 G +(tartup \214les are read.)-2.5 E .429 +(When a command that is found to be a shell script is e)108 412.8 R -.15 +(xe)-.15 G(cuted,).15 E F2(rbash)2.929 E F0 .429(turns of)2.929 F 2.929 +(fa)-.25 G .729 -.15(ny r)-2.929 H .429(estrictions in the shell).15 F +(spa)108 424.8 Q(wned to e)-.15 E -.15(xe)-.15 G(cute the script.).15 E +F1(SEE ALSO)72 441.6 Q F0(bash\(1\))108 453.6 Q(GNU Bash-4.0)72 768 Q +(2004 Apr 20)148.735 E(1)203.725 E 0 Cg EP +%%Trailer +end +%%EOF diff --git a/doc/texinfo.tex b/doc/texinfo.tex index 555a077..03c2998 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3,15 +3,16 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2003-02-03.16} +\def\texinfoversion{2009-01-18.17} % -% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, -% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008, 2009 Free Software Foundation, Inc. % -% This texinfo.tex file is free software; you can redistribute it and/or +% This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as -% published by the Free Software Foundation; either version 2, or (at -% your option) any later version. +% published by the Free Software Foundation, either version 3 of the +% License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty @@ -19,27 +20,20 @@ % General Public License for more details. % % You should have received a copy of the GNU General Public License -% along with this texinfo.tex file; see the file COPYING. If not, write -% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -% Boston, MA 02111-1307, USA. +% along with this program. If not, see <http://www.gnu.org/licenses/>. % -% In other words, you are welcome to use, share and improve this program. -% You are forbidden to forbid anyone else to use, share and improve -% what you give them. Help stamp out software-hoarding! +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex -% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % ftp://tug.org/tex/texinfo.tex -% (and all CTAN mirrors, see http://www.ctan.org), -% and /home/gd/gnu/doc/texinfo.tex on the GNU machines. -% -% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. -% -% The texinfo.tex in any given Texinfo distribution could well be out +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. -% +% % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. @@ -55,10 +49,13 @@ % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. -% +% % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + \message{Loading texinfo [version \texinfoversion]:} @@ -68,14 +65,14 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} -\message{Basics,} + \chardef\other=12 -% We never want plain's outer \+ definition in Texinfo. +% We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax -% Save some parts of plain tex whose names we will redefine. +% Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c @@ -85,20 +82,39 @@ \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! +\let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexrbrace=\} +\let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t +\let\ptextop=\top +{\catcode`\'=\active +\global\let\ptexquoteright'}% Math-mode def from plain.tex. +\let\ptexraggedright=\raggedright % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi @@ -137,42 +153,83 @@ \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi -\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi -% In some macros, we cannot use the `\? notation---the left quote is -% in some cases the escape char. +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. \chardef\colonChar = `\: \chardef\commaChar = `\, +\chardef\dashChar = `\- \chardef\dotChar = `\. -\chardef\equalChar = `\= \chardef\exclamChar= `\! +\chardef\lquoteChar= `\` \chardef\questChar = `\? +\chardef\rquoteChar= `\' \chardef\semiChar = `\; -\chardef\spaceChar = `\ % \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} -% True if #1 is the empty string, i.e., called like `\ifempty{}'. -% -\def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}% -\def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}% +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. -\hyphenation{ap-pen-dix} -\hyphenation{mini-buf-fer mini-buf-fers} -\hyphenation{eshell} -\hyphenation{white-space} +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make @@ -197,12 +254,12 @@ \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex - \errorcontextlines\maxdimen + \errorcontextlines16 }% % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. -% +% \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount @@ -224,6 +281,50 @@ \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 + \noexpand\or \the\toks4 \the\toks6 + \noexpand\else \the\toks8 + }% +} +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} @@ -241,7 +342,9 @@ % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% @@ -249,13 +352,17 @@ % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % - \escapechar = `\\ % use backslash in output files. \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if - % the page break happens to be in the middle of an example. + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. - \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize @@ -280,9 +387,9 @@ \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. - % (We lessened \vsize for it in \oddfootingxxx.) + % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. - \vskip 2\baselineskip + \vskip 24pt \unvbox\footlinebox \fi % @@ -303,7 +410,7 @@ \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox - }% end of group with \normalturnoffactive + }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } @@ -316,7 +423,7 @@ % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi -\dimen@=\dp#1 \unvbox#1 +\dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } @@ -336,132 +443,161 @@ % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % -\def\parsearg#1{% - \let\next = #1% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% \begingroup \obeylines - \futurelet\temp\parseargx -} - -% If the next token is an obeyed space (from an @example environment or -% the like), remove it and recurse. Otherwise, we're done. -\def\parseargx{% - % \obeyedspace is defined far below, after the definition of \sepspaces. - \ifx\obeyedspace\temp - \expandafter\parseargdiscardspace - \else - \expandafter\parseargline - \fi + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. } -% Remove a single space (as the delimiter token to the macro call). -{\obeyspaces % - \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} - {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. - % - % First remove any @c comment, then any @comment. - % Result of each macro is put in \toks0. - \argremovec #1\c\relax % - \expandafter\argremovecomment \the\toks0 \comment\relax % - % - % Call the caller's macro, saved as \next in \parsearg. - \expandafter\next\expandafter{\the\toks0}% + \argremovecomment #1\comment\ArgTerm% }% } -% Since all \c{,omment} does is throw away the argument, we can let TeX -% do that for us. The \relax here is matched by the \relax in the call -% in \parseargline; it could be more or less anything, its purpose is -% just to delimit the argument to the \c. -\def\argremovec#1\c#2\relax{\toks0 = {#1}} -\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} -% \argremovec{,omment} might leave us with trailing spaces, though; e.g., +% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., % @end itemize @c foo -% will have two active spaces as part of the argument with the -% `itemize'. Here we remove all active spaces from #1, and assign the -% result to \toks0. -% -% This loses if there are any *other* active characters besides spaces -% in the argument -- _ ^ +, for example -- since they get expanded. -% Fortunately, Texinfo does not define any such commands. (If it ever -% does, the catcode of the characters in questionwill have to be changed -% here.) But this means we cannot call \removeactivespaces as part of -% \argremovec{,omment}, since @c uses \parsearg, and thus the argument -% that \parsearg gets might well have any character at all in it. -% -\def\removeactivespaces#1{% - \begingroup - \ignoreactivespaces - \edef\temp{#1}% - \global\toks0 = \expandafter{\temp}% - \endgroup +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm } -% Change the active space to expand to nothing. +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarly, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. % -\begingroup +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ \obeyspaces - \gdef\ignoreactivespaces{\obeyspaces\let =\empty} -\endgroup + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} -%% These are used to keep @begin/@end levels from running away -%% Call \inENV within environments (after a \begingroup) -\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} -\def\ENVcheck{% -\ifENV\errmessage{Still within an environment; press RETURN to continue} -\endgroup\fi} % This is not perfect, but it should reduce lossage +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as environments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) -% @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Press RETURN to continue.} -\outer\def\begin{\parsearg\beginxxx} +% At run-time, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty -\def\beginxxx #1{% -\expandafter\ifx\csname #1\endcsname\relax -{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else -\csname #1\endcsname\fi} +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} -% @end foo executes the definition of \Efoo. -% -\def\end{\parsearg\endxxx} -\def\endxxx #1{% - \removeactivespaces{#1}% - \edef\endthing{\the\toks0}% - % - \expandafter\ifx\csname E\endthing\endcsname\relax - \expandafter\ifx\csname \endthing\endcsname\relax - % There's no \foo, i.e., no ``environment'' foo. - \errhelp = \EMsimple - \errmessage{Undefined command `@end \endthing'}% - \else - \unmatchedenderror\endthing - \fi +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp \else - % Everything's ok; the right environment has been started. - \csname E\endthing\endcsname + \badenverr \fi } -% There is an environment #1, but it hasn't been started. Give an error. -% -\def\unmatchedenderror#1{% +% Environment mismatch, #1 expected: +\def\badenverr{% \errhelp = \EMsimple - \errmessage{This `@end #1' doesn't have a matching `@#1'}% + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi } -% Define the control sequence \E#1 to give an unmatched @end error. +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv % -\def\defineunmatchedend#1{% - \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi } +\newhelp\EMsimple{Press RETURN to continue.} + %% Simple single-character @ commands @@ -483,7 +619,7 @@ \let\}=\myrbrace \begingroup % Definitions to produce \{ and \} commands for indices, - % and @{ and @} for the aux file. + % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other @@ -493,6 +629,9 @@ !gdef!rbraceatcmd[@}]% !endgroup +% @comma{} to avoid , parsing problems. +\let\comma = , + % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \c @@ -502,22 +641,43 @@ \let\ubaraccent = \b \let\udotaccent = \d -% Other special characters: @questiondown @exclamdown +% Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% - \ifx\temp\imacro \ptexi - \else\ifx\temp\jmacro \j + \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi + \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and @@ -536,14 +696,32 @@ % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} +% @/ allows a line break. +\let\/=\allowbreak + % @. is an end-of-sentence period. -\def\.{.\spacefactor=3000 } +\def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. -\def\!{!\spacefactor=3000 } +\def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. -\def\?{?\spacefactor=3000 } +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% + \fi\fi +} % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would @@ -564,63 +742,18 @@ % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). -% +% \newbox\groupbox \def\vfilllimit{0.7} % -\def\group{\begingroup - \ifnum\catcode13=\active \else +\envdef\group{% + \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi - % - % The \vtop we start below produces a box with normal height and large - % depth; thus, TeX puts \baselineskip glue before it, and (when the - % next line of text is done) \lineskip glue after it. (See p.82 of - % the TeXbook.) Thus, space below is not quite equal to space - % above. But it's pretty close. - \def\Egroup{% - \egroup % End the \vtop. - % \dimen0 is the vertical size of the group's box. - \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox - % \dimen2 is how much space is left on the page (more or less). - \dimen2 = \pageheight \advance\dimen2 by -\pagetotal - % if the group doesn't fit on the current page, and it's a big big - % group, force a page break. - \ifdim \dimen0 > \dimen2 - \ifdim \pagetotal < \vfilllimit\pageheight - \page - \fi - \fi - \copy\groupbox - \endgroup % End the \group. - }% + \startsavinginserts % \setbox\groupbox = \vtop\bgroup - % We have to put a strut on the last line in case the @group is in - % the midst of an example, rather than completely enclosing it. - % Otherwise, the interline space between the last line of the group - % and the first line afterwards is too small. But we can't put the - % strut in \Egroup, since there it would be on a line by itself. - % Hence this just inserts a strut at the beginning of each line. - \everypar = {\strut}% - % - % Since we have a strut on every line, we don't need any of TeX's - % normal interline spacing. - \offinterlineskip - % - % OK, but now we have to do something about blank - % lines in the input in @example-like environments, which normally - % just turn into \lisppar, which will insert no space now that we've - % turned off the interline space. Simplest is to make them be an - % empty paragraph. - \ifx\par\lisppar - \edef\par{\leavevmode \par}% - % - % Reset ^^M's definition to new definition of \par. - \obeylines - \fi - % % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after @@ -630,6 +763,32 @@ \comment } % +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % @@ -642,10 +801,8 @@ where each line of input produces a line of output.} \newdimen\mil \mil=0.001in -\def\need{\parsearg\needx} - % Old definition--didn't work. -%\def\needx #1{\par % +%\parseargdef\need{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% @@ -653,7 +810,7 @@ where each line of input produces a line of output.} %\prevdepth=-1000pt %}} -\def\needx#1{% +\parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par @@ -692,37 +849,11 @@ where each line of input produces a line of output.} \fi } -% @br forces paragraph break +% @br forces paragraph break (and is undocumented). \let\br = \par -% @dots{} output an ellipsis using the current font. -% We do .5em per period so that it has the same spacing in a typewriter -% font as three actual period characters. -% -\def\dots{% - \leavevmode - \hbox to 1.5em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% -} - -% @enddots{} is an end-of-sentence ellipsis. -% -\def\enddots{% - \leavevmode - \hbox to 2em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% - \spacefactor=3000 -} - - -% @page forces the start of a new page +% @page forces the start of a new page. % \def\page{\par\vfill\supereject} @@ -734,13 +865,11 @@ where each line of input produces a line of output.} \newskip\exdentamount % This defn is used inside fill environments such as @defun. -\def\exdent{\parsearg\exdentyyy} -\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. -\def\nofillexdent{\parsearg\nofillexdentyyy} -\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount -\leftline{\hskip\leftskip{\rm#1}}}} +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion @@ -771,10 +900,10 @@ where each line of input produces a line of output.} % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). -% +% \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. - \setbox0 = \hbox{\ignorespaces #2}% + \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% @@ -791,9 +920,25 @@ where each line of input produces a line of output.} \temp } -% @include file insert text of that file as input. -% Allow normal characters that we make active in the argument (a file name). -\def\include{\begingroup +% @include FILE -- \input text of FILE. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable % we want to expand any @value in FILE. + \turnoffactive % and allow special characters in the expansion + \indexnofonts % Allow `@@' and other weird things in file names. + \edef\temp{\noexpand\input #1 }% + % + % This trickery is to read FILE outside of a group, in case it makes + % definitions, etc. + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other @@ -802,33 +947,52 @@ where each line of input produces a line of output.} \catcode`<=\other \catcode`>=\other \catcode`+=\other - \parsearg\includezzz} -% Restore active chars for included file. -\def\includezzz#1{\endgroup\begingroup - % Read the included file in a group so nested @include's work. - \def\thisfile{#1}% - \let\value=\expandablevalue - \input\thisfile -\endgroup} + \catcode`-=\other + \catcode`\`=\other + \catcode`\'=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} \def\thisfile{} % @center line % outputs that line, centered. % -\def\center{\parsearg\docenter} -\def\docenter#1{{% - \ifhmode \hfil\break \fi - \advance\hsize by -\leftskip - \advance\hsize by -\rightskip - \line{\hfil \ignorespaces#1\unskip \hfil}% - \ifhmode \break \fi -}} +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space -\def\sp{\parsearg\spxxx} -\def\spxxx #1{\vskip #1\baselineskip} +\parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment @@ -843,13 +1007,13 @@ where each line of input produces a line of output.} % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. -% We cannot implement @paragraphindent asis, though. -% +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % -\def\paragraphindent{\parsearg\doparagraphindent} -\def\doparagraphindent#1{% +\parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -866,8 +1030,7 @@ where each line of input produces a line of output.} % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. -\def\exampleindent{\parsearg\doexampleindent} -\def\doexampleindent#1{% +\parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -879,64 +1042,161 @@ where each line of input produces a line of output.} \fi } +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. -% We don't use $'s directly in the definition of \math because we need -% to set catcodes according to plain TeX first, to allow for subscripts, -% superscripts, special math chars, etc. -% -\let\implicitmath = $%$ font-lock fix % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make -% _ within @math be active (mathcode "8000), and distinguish by seeing -% if the current family is \slfam, which is what @var uses. -% -{\catcode\underChar = \active -\gdef\mathunderscore{% - \catcode\underChar=\active - \def_{\ifnum\fam=\slfam \_\else\sb\fi}% -}} -% +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} % Another complication: we want \\ (and @\) to output a \ character. % FYI, plain.tex uses \\ as a temporary control sequence (why?), but % this is not advertised and we don't care. Texinfo does not % otherwise define @\. -% +% % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex - \mathcode`\_="8000 \mathunderscore + \mathunderscore \let\\ = \mathbackslash \mathactive - \implicitmath\finishmath} -\def\finishmath#1{#1\implicitmath\Etex} + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. -% We have to reset their definitions in case the @math was an -% argument to a command which set the catcodes (such as @item or @section). -% +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active + \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus + \let' = \ptexquoteright } } -% @bullet and @minus need the same treatment as @math, just above. -\def\bullet{\implicitmath\ptexbullet\implicitmath} -\def\minus{\implicitmath-\implicitmath} +% Some math mode symbols. +\def\bullet{$\ptexbullet$} +\def\geq{\ifmmode \ge\else $\ge$\fi} +\def\leq{\ifmmode \le\else $\le$\fi} +\def\minus{\ifmmode -\else $-$\fi} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma = , % @refill is a no-op. \let\refill=\relax @@ -952,20 +1212,20 @@ where each line of input produces a line of output.} % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks - \readauxfile + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. - % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf - \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi - \closein1 - \temp + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 % \comment % Ignore the actual filename. } @@ -1001,119 +1261,297 @@ where each line of input produces a line of output.} \newif\ifpdf \newif\ifpdfmakepagedest +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. \ifx\pdfoutput\undefined - \pdffalse - \let\pdfmkdest = \gobble - \let\pdfurl = \gobble - \let\endlink = \relax - \let\linkcolor = \relax - \let\pdfmakeoutlines = \relax \else - \pdftrue - \pdfoutput = 1 - \input pdfcolor + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html +% (and related messages, the final outcome is that it is up to the TeX +% user to double the backslashes and otherwise make the string valid, so +% that's what we do). + +% double active backslashes. +% +{\catcode`\@=0 \catcode`\\=\active + @gdef@activebackslashdouble{% + @catcode`@\=@active + @let\=@doublebackslash} +} + +% To handle parens, we must adopt a different approach, since parens are +% not active characters. hyperref.dtx (which has the same problem as +% us) handles it with this amazing macro to replace tokens, with minor +% changes for Texinfo. It is included here under the GPL by permission +% from the author, Heiko Oberdiek. +% +% #1 is the tokens to replace. +% #2 is the replacement. +% #3 is the control sequence with the string. +% +\def\HyPsdSubst#1#2#3{% + \def\HyPsdReplace##1#1##2\END{% + ##1% + \ifx\\##2\\% + \else + #2% + \HyReturnAfterFi{% + \HyPsdReplace##2\END + }% + \fi + }% + \xdef#3{\expandafter\HyPsdReplace#3#1\END}% +} +\long\def\HyReturnAfterFi#1\fi{\fi#1} + +% #1 is a control sequence in which to do the replacements. +\def\backslashparens#1{% + \xdef#1{#1}% redefine it as its expansion; the definition is simply + % \lastnode when called from \setref -> \pdfmkdest. + \HyPsdSubst{(}{\realbackslash(}{#1}% + \HyPsdSubst{)}{\realbackslash)}{#1}% +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + % + % Color manipulation macros based on pdfcolor.tex. + \def\cmykDarkRed{0.28 1 1 0.35} + \def\cmykBlack{0 0 0 1} + % + % k sets the color for filling (usual text, etc.); + % K sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 k #1 K}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\cmykBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% - \def\imagewidth{#2}% - \def\imageheight{#3}% - % without \immediate, pdftex seg faults when the same image is + \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .png, .jpg, .pdf (among + % others). Let's try in that order. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{PDF}% + \fi + \else \gdef\pdfimgext{pdf}% + \fi + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \closein 1 + \endgroup + % + % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi - \ifx\empty\imagewidth\else width \imagewidth \fi - \ifx\empty\imageheight\else height \imageheight \fi + \ifdim \wd0 >0pt width \imagewidth \fi + \ifdim \wd2 >0pt height \imageheight \fi \ifnum\pdftexversion<13 - #1.pdf% + #1.\pdfimgext \else - {#1.pdf}% + {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} - \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \activebackslashdouble + \makevalueexpandable + \def\pdfdestname{#1}% + \backslashparens\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} - \let\linkcolor = \Blue % was Cyan, but that seems light? - \def\endlink{\Black\pdfendlink} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + \def\urlcolor{\cmykDarkRed} + \def\linkcolor{\cmykDarkRed} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax - \advance\tempnum by1 + \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} - \def\pdfmakeoutlines{{% - \openin 1 \jobname.toc - \ifeof 1\else\begingroup - \closein 1 - % Thanh's hack / proper braces in bookmarks + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + % Doubled backslashes in the name. + {\activebackslashdouble \xdef\pdfoutlinedest{#3}% + \backslashparens\pdfoutlinedest}% + \fi + % + % Also double the backslashes in the display string. + {\activebackslashdouble \xdef\pdfoutlinetext{#1}% + \backslashparens\pdfoutlinetext}% + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % - \def\chapentry ##1##2##3{} - \def\secentry ##1##2##3##4{\advancenumber{chap##2}} - \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} - \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} - \let\appendixentry = \chapentry - \let\unnumbchapentry = \chapentry - \let\unnumbsecentry = \secentry - \let\unnumbsubsecentry = \subsecentry - \let\unnumbsubsubsecentry = \subsubsecentry - \input \jobname.toc - \def\chapentry ##1##2##3{% - \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} - \def\secentry ##1##2##3##4{% - \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} - \def\subsecentry ##1##2##3##4##5{% - \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} - \def\subsubsecentry ##1##2##3##4##5##6{% - \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} - \let\appendixentry = \chapentry - \let\unnumbchapentry = \chapentry - \let\unnumbsecentry = \secentry - \let\unnumbsubsecentry = \subsecentry - \let\unnumbsubsubsecentry = \subsubsecentry + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% % - % Make special characters normal for writing to the pdf file. - % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. \indexnofonts - \let\tt=\relax - \turnoffactive - \input \jobname.toc - \endgroup\fi - }} - \def\makelinks #1,{% - \def\params{#1}\def\E{END}% - \ifx\params\E - \let\nextmakelinks=\relax - \else - \let\nextmakelinks=\makelinks - \ifnum\lnkcount>0,\fi - \picknum{#1}% - \startlink attr{/Border [0 0 0]} - goto name{\pdfmkpgn{\the\pgn}}% - \linkcolor #1% - \advance\lnkcount by 1% - \endlink - \fi - \nextmakelinks - } - \def\picknum#1{\expandafter\pn#1} - \def\pn#1{% - \def\p{#1}% - \ifx\p\lbrace - \let\nextpn=\ppn - \else - \let\nextpn=\ppnn - \def\first{#1} - \fi - \nextpn + \setupdatafile + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup } - \def\ppn#1{\pgn=#1\gobble} - \def\ppnn{\pgn=\first} - \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces @@ -1128,25 +1566,36 @@ where each line of input produces a line of output.} \else \let \startlink \pdfstartlink \fi + % make a live url in pdf output. \def\pdfurl#1{% \begingroup - \normalturnoffactive\def\@{@}% - \let\value=\expandablevalue - \leavevmode\Red + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% - % #1 \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS| + \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else @@ -1160,22 +1609,53 @@ where each line of input produces a line of output.} {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} - \linkcolor #1\endlink} + \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\fi % \ifx\pdfoutput +\else + % non-pdf mode + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput \message{fonts,} -% Font-change commands. + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Unfortunately, we have to override this for titles and the like, since +% in those cases "rm" is bold. Sigh. +\def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf analogous to plain's \rm, etc. +% So we set up a \sf. \newfam\sffam -\def\sf{\fam=\sffam \tensf} +\def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. -% We don't need math for this one. -\def\ttsl{\tenttsl} +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + % Default leading. \newdimen\textleading \textleading = 13.2pt @@ -1188,8 +1668,12 @@ where each line of input produces a line of output.} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% \def\setleading#1{% - \normalbaselineskip = #1\relax + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% @@ -1198,10 +1682,279 @@ where each line of input produces a line of output.} }% } +% PDF CMaps. See also LaTeX's t1.cmap. +% +% do nothing with this by default. +\expandafter\let\csname cmapOT1\endcsname\gobble +\expandafter\let\csname cmapOT1IT\endcsname\gobble +\expandafter\let\csname cmapOT1TT\endcsname\gobble + +% if we are producing pdf, and we have \pdffontattr, then define cmaps. +% (\pdffontattr was introduced many years ago, but people still run +% older pdftex's; it's easy to conditionalize, so we do.) +\ifpdf \ifx\pdffontattr\undefined \else + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\fi\fi + + % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). -% #3 is the font's design size, #4 is a scale factor -\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass +% empty to omit). +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% emacs-page end of cmaps % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix @@ -1226,110 +1979,293 @@ where each line of input produces a line of output.} \def\scshape{csc} \def\scbshape{csc} -\newcount\mainmagstep -\ifx\bigger\relax - % not really supported. - \mainmagstep=\magstep1 - \setfont\textrm\rmshape{12}{1000} - \setfont\texttt\ttshape{12}{1000} -\else - \mainmagstep=\magstephalf - \setfont\textrm\rmshape{10}{\mainmagstep} - \setfont\texttt\ttshape{10}{\mainmagstep} -\fi -% Instead of cmb10, you may want to use cmbx10. -% cmbx10 is a prettier font on its own, but cmb10 -% looks better when embedded in a line with cmr10 -% (in Bob's opinion). -\setfont\textbf\bfshape{10}{\mainmagstep} -\setfont\textit\itshape{10}{\mainmagstep} -\setfont\textsl\slshape{10}{\mainmagstep} -\setfont\textsf\sfshape{10}{\mainmagstep} -\setfont\textsc\scshape{10}{\mainmagstep} -\setfont\textttsl\ttslshape{10}{\mainmagstep} +% Definitions for a main text size of 11pt. This is the default in +% Texinfo. +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} -% A few fonts for @defun, etc. -\setfont\defbf\bxshape{10}{\magstep1} %was 1314 -\setfont\deftt\ttshape{10}{\magstep1} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). -\setfont\smallrm\rmshape{9}{1000} -\setfont\smalltt\ttshape{9}{1000} -\setfont\smallbf\bfshape{10}{900} -\setfont\smallit\itshape{9}{1000} -\setfont\smallsl\slshape{9}{1000} -\setfont\smallsf\sfshape{9}{1000} -\setfont\smallsc\scshape{10}{900} -\setfont\smallttsl\ttslshape{10}{900} +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 +\def\smallecsize{0900} % Fonts for small examples (8pt). -\setfont\smallerrm\rmshape{8}{1000} -\setfont\smallertt\ttshape{8}{1000} -\setfont\smallerbf\bfshape{10}{800} -\setfont\smallerit\itshape{8}{1000} -\setfont\smallersl\slshape{8}{1000} -\setfont\smallersf\sfshape{8}{1000} -\setfont\smallersc\scshape{10}{800} -\setfont\smallerttsl\ttslshape{10}{800} +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 - -% Fonts for title page: -\setfont\titlerm\rmbshape{12}{\magstep3} -\setfont\titleit\itbshape{10}{\magstep4} -\setfont\titlesl\slbshape{10}{\magstep4} -\setfont\titlett\ttbshape{12}{\magstep3} -\setfont\titlettsl\ttslshape{10}{\magstep4} -\setfont\titlesf\sfbshape{17}{\magstep1} +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm -\setfont\titlesc\scbshape{10}{\magstep4} +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 -\def\authorrm{\secrm} -\def\authortt{\sectt} +\def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). -\setfont\chaprm\rmbshape{12}{\magstep2} -\setfont\chapit\itbshape{10}{\magstep3} -\setfont\chapsl\slbshape{10}{\magstep3} -\setfont\chaptt\ttbshape{12}{\magstep2} -\setfont\chapttsl\ttslshape{10}{\magstep3} -\setfont\chapsf\sfbshape{17}{1000} +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm -\setfont\chapsc\scbshape{10}{\magstep3} +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} % Section fonts (14.4pt). -\setfont\secrm\rmbshape{12}{\magstep1} -\setfont\secit\itbshape{10}{\magstep2} -\setfont\secsl\slbshape{10}{\magstep2} -\setfont\sectt\ttbshape{12}{\magstep1} -\setfont\secttsl\ttslshape{10}{\magstep2} -\setfont\secsf\sfbshape{12}{\magstep1} +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm -\setfont\secsc\scbshape{10}{\magstep2} +\setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} % Subsection fonts (13.15pt). -\setfont\ssecrm\rmbshape{12}{\magstephalf} -\setfont\ssecit\itbshape{10}{1315} -\setfont\ssecsl\slbshape{10}{1315} -\setfont\ssectt\ttbshape{12}{\magstephalf} -\setfont\ssecttsl\ttslshape{10}{1315} -\setfont\ssecsf\sfbshape{12}{\magstephalf} +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{\magstep1} +\setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 -% The smallcaps and symbol fonts should actually be scaled \magstep1.5, -% but that is not a standard magnification. +\def\ssececsize{1200} + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +% reset the current fonts +\textfonts +\rm +} % end of 11pt text font size definitions + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +% reduce space between paragraphs +\divide\parskip by 2 + +% reset the current fonts +\textfonts +\rm +} % end of 10pt text font size definitions + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xword{10} +\def\xiword{11} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + \wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since @@ -1344,106 +2280,264 @@ where each line of input produces a line of output.} } % The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this so that font changes will continue to work -% in math mode, where it is the current \fam that is relevant in most -% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam -% \tenbf}, for example. By redefining \tenbf, we obviate the need to -% redefine \bf itself. +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{25pt}} -\def\titlefont#1{{\titlefonts\rm #1}} +\def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +% Define these just so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 -% If we use \smallerfonts (8pt), then we can fit this many characters: +% If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. -% +% % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 -% -% I wish we used A4 paper on this side of the Atlantic. -% % --karl, 24jan03. - % Set up the default fonts, so we can use them for creating boxes. % -\textfonts +\definetextfontsizexi -% Define these so they can be easily changed for other fonts. -\def\angleleft{$\langle$} -\def\angleright{$\rangle$} + +\message{markup,} + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will +% define and register \INITMACRO to be called on markup style changes. +% \INITMACRO can check \currentmarkupstyle for the innermost +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim + +\let\currentmarkupstyle\empty + +\def\setupmarkupstyle#1{% + \csname markup#1true\endcsname + \def\currentmarkupstyle{#1}% + \markupstylesetup +} + +\let\markupstylesetup\empty + +\def\defmarkupstylesetup#1{% + \expandafter\def\expandafter\markupstylesetup + \expandafter{\markupstylesetup #1}% + \def#1% +} + +% Markup style setup for left and right quotes. +\defmarkupstylesetup\markupsetuplq{% + \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuplqdefault \else \temp \fi +} + +\defmarkupstylesetup\markupsetuprq{% + \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuprqdefault \else \temp \fi +} + +{ +\catcode`\'=\active +\catcode`\`=\active + +\gdef\markupsetuplqdefault{\let`\lq} +\gdef\markupsetuprqdefault{\let'\rq} + +\gdef\markupsetcodequoteleft{\let`\codequoteleft} +\gdef\markupsetcodequoteright{\let'\codequoteright} + +\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} +} + +\let\markupsetuplqcode \markupsetcodequoteleft +\let\markupsetuprqcode \markupsetcodequoteright +\let\markupsetuplqexample \markupsetcodequoteleft +\let\markupsetuprqexample \markupsetcodequoteright +\let\markupsetuplqverb \markupsetcodequoteleft +\let\markupsetuprqverb \markupsetcodequoteright +\let\markupsetuplqverbatim \markupsetcodequoteleft +\let\markupsetuprqverbatim \markupsetcodequoteright + +\let\markupsetuplqsamp \markupsetnoligaturesquoteleft +\let\markupsetuplqkbd \markupsetnoligaturesquoteleft + +% Allow an option to not replace quotes with a regular directed right +% quote/apostrophe (char 0x27), but instead use the undirected quote +% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it +% the default, but it works for pasting with more pdf viewers (at least +% evince), the lilypond developers report. xpdf does work with the +% regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi + \else \char'22 \fi +} + +% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. +\def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 -% Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000} -\setfont\shortcontbf\bxshape{12}{1000} -\setfont\shortcontsl\slshape{12}{1000} -\setfont\shortconttt\ttshape{12}{1000} - %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. -\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% @cite is like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} + \let\i=\smartitalic -\let\var=\smartslanted +\let\slanted=\smartslanted +\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}} \let\dfn=\smartslanted \let\emph=\smartitalic -\let\cite=\smartslanted +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. @@ -1454,30 +2548,50 @@ where each line of input produces a line of output.} % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. -% +% \catcode`@=11 - \def\frenchspacing{% + \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other +\def\endofsentencespacefactor{3000}% default +% @t, explicit typewriter. \def\t#1{% - {\tt \rawbackslash \frenchspacing #1}% + {\tt \rawbackslash \plainfrenchspacing #1}% \null } -\let\ttfont=\t -\def\samp#1{`\tclose{#1}'\null} -\setfont\keyrm\rmshape{8}{1000} -\font\keysy=cmsy9 -\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% - \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% - \vbox{\hrule\kern-0.4pt - \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% - \kern-0.4pt\hrule}% - \kern-.06em\raise0.4pt\hbox{\angleright}}}} -% The old definition, with no lozenge: -%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} + +% @samp. +\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} + +% ctrl is no longer a Texinfo command. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. @@ -1501,13 +2615,13 @@ where each line of input produces a line of output.} \nohyphenation % \rawbackslash - \frenchspacing + \plainfrenchspacing #1% }% \null } -% We *must* turn on hyphenation at `-' and `_' in \code. +% We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. @@ -1517,18 +2631,23 @@ where each line of input produces a line of output.} % and arrange explicitly to hyphenate at a dash. % -- rms. { - \catcode`\-=\active - \catcode`\_=\active + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup - \catcode`\-=\active \let-\codedash - \catcode`\_=\active \let_\codeunder + \setupmarkupstyle{code}% + % The following should really be moved into \setupmarkupstyle handlers. + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\realdash + \let_\realunder + \fi \codex } - % - % If we end up with any active - characters when handling the index, - % just treat them as a normal -. - \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} @@ -1546,44 +2665,73 @@ where each line of input produces a line of output.} } \def\codex #1{\tclose{#1}\endgroup} +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is undesirable in +% some manuals, especially if they don't have long identifiers in +% general. @allowcodebreaks provides a way to control this. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg'}% + \fi\fi +} + % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. +\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). -\def\kbdinputstyle{\parsearg\kbdinputstylexxx} -\def\kbdinputstylexxx#1{% - \def\arg{#1}% - \ifx\arg\worddistinct +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% - \else\ifx\arg\wordexample + \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% - \else\ifx\arg\wordcode + \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple - \errmessage{Unknown @kbdinputstyle `\arg'}% + \errmessage{Unknown @kbdinputstyle option `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} -% Default is `distinct.' +% Default is `distinct'. \kbdinputstyle distinct \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% -\else{\tclose{\kbdfont\look}}\fi -\else{\tclose{\kbdfont\look}}\fi} +\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} -% For @url, @env, @command quotes seem unnecessary, so use \code. -\let\url=\code +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=\code \let\env=\code \let\command=\code +% @clicksequence{File @click{} Open ...} +\def\clicksequence#1{\begingroup #1\endgroup} + +% @clickstyle @arrow (by default) +\parseargdef\clickstyle{\def\click{#1}} +\def\click{\arrow} + % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url @@ -1612,9 +2760,13 @@ where each line of input produces a line of output.} \endlink \endgroup} +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. -% +% %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} @@ -1629,36 +2781,215 @@ where each line of input produces a line of output.} \let\email=\uref \fi -% Check if we are currently using a typewriter font. Since all the -% Computer Modern typewriter fonts have zero interword stretch (and -% shrink), and it is reasonable to expect all typewriter fonts to have -% this property, we can check that font parameter. -% -\def\ifmonospace{\ifdim\fontdimen3\font=0pt } - % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} -\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} - % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} -% Explicit font changes: @r, @sc, undocumented @ii. -\def\r#1{{\rm #1}} % roman font -\def\sc#1{{\smallcaps#1}} % smallcaps font -\def\ii#1{{\it #1}} % italic font +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} -% @acronym downcases the argument and prints in smallcaps. -\def\acronym#1{{\smallcaps \lowercase{#1}}} -% @pounds{} is a sterling sign. +\message{glyphs,} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, they should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% \def\pounds{{\it\$}} +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% Hacks for glyphs from the EC fonts similar to \euro. We don't +% use \let for the aliases, because sometimes we redefine the original +% macro, and the alias should reflect the redefinition. +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +% This positioning is not perfect (see the ogonek LaTeX package), but +% we have the precomposed glyphs for the most common cases. We put the +% tests to use those glyphs in the single \ogonek macro so we have fewer +% dummy definitions to worry about for index entries, etc. +% +% ogonek is also used with other letters in Lithuanian (IOU), but using +% the precomposed glyphs for those is not so easy since they aren't in +% the same EC font. +\def\ogonek#1{{% + \def\temp{#1}% + \ifx\temp\macrocharA\Aogonek + \else\ifx\temp\macrochara\aogonek + \else\ifx\temp\macrocharE\Eogonek + \else\ifx\temp\macrochare\eogonek + \else + \ecfont \setbox0=\hbox{#1}% + \ifdim\ht0=1ex\accent"0C #1% + \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% + \fi + \fi\fi\fi\fi + }% +} +\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} +\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} +\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} +\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} +% +\def\ecfont{% + % We can't distinguish serif/sans and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \thisecfont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + \message{page headings,} @@ -1677,87 +3008,100 @@ where each line of input produces a line of output.} \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue -\def\shorttitlepage{\parsearg\shorttitlepagezzz} -\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} -\def\titlepage{\begingroup \parindent=0pt \textfonts - \let\subtitlerm=\tenrm - \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% - % - \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines - \let\tt=\authortt}% - % - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - \def\titlezzz##1{\leftline{\titlefonts\rm ##1} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Now you can put text using @subtitle. - \def\subtitle{\parsearg\subtitlezzz}% - \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% - % - % @author should come last, but may come many times. - \def\author{\parsearg\authorzzz}% - \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi - {\authorfont \leftline{##1}}}% - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% \iffinishedtitlepage\else - \finishtitlepage + \finishtitlepage \fi - \oldpage \let\page = \oldpage - \hbox{}}% -% \def\page{\oldpage \hbox{}} + \page + \null + }% } \def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - % - % Need this before the \...aftertitlepage checks so that if they are - % in effect the toc pages will come out with page numbers. - \HEADINGSon - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi } \def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rmisbold #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\secfonts\rmisbold \leftline{#1}}% + \fi } + %%% Set up page headings and footings. \let\thispage=\folio @@ -1767,7 +3111,7 @@ where each line of input produces a line of output.} \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages -% Now make Tex use those variables +% Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline @@ -1781,43 +3125,64 @@ where each line of input produces a line of output.} % @evenfooting @thisfile|| % @oddfooting ||@thisfile -\def\evenheading{\parsearg\evenheadingxxx} -\def\oddheading{\parsearg\oddheadingxxx} -\def\everyheading{\parsearg\everyheadingxxx} -\def\evenfooting{\parsearg\evenfootingxxx} -\def\oddfooting{\parsearg\oddfootingxxx} -\def\everyfooting{\parsearg\everyfootingxxx} - -{\catcode`\@=0 % - -\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} -\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} -\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% -\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} -\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} -\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. - \global\advance\pageheight by -\baselineskip - \global\advance\vsize by -\baselineskip + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt } -\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: % -}% unbind the catcode of @. +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. @@ -1831,7 +3196,7 @@ where each line of input produces a line of output.} \def\headings #1 {\csname HEADINGS#1\endcsname} -\def\HEADINGSoff{ +\def\HEADINGSoff{% \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff @@ -1840,7 +3205,7 @@ where each line of input produces a line of output.} % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. -\def\HEADINGSdouble{ +\def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1852,7 +3217,7 @@ where each line of input produces a line of output.} % For single-sided printing, chapter title goes across top left of page, % page number on top right. -\def\HEADINGSsingle{ +\def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1899,12 +3264,11 @@ where each line of input produces a line of output.} % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} -\def\settitle{\parsearg\settitlezzz} -\def\settitlezzz #1{\gdef\thistitle{#1}} +\def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} -% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). +% Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in @@ -1916,7 +3280,7 @@ where each line of input produces a line of output.} % used internally for \itemindent minus \itemmargin \newdimen\itemmax -% Note @table, @vtable, and @vtable define @item, @itemx, etc., with +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). @@ -1928,22 +3292,10 @@ where each line of input produces a line of output.} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} -\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} -\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} - -\def\internalBkitem{\smallbreak \parsearg\kitemzzz} -\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} - -\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% - \itemzzz {#1}} - -\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% - \itemzzz {#1}} - \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent - \setbox0=\hbox{\itemfont{#1}}% + \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % @@ -1967,17 +3319,13 @@ where each line of input produces a line of output.} % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % - % Stop a page break at the \parskip glue coming up. (Unfortunately - % we can't prevent a possible page break at the following - % \baselineskip glue.) However, if what follows is an environment - % such as @example, there will be no \parskip glue; then - % the negative vskip we just would cause the example and the item to - % crash together. So we use this bizarre value of 10001 as a signal - % to \aboveenvbreak to insert \parskip glue after all. - % (Possibly there are other commands that could be followed by - % @example which need the same treatment, but not section titles; or - % maybe section titles are the only special case and they should be - % penalty 10001...) + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse @@ -1997,92 +3345,116 @@ where each line of input produces a line of output.} \fi } -\def\item{\errmessage{@item while not in a table}} -\def\itemx{\errmessage{@itemx while not in a table}} -\def\kitem{\errmessage{@kitem while not in a table}} -\def\kitemx{\errmessage{@kitemx while not in a table}} -\def\xitem{\errmessage{@xitem while not in a table}} -\def\xitemx{\errmessage{@xitemx while not in a table}} - -% Contains a kludge to get @end[description] to work. -\def\description{\tablez{\dontindex}{1}{}{}{}{}} +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. -\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} -{\obeylines\obeyspaces% -\gdef\tablex #1^^M{% -\tabley\dontindex#1 \endtabley}} - -\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} -{\obeylines\obeyspaces% -\gdef\ftablex #1^^M{% -\tabley\fnitemindex#1 \endtabley -\def\Eftable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} -{\obeylines\obeyspaces% -\gdef\vtablex #1^^M{% -\tabley\vritemindex#1 \endtabley -\def\Evtable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\dontindex #1{} -\def\fnitemindex #1{\doind {fn}{\code{#1}}}% -\def\vritemindex #1{\doind {vr}{\code{#1}}}% - -{\obeyspaces % -\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% -\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} - -\def\tablez #1#2#3#4#5#6{% -\aboveenvbreak % -\begingroup % -\def\Edescription{\Etable}% Necessary kludge. -\let\itemindex=#1% -\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % -\ifnum 0#4>0 \tableindent=#4\mil \fi % -\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % -\def\itemfont{#2}% -\itemmax=\tableindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \tableindent % -\exdentamount=\tableindent -\parindent = 0pt -\parskip = \smallskipamount -\ifdim \parskip=0pt \parskip=2pt \fi% -\def\Etable{\endgraf\afterenvbreak\endgroup}% -\let\item = \internalBitem % -\let\itemx = \internalBitemx % -\let\kitem = \internalBkitem % -\let\kitemx = \internalBkitemx % -\let\xitem = \internalBxitem % -\let\xitemx = \internalBxitemx % +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez } +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno -\def\itemize{\parsearg\itemizezzz} +\envdef\itemize{\parsearg\doitemize} -\def\itemizezzz #1{% - \begingroup % ended by the @end itemize - \itemizey {#1}{\Eitemize} +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + % + % Try typesetting the item mark that if the document erroneously says + % something like @itemize @samp (intending @table), there's an error + % right away at the @itemize. It's not the best error message in the + % world, but it's better than leaving it to the @item. This means if + % the user wants an empty mark, they have to say @w{} not just @w. + \def\itemcontents{#1}% + \setbox0 = \hbox{\itemcontents}% + % + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + % + \let\item=\itemizeitem } -\def\itemizey #1#2{% -\aboveenvbreak % -\itemmax=\itemindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \itemindent % -\exdentamount=\itemindent -\parindent = 0pt % -\parskip = \smallskipamount % -\ifdim \parskip=0pt \parskip=2pt \fi% -\def#2{\endgraf\afterenvbreak\endgroup}% -\def\itemcontents{#1}% -\let\item=\itemizeitem} +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + % + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. @@ -2093,11 +3465,8 @@ where each line of input produces a line of output.} % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % -\def\enumerate{\parsearg\enumeratezzz} -\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% - \begingroup % ended by the @end enumerate - % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi @@ -2168,13 +3537,13 @@ where each line of input produces a line of output.} }% } -% Call itemizey, adding a period to the first argument and supplying the +% Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 - \itemizey{#1.}\Eenumerate\flushcr + \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg @@ -2185,16 +3554,6 @@ where each line of input produces a line of output.} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} -% Definition of @item while inside @itemize. - -\def\itemizeitem{% -\advance\itemno by 1 -{\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{In hmode at itemizeitem}\fi -{\parskip=0in \hskip 0pt -\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% -\vadjust{\penalty 1200}}% -\flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 @@ -2221,24 +3580,14 @@ where each line of input produces a line of output.} % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. -% -% For those who want to use more than one line's worth of words in -% the preamble, break the line within one argument and it -% will parse correctly, i.e., -% -% @multitable {Column 1 template} {Column 2 template} {Column 3 -% template} -% Not: -% @multitable {Column 1 template} {Column 2 template} -% {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. -% @item, @tab, @multitable or @end multitable do not need to be on their -% own lines, but it will not hurt if they are. +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. % Sample multitable: @@ -2282,13 +3631,12 @@ where each line of input produces a line of output.} \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent -% #1 is the part of the @columnfraction before the decimal point, which -% is presumably either 0 or the empty string (but we don't check, we -% just throw it away). #2 is the decimal part, which we use as the -% percent of \hsize for this column. -\def\pickupwholefraction#1.#2 {% +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% \global\advance\colcount by 1 - \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } @@ -2321,18 +3669,40 @@ where each line of input produces a line of output.} \go } +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. \everycr resets \everytab so we don't have to +% undo it ourselves. +\def\headitemfont{\b}% for people to use in the template row; not changeable +\def\headitem{% + \checkenv\multitable + \crcr + \global\everytab={\bf}% can't use \headitemfont since the parsing differs + \the\everytab % for the first item +}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we again encounter the problem the 1sp was intended to solve. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + % @multitable ... @end multitable definitions: % -\def\multitable{\parsearg\dotable} -\def\dotable#1{\bgroup +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% \vskip\parskip - \let\item=\crcrwithfootnotes - % A \tab used to include \hskip1sp. But then the space in a template - % line is not enough. That is bad. So let's go back to just & until - % we encounter the problem it was intended to solve again. --karl, - % nathan@acm.org, 20apr99. - \let\tab=&% - \let\startfootins=\startsavedfootnote + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % \tolerance=9500 \hbadness=9500 \setmultitablespacing @@ -2340,85 +3710,93 @@ where each line of input produces a line of output.} \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 - \def\Emultitable{% - \global\setpercentfalse - \crcrwithfootnotes\crcr - \egroup\egroup + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% }% % + \parsearg\domultitable +} +\def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. - \everycr{\noalign{% - % - % \filbreak%% keeps underfull box messages off when table breaks over pages. - % Maybe so, but it also creates really weird page breaks when the table - % breaks over pages. Wouldn't \vfil be better? Wait until the problem - % manifests itself, so it can be fixed for real --karl. - \global\colcount=0\relax}}% - % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. - \halign\bgroup&\global\advance\colcount by 1\relax - \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % - % If the user has set preamble in terms of percent of \hsize we will - % use that dimension as the width of the column, and the \leftskip - % will keep entries from bumping into each other. Table will start at - % left margin and final column will justify at right margin. - % - % Make sure we don't inherit \rightskip from the outer environment. - \rightskip=0pt - \ifnum\colcount=1 - % The first column will be indented with the surrounding text. - \advance\hsize by\leftskip - \else - \ifsetpercent \else - % If user has not set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace. - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: - \leftskip=\multitablecolspace - \fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively marking - % characters. - \noindent\ignorespaces##\unskip\multistrut}\cr -} - -\def\setmultitablespacing{% test to see if user has set \multitablelinespace. -% If so, do nothing. If not, give it an appropriate dimension based on -% current baselineskip. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 -%% strut to put in table in case some entry doesn't have descenders, -%% to keep lines equally spaced -\let\multistrut = \strut -\else -%% FIXME: what is \box0 supposed to be? -\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 -width0pt\relax} \fi +\fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. @@ -2433,163 +3811,33 @@ width0pt\relax} \fi %% than skip between lines in the table. \fi} -% In case a @footnote appears inside an alignment, save the footnote -% text to a box and make the \insert when a row of the table is -% finished. Otherwise, the insertion is lost, it never migrates to the -% main vertical list. --kasal, 22jan03. -% -\newbox\savedfootnotes -% -% \dotable \let's \startfootins to this, so that \dofootnote will call -% it instead of starting the insertion right away. -\def\startsavedfootnote{% - \global\setbox\savedfootnotes = \vbox\bgroup - \unvbox\savedfootnotes -} -\def\crcrwithfootnotes{% - \crcr - \ifvoid\savedfootnotes \else - \noalign{\insert\footins{\box\savedfootnotes}}% - \fi -} \message{conditionals,} -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% - \let\chapter=\relax - \let\unnumbered=\relax - \let\top=\relax - \let\unnumberedsec=\relax - \let\unnumberedsection=\relax - \let\unnumberedsubsec=\relax - \let\unnumberedsubsection=\relax - \let\unnumberedsubsubsec=\relax - \let\unnumberedsubsubsection=\relax - \let\section=\relax - \let\subsec=\relax - \let\subsubsec=\relax - \let\subsection=\relax - \let\subsubsection=\relax - \let\appendix=\relax - \let\appendixsec=\relax - \let\appendixsection=\relax - \let\appendixsubsec=\relax - \let\appendixsubsection=\relax - \let\appendixsubsubsec=\relax - \let\appendixsubsubsection=\relax - \let\contents=\relax - \let\smallbook=\relax - \let\titlepage=\relax -} - -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. -% -% We use \empty instead of \relax for the @def... commands, so that \end -% doesn't throw an error. For instance: -% @ignore -% @deffn ... -% @end deffn -% @end ignore -% -% The @end deffn is going to get expanded, because we're trying to allow -% nested conditionals. But we don't want to expand the actual @deffn, -% since it might be syntactically correct and intended to be ignored. -% Since \end checks for \relax, using \empty does not cause an error. -% -\def\ignoremorecommands{% - \let\defcodeindex = \relax - \let\defcv = \empty - \let\defcvx = \empty - \let\Edefcv = \empty - \let\deffn = \empty - \let\deffnx = \empty - \let\Edeffn = \empty - \let\defindex = \relax - \let\defivar = \empty - \let\defivarx = \empty - \let\Edefivar = \empty - \let\defmac = \empty - \let\defmacx = \empty - \let\Edefmac = \empty - \let\defmethod = \empty - \let\defmethodx = \empty - \let\Edefmethod = \empty - \let\defop = \empty - \let\defopx = \empty - \let\Edefop = \empty - \let\defopt = \empty - \let\defoptx = \empty - \let\Edefopt = \empty - \let\defspec = \empty - \let\defspecx = \empty - \let\Edefspec = \empty - \let\deftp = \empty - \let\deftpx = \empty - \let\Edeftp = \empty - \let\deftypefn = \empty - \let\deftypefnx = \empty - \let\Edeftypefn = \empty - \let\deftypefun = \empty - \let\deftypefunx = \empty - \let\Edeftypefun = \empty - \let\deftypeivar = \empty - \let\deftypeivarx = \empty - \let\Edeftypeivar = \empty - \let\deftypemethod = \empty - \let\deftypemethodx = \empty - \let\Edeftypemethod = \empty - \let\deftypeop = \empty - \let\deftypeopx = \empty - \let\Edeftypeop = \empty - \let\deftypevar = \empty - \let\deftypevarx = \empty - \let\Edeftypevar = \empty - \let\deftypevr = \empty - \let\deftypevrx = \empty - \let\Edeftypevr = \empty - \let\defun = \empty - \let\defunx = \empty - \let\Edefun = \empty - \let\defvar = \empty - \let\defvarx = \empty - \let\Edefvar = \empty - \let\defvr = \empty - \let\defvrx = \empty - \let\Edefvr = \empty - \let\clear = \relax - \let\down = \relax - \let\evenfooting = \relax - \let\evenheading = \relax - \let\everyfooting = \relax - \let\everyheading = \relax - \let\headings = \relax - \let\include = \relax - \let\item = \relax - \let\lowersections = \relax - \let\oddfooting = \relax - \let\oddheading = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\raisesections = \relax - \let\ref = \relax - \let\set = \relax - \let\setchapternewpage = \relax - \let\setchapterstyle = \relax - \let\settitle = \relax - \let\up = \relax - \let\verbatiminclude = \relax - \let\xref = \relax + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 } +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} -\def\documentdescriptionword{documentdescription} \def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} \def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} @@ -2599,198 +3847,139 @@ width0pt\relax} \fi \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. -\let\dircategory = \comment - -% Ignore text until a line `@end #1'. +% Ignore text until a line `@end #1', keeping track of nested conditionals. % +% A count to remember the depth of nesting. +\newcount\doignorecount + \def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - % This @ is a catcode 12 token (that is the normal catcode of @ in - % this texinfo.tex file). We change the catcode of @ below to match. - \long\def\doignoretext##1@end #1{\enddoignore}% + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode\spaceChar = 10 - % - % Ignore braces, too, so mismatched braces don't cause trouble. - \catcode`\{ = 9 - \catcode`\} = 9 + \spaceisspace % - % We must not have @c interpreted as a control sequence. - \catcode`\@ = 12 + % Count number of #1's that we've seen. + \doignorecount = 0 % - \def\ignoreword{#1}% - \ifx\ignoreword\documentdescriptionword - % The c kludge breaks documentdescription, since - % `documentdescription' contains a `c'. Means not everything will - % be ignored inside @documentdescription, but oh well... - \else - % Make the letter c a comment character so that the rest of the line - % will be ignored. This way, the document can have (for example) - % @c @end ifinfo - % and the @end ifinfo will be properly ignored. - % (We've just changed @ to catcode 12.) - \catcode`\c = 14 - \fi - % - % And now expand the command defined above. - \doignoretext -} - -% What we do to finish off ignored text. -% -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{WARNING: for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{ (See ftp://ftp.gnu.org/non-gnu/TeX.README.)} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \global\warnedobstrue - \fi + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% } -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax - -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the chance of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook. +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because some sites - % might not have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. - % - \nullfont - \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont - \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont - \let\tensf=\nullfont - % Similarly for index fonts. - \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont - \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont - \let\smallsf=\nullfont - % Similarly for smallexample fonts. - \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont - \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont - \let\smallersf=\nullfont + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% % - % Don't bother to do space factor calculations. - \frenchspacing + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 - % - % Do not execute instructions in @tex. - \def\tex{\doignore{tex}}% - % Do not execute macro definitions. - % `c' is a comment character, so the word `macro' will get cut off. - \def\macro{\doignore{ma}}% + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. } +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we -% didn't need it. Make sure the catcode of space is correct to avoid -% losing inside @example, for instance. +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. % -\def\set{\begingroup\catcode` =10 - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} +\parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi - \endgroup + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% } -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} % @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} { - \catcode`\_ = \active + \catcode`\- = \active \catcode`\_ = \active % - % We might end up with active _ or - characters in the argument if - % we're called from @code, as @code{@value{foo-bar_}}. So \let any - % such active characters to their normal equivalents. - \gdef\value{\begingroup + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other - \indexbreaks \let_\normalunderscore - \valuexxx} + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } } -\def\valuexxx#1{\expandablevalue{#1}\endgroup} % We have this subroutine so that we can handle at least some @value's -% properly in indexes (we \let\value to this in \indexdummies). Ones -% whose names contain - or _ still won't work, but we can't do anything -% about that. The command has to be fully expandable (if the variable -% is set), since the result winds up in the index file. This means that -% if the variable's value contains other Texinfo commands, it's almost -% certain it will fail (although perhaps we could fix that with -% sufficient work to do a one-level expansion on the result, instead of -% complete). +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax @@ -2804,55 +3993,36 @@ width0pt\relax} \fi % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % -\def\ifset{\parsearg\doifset} -\def\doifset#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \let\next=\ifsetfail - \else - \let\next=\ifsetsucceed - \fi - \next +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next } -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} +\def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % -\def\ifclear{\parsearg\doifclear} -\def\doifclear#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \let\next=\ifclearsucceed - \else - \let\next=\ifclearfail - \fi - \next -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we -% read the text following, through the first @end iftex (etc.). Make -% `@end iftex' (etc.) valid only after an @iftex. +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. % -\def\iftex{\conditionalsucceed{iftex}} -\def\ifnothtml{\conditionalsucceed{ifnothtml}} -\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} -\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} -\defineunmatchedend{iftex} -\defineunmatchedend{ifnothtml} -\defineunmatchedend{ifnotinfo} -\defineunmatchedend{ifnotplaintext} +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} -% True conditional. Since \set globally defines its variables, we can -% just start and end a group (to keep the @end definition undefined at -% the outer level). -% -\def\conditionalsucceed#1{\begingroup - \expandafter\def\csname E#1\endcsname{\endgroup}% -} +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment @@ -2862,9 +4032,8 @@ width0pt\relax} \fi % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite -% except not \outer, so it can be used within \newindex. -{\catcode`\@=11 -\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that @@ -2903,10 +4072,10 @@ width0pt\relax} \fi % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. -% +% % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. -% +% \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} @@ -2915,11 +4084,11 @@ width0pt\relax} \fi \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. - \expandafter \ifx\csname donesynindex#2\endcsname \undefined + \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname - \expandafter\let\csname\donesynindex#2\endcsname = 1 + \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname @@ -2948,204 +4117,245 @@ width0pt\relax} \fi % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. -% +% \def\indexdummies{% + \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% + % % Need these in case \tex is in effect and \{ is a \delimiter again. % But can't use \lbracecmd and \rbracecmd because texindex assumes - % braces and backslashes are used only as delimiters. + % braces and backslashes are used only as delimiters. \let\{ = \mylbrace \let\} = \myrbrace % - % \definedummyword defines \#1 as \realbackslash #1\space, thus - % effectively preventing its expansion. This is used only for control - % words, not control letters, because the \space would be incorrect - % for control characters, but is needed to separate the control word - % from whatever follows. + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. % - % For control letters, we have \definedummyletter, which omits the - % space. + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest % - % These can be used both for control words that take an argument and - % those that do not. If it is followed by {arg} in the input, then - % that will dutifully get written to the index (or wherever). + % The above is not enough to reproduce the bug, but it gives the flavor. % - \def\definedummyword##1{% - \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}% - }% - \def\definedummyletter##1{% - \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% - }% + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty % % Do the redefinitions. \commondummies } -% For the aux file, @ is the escape character. So we want to redefine -% everything using @ instead of \realbackslash. When everything uses -% @, this will be simpler. -% +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % - % (See comments in \indexdummies.) - \def\definedummyword##1{% - \expandafter\def\csname ##1\endcsname{@##1\space}% - }% - \def\definedummyletter##1{% - \expandafter\def\csname ##1\endcsname{@##1}% - }% - % % Do the redefinitions. \commondummies + \otherbackslash } -% Called from \indexdummies and \atdummies. \definedummyword and -% \definedummyletter must be defined first. -% +% Called from \indexdummies and \atdummies. +% \def\commondummies{% % - \normalturnoffactive + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control% words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. % - % Control letters and accents. - \definedummyletter{_}% - \definedummyletter{,}% - \definedummyletter{"}% - \definedummyletter{`}% - \definedummyletter{'}% - \definedummyletter{^}% - \definedummyletter{~}% - \definedummyletter{=}% - \definedummyword{u}% - \definedummyword{v}% - \definedummyword{H}% - \definedummyword{dotaccent}% - \definedummyword{ringaccent}% - \definedummyword{tieaccent}% - \definedummyword{ubaraccent}% - \definedummyword{udotaccent}% - \definedummyword{dotless}% - % - % Other non-English letters. - \definedummyword{AA}% - \definedummyword{AE}% - \definedummyword{L}% - \definedummyword{OE}% - \definedummyword{O}% - \definedummyword{aa}% - \definedummyword{ae}% - \definedummyword{l}% - \definedummyword{oe}% - \definedummyword{o}% - \definedummyword{ss}% + % For control letters, we have \definedummyletter, which omits the + % space. % - % Although these internal commands shouldn't show up, sometimes they do. - \definedummyword{bf}% - \definedummyword{gtr}% - \definedummyword{hat}% - \definedummyword{less}% - \definedummyword{sf}% - \definedummyword{sl}% - \definedummyword{tclose}% - \definedummyword{tt}% + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). % - % Texinfo font commands. - \definedummyword{b}% - \definedummyword{i}% - \definedummyword{r}% - \definedummyword{sc}% - \definedummyword{t}% - % - \definedummyword{TeX}% - \definedummyword{acronym}% - \definedummyword{cite}% - \definedummyword{code}% - \definedummyword{command}% - \definedummyword{dfn}% - \definedummyword{dots}% - \definedummyword{emph}% - \definedummyword{env}% - \definedummyword{file}% - \definedummyword{kbd}% - \definedummyword{key}% - \definedummyword{math}% - \definedummyword{option}% - \definedummyword{samp}% - \definedummyword{strong}% - \definedummyword{uref}% - \definedummyword{url}% - \definedummyword{var}% - \definedummyword{w}% + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\L + \definedummyword\OE + \definedummyword\O + \definedummyword\aa + \definedummyword\ae + \definedummyword\l + \definedummyword\oe + \definedummyword\o + \definedummyword\ss + \definedummyword\exclamdown + \definedummyword\questiondown + \definedummyword\ordf + \definedummyword\ordm + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX % % Assorted special characters. - \definedummyword{bullet}% - \definedummyword{copyright}% - \definedummyword{dots}% - \definedummyword{enddots}% - \definedummyword{equiv}% - \definedummyword{error}% - \definedummyword{expansion}% - \definedummyword{minus}% - \definedummyword{pounds}% - \definedummyword{point}% - \definedummyword{print}% - \definedummyword{result}% - % - % Handle some cases of @value -- where the variable name does not - % contain - or _, and the value does not contain any - % (non-fully-expandable) commands. - \let\value = \expandablevalue + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\expansion + \definedummyword\minus + \definedummyword\ogonek + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist % - % Normal spaces, not active ones. - \unsepspaces + \normalturnoffactive % - % No macro expansion. - \turnoffmacros + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable } -% If an index command is used in an @example environment, any spaces -% therein should become regular spaces in the raw index file, not the -% expansion of \tie (\leavevmode \penalty \@M \ ). -{\obeyspaces - \gdef\unsepspaces{\obeyspaces\let =\space}} - +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ogonek + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sc + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\acronym + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref +} % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % -\def\indexdummytex{TeX} -\def\indexdummydots{...} -% \def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % \def\ { }% \def\@{@}% % how to handle braces? \def\_{\normalunderscore}% % - \let\,=\asis - \let\"=\asis - \let\`=\asis - \let\'=\asis - \let\^=\asis - \let\~=\asis - \let\==\asis - \let\u=\asis - \let\v=\asis - \let\H=\asis - \let\dotaccent=\asis - \let\ringaccent=\asis - \let\tieaccent=\asis - \let\ubaraccent=\asis - \let\udotaccent=\asis - \let\dotless=\asis - % - % Other non-English letters. + % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\L{L}% @@ -3159,130 +4369,192 @@ width0pt\relax} \fi \def\ss{ss}% \def\exclamdown{!}% \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% % - % Don't no-op \tt, since it isn't a user-level command - % and is used in the definitions of the active chars like <, >, |, etc. - % Likewise with the other plain tex font commands. - %\let\tt=\asis + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% % - % Texinfo font commands. - \let\b=\asis - \let\i=\asis - \let\r=\asis - \let\sc=\asis - \let\t=\asis - % - \let\TeX=\indexdummytex - \let\acronym=\asis - \let\cite=\asis - \let\code=\asis - \let\command=\asis - \let\dfn=\asis - \let\dots=\indexdummydots - \let\emph=\asis - \let\env=\asis - \let\file=\asis - \let\kbd=\asis - \let\key=\asis - \let\math=\asis - \let\option=\asis - \let\samp=\asis - \let\strong=\asis - \let\uref=\asis - \let\url=\asis - \let\var=\asis - \let\w=\asis + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% + \def\expansion{==>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% + \def\result{=>}% + \def\textdegree{degrees}% + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist } \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? -% For \ifx comparisons. -\def\emptymacro{\empty} - % Most index entries go through here, but \dosubind is the general case. -% -\def\doind#1#2{\dosubind{#1}{#2}\empty} +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% \empty if called from \doind, as we usually are. The main exception -% is with defuns, which call us directly. +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). % \def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi - {% - \count255=\lastpenalty - {% - \indexdummies % Must do this here, since \bf, etc expand at this stage - \escapechar=`\\ - {% - \let\folio = 0% We will expand all macros now EXCEPT \folio. - \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. - % - % The main index entry text. - \toks0 = {#2}% - % - % If third arg is present, precede it with space in sort key. - \def\thirdarg{#3}% - \ifx\thirdarg\emptymacro \else - % If the third (subentry) arg is present, add it to the index - % line to write. - \toks0 = \expandafter{\the\toks0 \space #3}% - \fi - % - % Process the index entry with all font commands turned off, to - % get the string to sort by. - {\indexnofonts - \edef\temp{\the\toks0}% need full expansion - \xdef\indexsorttmp{\temp}% - }% - % - % Set up the complete index entry, with both the sort key and - % the original text, including any font commands. We write - % three arguments to \entry to the .?? file (four in the - % subentry case), texindex reduces to two when writing the .??s - % sorted result. - \edef\temp{% - \write\csname#1indfile\endcsname{% - \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% - }% - % - % If a skip is the last thing on the list now, preserve it - % by backing up by \lastskip, doing the \write, then inserting - % the skip again. Otherwise, the whatsit generated by the - % \write will make \lastskip zero. The result is that sequences - % like this: - % @end defun - % @tindex whatever - % @defun ... - % will have extra space inserted, because the \medbreak in the - % start of the @defun won't see the skip inserted by the @end of - % the previous defun. - % - % But don't do any of this if we're not in vertical mode. We - % don't want to do a \vskip and prematurely end a paragraph. - % - % Avoid page breaks due to these extra skips, too. - % - \iflinks - \ifvmode - \skip0 = \lastskip - \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi - \fi - % - \temp % do the write - % - \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi - \fi - }% - }% - \penalty\count255 + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{% +\ifhmode + #1% +\else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\whatsitskip glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi } % The index entry written in the file actually looks like @@ -3320,13 +4592,13 @@ width0pt\relax} \fi % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % -\def\printindex{\parsearg\doprintindex} -\def\doprintindex#1{\begingroup +\parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 - \indexbreaks + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains @@ -3353,7 +4625,7 @@ width0pt\relax} \fi % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. - \def\indexbackslash{\rawbackslashxx}% + \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns @@ -3375,7 +4647,10 @@ width0pt\relax} \fi \removelastskip % % We like breaks before the index initials, so insert a bonus. - \penalty -300 + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -3385,84 +4660,101 @@ width0pt\relax} \fi % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% - \vskip .33\baselineskip plus .1\baselineskip - % % Do our best not to break after the initial. \nobreak + \vskip .33\baselineskip plus .1\baselineskip }} -% This typesets a paragraph consisting of #1, dot leaders, and then #2 -% flush to the right margin. It is used for index and table of contents -% entries. The paragraph is indented by \leftskip. +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. % -\def\entry#1#2{\begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent = 2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % A bit of stretch before each entry for the benefit of balancing columns. - \vskip 0pt plus1pt - % - % Start a ``paragraph'' for the index entry so the line breaking - % parameters we've set above will have an effect. - \noindent - % - % Insert the text of the index entry. TeX will do line-breaking on it. - #1% - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#2}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd\ \else% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this freezes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ifpdf - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % \else - \ #2% The page number ends the paragraph. + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi \fi - \fi% - \par -\endgroup} + \par + \endgroup +} -% Like \dotfill except takes at least 1 em. +% Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} @@ -3569,9 +4861,37 @@ width0pt\relax} \fi \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } -% +% % All done with double columns. \def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. @@ -3627,6 +4947,12 @@ width0pt\relax} \fi \message{sectioning,} % Chapters, sections, etc. +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 @@ -3634,9 +4960,12 @@ width0pt\relax} \fi % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ +% % \def\appendixletter{\char\the\appendixno} -% We do the following for the sake of pdftex, which needs the actual +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. +% \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% @@ -3672,13 +5001,18 @@ width0pt\relax} \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} -% Each @chapter defines this as the name of the chapter. -% page headings and footings can use it. @section does likewise. +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. \def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} \def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level -\newcount\secbase\secbase=0 % @raise/lowersections modify this count +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} @@ -3688,118 +5022,142 @@ width0pt\relax} \fi \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name -% Choose a numbered-heading macro -% #1 is heading level if unmodified by @raisesections or @lowersections -% #2 is text for heading -\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \chapterzzz{#2} -\or - \seczzz{#2} -\or - \numberedsubseczzz{#2} -\or - \numberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \chapterzzz{#2} +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 \else - \numberedsubsubseczzz{#2} + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi \fi -\fi -} - -% like \numhead, but chooses appendix heading levels -\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \appendixzzz{#2} -\or - \appendixsectionzzz{#2} -\or - \appendixsubseczzz{#2} -\or - \appendixsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \appendixzzz{#2} + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel = \absseclevel + \fi \else - \appendixsubsubseczzz{#2} + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel = 3 + \fi \fi -\fi -} - -% like \numhead, but chooses numberless heading levels -\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \unnumberedzzz{#2} -\or - \unnumberedseczzz{#2} -\or - \unnumberedsubseczzz{#2} -\or - \unnumberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \unnumberedzzz{#2} + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi \else - \unnumberedsubsubseczzz{#2} + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi \fi -\fi + \suppressfirstparagraphindent } -% @chapter, @appendix, @unnumbered. -\def\thischaptername{No Chapter Title} -\outer\def\chapter{\parsearg\chapteryyy} -\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{% - \secno=0 \subsecno=0 \subsubsecno=0 - \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% - \chapmacro {#1}{\the\chapno}% - \gdef\thissection{#1}% - \gdef\thischaptername{#1}% - % We don't substitute the actual chapter name into \thischapter - % because we don't want its macros evaluated now. - \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% - \writetocentry{chap}{#1}{{\the\chapno}} - \donoderef +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } -% we use \chapno to avoid indenting back -\def\appendixbox#1{% - \setbox0 = \hbox{\putwordAppendix{} \the\chapno}% - \hbox to \wd0{#1\hss}} - -\outer\def\appendix{\parsearg\appendixyyy} -\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{% - \secno=0 \subsecno=0 \subsubsecno=0 - \global\advance \appendixno by 1 - \message{\putwordAppendix\space \appendixletter}% - \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}% - \gdef\thissection{#1}% - \gdef\thischaptername{#1}% - \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% - \writetocentry{appendix}{#1}{{\appendixletter}} - \appendixnoderef +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } -% @centerchap is like @unnumbered, but the heading is centered. -\outer\def\centerchap{\parsearg\centerchapyyy} -\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} - -% @top is like @unnumbered. -\outer\def\top{\parsearg\unnumberedyyy} - -\outer\def\unnumbered{\parsearg\unnumberedyyy} -\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{% - \secno=0 \subsecno=0 \subsubsecno=0 +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX @@ -3812,134 +5170,98 @@ width0pt\relax} \fi % \the<toks register> to achieve this: TeX expands \the<toks> only once, % simply yielding the contents of <toks register>. (We also do this for % the toc entries.) - \toks0 = {#1}\message{(\the\toks0)}% + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % - \unnumbchapmacro {#1}% - \gdef\thischapter{#1}\gdef\thissection{#1}% - \writetocentry{unnumbchap}{#1}{{\the\chapno}} - \unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + % Sections. -\outer\def\numberedsec{\parsearg\secyyy} -\def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{% - \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % - \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% - \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}} - \donoderef - \nobreak +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } -\outer\def\appendixsection{\parsearg\appendixsecyyy} -\outer\def\appendixsec{\parsearg\appendixsecyyy} -\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{% - \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % - \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% - \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}} - \appendixnoderef - \nobreak +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } +\let\appendixsec\appendixsection -\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} -\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{% - \plainsecheading {#1}\gdef\thissection{#1}% - \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}} - \unnumbnoderef - \nobreak +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. -\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} -\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{% - \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % - \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% - \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} - \donoderef - \nobreak +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } -\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} -\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{% - \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % - \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% - \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}} - \appendixnoderef - \nobreak +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% } -\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} -\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{% - \plainsubsecheading {#1}\gdef\thissection{#1}% - \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} - \unnumbnoderef - \nobreak +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. -\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} -\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{% - \gdef\thissection{#1}\global\advance \subsubsecno by 1 % - \subsubsecheading {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} - \donoderef - \nobreak +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } -\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} -\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{% - \gdef\thissection{#1}\global\advance \subsubsecno by 1 % - \subsubsecheading {#1} - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}} - \appendixnoderef - \nobreak +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } -\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} -\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{% - \plainsubsubsecheading {#1}\gdef\thissection{#1}% - \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} - \unnumbnoderef - \nobreak +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } -% These are variants which are not "outer", so they can appear in @ifinfo. -% Actually, they should now be obsolete; ordinary section commands should work. -\def\infotop{\parsearg\unnumberedzzz} -\def\infounnumbered{\parsearg\unnumberedzzz} -\def\infounnumberedsec{\parsearg\unnumberedseczzz} -\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} -\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} - -\def\infoappendix{\parsearg\appendixzzz} -\def\infoappendixsec{\parsearg\appendixseczzz} -\def\infoappendixsubsec{\parsearg\appendixsubseczzz} -\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} - -\def\infochapter{\parsearg\chapterzzz} -\def\infosection{\parsearg\sectionzzz} -\def\infosubsection{\parsearg\subsectionzzz} -\def\infosubsubsection{\parsearg\subsubsectionzzz} - % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading @@ -3951,24 +5273,27 @@ width0pt\relax} \fi % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. - -\def\majorheading{\parsearg\majorheadingzzz} -\def\majorheadingzzz #1{% +\def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% - {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} + \parsearg\chapheadingzzz +} -\def\chapheading{\parsearg\chapheadingzzz} -\def\chapheadingzzz #1{\chapbreak % +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} + \parindent=0pt\ptexraggedright + \rmisbold #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} % @heading, @subheading, @subsubheading. -\def\heading{\parsearg\plainsecheading} -\def\subheading{\parsearg\plainsubsecheading} -\def\subsubheading{\parsearg\plainsubsubsecheading} +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), @@ -3977,8 +5302,6 @@ width0pt\relax} \fi %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} - %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) @@ -3986,7 +5309,20 @@ width0pt\relax} \fi \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} -\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% + \hbox to 0pt{}% + \chappager + \endgroup + \fi +} \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} @@ -4001,7 +5337,7 @@ width0pt\relax} \fi \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} -\def\CHAPPAGodd{ +\def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage @@ -4009,116 +5345,280 @@ width0pt\relax} \fi \CHAPPAGon -\def\CHAPFplain{ -\global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain -\global\let\centerchapmacro=\centerchfplain} - -% Plain chapter opening. -% #1 is the text, #2 the chapter number or empty if unnumbered. -\def\chfplain#1#2{% +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % {% - \chapfonts \rm - \def\chapnum{#2}% - \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 \centerparametersmaybe + \chapfonts \rmisbold + % + % Have to define \lastsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\lastsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright + \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } -% Plain opening for unnumbered. -\def\unnchfplain#1{\chfplain{#1}{}} - % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax -\def\centerchfplain#1{{% - \def\centerparametersmaybe{% - \advance\rightskip by 3\rightskip - \leftskip = \rightskip - \parfillskip = 0pt - }% - \chfplain{#1}{}% -}} +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} -\CHAPFplain % The default +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\nobreak + \parindent=0pt\ptexraggedright + \rmisbold #1\hfill}}\bigskip \par\nobreak } - \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } - \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt - \hfill {\rm #1}\hfill}}\bigskip \par\nobreak + \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak } +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} -\def\CHAPFopen{ -\global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen -\global\let\centerchapmacro=\centerchfopen} - -% Section titles. +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% \newskip\secheadingskip -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} -\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} -\def\plainsecheading#1{\sectionheading{sec}{}{#1}} +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. -\newskip \subsecheadingskip -\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} -\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} -\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. -\let\subsubsecheadingskip = \subsecheadingskip -\let\subsubsecheadingbreak = \subsecheadingbreak -\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} -\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} -% Print any size section title. +% Print any size, any type, section title. % -% #1 is the section type (sec/subsec/subsubsec), #2 is the section -% number (maybe empty), #3 the text. -\def\sectionheading#1#2#3{% - {% - \expandafter\advance\csname #1headingskip\endcsname by \parskip - \csname #1headingbreak\endcsname - }% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\seckeyword{sec} +% +\def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. - \csname #1fonts\endcsname \rm + \csname #2fonts\endcsname \rmisbold + % + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Go into vertical mode. Usually we'll already be there, but we + % don't want the following whatsit to end up in a preceding paragraph + % if the document didn't happen to have a blank line. + \par + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevsectiondefs=\lastsectiondefs + \domark % - % Only insert the separating space if we have a section number. - \def\secnum{#2}% - \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\lastsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \lastsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\lastsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\lastsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% % - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 % zero if no section number - \unhbox0 #3}% + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% }% - % Add extra space after the heading -- either a line space or a - % paragraph space, whichever is more. (Some people like to set - % \parskip to large values for some reason.) Don't allow stretch, though. - \nobreak - \ifdim\parskip>\normalbaselineskip - \kern\parskip - \else - \kern\normalbaselineskip - \fi + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This is purely so the last item on the list is a known \penalty > + % 10000. This is so \startdefun can avoid allowing breakpoints after + % section headings. Otherwise, it would insert a valid breakpoint between: + % + % @section sec-whatever + % @deffn def-whatever + \penalty 10001 } @@ -4127,119 +5627,177 @@ width0pt\relax} \fi \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. -% Called from @chapter, etc. We supply {\folio} at the end of the -% argument, which will end up as the last argument to the \...entry macro. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. % -% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}} % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. % \newif\iftocfileopened +\def\omitkeyword{omit}% +% \def\writetocentry#1#2#3{% - \iftocfileopened\else - \immediate\openout\tocfile = \jobname.toc - \global\tocfileopenedtrue - \fi - % - \iflinks - \toks0 = {#2}% - \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}% - \temp + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi \fi % - % Tell \shipout to create a page destination if we're doing pdf, which - % will be the target of the links in the table of contents. We can't - % just do it on every page because the title pages are numbered 1 and - % 2 (the page numbers aren't printed), and so are the first two pages - % of the document. Thus, we'd have two destinations named `1', and - % two named `2'. - \ifpdf \pdfmakepagedesttrue \fi + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 -% Finish up the main text and prepare to read what we've written -% to \tocfile. +% Prepare to read what we've written to \tocfile. % \def\startcontents#1{% - % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund <tege@matematik.su.se> - \contentsalignmacro - \immediate\closeout\tocfile - % - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - \savepageno = \pageno - \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - % We can't do this, because then an actual ^ in a section - % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. - %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. - % - % Roman numerals for page numbers. - \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund <tege@matematik.su.se> + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} % Normal (long) toc. +% \def\contents{% - \startcontents{\putwordTOC}% - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \pdfmakeoutlines - \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% - \startcontents{\putwordShortTOC}% - % - \let\chapentry = \shortchapentry - \let\appendixentry = \shortappendixentry - \let\unnumbchapentry = \shortunnumberedentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf - \let\sl=\shortcontsl \let\tt=\shortconttt - \rm - \hyphenpenalty = 10000 - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - \def\subsecentry ##1##2##3##4##5{} - \def\subsubsecentry ##1##2##3##4##5##6{} - \let\unnumbsecentry = \secentry - \let\unnumbsubsecentry = \subsecentry - \let\unnumbsubsubsecentry = \subsubsecentry - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno + \startcontents{\putwordShortTOC}% + % + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } \let\shortcontents = \summarycontents -\ifpdf - \pdfcatalog{/PageMode /UseOutlines}% -\fi +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. @@ -4247,58 +5805,46 @@ width0pt\relax} \fi % The arguments in between are the chapter number, section number, ... % Chapters, in the main contents. -\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. -\def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. -\def\appendixentry#1#2#3{% - \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}} +% Need the word Appendix, and a fixed-size box. % -% Appendices, in the short toc. -\let\shortappendixentry = \shortchapentry - -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. -% We could simplify the code here by writing out an \appendixentry -% command in the toc file for appendices, instead of using \chapentry -% for both, but it doesn't seem worth it. -% -\newdimen\shortappendixwidth +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} % -\def\shortchaplabel#1{% - % This space should be enough, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % But use \hss just in case. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in by \shortchapentry above.) - \dimen0 = 1em - \hbox to \dimen0{#1\hss}% -} +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. -\def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}} -\def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}} +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. -\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}} +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. -\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}} +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. -\def\subsubsecentry#1#2#3#4#5#6{% - \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}} +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. -\newdimen\tocindent \tocindent = 3pc +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. @@ -4329,17 +5875,8 @@ width0pt\relax} \fi \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} -% Final typesetting of a toc entry; we use the same \entry macro as for -% the index entries, but we want to suppress hyphenation here. (We -% can't do that in the \entry macro, since index entries might consist -% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -\def\tocentry#1#2{\begingroup - \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - % Do not use \turnoffactive in these arguments. Since the toc is - % typeset in cmr, characters such as _ would come out wrong; we - % have to do the usual translation tricks. - \entry{#1}{#2}% -\endgroup} +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} @@ -4349,62 +5886,30 @@ width0pt\relax} \fi \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} -\let\subsecentryfonts = \textfonts -\let\subsubsecentryfonts = \textfonts +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. -% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. -% -% Since these characters are used in examples, it should be an even number of -% \tt widths. Each \tt character is 1en, so two makes it 1em. -% -\def\point{$\star$} -\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} -\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} -\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} -\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} - -% The @error{} command. -% Adapted from the TeXbook's \boxit. -% -\newbox\errorbox -% -{\tentt \global\dimen0 = 3em}% Width of the box. -\dimen2 = .55pt % Thickness of rules -% The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} -% -\global\setbox\errorbox=\hbox to \dimen0{\hfil - \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. - \advance\hsize by -2\dimen2 % Rules. - \vbox{ - \hrule height\dimen2 - \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. - \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. - \kern3pt\vrule width\dimen2}% Space to right. - \hrule height\dimen2} - \hfil} -% -\def\error{\leavevmode\lower.7ex\copy\errorbox} - % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. -\def\tex{\begingroup +\envdef\tex{% + \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other - \catcode `\==\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other + \catcode`\`=\other + \catcode`\'=\other \escapechar=`\\ % \let\b=\ptexb @@ -4416,19 +5921,25 @@ width0pt\relax} \fi \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace + \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext + \expandafter \let\csname top\endcsname=\ptextop % outer + \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% -\let\Etex=\endgroup} +} +% There is no need to define \Etex. % Define @lisp ... @end lisp. -% @lisp does a \begingroup so it can rebind things, +% @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. @@ -4439,19 +5950,6 @@ width0pt\relax} \fi % have any width. \def\lisppar{\null\endgraf} -% Make each space character in the input produce a normal interword -% space in the output. Don't allow a line break at this space, as this -% is used only in environments like @example, where each line of input -% should produce a line of output anyway. -% -{\obeyspaces % -\gdef\sepspaces{\obeyspaces\let =\tie}} - -% Define \obeyedspace to be our active space, whatever it is. This is -% for use in \parsearg. -{\sepspaces% -\global\let\obeyedspace= } - % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt @@ -4461,7 +5959,8 @@ width0pt\relax} \fi % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% - % =10000 instead of <10000 because of a special case in \itemzzz, q.v. + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf @@ -4469,7 +5968,7 @@ width0pt\relax} \fi \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... - \ifnum\lastpenalty>10000 \else \penalty-50 \fi + \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi @@ -4477,7 +5976,8 @@ width0pt\relax} \fi \let\afterenvbreak = \aboveenvbreak -% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around @@ -4501,174 +6001,256 @@ width0pt\relax} \fi % \newskip\lskip\newskip\rskip -\def\cartouche{% -\par % can't be in the midst of a paragraph. -\begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char, and rule thickness - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing = t% + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} \def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup -\endgroup -}} + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} % This macro is called at the beginning of all the @example variants, % inside a group. +\newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak - \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt + % Turn off paragraph indentation but redefine \indent to emulate + % the normal \indent. + \nonfillparindent=\parindent \parindent = 0pt + \let\indent\nonfillindent + % \emergencystretch = 0pt % don't try to avoid overfull boxes - % @cartouche defines \nonarrowing to inhibit narrowing - % at next level down. \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing - \let\exdent=\nofillexdent - \let\nonarrowing=\relax + \else + \let\nonarrowing = \relax \fi + \let\exdent=\nofillexdent } -% Define the \E... control sequence only if we are inside the particular -% environment, so the error checking in \end will work. -% -% To end an @example-like environment, we first end the paragraph (via -% \afterenvbreak's vertical glue), and then the group. That way we keep -% the zero \parskip that the environments set -- \parskip glue will be -% inserted at the beginning of the next paragraph in the document, after -% the environment. -% -\def\nonfillfinish{\afterenvbreak\endgroup} +\begingroup +\obeyspaces +% We want to swallow spaces (but not other tokens) after the fake +% @indent in our nonfill-environments, where spaces are normally +% active and set to @tie, resulting in them not being ignored after +% @indent. +\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% +\gdef\nonfillindentcheck{% +\ifx\temp % +\expandafter\nonfillindentgobble% +\else% +\leavevmode\nonfillindentbox% +\fi% +}% +\endgroup +\def\nonfillindentgobble#1{\nonfillindent} +\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} -% @lisp: indented, narrowed, typewriter font. -\def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. - \gobble % eat return +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } -% @example: Same as @lisp. -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. +% % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. -\def\smalllisp{\begingroup - \def\Esmalllisp{\nonfillfinish\endgroup}% - \def\Esmallexample{\nonfillfinish\endgroup}% - \smallexamplefonts - \lisp -} -\let\smallexample = \smalllisp - - -% @display: same as @lisp except keep current font. % -\def\display{\begingroup +\maketwodispenvs {lisp}{example}{% \nonfillstart - \let\Edisplay = \nonfillfinish - \gobble + \tt\setupmarkupstyle{example}% + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return } +% @display/@smalldisplay: same as @lisp except keep current font. % -% @smalldisplay: @display plus smaller fonts. -% -\def\smalldisplay{\begingroup - \def\Esmalldisplay{\nonfillfinish\endgroup}% - \smallexamplefonts \rm - \display +\makedispenv {display}{% + \nonfillstart + \gobble } -% @format: same as @display except don't narrow margins. +% @format/@smallformat: same as @display except don't narrow margins. % -\def\format{\begingroup - \let\nonarrowing = t +\makedispenv{format}{% + \let\nonarrowing = t% \nonfillstart - \let\Eformat = \nonfillfinish \gobble } -% -% @smallformat: @format plus smaller fonts. -% -\def\smallformat{\begingroup - \def\Esmallformat{\nonfillfinish\endgroup}% - \smallexamplefonts \rm - \format -} -% @flushleft (same as @format). -% -\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak % @flushright. % -\def\flushright{\begingroup - \let\nonarrowing = t +\envdef\flushright{% + \let\nonarrowing = t% \nonfillstart - \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } +\let\Eflushright = \afterenvbreak + + +% @raggedright does more-or-less normal line breaking but no right +% justification. From plain.tex. +\envdef\raggedright{% + \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax +} +\let\Eraggedright\par + +\envdef\raggedleft{% + \parindent=0pt \leftskip0pt plus2em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedleft\par + +\envdef\raggedcenter{% + \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. % -\def\quotation{% - \begingroup\inENV %This group ends at the end of the @quotation body +\def\quotationstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt - % We have retained a nonzero parskip for the environment, since we're - % doing normal filling. So to avoid extra space below the environment... - \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing + \else \let\nonarrowing = \relax \fi + \parsearg\quotationlabel +} + +\envdef\quotation{% + \setnormaldispenv + \quotationstart +} + +\envdef\smallquotation{% + \setsmalldispenv + \quotationstart +} +\let\Esmallquotation = \Equotation + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi } % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} -% If we want to allow any <char> as delimiter, +% If we want to allow any <char> as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % @@ -4681,17 +6263,15 @@ width0pt\relax} \fi \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% + % Don't do the quotes -- if we do, @set txicodequoteundirected and + % @set txicodequotebacktick will not have effect on @verb and + % @verbatim, and ?` and !` ligatures won't get disabled. + %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% - \def\do##1{\catcode`##1=12}\dospecials} -% -% [Knuth] pp. 380,381,391 -% Disable Spanish ligatures ?` and !` of \tt font -\begingroup - \catcode`\`=\active\gdef`{\relax\lq} -\endgroup + \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % @@ -4704,7 +6284,7 @@ width0pt\relax} \fi \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% - \catcode`\`=\active + \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and @@ -4719,6 +6299,7 @@ width0pt\relax} \fi \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} +% \begingroup \catcode`\^^I=\active \gdef\tabexpand{% @@ -4732,12 +6313,16 @@ width0pt\relax} \fi }% } \endgroup + +% start the verbatim environment. \def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% - \catcode`\`=\active \tabexpand + \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count @@ -4746,15 +6331,15 @@ width0pt\relax} \fi \everypar{\starttabbox}% } -% Do the @verb magic: verbatim text is quoted by unique -% delimiter characters. Before first delimiter expect a +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'<char>#1<char>'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup - \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12 + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % @@ -4766,18 +6351,11 @@ width0pt\relax} \fi % % \def\doverbatim#1@end verbatim{#1} % -% For Texinfo it's a lot easier than for LaTeX, +% For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] -%% Include LaTeX hack for completeness -- never know -%% \begingroup -%% \catcode`|=0 \catcode`[=1 -%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active -%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ -%% #1|endgroup|def|Everbatim[]|end[verbatim]] -%% |endgroup % \begingroup \catcode`\ =\active @@ -4785,697 +6363,394 @@ width0pt\relax} \fi % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. - \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}% + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. \endgroup % -\def\verbatim{% - \def\Everbatim{\nonfillfinish\endgroup}% - \begingroup - \nonfillstart - \advance\leftskip by -\defbodyindent - \begingroup\setupverbatim\doverbatim +\envdef\verbatim{% + \setupverbatim\doverbatim } +\let\Everbatim = \afterenvbreak + % @verbatiminclude FILE - insert text of file in verbatim environment. % -% Allow normal characters that we make active in the argument (a file name). -\def\verbatiminclude{% - \begingroup - \catcode`\\=\other - \catcode`~=\other - \catcode`^=\other - \catcode`_=\other - \catcode`|=\other - \catcode`<=\other - \catcode`>=\other - \catcode`+=\other - \parsearg\doverbatiminclude -} -\def\setupverbatiminclude{% - \begingroup - \nonfillstart - \advance\leftskip by -\defbodyindent - \begingroup\setupverbatim -} +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% - % Restore active chars for included file. - \endgroup - \begingroup - \let\value=\expandablevalue - \def\thisfile{#1}% - \expandafter\expandafter\setupverbatiminclude\input\thisfile - \endgroup - \nonfillfinish - \endgroup + {% + \makevalueexpandable + \setupverbatim + \indexnofonts % Allow `@@' and other weird things in file names. + \input #1 + \afterenvbreak + }% } % @copying ... @end copying. -% Save the text away for @insertcopying later. Many commands won't be -% allowed in this context, but that's ok. -% +% Save the text away for @insertcopying later. +% % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. -% -\def\copying{\begingroup - % Define a command to swallow text until we reach `@end copying'. - % \ is the escape char in this texinfo.tex file, so it is the - % delimiter for the command; @ will be the escape char when we read - % it, but that doesn't matter. - \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}% - % - % We must preserve ^^M's in the input file; see \insertcopying below. - \catcode`\^^M = \active - \docopying -} - -% What we do to finish off the copying text. % -\def\enddocopying{\endgroup\ignorespaces} - -% @insertcopying. Here we must play games with ^^M's. On the one hand, -% we need them to delimit commands such as `@end quotation', so they -% must be active. On the other hand, we certainly don't want every -% end-of-line to be a \par, as would happen with the normal active -% definition of ^^M. On the third hand, two ^^M's in a row should still -% generate a \par. -% -% Our approach is to make ^^M insert a space and a penalty1 normally; -% then it can also check if \lastpenalty=1. If it does, then manually -% do \par. -% -% This messes up the normal definitions of @c[omment], so we redefine -% it. Similarly for @ignore. (These commands are used in the gcc -% manual for man page generation.) -% -% Seems pretty fragile, most line-oriented commands will presumably -% fail, but for the limited use of getting the copying text (which -% should be quite simple) inserted, we can hope it's ok. -% -{\catcode`\^^M=\active % -\gdef\insertcopying{\begingroup % - \parindent = 0pt % looks wrong on title page - \def^^M{% - \ifnum \lastpenalty=1 % - \par % - \else % - \space \penalty 1 % - \fi % - }% - % - % Fix @c[omment] for catcode 13 ^^M's. - \def\c##1^^M{\ignorespaces}% - \let\comment = \c % - % - % Don't bother jumping through all the hoops that \doignore does, it - % would be very hard since the catcodes are already set. - \long\def\ignore##1\end ignore{\ignorespaces}% - % - \copyingtext % -\endgroup}% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup } + \message{defuns,} % @defun etc. -% Allow user to change definition object font (\df) internally -\def\setdeffont#1 {\csname DEF#1\endcsname} - \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt - -\newcount\parencount - -% We want ()&[] to print specially on the defun line. -% -\def\activeparens{% - \catcode`\(=\active \catcode`\)=\active - \catcode`\&=\active - \catcode`\[=\active \catcode`\]=\active -} - -% Make control sequences which act like normal parenthesis chars. -\let\lparen = ( \let\rparen = ) - -{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) - -% Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. -\global\let(=\lparen \global\let)=\rparen -\global\let[=\lbrack \global\let]=\rbrack - -\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } -\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} -% This is used to turn on special parens -% but make & act ordinary (given that it's active). -\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} - -% Definitions of (, ) and & used in args for functions. -% This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested - \global\advance\parencount by 1 -} -% -% This is the definition of ( when already inside a level of parens. -\gdef\opnested{\char`\(\global\advance\parencount by 1 } -% -\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. - % also in that case restore the outer-level definition of (. - \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi - \global\advance \parencount by -1 } -% If we encounter &foo, then turn on ()-hacking afterwards -\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } -% -\gdef\normalparens{\boldbrax\let&=\ampnr} -} % End of definition inside \activeparens -%% These parens (in \boldbrax) actually are a little bolder than the -%% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } -\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } -\let\ampnr = \& -\def\lbrb{{\bf\char`\[}} -\def\rbrb{{\bf\char`\]}} - -% Active &'s sneak into the index arguments, so make sure it's defined. -{ - \catcode`& = \active - \global\let& = \ampnr -} - -% \defname, which formats the name of the @def (not the args). -% #1 is the function name. -% #2 is the type of definition, such as "Function". -% -\def\defname#1#2{% - % How we'll output the type name. Putting it in brackets helps - % distinguish it from the body text that may end up on the next line - % just below it. - \ifempty{#2}% - \def\defnametype{}% +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. \else - \def\defnametype{[\rm #2]}% + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a minor refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint \fi % - % Get the values of \leftskip and \rightskip as they were outside the @def... - \dimen2=\leftskip - \advance\dimen2 by -\defbodyindent - % - % Figure out values for the paragraph shape. - \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}% - \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line - \dimen1=\hsize \advance \dimen1 by -\defargsindent % size for continuations - \parshape 2 0in \dimen0 \defargsindent \dimen1 - % - % Output arg 2 ("Function" or some such) but stuck inside a box of - % width 0 so it does not interfere with linebreaking. - \noindent - % - {% Adjust \hsize to exclude the ambient margins, - % so that \rightline will obey them. - \advance \hsize by -\dimen2 - \dimen3 = 0pt % was -1.25pc - \rlap{\rightline{\defnametype\kern\dimen3}}% - }% - % - % Allow all lines to be underfull without complaint: - \tolerance=10000 \hbadness=10000 - \advance\leftskip by -\defbodyindent - \exdentamount=\defbodyindent - {\df #1}\enskip % output function name - % \defunargs will be called next to output the arguments, if any. -} - -% Common pieces to start any @def... -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence (which our caller defines). -% #3 is the control sequence to process the header, such as \defunheader. -% -\def\parsebodycommon#1#2#3{% - \begingroup\inENV - % If there are two @def commands in a row, we'll have a \nobreak, - % which is there to keep the function description together with its - % header. But if there's nothing but headers, we want to allow a - % break after all. Check for penalty 10002 (inserted by - % \defargscommonending) instead of 10000, since the sectioning - % commands insert a \penalty10000, and we don't want to allow a break - % between a section heading and a defun. - \ifnum\lastpenalty=10002 \penalty0 \fi - \medbreak - % - % Define the \E... end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } -% Common part of the \...x definitions. -% -\def\defxbodycommon{% - % As with \parsebodycommon above, allow line break if we have multiple - % x headers in a row. It's not a great place, though. - \ifnum\lastpenalty=10000 \penalty1000 \fi +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% % - \begingroup\obeylines -} - -% Process body of @defun, @deffn, @defmac, etc. -% -\def\defparsebody#1#2#3{% - \parsebodycommon{#1}{#2}{#3}% - \def#2{\defxbodycommon \activeparens \spacesplit#3}% - \catcode\equalChar=\active - \begingroup\obeylines\activeparens - \spacesplit#3% -} - -% #1, #2, #3 are the common arguments (see \parsebodycommon above). -% #4, delimited by the space, is the class name. -% -\def\defmethparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}% - \begingroup\obeylines\activeparens - % The \empty here prevents misinterpretation of a construct such as - % @deffn {whatever} {Enharmonic comma} - % See comments at \deftpparsebody, although in our case we don't have - % to remove the \empty afterwards, since it is empty. - \spacesplit{#3{#4}}\empty + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% } +\def\gobbledefun#1\startdefun{} -% Used for @deftypemethod and @deftypeivar. -% #1, #2, #3 are the common arguments (see \defparsebody). -% #4, delimited by a space, is the class name. -% #5 is the method's return type. +% \printdefunline \deffnheader{text} % -\def\deftypemethparsebody#1#2#3#4 #5 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}% - \begingroup\obeylines\activeparens - \spacesplit{#3{#4}{#5}}% -} - -% Used for @deftypeop. The change from \deftypemethparsebody is an -% extra argument at the beginning which is the `category', instead of it -% being the hardwired string `Method' or `Instance Variable'. We have -% to account for this both in the \...x definition and in parsing the -% input at hand. Thus also need a control sequence (passed as #5) for -% the \E... definition to assign the category name to. -% -\def\deftypeopparsebody#1#2#3#4#5 #6 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 ##3 {\def#4{##1}% - \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}% - \begingroup\obeylines\activeparens - \spacesplit{#3{#5}{#6}}% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup } -% For @defop. -\def\defopparsebody #1#2#3#4#5 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 {\def#4{##1}% - \defxbodycommon \activeparens \spacesplit{#3{##2}}}% - \begingroup\obeylines\activeparens - \spacesplit{#3{#5}}% -} +\def\Edefun{\endgraf\medbreak} -% These parsing functions are similar to the preceding ones -% except that they do not make parens into active characters. -% These are used for "variables" since they have no arguments. +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remaining is to define \deffnheader. % -\def\defvarparsebody #1#2#3{% - \parsebodycommon{#1}{#2}{#3}% - \def#2{\defxbodycommon \spacesplit#3}% - \catcode\equalChar=\active - \begingroup\obeylines - \spacesplit#3% -} - -% @defopvar. -\def\defopvarparsebody #1#2#3#4#5 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 {\def#4{##1}% - \defxbodycommon \spacesplit{#3{##2}}}% - \begingroup\obeylines - \spacesplit{#3{#5}}% -} - -\def\defvrparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% - \begingroup\obeylines - \spacesplit{#3{#4}}% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp } -% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the -% type is just `struct', because we lose the braces in `{struct -% termios}' when \spacesplit reads its undelimited argument. Sigh. -% \let\deftpparsebody=\defvrparsebody +% \domakedefun \deffn \deffnx \deffnheader % -% So, to get around this, we put \empty in with the type name. That -% way, TeX won't find exactly `{...}' as an undelimited argument, and -% won't strip off the braces. +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. % -\def\deftpparsebody #1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% - \begingroup\obeylines - \spacesplit{\parsetpheaderline{#3{#4}}}\empty +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% } -% Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does. -% -\def\removeemptybraces\empty#1\relax{#1} +%%% Untyped functions: -% After \spacesplit has done its work, this is called -- #1 is the final -% thing to call, #2 the type name (which starts with \empty), and #3 -% (which might be empty) the arguments. -% -\def\parsetpheaderline#1#2#3{% - #1{\removeemptybraces#2\relax}{#3}% -}% +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} -% Split up #2 (the rest of the input line) at the first space token. -% call #1 with two arguments: -% the first is all of #2 before the space token, -% the second is all of #2 after that space token. -% If #2 contains no space token, all of it is passed as the first arg -% and the second is passed as empty. -% -{\obeylines % - \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}% - \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{% - \ifx\relax #3% - #1{#2}{}% - \else % - #1{#2}{#3#4}% - \fi}% -} +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} -% Define @defun. +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } -% This is called to end the arguments processing for all the @def... commands. +% \deffngeneral {subind}category name args % -\def\defargscommonending{% - \interlinepenalty = 10000 - \advance\rightskip by 0pt plus 1fil - \endgraf - \nobreak\vskip -\parskip - \penalty 10002 % signal to \parsebodycommon. +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } -% This expands the args and terminates the paragraph they comprise. -% -\def\defunargs#1{\functionparens \sl -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Set the font temporarily and use \font in case \setfont made \tensl a macro. -{\tensl\hyphenchar\font=0}% -#1% -{\tensl\hyphenchar\font=45}% -\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% - \defargscommonending -} +%%% Typed functions: -\def\deftypefunargs #1{% -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Use \boldbraxnoamp, not \functionparens, so that & is not special. -\boldbraxnoamp -\tclose{#1}% avoid \code because of side effects on active chars - \defargscommonending -} +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} -% Do complete processing of one @defun or @defunx line already parsed. +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} -% @deffn Command forward-char nchars +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } -\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} - -\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% -\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } -% @defun == @deffn Function +%%% Typed variables: -\def\defun{\defparsebody\Edefun\defunx\defunheader} - -\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDeffunc}% -\defunargs {#2}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody -} +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} -% @deftypefun int foobar (int @var{foo}, float @var{bar}) +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} -\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } -% #1 is the data type. #2 is the name and args. -\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} -% #1 is the data type, #2 the name, #3 the args. -\def\deftypefunheaderx #1#2 #3\relax{% -\doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% -\deftypefunargs {#3}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } -% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) +%%% Untyped variables: -\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } -% \defheaderxcond#1\relax$.$ -% puts #1 in @code, followed by a space, but does nothing if #1 is null. -\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} -% #1 is the classification. #2 is the data type. #3 is the name and args. -\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} -% #1 is the classification, #2 the data type, #3 the name, #4 the args. -\def\deftypefnheaderx #1#2#3 #4\relax{% -\doind {fn}{\code{#3}}% Make entry in function index -\begingroup -\normalparens % notably, turn off `&' magic, which prevents -% at least some C++ text from working -\defname {\defheaderxcond#2\relax$.$#3}{#1}% -\deftypefunargs {#4}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody -} +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } -% @defmac == @deffn Macro - -\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} - -\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefmac}% -\defunargs {#2}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% } -% @defspec == @deffn Special Form - -\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} -\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefspec}% -\defunargs {#2}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody -} - -% @defop CATEGORY CLASS OPERATION ARG... +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. % -\def\defop #1 {\def\defoptype{#1}% -\defopparsebody\Edefop\defopx\defopheader\defoptype} +% We are followed by (but not passed) the arguments, if any. % -\def\defopheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry - \begingroup - \defname{#2}{\defoptype\ \putwordon\ #1}% - \defunargs{#3}% - \endgroup +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. } -% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... -% -\def\deftypeop #1 {\def\deftypeopcategory{#1}% - \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader - \deftypeopcategory} +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. % -% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. -\def\deftypeopheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3} - {\deftypeopcategory\ \putwordon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + #1% + \sl\hyphenchar\font=45 } -% @deftypemethod CLASS TYPE METHOD ARG... -% -\def\deftypemethod{% - \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} +% We want ()&[] to print specially on the defun line. % -% #1 is the class name, #2 the data type, #3 the method name, #4 the args. -\def\deftypemethodheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active } -% @deftypeivar CLASS TYPE VARNAME -% -\def\deftypeivar{% - \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} -% -% #1 is the class name, #2 the data type, #3 the variable name. -\def\deftypeivarheader#1#2#3{% - \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3} - {\putwordInstanceVariableof\ \code{#1}}% - \defvarargs{#3}% - \endgroup -} +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) -% @defmethod == @defop Method -% -\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} -% -% #1 is the class name, #2 the method name, #3 the args. -\def\defmethodheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{#2}{\putwordMethodon\ \code{#1}}% - \defunargs{#3}% - \endgroup -} +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& -% @defcv {Class Option} foo-class foo-flag + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} -\def\defcv #1 {\def\defcvtype{#1}% -\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} +\newcount\parencount -\def\defcvarheader #1#2#3{% - \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry - \begingroup - \defname{#2}{\defcvtype\ \putwordof\ #1}% - \defvarargs{#3}% - \endgroup +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi } - -% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME -% -\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} -% -\def\defivarheader#1#2#3{% - \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index - \begingroup - \defname{#2}{\putwordInstanceVariableof\ #1}% - \defvarargs{#3}% - \endgroup +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi } +\def\bfafterword#1 {#1 \bf} -% @defvar -% First, define the processing that is wanted for arguments of @defvar. -% This is actually simple: just print them in roman. -% This must expand the args and terminate the paragraph they make up -\def\defvarargs #1{\normalparens #1% - \defargscommonending +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword } - -% @defvr Counter foo-count - -\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} - -\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% -\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} - -% @defvar == @defvr Variable - -\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} - -\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefvar}% -\defvarargs {#2}\endgroup % +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 } -% @defopt == @defvr {User Option} - -\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} - -\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefopt}% -\defvarargs {#2}\endgroup % +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 } -% @deftypevar int foobar - -\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - -% #1 is the data type. #2 is the name, perhaps followed by text that -% is actually part of the data type, which should not be put into the index. -\def\deftypevarheader #1#2{% -\dovarind#2 \relax% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% - \defargscommonending -\endgroup} -\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} - -% @deftypevr {Global Flag} int enable - -\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - -\def\deftypevrheader #1#2#3{\dovarind#3 \relax% -\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} - \defargscommonending -\endgroup} - -% Now define @deftp -% Args are printed in bold, a slight difference from @defvar. - -\def\deftpargs #1{\bf \defvarargs{#1}} - -% @deftp Class window height width ... - -\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} - -\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% -\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} - -% These definitions are used if you use @defunx (etc.) -% anywhere other than immediately after a @defun or @defunx. -% -\def\defcvx#1 {\errmessage{@defcvx in invalid context}} -\def\deffnx#1 {\errmessage{@deffnx in invalid context}} -\def\defivarx#1 {\errmessage{@defivarx in invalid context}} -\def\defmacx#1 {\errmessage{@defmacx in invalid context}} -\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\defopx#1 {\errmessage{@defopx in invalid context}} -\def\defspecx#1 {\errmessage{@defspecx in invalid context}} -\def\deftpx#1 {\errmessage{@deftpx in invalid context}} -\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} -\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} -\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} -\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} -\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} -\def\defunx#1 {\errmessage{@defunx in invalid context}} -\def\defvarx#1 {\errmessage{@defvarx in invalid context}} -\def\defvrx#1 {\errmessage{@defvrx in invalid context}} +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). +\def\badparencount{% + \message{Warning: unbalanced parentheses in @def...}% + \global\parencount=0 +} +\def\badbrackcount{% + \message{Warning: unbalanced square brackets in @def...}% + \global\brackcount=0 +} \message{macros,} @@ -5484,42 +6759,68 @@ width0pt\relax} \fi % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined - \newwrite\macscribble - \def\scanmacro#1{% - \begingroup \newlinechar`\^^M - % Undo catcode changes of \startcontents and \doprintindex - \catcode`\@=0 \catcode`\\=\other \escapechar=`\@ - % Append \endinput to make sure that TeX does not see the ending newline. - \toks0={#1\endinput}% - \immediate\openout\macscribble=\jobname.tmp - \immediate\write\macscribble{\the\toks0}% - \immediate\closeout\macscribble - \let\xeatspaces\eatspaces - \input \jobname.tmp - \endgroup -} -\else -\def\scanmacro#1{% -\begingroup \newlinechar`\^^M -% Undo catcode changes of \startcontents and \doprintindex -\catcode`\@=0 \catcode`\\=\other \escapechar=`\@ -\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } \fi +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newline. + % I've verified that it is necessary both for e-TeX and for ordinary TeX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? -\def\macrolist{} % List of all defined macros in the form - % \do\macro1\do\macro2... + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} % Utility routines. -% Thisdoes \let #1 = #2, except with \csnames. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% \def\cslet#1#2{% -\expandafter\expandafter -\expandafter\let -\expandafter\expandafter -\csname#1\endcsname -\csname#2\endcsname} + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). @@ -5542,34 +6843,45 @@ width0pt\relax} \fi % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. + % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. -\def\macrobodyctxt{% - \catcode`\~=\other +\def\scanctxt{% + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other - \catcode`\<=\other - \catcode`\>=\other - \catcode`\+=\other + \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi +} + +\def\scanargctxt{% + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% + \scanctxt \catcode`\{=\other \catcode`\}=\other - \catcode`\@=\other \catcode`\^^M=\other - \usembodybackslash} + \usembodybackslash +} \def\macroargctxt{% - \catcode`\~=\other - \catcode`\^=\other - \catcode`\_=\other - \catcode`\|=\other - \catcode`\<=\other - \catcode`\>=\other - \catcode`\+=\other - \catcode`\@=\other - \catcode`\\=\other} + \scanctxt + \catcode`\\=\other +} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N @@ -5600,25 +6912,21 @@ width0pt\relax} \fi \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% - % Add the macroname to \macrolist - \toks0 = \expandafter{\macrolist\do}% - \xdef\macrolist{\the\toks0 - \expandafter\noexpand\csname\the\macname\endcsname}% + \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} -\def\unmacro{\parsearg\dounmacro} -\def\dounmacro#1{% +\parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax - \let\do\unmacrodo + \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else @@ -5628,12 +6936,12 @@ width0pt\relax} \fi % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. -% +% \def\unmacrodo#1{% - \ifx#1\relax + \ifx #1\relax % remove this \else - \noexpand\do \noexpand #1% + \noexpand\definedummyword \noexpand#1% \fi } @@ -5746,34 +7054,31 @@ width0pt\relax} \fi % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) -\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg - \fi \next} - -% We mant to disable all macros during \shipout so that they are not -% expanded by \write. -\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% - \edef\next{\macrolist}\expandafter\endgroup\next} + \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Just make them active and then expand them all to nothing. -\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} +\def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} -\def\aliasyyy #1=#2\relax{\ignoreactivespaces -\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% - \expandafter\noexpand\csname#2\endcsname}% -\expandafter\endgroup\next} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} \message{cross references,} -% @xref etc. \newwrite\auxfile - \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. @@ -5782,64 +7087,68 @@ width0pt\relax} \fi \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} -% @node's job is to define \lastnode. -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + \let\nwnode=\node -\let\lastnode=\relax - -% The sectioning commands (@chapter, etc.) call these. -\def\donoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Ysectionnumberandtype}% - \global\let\lastnode=\relax - \fi -} -\def\unnumbnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% - \global\let\lastnode=\relax - \fi -} -\def\appendixnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Yappendixletterandtype}% - \global\let\lastnode=\relax +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty \fi } - % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister -\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} -\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} -\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an -% anchor), namely NAME-title (the corresponding @chapter/etc. name), -% NAME-pg (the page number), and NAME-snt (section number and type). -% Called from \foonoderef. -% -% We have to set \indexdummies so commands such as @code in a section -% title aren't expanded. It would be nicer not to expand the titles in -% the first place, but there's so many layers that that is hard to do. -% -% Likewise, use \turnoffactive so that punctuation chars such as underscore -% and backslash work in node names. -% -\def\setref#1#2{{% - \atdummies +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \lastsection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% \pdfmkdest{#1}% - % - \turnoffactive - \dosetq{#1-title}{Ytitle}% - \dosetq{#1-pg}{Ypagenumber}% - \dosetq{#1-snt}{#2}% -}} + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\lastsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout + }% + \fi +} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed @@ -5852,94 +7161,128 @@ width0pt\relax} \fi \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% - \def\printednodename{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual}% - \setbox0=\hbox{\printednodename}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual\unskip}% + \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. - \def\printednodename{\refx{#1-title}{}}% + \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. + % Make link in pdf output. \ifpdf - \leavevmode - \getfilename{#4}% - {\turnoffactive \otherbackslash + {\indexnofonts + \turnoffactive + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. + \getfilename{#4}% + % + % See comments at \activebackslashdouble. + {\activebackslashdouble \xdef\pdfxrefdest{#1}% + \backslashparens\pdfxrefdest}% + % + \leavevmode + \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 - \startlink attr{/Border [0 0 0]}% - goto file{\the\filename.pdf} name{#1}% + goto file{\the\filename.pdf} name{\pdfxrefdest}% \else - \startlink attr{/Border [0 0 0]}% - goto name{#1}% + goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% - \linkcolor + \setcolor{\linkcolor}% \fi % - \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\turnoffactive \otherbackslash - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - }% - % [mynode], - [\printednodename],\space - % page 3 - \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% + % node/anchor (non-float) references. + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi \fi \endlink \endgroup} -% \dosetq is called from \setref to do the actual \write (\iflinks). +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). % -\def\dosetq#1#2{% - {\let\folio=0% - \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% - \iflinks \next \fi - }% -} - -% \internalsetq{foo}{page} expands into -% CHARACTERS @xrdef{foo}{...expansion of \page...} -\def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}} +\def\xrefprintnodename#1{[#1]} -% Things to be expanded by \internalsetq. -% -\def\Ypagenumber{\folio} -\def\Ytitle{\thissection} +% Things referred to by \setref. +% \def\Ynothing{} -\def\Ysectionnumberandtype{% +\def\Yomitfromtoc{} +\def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 @@ -5950,8 +7293,7 @@ width0pt\relax} \fi \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } - -\def\Yappendixletterandtype{% +\def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 @@ -5964,15 +7306,6 @@ width0pt\relax} \fi \fi\fi\fi } -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. -% -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Pre-3.0. -\else - \def\linenumber{\the\inputlineno:\space} -\fi - % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % @@ -5981,7 +7314,7 @@ width0pt\relax} \fi \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX - \csname X#1\endcsname + \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. @@ -6003,12 +7336,54 @@ width0pt\relax} \fi #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. % -\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname} +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} % Read the last existing aux file, if any. No error if none exists. -\def\readauxfile{\begingroup +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other @@ -6066,41 +7441,40 @@ width0pt\relax} \fi \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % - % Make the characters 128-255 be printing characters + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. {% - \count 1=128 + \count1=128 \def\loop{% - \catcode\count 1=\other - \advance\count 1 by 1 - \ifnum \count 1<256 \loop \fi + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi }% }% % - % Turn off \ as an escape so we do not lose on - % entries which were dumped with control sequences in their names. - % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^ - % Reference to such entries still does not work the way one would wish, - % but at least they do not bomb out when the aux file is read in. - \catcode`\\=\other - % - % @ is our escape character in .aux files. + % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 - % - \openin 1 \jobname.aux - \ifeof 1 \else - \closein 1 - \input \jobname.aux - \global\havexrefstrue - \global\warnedobstrue - \fi - % Open the new aux file. TeX will close it automatically at exit. - \openout\auxfile=\jobname.aux +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 \endgroup} -% Footnotes. +\message{insertions,} +% including footnotes. \newcount \footnoteno @@ -6114,19 +7488,19 @@ width0pt\relax} \fi % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment -\let\ptexfootnote=\footnote - {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip @@ -6137,17 +7511,12 @@ width0pt\relax} \fi % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % -% Oh yes, they do; otherwise, @ifset and anything else that uses -% \parseargline fail inside footnotes because the tokens are fixed when +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % -% The start of the footnote looks usually like this: -\gdef\startfootins{\insert\footins\bgroup} -% -% ... but this macro is redefined inside @multitable. -% \gdef\dofootnote{% - \startfootins + \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. @@ -6183,40 +7552,66 @@ width0pt\relax} \fi } }%end \catcode `\@=11 -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarly, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. % -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi } -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % -\def\finalout{\overfullrule=0pt} +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. @@ -6226,12 +7621,12 @@ width0pt\relax} \fi % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else - \closein 1 % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi +\closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf @@ -6264,15 +7659,19 @@ width0pt\relax} \fi % If the image is by itself, center it. \ifvmode \imagevmodetrue - \nobreak\bigskip + \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space - % above and below. + % above and below. \nobreak\vskip\parskip \nobreak - \line\bgroup\hss \fi % + % Leave vertical mode so that indentation from an enclosing + % environment such as @quotation is respected. On the other hand, if + % it's at the top level, we don't want the normal paragraph indentation. + \noindent + % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% @@ -6283,45 +7682,1173 @@ width0pt\relax} \fi \epsfbox{#1.eps}% \fi % - \ifimagevmode \hss \egroup \bigbreak \fi % space after the image + \ifimagevmode \medskip \fi % space after the standalone image \endgroup} +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \lastsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\lastsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \lastsection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + \message{localization,} -% and i18n. -% @documentlanguage is usually given very early, just after -% @setfilename. If done too late, it may not override everything -% properly. Single argument is the language abbreviation. -% It would be nice if we could set up a hyphenation file here. +% For single-language documents, @documentlanguage is usually given very +% early, just after @documentencoding. Single argument is the language +% (de) or locale (de_DE) abbreviation. % -\def\documentlanguage{\parsearg\dodocumentlanguage} -\def\dodocumentlanguage#1{% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. - % Read the file if it exists. + % Read the file by the name they passed if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \documentlanguagetrywithoutunderscore{#1_\finish}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 + \endgroup % end raw TeX +\endgroup} +} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\def\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex - \ifeof1 + \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% - \let\temp = \relax \else - \def\temp{\input txi-#1.tex }% + \input txi-#1.tex \fi - \temp - \endgroup + \closein 1 } +% \newhelp\nolanghelp{The given language definition file cannot be found or -is empty. Maybe you need to install it? In the current directory -should work if nowhere else does.} +is empty. Maybe you need to install it? Putting it in the current +directory should work if nowhere else does.} +% This macro is called from txi-??.tex files; the first argument is the +% \language name to set (without the "\lang@" prefix), the second and +% third args are \{left,right}hyphenmin. +% +% The language names to pass are determined when the format is built. +% See the etex.log file created at that time, e.g., +% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. +% +% With TeX Live 2008, etex now includes hyphenation patterns for all +% available languages. This means we can support hyphenation in +% Texinfo, at least to some extent. (This still doesn't solve the +% accented characters problem.) +% +\catcode`@=11 +\def\txisetlanguage#1#2#3{% + % do not set the language if the name is undefined in the current TeX. + \expandafter\ifx\csname lang@#1\endcsname \relax + \message{no patterns for #1}% + \else + \global\language = \csname lang@#1\endcsname + \fi + % but there is no harm in adjusting the hyphenmin values regardless. + \global\lefthyphenmin = #2\relax + \global\righthyphenmin = #3\relax +} -% @documentencoding should change something in TeX eventually, most -% likely, but for now just recognize it. -\let\documentencoding = \comment +% Helpers for encodings. +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} -% Page size parameters. +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. % +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{~} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\guillemetleft} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\guilletright} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{~} + \gdef^^a1{\ogonek{A}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\ogonek{a}} + \gdef^^b2{\ogonek{ }} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\ogonek{E}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\ogonek{e}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'\i} + \gdef^^ee{\^\i} + \gdef^^ef{\v d} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0104}{\ogonek{A}} + \DeclareUnicodeCharacter{0105}{\ogonek{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{02DB}{\ogonek{ }} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2018}{\quoteleft} + \DeclareUnicodeCharacter{2019}{\quoteright} + \DeclareUnicodeCharacter{201A}{\quotesinglbase} + \DeclareUnicodeCharacter{201C}{\quotedblleft} + \DeclareUnicodeCharacter{201D}{\quotedblright} + \DeclareUnicodeCharacter{201E}{\quotedblbase} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{2039}{\guilsinglleft} + \DeclareUnicodeCharacter{203A}{\guilsinglright} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt @@ -6334,7 +8861,7 @@ should work if nowhere else does.} % Don't be so finicky about underfull hboxes, either. \hbadness = 2000 -% Following George Bush, just get rid of widows and orphans. +% Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 @@ -6352,10 +8879,10 @@ should work if nowhere else does.} \fi } -% Parameters in order: 1) textheight; 2) textwidth; 3) voffset; -% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8) -% physical page width. -% +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % @@ -6381,6 +8908,10 @@ should work if nowhere else does.} \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in \fi % \setleading{\textleading} @@ -6395,19 +8926,19 @@ should work if nowhere else does.} \textleading = 13.2pt % % If page is nothing but text, make it come out even. - \internalpagesizes{46\baselineskip}{6in}% + \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} -% Use @smallbook to reset parameters for 7x9.5 (or so) format. +% Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% - {\voffset}{.25in}% + {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % @@ -6418,12 +8949,30 @@ should work if nowhere else does.} \defbodyindent = .5cm }} +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % - % Double-side printing via postscript on Laserjet 4050 + % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then @@ -6433,7 +8982,7 @@ should work if nowhere else does.} % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex - \internalpagesizes{51\baselineskip}{160mm} + \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% @@ -6464,7 +9013,7 @@ should work if nowhere else does.} \tableindent = 12mm }} -% A specific text layout, 24x15cm overall, intended for A4 paper. +% A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% @@ -6490,8 +9039,7 @@ should work if nowhere else does.} % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % -\def\pagesizes{\parsearg\pagesizesxxx} -\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 @@ -6499,7 +9047,7 @@ should work if nowhere else does.} \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % - \dimen0 = #1 + \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize @@ -6518,6 +9066,9 @@ should work if nowhere else does.} \message{and turning on texinfo input format.} +% DEL is a comment character, in case @c does not suffice. +\catcode`\^^? = 14 + % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other @@ -6538,8 +9089,8 @@ should work if nowhere else does.} \def\normalplus{+} \def\normaldollar{$}%$ font-lock fix -% This macro is used to make a character print one way in ttfont -% where it can probably just be output, and another way in other fonts, +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print @@ -6571,6 +9122,7 @@ should work if nowhere else does.} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} +\let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } @@ -6587,46 +9139,49 @@ should work if nowhere else does.} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix -% Set up an active definition for =, but don't enable it most of the time. -{\catcode`\==\active -\global\def={{\tt \char 61}}} - -\catcode`+=\active -\catcode`\_=\active - % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + \catcode`\@=0 -% \rawbackslashxx outputs one backslash character in current font, +% \backslashcurfont outputs one backslash character in current font, % as in \char`\\. -\global\chardef\rawbackslashxx=`\\ - -% \rawbackslash defines an active \ to do \rawbackslashxx. -% \otherbackslash defines an active \ to be a literal `\' character with -% catcode other. -{\catcode`\\=\active - @gdef@rawbackslash{@let\=@rawbackslashxx} - @gdef@otherbackslash{@let\=@realbackslash} -} +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work -% \realbackslash is an actual character `\' with catcode other. -{\catcode`\\=\other @gdef@realbackslash{\}} - -% \normalbackslash outputs one backslash in fixed width font. -\def\normalbackslash{{\tt\rawbackslashxx}} +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. \catcode`\\=\active +@def@normalbackslash{{@tt@backslashcurfont}} +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash + +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} -% Used sometimes to turn off (effectively) the active characters -% even after parsing them. -@def@turnoffactive{% +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. +% +@def@normalturnoffactive{% + @let\=@normalbackslash @let"=@normaldoublequote - @let\=@realbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @@ -6635,14 +9190,11 @@ should work if nowhere else does.} @let>=@normalgreater @let+=@normalplus @let$=@normaldollar %$ font-lock fix + @markupsetuplqdefault + @markupsetuprqdefault + @unsepspaces } -% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. (Thus, \ is not expandable when this is in -% effect.) -% -@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash} - % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive @@ -6655,9 +9207,9 @@ should work if nowhere else does.} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\{ in the file would cause an error. This macro tries to fix +% the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. -% Also back turn on active characters that might appear in the input +% Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @@ -6669,16 +9221,20 @@ should work if nowhere else does.} % Say @foo, not \foo, in error messages. @escapechar = `@@ -% These look ok in all fonts, so just make them not special. +% These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other -@c Set initial fonts. -@textfonts -@rm - - +@c Finally, make ` and ' active, so that txicodequoteundirected and +@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we +@c don't make ` and ' active, @code will not get them as active chars. +@c Do this last of all since we use ` in the previous @catcode assignments. +@catcode`@'=@active +@catcode`@`=@active +@markupsetuplqdefault +@markupsetuprqdefault + @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @@ -6686,3 +9242,9 @@ should work if nowhere else does.} @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/doc/version.texi b/doc/version.texi index ca1a17b..80a2209 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,10 +1,10 @@ @ignore -Copyright (C) 1988-2006 Free Software Foundation, Inc. +Copyright (C) 1988-2009 Free Software Foundation, Inc. @end ignore -@set LASTCHANGE Thu Sep 28 10:25:45 EDT 2006 +@set LASTCHANGE Wed Dec 23 16:29:41 EST 2009 -@set EDITION 3.2 -@set VERSION 3.2 -@set UPDATED 28 September 2006 -@set UPDATED-MONTH September 2006 +@set EDITION 4.1 +@set VERSION 4.1 +@set UPDATED 23 December 2009 +@set UPDATED-MONTH December 2009 |