2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <!-- Created on December, 28 2010 by texi2html 1.64 -->
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
9 Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10 Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
14 <TITLE>Bash Reference Manual: </TITLE>
16 <META NAME="description" CONTENT="Bash Reference Manual: ">
17 <META NAME="keywords" CONTENT="Bash Reference Manual: ">
18 <META NAME="resource-type" CONTENT="document">
19 <META NAME="distribution" CONTENT="global">
20 <META NAME="Generator" CONTENT="texi2html 1.64">
24 <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
26 <A NAME="SEC_Top"></A>
27 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
28 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
29 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
30 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
31 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
33 <H1>Bash Reference Manual</H1></P><P>
35 This text is a brief description of the features that are present in
36 the Bash shell (version 4.2, 28 December 2010).
39 This is Edition 4.2, last updated 28 December 2010,
40 of <CITE>The GNU Bash Reference Manual</CITE>,
41 for <CODE>Bash</CODE>, Version 4.2.
44 Bash contains features that appear in other popular shells, and some
45 features that only appear in Bash. Some of the shells that Bash has
46 borrowed concepts from are the Bourne Shell (<TT>`sh'</TT>), the Korn Shell
47 (<TT>`ksh'</TT>), and the C-shell (<TT>`csh'</TT> and its successor,
48 <TT>`tcsh'</TT>). The following menu breaks the features up into
49 categories based upon which one of these other shells inspired the
53 This manual is meant as a brief introduction to features found in
54 Bash. The Bash manual page should be used as the definitive
55 reference on shell behavior.
58 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
59 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC1">1. Introduction</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">An introduction to the shell.</TD></TR>
60 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC4">2. Definitions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Some definitions used in the rest of this
62 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The shell "building blocks".</TD></TR>
63 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC59">4. Shell Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands that are a part of the shell.</TD></TR>
64 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC66">5. Shell Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables used or set by Bash.</TD></TR>
65 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC69">6. Bash Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Features found only in Bash.</TD></TR>
66 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC92">7. Job Control</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What job control is and how Bash allows you
68 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC96">8. Command Line Editing</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Chapter describing the command line
69 editing features.</TD></TR>
70 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC120">9. Using History Interactively</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command History Expansion</TD></TR>
71 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC127">10. Installing Bash</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to build and install Bash on your system.</TD></TR>
72 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC136">A. Reporting Bugs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to report bugs in Bash.</TD></TR>
73 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC137">B. Major Differences From The Bourne Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A terse list of the differences
74 between Bash and historical
75 versions of /bin/sh.</TD></TR>
76 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC139">C. GNU Free Documentation License</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Copying and sharing this documentation.</TD></TR>
77 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC141">D. Indexes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Various indexes for this manual.</TD></TR>
83 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
84 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> < </A>]</TD>
85 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> > </A>]</TD>
86 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
87 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
88 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD>
89 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
90 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
91 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
92 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
94 <A NAME="Introduction"></A>
95 <H1> 1. Introduction </H1>
97 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
98 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC2">1.1 What is Bash?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A short description of Bash.</TD></TR>
99 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC3">1.2 What is a shell?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A brief introduction to shells.</TD></TR>
100 </TABLE></BLOCKQUOTE>
103 <A NAME="What is Bash?"></A>
106 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
107 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> < </A>]</TD>
108 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> > </A>]</TD>
109 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
110 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD>
111 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD>
112 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
113 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
114 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
115 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
117 <H2> 1.1 What is Bash? </H2>
121 Bash is the shell, or command language interpreter,
122 for the GNU operating system.
123 The name is an acronym for the <SAMP>`Bourne-Again SHell'</SAMP>,
124 a pun on Stephen Bourne, the author of the direct ancestor of
125 the current Unix shell <CODE>sh</CODE>,
126 which appeared in the Seventh Edition Bell Labs Research version
130 Bash is largely compatible with <CODE>sh</CODE> and incorporates useful
131 features from the Korn shell <CODE>ksh</CODE> and the C shell <CODE>csh</CODE>.
132 It is intended to be a conformant implementation of the IEEE
133 POSIX Shell and Tools portion of the IEEE POSIX
134 specification (IEEE Standard 1003.1).
135 It offers functional improvements over <CODE>sh</CODE> for both interactive and
139 While the GNU operating system provides other shells, including
140 a version of <CODE>csh</CODE>, Bash is the default shell.
141 Like other GNU software, Bash is quite portable. It currently runs
142 on nearly every version of Unix and a few other operating systems -
143 independently-supported ports exist for MS-DOS, OS/2,
144 and Windows platforms.
147 <A NAME="What is a shell?"></A>
150 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
151 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> < </A>]</TD>
152 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> > </A>]</TD>
153 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
154 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD>
155 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD>
156 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
157 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
158 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
159 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
161 <H2> 1.2 What is a shell? </H2>
165 At its base, a shell is simply a macro processor that executes
166 commands. The term macro processor means functionality where text
167 and symbols are expanded to create larger expressions.
170 A Unix shell is both a command interpreter and a programming
171 language. As a command interpreter, the shell provides the user
172 interface to the rich set of GNU utilities. The programming
173 language features allow these utilities to be combined.
174 Files containing commands can be created, and become
175 commands themselves. These new commands have the same status as
176 system commands in directories such as <TT>`/bin'</TT>, allowing users
177 or groups to establish custom environments to automate their common
181 Shells may be used interactively or non-interactively. In
182 interactive mode, they accept input typed from the keyboard.
183 When executing non-interactively, shells execute commands read
187 A shell allows execution of GNU commands, both synchronously and
189 The shell waits for synchronous commands to complete before accepting
190 more input; asynchronous commands continue to execute in parallel
191 with the shell while it reads and executes additional commands.
192 The <EM>redirection</EM> constructs permit
193 fine-grained control of the input and output of those commands.
194 Moreover, the shell allows control over the contents of commands'
198 Shells also provide a small set of built-in
199 commands (<EM>builtins</EM>) implementing functionality impossible
200 or inconvenient to obtain via separate utilities.
201 For example, <CODE>cd</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, and
202 <CODE>exec</CODE>) cannot be implemented outside of the shell because
203 they directly manipulate the shell itself.
204 The <CODE>history</CODE>, <CODE>getopts</CODE>, <CODE>kill</CODE>, or <CODE>pwd</CODE>
205 builtins, among others, could be implemented in separate utilities,
206 but they are more convenient to use as builtin commands.
207 All of the shell builtins are described in
211 While executing commands is essential, most of the power (and
212 complexity) of shells is due to their embedded programming
213 languages. Like any high-level language, the shell provides
214 variables, flow control constructs, quoting, and functions.
217 Shells offer features geared specifically for
218 interactive use rather than to augment the programming language.
219 These interactive features include job control, command line
220 editing, command history and aliases. Each of these features is
221 described in this manual.
224 <A NAME="Definitions"></A>
227 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
228 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> < </A>]</TD>
229 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> > </A>]</TD>
230 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
231 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
232 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> >> </A>]</TD>
233 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
234 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
235 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
236 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
238 <H1> 2. Definitions </H1>
240 These definitions are used throughout the remainder of this manual.
245 <DT><CODE>POSIX</CODE>
246 <DD><A NAME="IDX1"></A>
247 A family of open system standards based on Unix. Bash
248 is primarily concerned with the Shell and Utilities portion of the
249 POSIX 1003.1 standard.
252 <DT><CODE>blank</CODE>
253 <DD>A space or tab character.
256 <DT><CODE>builtin</CODE>
257 <DD><A NAME="IDX2"></A>
258 A command that is implemented internally by the shell itself, rather
259 than by an executable program somewhere in the file system.
262 <DT><CODE>control operator</CODE>
263 <DD><A NAME="IDX3"></A>
264 A <CODE>token</CODE> that performs a control function. It is a <CODE>newline</CODE>
265 or one of the following:
266 <SAMP>`||'</SAMP>, <SAMP>`&&'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`;;'</SAMP>,
267 <SAMP>`|'</SAMP>, <SAMP>`|&'</SAMP>, <SAMP>`('</SAMP>, or <SAMP>`)'</SAMP>.
270 <DT><CODE>exit status</CODE>
271 <DD><A NAME="IDX4"></A>
272 The value returned by a command to its caller. The value is restricted
273 to eight bits, so the maximum value is 255.
276 <DT><CODE>field</CODE>
277 <DD><A NAME="IDX5"></A>
278 A unit of text that is the result of one of the shell expansions. After
279 expansion, when executing a command, the resulting fields are used as
280 the command name and arguments.
283 <DT><CODE>filename</CODE>
284 <DD><A NAME="IDX6"></A>
285 A string of characters used to identify a file.
289 <DD><A NAME="IDX7"></A>
290 A set of processes comprising a pipeline, and any processes descended
291 from it, that are all in the same process group.
294 <DT><CODE>job control</CODE>
295 <DD><A NAME="IDX8"></A>
296 A mechanism by which users can selectively stop (suspend) and restart
297 (resume) execution of processes.
300 <DT><CODE>metacharacter</CODE>
301 <DD><A NAME="IDX9"></A>
302 A character that, when unquoted, separates words. A metacharacter is
303 a <CODE>blank</CODE> or one of the following characters:
304 <SAMP>`|'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`('</SAMP>, <SAMP>`)'</SAMP>, <SAMP>`<'</SAMP>, or
305 <SAMP>`>'</SAMP>.
308 <DT><CODE>name</CODE>
309 <DD><A NAME="IDX10"></A>
311 A <CODE>word</CODE> consisting solely of letters, numbers, and underscores,
312 and beginning with a letter or underscore. <CODE>Name</CODE>s are used as
313 shell variable and function names.
314 Also referred to as an <CODE>identifier</CODE>.
317 <DT><CODE>operator</CODE>
318 <DD><A NAME="IDX12"></A>
319 A <CODE>control operator</CODE> or a <CODE>redirection operator</CODE>.
320 See section <A HREF="bashref.html#SEC40">3.6 Redirections</A>, for a list of redirection operators.
321 Operators contain at least one unquoted <CODE>metacharacter</CODE>.
324 <DT><CODE>process group</CODE>
325 <DD><A NAME="IDX13"></A>
326 A collection of related processes each having the same process
330 <DT><CODE>process group ID</CODE>
331 <DD><A NAME="IDX14"></A>
332 A unique identifier that represents a <CODE>process group</CODE>
336 <DT><CODE>reserved word</CODE>
337 <DD><A NAME="IDX15"></A>
338 A <CODE>word</CODE> that has a special meaning to the shell. Most reserved
339 words introduce shell flow control constructs, such as <CODE>for</CODE> and
343 <DT><CODE>return status</CODE>
344 <DD><A NAME="IDX16"></A>
345 A synonym for <CODE>exit status</CODE>.
348 <DT><CODE>signal</CODE>
349 <DD><A NAME="IDX17"></A>
350 A mechanism by which a process may be notified by the kernel
351 of an event occurring in the system.
354 <DT><CODE>special builtin</CODE>
355 <DD><A NAME="IDX18"></A>
356 A shell builtin command that has been classified as special by the
360 <DT><CODE>token</CODE>
361 <DD><A NAME="IDX19"></A>
362 A sequence of characters considered a single unit by the shell.
363 It is either a <CODE>word</CODE> or an <CODE>operator</CODE>.
366 <DT><CODE>word</CODE>
367 <DD><A NAME="IDX20"></A>
368 A sequence of characters treated as a unit by the shell.
369 Words may not include unquoted <CODE>metacharacters</CODE>.
373 <A NAME="Basic Shell Features"></A>
376 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
377 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> < </A>]</TD>
378 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> > </A>]</TD>
379 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> << </A>]</TD>
380 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> >> </A>]</TD>
382 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
383 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
387 <H1> 3. Basic Shell Features </H1>
391 Bash is an acronym for <SAMP>`Bourne-Again SHell'</SAMP>.
393 the traditional Unix shell originally written by Stephen Bourne.
394 All of the Bourne shell builtin commands are available in Bash,
395 The rules for evaluation and quoting are taken from the POSIX
396 specification for the `standard' Unix shell.
399 This chapter briefly summarizes the shell's `building blocks':
400 commands, control structures, shell functions, shell <I>parameters</I>,
402 <I>redirections</I>, which are a way to direct input and output from
403 and to named files, and how the shell executes commands.
406 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
407 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC6">3.1 Shell Syntax</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What your input means to the shell.</TD></TR>
408 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC15">3.2 Shell Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The types of commands you can use.</TD></TR>
409 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC25">3.3 Shell Functions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Grouping commands by name.</TD></TR>
410 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC26">3.4 Shell Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell stores values.</TD></TR>
411 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC29">3.5 Shell Expansions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands parameters and the various
412 expansions available.</TD></TR>
413 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC40">3.6 Redirections</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to control where input and output go.</TD></TR>
414 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC51">3.7 Executing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when you run a command.</TD></TR>
415 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC58">3.8 Shell Scripts</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Executing files of shell commands.</TD></TR>
416 </TABLE></BLOCKQUOTE>
419 <A NAME="Shell Syntax"></A>
422 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
423 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> < </A>]</TD>
424 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> > </A>]</TD>
425 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
426 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
427 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD>
428 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
429 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
430 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
431 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
433 <H2> 3.1 Shell Syntax </H2>
435 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
436 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC7">3.1.1 Shell Operation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The basic operation of the shell.</TD></TR>
437 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC8">3.1.2 Quoting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from characters.</TD></TR>
438 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC14">3.1.3 Comments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify comments.</TD></TR>
439 </TABLE></BLOCKQUOTE>
442 When the shell reads input, it proceeds through a
443 sequence of operations. If the input indicates the beginning of a
444 comment, the shell ignores the comment symbol (<SAMP>`#'</SAMP>), and the rest
447 Otherwise, roughly speaking, the shell reads its input and
448 divides the input into words and operators, employing the quoting rules
449 to select which meanings to assign various words and characters.
452 The shell then parses these tokens into commands and other constructs,
453 removes the special meaning of certain words or characters, expands
454 others, redirects input and output as needed, executes the specified
455 command, waits for the command's exit status, and makes that exit status
456 available for further inspection or processing.
459 <A NAME="Shell Operation"></A>
462 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
463 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> < </A>]</TD>
464 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> > </A>]</TD>
465 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
466 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
467 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD>
468 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
469 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
470 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
471 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
473 <H3> 3.1.1 Shell Operation </H3>
477 The following is a brief description of the shell's operation when it
478 reads and executes a command. Basically, the shell does the
484 Reads its input from a file (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>), from a string
485 supplied as an argument to the <SAMP>`-c'</SAMP> invocation option
486 (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>), or from the user's terminal.
490 Breaks the input into words and operators, obeying the quoting rules
491 described in <A HREF="bashref.html#SEC8">3.1.2 Quoting</A>. These tokens are separated by
492 <CODE>metacharacters</CODE>. Alias expansion is performed by this step
493 (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
497 Parses the tokens into simple and compound commands
498 (see section <A HREF="bashref.html#SEC15">3.2 Shell Commands</A>).
502 Performs the various shell expansions (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>), breaking
503 the expanded tokens into lists of filenames (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>)
504 and commands and arguments.
508 Performs any necessary redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>) and removes
509 the redirection operators and their operands from the argument list.
513 Executes the command (see section <A HREF="bashref.html#SEC51">3.7 Executing Commands</A>).
517 Optionally waits for the command to complete and collects its exit
518 status (see section <A HREF="bashref.html#SEC56">3.7.5 Exit Status</A>).
524 <A NAME="Quoting"></A>
527 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
528 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> < </A>]</TD>
529 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> > </A>]</TD>
530 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD>
531 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
532 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
533 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
534 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
536 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
538 <H3> 3.1.2 Quoting </H3>
540 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
541 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from a single
543 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to inhibit all interpretation of a sequence
544 of characters.</TD></TR>
545 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to suppress most of the interpretation of a
546 sequence of characters.</TD></TR>
547 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to expand ANSI-C sequences in quoted strings.</TD></TR>
548 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to translate strings into different languages.</TD></TR>
549 </TABLE></BLOCKQUOTE>
552 Quoting is used to remove the special meaning of certain
553 characters or words to the shell. Quoting can be used to
554 disable special treatment for special characters, to prevent
555 reserved words from being recognized as such, and to prevent
559 Each of the shell metacharacters (see section <A HREF="bashref.html#SEC4">2. Definitions</A>)
560 has special meaning to the shell and must be quoted if it is to
562 When the command history expansion facilities are being used
563 (see section <A HREF="bashref.html#SEC123">9.3 History Expansion</A>), the
564 <VAR>history expansion</VAR> character, usually <SAMP>`!'</SAMP>, must be quoted
565 to prevent history expansion. See section <A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>, for
566 more details concerning history expansion.
569 There are three quoting mechanisms: the
570 <VAR>escape character</VAR>, single quotes, and double quotes.
573 <A NAME="Escape Character"></A>
576 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
577 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> < </A>]</TD>
578 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> > </A>]</TD>
579 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD>
580 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
581 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
582 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
583 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
584 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
585 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
587 <H4> 3.1.2.1 Escape Character </H4>
589 A non-quoted backslash <SAMP>`\'</SAMP> is the Bash escape character.
590 It preserves the literal value of the next character that follows,
591 with the exception of <CODE>newline</CODE>. If a <CODE>\newline</CODE> pair
592 appears, and the backslash itself is not quoted, the <CODE>\newline</CODE>
593 is treated as a line continuation (that is, it is removed from
594 the input stream and effectively ignored).
597 <A NAME="Single Quotes"></A>
600 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
601 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> < </A>]</TD>
602 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> > </A>]</TD>
603 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> << </A>]</TD>
604 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
605 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
606 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
607 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
608 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
609 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
611 <H4> 3.1.2.2 Single Quotes </H4>
612 <!--docid::SEC10::-->
615 Enclosing characters in single quotes (<SAMP>`''</SAMP>) preserves the literal value
616 of each character within the quotes. A single quote may not occur
617 between single quotes, even when preceded by a backslash.
620 <A NAME="Double Quotes"></A>
623 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
624 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> < </A>]</TD>
625 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> > </A>]</TD>
626 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> << </A>]</TD>
627 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
628 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
629 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
630 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
631 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
632 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
634 <H4> 3.1.2.3 Double Quotes </H4>
635 <!--docid::SEC11::-->
638 Enclosing characters in double quotes (<SAMP>`"'</SAMP>) preserves the literal value
639 of all characters within the quotes, with the exception of
640 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`\'</SAMP>,
641 and, when history expansion is enabled, <SAMP>`!'</SAMP>.
642 The characters <SAMP>`$'</SAMP> and <SAMP>``'</SAMP>
643 retain their special meaning within double quotes (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
644 The backslash retains its special meaning only when followed by one of
645 the following characters:
646 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`"'</SAMP>, <SAMP>`\'</SAMP>, or <CODE>newline</CODE>.
647 Within double quotes, backslashes that are followed by one of these
648 characters are removed. Backslashes preceding characters without a
649 special meaning are left unmodified.
650 A double quote may be quoted within double quotes by preceding it with
652 If enabled, history expansion will be performed unless an <SAMP>`!'</SAMP>
653 appearing in double quotes is escaped using a backslash.
654 The backslash preceding the <SAMP>`!'</SAMP> is not removed.
657 The special parameters <SAMP>`*'</SAMP> and <SAMP>`@'</SAMP> have special meaning
658 when in double quotes (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
661 <A NAME="ANSI-C Quoting"></A>
664 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
665 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> < </A>]</TD>
666 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> > </A>]</TD>
667 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> << </A>]</TD>
668 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
669 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
670 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
671 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
672 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
673 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
675 <H4> 3.1.2.4 ANSI-C Quoting </H4>
676 <!--docid::SEC12::-->
679 Words of the form <CODE>$'<VAR>string</VAR>'</CODE> are treated specially. The
680 word expands to <VAR>string</VAR>, with backslash-escaped characters replaced
681 as specified by the ANSI C standard. Backslash escape sequences, if
682 present, are decoded as follows:
691 <DD><DT><CODE>\E</CODE>
692 <DD>an escape character (not ANSI C)
709 <DT><CODE>\<VAR>nnn</VAR></CODE>
710 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
711 (one to three digits)
712 <DT><CODE>\x<VAR>HH</VAR></CODE>
713 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
714 (one or two hex digits)
715 <DT><CODE>\u<VAR>HHHH</VAR></CODE>
716 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
717 <VAR>HHHH</VAR> (one to four hex digits)
718 <DT><CODE>\U<VAR>HHHHHHHH</VAR></CODE>
719 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
720 <VAR>HHHHHHHH</VAR> (one to eight hex digits)
721 <DT><CODE>\c<VAR>x</VAR></CODE>
722 <DD>a control-<VAR>x</VAR> character
726 The expanded result is single-quoted, as if the dollar sign had not
730 <A NAME="Locale Translation"></A>
733 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
734 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> < </A>]</TD>
735 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> > </A>]</TD>
736 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD>
737 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
738 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
739 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
740 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
741 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
742 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
744 <H4> 3.1.2.5 Locale-Specific Translation </H4>
745 <!--docid::SEC13::-->
748 A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause
749 the string to be translated according to the current locale.
750 If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign
752 If the string is translated and replaced, the replacement is
759 Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE>
760 shell variable. Others create the name of the message catalog from the
761 value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a
762 suffix of <SAMP>`.mo'</SAMP>. If you use the <CODE>TEXTDOMAIN</CODE> variable, you
763 may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of
764 the message catalog files. Still others use both variables in this
766 <CODE>TEXTDOMAINDIR</CODE>/<CODE>LC_MESSAGES</CODE>/LC_MESSAGES/<CODE>TEXTDOMAIN</CODE>.mo.
769 <A NAME="Comments"></A>
772 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
773 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> < </A>]</TD>
774 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> > </A>]</TD>
775 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
776 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
777 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD>
778 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
779 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
780 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
781 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
783 <H3> 3.1.3 Comments </H3>
784 <!--docid::SEC14::-->
787 In a non-interactive shell, or an interactive shell in which the
788 <CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE>
789 builtin is enabled (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>),
790 a word beginning with <SAMP>`#'</SAMP>
791 causes that word and all remaining characters on that line to
792 be ignored. An interactive shell without the <CODE>interactive_comments</CODE>
793 option enabled does not allow comments. The <CODE>interactive_comments</CODE>
794 option is on by default in interactive shells.
795 See section <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>, for a description of what makes
799 <A NAME="Shell Commands"></A>
802 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
803 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> < </A>]</TD>
804 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> > </A>]</TD>
805 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> << </A>]</TD>
806 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
807 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> >> </A>]</TD>
808 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
809 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
810 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
811 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
813 <H2> 3.2 Shell Commands </H2>
814 <!--docid::SEC15::-->
817 A simple shell command such as <CODE>echo a b c</CODE> consists of the command
818 itself followed by arguments, separated by spaces.
821 More complex shell commands are composed of simple commands arranged together
822 in a variety of ways: in a pipeline in which the output of one command
823 becomes the input of a second, in a loop or conditional construct, or in
827 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
828 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The most common type of command.</TD></TR>
829 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Connecting the input and output of several
831 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to execute commands sequentially.</TD></TR>
832 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for control flow.</TD></TR>
833 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Two-way communication between commands.</TD></TR>
834 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC24">3.2.6 GNU Parallel</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Running commands in parallel.</TD></TR>
835 </TABLE></BLOCKQUOTE>
838 <A NAME="Simple Commands"></A>
841 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
842 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> < </A>]</TD>
843 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> > </A>]</TD>
844 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> << </A>]</TD>
845 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
846 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> >> </A>]</TD>
847 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
848 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
849 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
850 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
852 <H3> 3.2.1 Simple Commands </H3>
853 <!--docid::SEC16::-->
856 A simple command is the kind of command encountered most often.
857 It's just a sequence of words separated by <CODE>blank</CODE>s, terminated
858 by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>). The
859 first word generally specifies a command to be executed, with the
860 rest of the words being that command's arguments.
863 The return status (see section <A HREF="bashref.html#SEC56">3.7.5 Exit Status</A>) of a simple command is
864 its exit status as provided
865 by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if
866 the command was terminated by signal <VAR>n</VAR>.
869 <A NAME="Pipelines"></A>
872 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
873 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> < </A>]</TD>
874 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> > </A>]</TD>
875 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> << </A>]</TD>
876 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
877 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> >> </A>]</TD>
878 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
879 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
880 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
881 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
883 <H3> 3.2.2 Pipelines </H3>
884 <!--docid::SEC17::-->
887 A <CODE>pipeline</CODE> is a sequence of simple commands separated by one of
888 the control operators <SAMP>`|'</SAMP> or <SAMP>`|&'</SAMP>.
894 The format for a pipeline is
895 <TABLE><tr><td> </td><td class=example><pre>[<CODE>time</CODE> [<CODE>-p</CODE>]] [<CODE>!</CODE>] <VAR>command1</VAR> [ [<CODE>|</CODE> or <CODE>|&</CODE>] <VAR>command2</VAR> <small>...</small>]
896 </pre></td></tr></table></P><P>
898 The output of each command in the pipeline is connected via a pipe
899 to the input of the next command.
900 That is, each command reads the previous command's output. This
901 connection is performed before any redirections specified by the
905 If <SAMP>`|&'</SAMP> is used, the standard error of <VAR>command1</VAR> is connected to
906 <VAR>command2</VAR>'s standard input through the pipe; it is shorthand for
907 <CODE>2>&1 |</CODE>. This implicit redirection of the standard error is
908 performed after any redirections specified by the command.
911 The reserved word <CODE>time</CODE> causes timing statistics
912 to be printed for the pipeline once it finishes.
913 The statistics currently consist of elapsed (wall-clock) time and
914 user and system time consumed by the command's execution.
915 The <SAMP>`-p'</SAMP> option changes the output format to that specified
917 When the shell is in POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>),
918 it does not recognize <CODE>time</CODE> as a reserved word if the next
919 token begins with a <SAMP>`-'</SAMP>.
920 The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that
921 specifies how the timing information should be displayed.
922 See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>, for a description of the available formats.
923 The use of <CODE>time</CODE> as a reserved word permits the timing of
924 shell builtins, shell functions, and pipelines. An external
925 <CODE>time</CODE> command cannot time these easily.
928 When the shell is in POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>), <CODE>time</CODE>
929 may be followed by a newline. In this case, the shell displays the
930 total user and system time consumed by the shell and its children.
931 The <CODE>TIMEFORMAT</CODE> variable may be used to specify the format of
932 the time information.
935 If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the
936 shell waits for all commands in the pipeline to complete.
939 Each command in a pipeline is executed in its own subshell
940 (see section <A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>). The exit
941 status of a pipeline is the exit status of the last command in the
942 pipeline, unless the <CODE>pipefail</CODE> option is enabled
943 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
944 If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the
945 value of the last (rightmost) command to exit with a non-zero status,
946 or zero if all commands exit successfully.
947 If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the
948 exit status is the logical negation of the exit status as described
950 The shell waits for all commands in the pipeline to terminate before
957 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
958 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> < </A>]</TD>
959 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> > </A>]</TD>
960 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> << </A>]</TD>
961 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
962 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> >> </A>]</TD>
963 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
964 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
965 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
966 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
968 <H3> 3.2.3 Lists of Commands </H3>
969 <!--docid::SEC18::-->
972 A <CODE>list</CODE> is a sequence of one or more pipelines separated by one
973 of the operators <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`&&'</SAMP>, or <SAMP>`||'</SAMP>,
974 and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, or a
975 <CODE>newline</CODE>.
978 Of these list operators, <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP>
979 have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&'</SAMP>,
980 which have equal precedence.
983 A sequence of one or more newlines may appear in a <CODE>list</CODE>
984 to delimit commands, equivalent to a semicolon.
987 If a command is terminated by the control operator <SAMP>`&'</SAMP>,
988 the shell executes the command asynchronously in a subshell.
989 This is known as executing the command in the <VAR>background</VAR>.
990 The shell does not wait for the command to finish, and the return
992 When job control is not active (see section <A HREF="bashref.html#SEC92">7. Job Control</A>),
993 the standard input for asynchronous commands, in the absence of any
994 explicit redirections, is redirected from <CODE>/dev/null</CODE>.
997 Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell
998 waits for each command to terminate in turn. The return status is the
999 exit status of the last command executed.
1002 AND and OR lists are sequences of one or more pipelines
1003 separated by the control operators <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP>,
1004 respectively. AND and OR lists are executed with left
1008 An AND list has the form
1009 <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> && <VAR>command2</VAR>
1010 </pre></td></tr></table></P><P>
1012 <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
1013 returns an exit status of zero.
1016 An OR list has the form
1017 <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR>
1018 </pre></td></tr></table></P><P>
1020 <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
1021 returns a non-zero exit status.
1024 The return status of
1025 AND and OR lists is the exit status of the last command
1026 executed in the list.
1029 <A NAME="Compound Commands"></A>
1031 <A NAME="SEC19"></A>
1032 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1033 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> < </A>]</TD>
1034 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> > </A>]</TD>
1035 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD>
1036 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1037 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1038 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1039 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1040 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1041 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1043 <H3> 3.2.4 Compound Commands </H3>
1044 <!--docid::SEC19::-->
1047 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1048 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for iterative action.</TD></TR>
1049 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for conditional execution.</TD></TR>
1050 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Ways to group commands.</TD></TR>
1051 </TABLE></BLOCKQUOTE>
1054 Compound commands are the shell programming constructs.
1055 Each construct begins with a reserved word or control operator and is
1056 terminated by a corresponding reserved word or operator.
1057 Any redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>) associated with a compound command
1058 apply to all commands within that compound command unless explicitly overridden.
1061 Bash provides looping constructs, conditional commands, and mechanisms
1062 to group commands and execute them as a unit.
1065 <A NAME="Looping Constructs"></A>
1067 <A NAME="SEC20"></A>
1068 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1069 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> < </A>]</TD>
1070 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> > </A>]</TD>
1071 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD>
1072 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1073 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1074 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1075 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1076 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1077 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1079 <H4> 3.2.4.1 Looping Constructs </H4>
1080 <!--docid::SEC20::-->
1083 Bash supports the following looping constructs.
1086 Note that wherever a <SAMP>`;'</SAMP> appears in the description of a
1087 command's syntax, it may be replaced with one or more newlines.
1091 <DT><CODE>until</CODE>
1092 <DD><A NAME="IDX27"></A>
1093 <A NAME="IDX28"></A>
1094 <A NAME="IDX29"></A>
1095 The syntax of the <CODE>until</CODE> command is:
1096 <TABLE><tr><td> </td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1097 </pre></td></tr></table>Execute <VAR>consequent-commands</VAR> as long as
1098 <VAR>test-commands</VAR> has an exit status which is not zero.
1099 The return status is the exit status of the last command executed
1100 in <VAR>consequent-commands</VAR>, or zero if none was executed.
1103 <DT><CODE>while</CODE>
1104 <DD><A NAME="IDX30"></A>
1105 The syntax of the <CODE>while</CODE> command is:
1106 <TABLE><tr><td> </td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1107 </pre></td></tr></table><P>
1109 Execute <VAR>consequent-commands</VAR> as long as
1110 <VAR>test-commands</VAR> has an exit status of zero.
1111 The return status is the exit status of the last command executed
1112 in <VAR>consequent-commands</VAR>, or zero if none was executed.
1115 <DT><CODE>for</CODE>
1116 <DD><A NAME="IDX31"></A>
1117 The syntax of the <CODE>for</CODE> command is:
1120 <TABLE><tr><td> </td><td class=example><pre>for <VAR>name</VAR> [ [in [<VAR>words</VAR> <small>...</small>] ] ; ] do <VAR>commands</VAR>; done
1121 </pre></td></tr></table>Expand <VAR>words</VAR>, and execute <VAR>commands</VAR> once for each member
1122 in the resultant list, with <VAR>name</VAR> bound to the current member.
1123 If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command
1124 executes the <VAR>commands</VAR> once for each positional parameter that is
1125 set, as if <SAMP>`in "$@"'</SAMP> had been specified
1126 (see section <A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A>).
1127 The return status is the exit status of the last command that executes.
1128 If there are no items in the expansion of <VAR>words</VAR>, no commands are
1129 executed, and the return status is zero.
1132 An alternate form of the <CODE>for</CODE> command is also supported:
1135 <TABLE><tr><td> </td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done
1136 </pre></td></tr></table>First, the arithmetic expression <VAR>expr1</VAR> is evaluated according
1137 to the rules described below (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
1138 The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly
1139 until it evaluates to zero.
1140 Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are
1141 executed and the arithmetic expression <VAR>expr3</VAR> is evaluated.
1142 If any expression is omitted, it behaves as if it evaluates to 1.
1143 The return value is the exit status of the last command in <VAR>commands</VAR>
1144 that is executed, or false if any of the expressions is invalid.
1150 The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
1151 may be used to control loop execution.
1154 <A NAME="Conditional Constructs"></A>
1156 <A NAME="SEC21"></A>
1157 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1158 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> < </A>]</TD>
1159 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> > </A>]</TD>
1160 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> << </A>]</TD>
1161 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1162 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1163 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1164 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1165 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1166 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1168 <H4> 3.2.4.2 Conditional Constructs </H4>
1169 <!--docid::SEC21::-->
1174 <DD><A NAME="IDX32"></A>
1175 <A NAME="IDX33"></A>
1176 <A NAME="IDX34"></A>
1177 <A NAME="IDX35"></A>
1178 <A NAME="IDX36"></A>
1179 The syntax of the <CODE>if</CODE> command is:
1182 <TABLE><tr><td> </td><td class=example><pre>if <VAR>test-commands</VAR>; then
1183 <VAR>consequent-commands</VAR>;
1184 [elif <VAR>more-test-commands</VAR>; then
1185 <VAR>more-consequents</VAR>;]
1186 [else <VAR>alternate-consequents</VAR>;]
1188 </pre></td></tr></table></P><P>
1190 The <VAR>test-commands</VAR> list is executed, and if its return status is zero,
1191 the <VAR>consequent-commands</VAR> list is executed.
1192 If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list
1193 is executed in turn, and if its exit status is zero,
1194 the corresponding <VAR>more-consequents</VAR> is executed and the
1196 If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and
1197 the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause
1198 has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed.
1199 The return status is the exit status of the last command executed, or
1200 zero if no condition tested true.
1203 <DT><CODE>case</CODE>
1204 <DD><A NAME="IDX37"></A>
1205 <A NAME="IDX38"></A>
1206 <A NAME="IDX39"></A>
1207 The syntax of the <CODE>case</CODE> command is:
1210 <TABLE><tr><td> </td><td class=example><pre><CODE>case <VAR>word</VAR> in [ [(] <VAR>pattern</VAR> [| <VAR>pattern</VAR>]<small>...</small>) <VAR>command-list</VAR> ;;]<small>...</small> esac</CODE>
1211 </pre></td></tr></table></P><P>
1213 <CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to
1214 the first <VAR>pattern</VAR> that matches <VAR>word</VAR>.
1215 If the shell option <CODE>nocasematch</CODE>
1216 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
1217 is enabled, the match is performed without regard to the case
1218 of alphabetic characters.
1219 The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP>
1220 operator terminates a pattern list.
1221 A list of patterns and an associated command-list is known
1222 as a <VAR>clause</VAR>.
1225 Each clause must be terminated with <SAMP>`;;'</SAMP>, <SAMP>`;&'</SAMP>, or <SAMP>`;;&'</SAMP>.
1226 The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command
1227 substitution, arithmetic expansion, and quote removal before matching is
1228 attempted. Each <VAR>pattern</VAR> undergoes tilde expansion, parameter
1229 expansion, command substitution, and arithmetic expansion.
1232 There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated
1233 by a <SAMP>`;;'</SAMP>, <SAMP>`;&'</SAMP>, or <SAMP>`;;&'</SAMP>.
1234 The first pattern that matches determines the
1235 command-list that is executed.
1238 Here is an example using <CODE>case</CODE> in a script that could be used to
1239 describe one interesting feature of an animal:
1242 <TABLE><tr><td> </td><td class=example><pre>echo -n "Enter the name of an animal: "
1244 echo -n "The $ANIMAL has "
1246 horse | dog | cat) echo -n "four";;
1247 man | kangaroo ) echo -n "two";;
1248 *) echo -n "an unknown number of";;
1251 </pre></td></tr></table></P><P>
1255 If the <SAMP>`;;'</SAMP> operator is used, no subsequent matches are attempted after
1256 the first pattern match.
1257 Using <SAMP>`;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes execution to continue with
1258 the <VAR>command-list</VAR> associated with the next clause, if any.
1259 Using <SAMP>`;;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes the shell to test the patterns
1260 in the next clause, if any, and execute any associated <VAR>command-list</VAR>
1261 on a successful match.
1264 The return status is zero if no <VAR>pattern</VAR> is matched. Otherwise, the
1265 return status is the exit status of the <VAR>command-list</VAR> executed.
1268 <DT><CODE>select</CODE>
1269 <DD><A NAME="IDX40"></A>
1272 The <CODE>select</CODE> construct allows the easy generation of menus.
1273 It has almost the same syntax as the <CODE>for</CODE> command:
1276 <TABLE><tr><td> </td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done
1277 </pre></td></tr></table></P><P>
1279 The list of words following <CODE>in</CODE> is expanded, generating a list
1280 of items. The set of expanded words is printed on the standard
1281 error output stream, each preceded by a number. If the
1282 <SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed,
1283 as if <SAMP>`in "$@"'</SAMP> had been specified.
1284 The <CODE>PS3</CODE> prompt is then displayed and a line is read from the
1286 If the line consists of a number corresponding to one of the displayed
1287 words, then the value of <VAR>name</VAR> is set to that word.
1288 If the line is empty, the words and prompt are displayed again.
1289 If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes.
1290 Any other value read causes <VAR>name</VAR> to be set to null.
1291 The line read is saved in the variable <CODE>REPLY</CODE>.
1294 The <VAR>commands</VAR> are executed after each selection until a
1295 <CODE>break</CODE> command is executed, at which
1296 point the <CODE>select</CODE> command completes.
1299 Here is an example that allows the user to pick a filename from the
1300 current directory, and displays the name and index of the file
1304 <TABLE><tr><td> </td><td class=example><pre>select fname in *;
1306 echo you picked $fname \($REPLY\)
1309 </pre></td></tr></table></P><P>
1311 <DT><CODE>((<small>...</small>))</CODE>
1312 <DD><TABLE><tr><td> </td><td class=example><pre>(( <VAR>expression</VAR> ))
1313 </pre></td></tr></table><P>
1315 The arithmetic <VAR>expression</VAR> is evaluated according to the rules
1316 described below (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
1317 If the value of the expression is non-zero, the return status is 0;
1318 otherwise the return status is 1. This is exactly equivalent to
1319 <TABLE><tr><td> </td><td class=example><pre>let "<VAR>expression</VAR>"
1320 </pre></td></tr></table>See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>, for a full description of the <CODE>let</CODE> builtin.
1323 <DT><CODE>[[<small>...</small>]]</CODE>
1324 <DD><A NAME="IDX41"></A>
1325 <A NAME="IDX42"></A>
1326 <TABLE><tr><td> </td><td class=example><pre>[[ <VAR>expression</VAR> ]]
1327 </pre></td></tr></table><P>
1329 Return a status of 0 or 1 depending on the evaluation of
1330 the conditional expression <VAR>expression</VAR>.
1331 Expressions are composed of the primaries described below in
1332 <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>.
1333 Word splitting and filename expansion are not performed on the words
1334 between the <SAMP>`[['</SAMP> and <SAMP>`]]'</SAMP>; tilde expansion, parameter and
1335 variable expansion, arithmetic expansion, command substitution, process
1336 substitution, and quote removal are performed.
1337 Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized
1341 When used with <SAMP>`[['</SAMP>, the <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators sort
1342 lexicographically using the current locale.
1345 When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the
1346 right of the operator is considered a pattern and matched according
1347 to the rules described below in <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>.
1348 If the shell option <CODE>nocasematch</CODE>
1349 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
1350 is enabled, the match is performed without regard to the case
1351 of alphabetic characters.
1352 The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not
1353 match (<SAMP>`!='</SAMP>)the pattern, and 1 otherwise.
1354 Any part of the pattern may be quoted to force it to be matched as a
1358 An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same
1359 precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>.
1360 When it is used, the string to the right of the operator is considered
1361 an extended regular expression and matched accordingly (as in <I>regex</I>3)).
1362 The return value is 0 if the string matches
1363 the pattern, and 1 otherwise.
1364 If the regular expression is syntactically incorrect, the conditional
1365 expression's return value is 2.
1366 If the shell option <CODE>nocasematch</CODE>
1367 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
1368 is enabled, the match is performed without regard to the case
1369 of alphabetic characters.
1370 Any part of the pattern may be quoted to force it to be matched as a
1372 Substrings matched by parenthesized subexpressions within the regular
1373 expression are saved in the array variable <CODE>BASH_REMATCH</CODE>.
1374 The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string
1375 matching the entire regular expression.
1376 The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the
1377 string matching the <VAR>n</VAR>th parenthesized subexpression.
1380 Expressions may be combined using the following operators, listed
1381 in decreasing order of precedence:
1385 <DT><CODE>( <VAR>expression</VAR> )</CODE>
1386 <DD>Returns the value of <VAR>expression</VAR>.
1387 This may be used to override the normal precedence of operators.
1390 <DT><CODE>! <VAR>expression</VAR></CODE>
1391 <DD>True if <VAR>expression</VAR> is false.
1394 <DT><CODE><VAR>expression1</VAR> && <VAR>expression2</VAR></CODE>
1395 <DD>True if both <VAR>expression1</VAR> and <VAR>expression2</VAR> are true.
1398 <DT><CODE><VAR>expression1</VAR> || <VAR>expression2</VAR></CODE>
1399 <DD>True if either <VAR>expression1</VAR> or <VAR>expression2</VAR> is true.
1401 The <CODE>&&</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the
1402 value of <VAR>expression1</VAR> is sufficient to determine the return
1403 value of the entire conditional expression.
1409 <A NAME="Command Grouping"></A>
1411 <A NAME="SEC22"></A>
1412 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1413 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> < </A>]</TD>
1414 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> > </A>]</TD>
1415 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD>
1416 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1417 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1418 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1419 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1420 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1421 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1423 <H4> 3.2.4.3 Grouping Commands </H4>
1424 <!--docid::SEC22::-->
1427 Bash provides two ways to group a list of commands to be executed
1428 as a unit. When commands are grouped, redirections may be applied
1429 to the entire command list. For example, the output of all the
1430 commands in the list may be redirected to a single stream.
1435 <DD><TABLE><tr><td> </td><td class=example><pre>( <VAR>list</VAR> )
1436 </pre></td></tr></table><P>
1438 Placing a list of commands between parentheses causes a subshell
1439 environment to be created (see section <A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>), and each
1440 of the commands in <VAR>list</VAR> to be executed in that subshell. Since the
1441 <VAR>list</VAR> is executed in a subshell, variable assignments do not remain in
1442 effect after the subshell completes.
1446 <DD><A NAME="IDX43"></A>
1447 <A NAME="IDX44"></A>
1448 <TABLE><tr><td> </td><td class=example><pre>{ <VAR>list</VAR>; }
1449 </pre></td></tr></table><P>
1451 Placing a list of commands between curly braces causes the list to
1452 be executed in the current shell context. No subshell is created.
1453 The semicolon (or newline) following <VAR>list</VAR> is required.
1457 In addition to the creation of a subshell, there is a subtle difference
1458 between these two constructs due to historical reasons. The braces
1459 are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR>
1460 by <CODE>blank</CODE>s or other shell metacharacters.
1461 The parentheses are <CODE>operators</CODE>, and are
1462 recognized as separate tokens by the shell even if they are not separated
1463 from the <VAR>list</VAR> by whitespace.
1466 The exit status of both of these constructs is the exit status of
1470 <A NAME="Coprocesses"></A>
1472 <A NAME="SEC23"></A>
1473 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1474 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> < </A>]</TD>
1475 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> > </A>]</TD>
1476 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD>
1477 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1478 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> >> </A>]</TD>
1479 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1480 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1481 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1482 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1484 <H3> 3.2.5 Coprocesses </H3>
1485 <!--docid::SEC23::-->
1488 A <CODE>coprocess</CODE> is a shell command preceded by the <CODE>coproc</CODE>
1490 A coprocess is executed asynchronously in a subshell, as if the command
1491 had been terminated with the <SAMP>`&'</SAMP> control operator, with a two-way pipe
1492 established between the executing shell and the coprocess.
1495 The format for a coprocess is:
1496 <TABLE><tr><td> </td><td class=example><pre><CODE>coproc</CODE> [<VAR>NAME</VAR>] <VAR>command</VAR> [<VAR>redirections</VAR>]
1497 </pre></td></tr></table></P><P>
1499 This creates a coprocess named <VAR>NAME</VAR>.
1500 If <VAR>NAME</VAR> is not supplied, the default name is <VAR>COPROC</VAR>.
1501 <VAR>NAME</VAR> must not be supplied if <VAR>command</VAR> is a simple
1502 command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>); otherwise, it is interpreted as
1503 the first word of the simple command.
1506 When the coproc is executed, the shell creates an array variable
1507 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>)
1508 named <VAR>NAME</VAR> in the context of the executing shell.
1509 The standard output of <VAR>command</VAR>
1510 is connected via a pipe to a file descriptor in the executing shell,
1511 and that file descriptor is assigned to <VAR>NAME</VAR>[0].
1512 The standard input of <VAR>command</VAR>
1513 is connected via a pipe to a file descriptor in the executing shell,
1514 and that file descriptor is assigned to <VAR>NAME</VAR>[1].
1515 This pipe is established before any redirections specified by the
1516 command (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
1517 The file descriptors can be utilized as arguments to shell commands
1518 and redirections using standard word expansions.
1521 The process ID of the shell spawned to execute the coprocess is
1522 available as the value of the variable <VAR>NAME</VAR>_PID.
1523 The <CODE>wait</CODE>
1524 builtin command may be used to wait for the coprocess to terminate.
1527 The return status of a coprocess is the exit status of <VAR>command</VAR>.
1530 <A NAME="GNU Parallel"></A>
1532 <A NAME="SEC24"></A>
1533 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1534 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> < </A>]</TD>
1535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> > </A>]</TD>
1536 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> << </A>]</TD>
1537 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1538 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> >> </A>]</TD>
1539 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1540 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1541 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1542 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1544 <H3> 3.2.6 GNU Parallel </H3>
1545 <!--docid::SEC24::-->
1548 GNU Parallel, as its name suggests, can be used to build and run commands
1549 in parallel. You may run the same command with different arguments, whether
1550 they are filenames, usernames, hostnames, or lines read from files.
1553 For a complete description, refer to the GNU Parallel documentation. A few
1554 examples should provide a brief introduction to its use.
1557 For example, it is easy to prefix each line in a text file with a specified
1559 <TABLE><tr><td> </td><td class=example><pre>cat file | parallel -k echo prefix_string
1560 </pre></td></tr></table>The <SAMP>`-k'</SAMP> option is required to preserve the lines' order.
1563 Similarly, you can append a specified string to each line in a text file:
1564 <TABLE><tr><td> </td><td class=example><pre>cat file | parallel -k echo {} append_string
1565 </pre></td></tr></table></P><P>
1567 You can use Parallel to move files from the current directory when the
1568 number of files is too large to process with one <CODE>mv</CODE> invocation:
1569 <TABLE><tr><td> </td><td class=example><pre>ls | parallel mv {} destdir
1570 </pre></td></tr></table></P><P>
1572 As you can see, the {} is replaced with each line read from standard input.
1573 This will run as many <CODE>mv</CODE> commands as there are files in the current
1574 directory. You can emulate a parallel <CODE>xargs</CODE> by adding the <SAMP>`-X'</SAMP>
1576 <TABLE><tr><td> </td><td class=example><pre>ls | parallel -X mv {} destdir
1577 </pre></td></tr></table></P><P>
1579 GNU Parallel can replace certain common idioms that operate on lines read
1580 from a file (in this case, filenames):
1581 <TABLE><tr><td> </td><td class=example><pre> for x in $(cat list); do
1582 do-something1 $x config-$x
1583 do-something2 < $x
1584 done | process-output
1585 </pre></td></tr></table></P><P>
1587 with a more compact syntax reminiscent of lambdas:
1588 <TABLE><tr><td> </td><td class=example><pre>cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" | process-output
1589 </pre></td></tr></table></P><P>
1591 Parallel provides a built-in mechanism to remove filename extensions, which
1592 lends itself to batch file transformations or renaming:
1593 <TABLE><tr><td> </td><td class=example><pre>ls *.gz | parallel -j+0 "zcat {} | bzip2 >{.}.bz2 && rm {}"
1594 </pre></td></tr></table>This will recompress all files in the current directory with names ending
1595 in .gz using bzip2, running one job per CPU (-j+0) in parallel.
1598 If a command generates output, you may want to preserve the input order in
1599 the output. For instance, the following command
1600 <TABLE><tr><td> </td><td class=example><pre>{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute
1601 </pre></td></tr></table>will display as output the traceroute invocation that finishes first. Using
1602 the <SAMP>`-k'</SAMP> option, as we saw above
1603 <TABLE><tr><td> </td><td class=example><pre>{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute
1604 </pre></td></tr></table>will ensure that the output of <CODE>traceroute foss.org.my</CODE> is displayed first.
1607 <A NAME="Shell Functions"></A>
1609 <A NAME="SEC25"></A>
1610 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1611 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> < </A>]</TD>
1612 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> > </A>]</TD>
1613 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> << </A>]</TD>
1614 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1615 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> >> </A>]</TD>
1616 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1617 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1618 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1619 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1621 <H2> 3.3 Shell Functions </H2>
1622 <!--docid::SEC25::-->
1625 Shell functions are a way to group commands for later execution
1626 using a single name for the group. They are executed just like
1627 a "regular" command.
1628 When the name of a shell function is used as a simple command name,
1629 the list of commands associated with that function name is executed.
1630 Shell functions are executed in the current
1631 shell context; no new process is created to interpret them.
1634 Functions are declared using this syntax:
1635 <A NAME="IDX45"></A>
1636 <TABLE><tr><td> </td><td class=example><pre><VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ]<BR>or<BR>
1637 <CODE>function</CODE> <VAR>name</VAR> [()] <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ]
1638 </pre></td></tr></table></P><P>
1640 This defines a shell function named <VAR>name</VAR>. The reserved
1641 word <CODE>function</CODE> is optional.
1642 If the <CODE>function</CODE> reserved
1643 word is supplied, the parentheses are optional.
1644 The <VAR>body</VAR> of the function is the compound command
1645 <VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>).
1646 That command is usually a <VAR>list</VAR> enclosed between { and }, but
1647 may be any compound command listed above.
1648 <VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the
1650 Any redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>) associated with the shell function
1651 are performed when the function is executed.
1654 A function definition may be deleted using the <SAMP>`-f'</SAMP> option to the
1655 <CODE>unset</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
1658 The exit status of a function definition is zero unless a syntax error
1659 occurs or a readonly function with the same name already exists.
1660 When executed, the exit status of a function is the exit status of the
1661 last command executed in the body.
1664 Note that for historical reasons, in the most common usage the curly braces
1665 that surround the body of the function must be separated from the body by
1666 <CODE>blank</CODE>s or newlines.
1667 This is because the braces are reserved words and are only recognized
1668 as such when they are separated from the command list
1669 by whitespace or another shell metacharacter.
1670 Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon,
1671 a <SAMP>`&'</SAMP>, or a newline.
1674 When a function is executed, the arguments to the
1675 function become the positional parameters
1676 during its execution (see section <A HREF="bashref.html#SEC27">3.4.1 Positional Parameters</A>).
1677 The special parameter <SAMP>`#'</SAMP> that expands to the number of
1678 positional parameters is updated to reflect the change.
1679 Special parameter <CODE>0</CODE> is unchanged.
1680 The first element of the <CODE>FUNCNAME</CODE> variable is set to the
1681 name of the function while the function is executing.
1684 All other aspects of the shell execution
1685 environment are identical between a function and its caller
1686 with these exceptions:
1687 the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps
1688 are not inherited unless the function has been given the
1689 <CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or
1690 the <CODE>-o functrace</CODE> option has been enabled with
1691 the <CODE>set</CODE> builtin,
1692 (in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps),
1693 and the <CODE>ERR</CODE> trap is not inherited unless the <CODE>-o errtrace</CODE>
1694 shell option has been enabled.
1695 See section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>, for the description of the
1696 <CODE>trap</CODE> builtin.
1699 The <CODE>FUNCNEST</CODE> variable, if set to a numeric value greater
1700 than 0, defines a maximum function nesting level. Function
1701 invocations that exceed the limit cause the entire command to
1705 If the builtin command <CODE>return</CODE>
1706 is executed in a function, the function completes and
1707 execution resumes with the next command after the function
1709 Any command associated with the <CODE>RETURN</CODE> trap is executed
1710 before execution resumes.
1711 When a function completes, the values of the
1712 positional parameters and the special parameter <SAMP>`#'</SAMP>
1713 are restored to the values they had prior to the function's
1714 execution. If a numeric argument is given to <CODE>return</CODE>,
1715 that is the function's return status; otherwise the function's
1716 return status is the exit status of the last command executed
1717 before the <CODE>return</CODE>.
1720 Variables local to the function may be declared with the
1721 <CODE>local</CODE> builtin. These variables are visible only to
1722 the function and the commands it invokes.
1725 Function names and definitions may be listed with the
1726 <SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> or <CODE>typeset</CODE>
1727 builtin commands (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
1728 The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE>
1729 will list the function names only
1730 (and optionally the source file and line number, if the <CODE>extdebug</CODE>
1731 shell option is enabled).
1732 Functions may be exported so that subshells
1733 automatically have them defined with the
1734 <SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin
1735 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
1736 Note that shell functions and variables with the same name may result
1737 in multiple identically-named entries in the environment passed to the
1739 Care should be taken in cases where this may cause a problem.
1742 Functions may be recursive.
1743 The <CODE>FUNCNEST</CODE> variable may be used to limit the depth of the
1744 function call stack and restrict the number of function invocations.
1745 By default, no limit is placed on the number of recursive calls.
1748 <A NAME="Shell Parameters"></A>
1750 <A NAME="SEC26"></A>
1751 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1752 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> < </A>]</TD>
1753 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> > </A>]</TD>
1754 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> << </A>]</TD>
1755 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1756 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> >> </A>]</TD>
1757 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1758 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1759 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1760 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1762 <H2> 3.4 Shell Parameters </H2>
1763 <!--docid::SEC26::-->
1766 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1767 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.4.1 Positional Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR>
1768 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR>
1769 </TABLE></BLOCKQUOTE>
1772 A <VAR>parameter</VAR> is an entity that stores values.
1773 It can be a <CODE>name</CODE>, a number, or one of the special characters
1775 A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>.
1776 A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>.
1777 Attributes are assigned using the <CODE>declare</CODE> builtin command
1778 (see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
1781 A parameter is set if it has been assigned a value. The null string is
1782 a valid value. Once a variable is set, it may be unset only by using
1783 the <CODE>unset</CODE> builtin command.
1786 A variable may be assigned to by a statement of the form
1787 <TABLE><tr><td> </td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>]
1788 </pre></td></tr></table>If <VAR>value</VAR>
1789 is not given, the variable is assigned the null string. All
1790 <VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion,
1791 command substitution, arithmetic expansion, and quote
1792 removal (detailed below). If the variable has its <CODE>integer</CODE>
1793 attribute set, then <VAR>value</VAR>
1794 is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE>
1795 expansion is not used (see section <A HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A>).
1796 Word splitting is not performed, with the exception
1797 of <CODE>"$@"</CODE> as explained below.
1798 Filename expansion is not performed.
1799 Assignment statements may also appear as arguments to the
1801 <CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>,
1802 and <CODE>local</CODE> builtin commands.
1805 In the context where an assignment statement is assigning a value
1806 to a shell variable or array index (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>), the <SAMP>`+='</SAMP>
1807 operator can be used to
1808 append to or add to the variable's previous value.
1809 When <SAMP>`+='</SAMP> is applied to a variable for which the <VAR>integer</VAR> attribute
1810 has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and
1811 added to the variable's current value, which is also evaluated.
1812 When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment
1813 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>), the
1814 variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new
1815 values are appended to the array beginning at one greater than the array's
1816 maximum index (for indexed arrays), or added as additional key-value pairs
1817 in an associative array.
1818 When applied to a string-valued variable, <VAR>value</VAR> is expanded and
1819 appended to the variable's value.
1822 <A NAME="Positional Parameters"></A>
1824 <A NAME="SEC27"></A>
1825 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1826 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> < </A>]</TD>
1827 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> > </A>]</TD>
1828 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> << </A>]</TD>
1829 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> Up </A>]</TD>
1830 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> >> </A>]</TD>
1831 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1832 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1833 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1834 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1836 <H3> 3.4.1 Positional Parameters </H3>
1837 <!--docid::SEC27::-->
1840 A <VAR>positional parameter</VAR> is a parameter denoted by one or more
1841 digits, other than the single digit <CODE>0</CODE>. Positional parameters are
1842 assigned from the shell's arguments when it is invoked,
1843 and may be reassigned using the <CODE>set</CODE> builtin command.
1844 Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or
1845 as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit.
1846 Positional parameters may not be assigned to with assignment statements.
1847 The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and
1848 unset them (see section <A HREF="bashref.html#SEC59">4. Shell Builtin Commands</A>).
1849 The positional parameters are
1850 temporarily replaced when a shell function is executed
1851 (see section <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>).
1854 When a positional parameter consisting of more than a single
1855 digit is expanded, it must be enclosed in braces.
1858 <A NAME="Special Parameters"></A>
1860 <A NAME="SEC28"></A>
1861 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1862 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> < </A>]</TD>
1863 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> > </A>]</TD>
1864 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> << </A>]</TD>
1865 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> Up </A>]</TD>
1866 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> >> </A>]</TD>
1867 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1868 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1869 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1870 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1872 <H3> 3.4.2 Special Parameters </H3>
1873 <!--docid::SEC28::-->
1876 The shell treats several parameters specially. These parameters may
1877 only be referenced; assignment to them is not allowed.
1882 <A NAME="IDX46"></A>
1884 <DD><A NAME="IDX47"></A>
1885 Expands to the positional parameters, starting from one. When the
1886 expansion occurs within double quotes, it expands to a single word
1887 with the value of each parameter separated by the first character
1888 of the <CODE>IFS</CODE>
1889 special variable. That is, <CODE>"$*"</CODE> is equivalent
1890 to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR>
1891 is the first character of the value of the <CODE>IFS</CODE>
1893 If <CODE>IFS</CODE> is unset, the parameters are separated by spaces.
1894 If <CODE>IFS</CODE> is null, the parameters are joined without intervening
1898 <A NAME="IDX48"></A>
1900 <DD><A NAME="IDX49"></A>
1901 Expands to the positional parameters, starting from one. When the
1902 expansion occurs within double quotes, each parameter expands to a
1903 separate word. That is, <CODE>"$@"</CODE> is equivalent to
1904 <CODE>"$1" "$2" <small>...</small></CODE>.
1905 If the double-quoted expansion occurs within a word, the expansion of
1906 the first parameter is joined with the beginning part of the original
1907 word, and the expansion of the last parameter is joined with the last
1908 part of the original word.
1909 When there are no positional parameters, <CODE>"$@"</CODE> and
1911 expand to nothing (i.e., they are removed).
1914 <A NAME="IDX50"></A>
1916 <DD><A NAME="IDX51"></A>
1917 Expands to the number of positional parameters in decimal.
1920 <A NAME="IDX52"></A>
1922 <DD><A NAME="IDX53"></A>
1923 Expands to the exit status of the most recently executed foreground
1927 <A NAME="IDX54"></A>
1929 <DD><A NAME="IDX55"></A>
1930 (A hyphen.) Expands to the current option flags as specified upon
1931 invocation, by the <CODE>set</CODE>
1932 builtin command, or those set by the shell itself
1933 (such as the <SAMP>`-i'</SAMP> option).
1936 <A NAME="IDX56"></A>
1938 <DD><A NAME="IDX57"></A>
1939 Expands to the process ID of the shell. In a <CODE>()</CODE> subshell, it
1940 expands to the process ID of the invoking shell, not the subshell.
1943 <A NAME="IDX58"></A>
1945 <DD><A NAME="IDX59"></A>
1946 Expands to the process ID of the most recently executed background
1947 (asynchronous) command.
1950 <A NAME="IDX60"></A>
1952 <DD><A NAME="IDX61"></A>
1953 Expands to the name of the shell or shell script. This is set at
1954 shell initialization. If Bash is invoked with a file of commands
1955 (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file.
1956 If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>),
1957 then <CODE>$0</CODE> is set to the first argument after the string to be
1958 executed, if one is present. Otherwise, it is set
1959 to the filename used to invoke Bash, as given by argument zero.
1962 <A NAME="IDX62"></A>
1964 <DD><A NAME="IDX63"></A>
1966 At shell startup, set to the absolute pathname used to invoke the
1967 shell or shell script being executed as passed in the environment
1969 Subsequently, expands to the last argument to the previous command,
1971 Also set to the full pathname used to invoke each command executed
1972 and placed in the environment exported to that command.
1973 When checking mail, this parameter holds the name of the mail file.
1977 <A NAME="Shell Expansions"></A>
1979 <A NAME="SEC29"></A>
1980 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1981 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> < </A>]</TD>
1982 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> > </A>]</TD>
1983 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> << </A>]</TD>
1984 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1985 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
1986 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1987 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1988 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
1989 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1991 <H2> 3.5 Shell Expansions </H2>
1992 <!--docid::SEC29::-->
1995 Expansion is performed on the command line after it has been split into
1996 <CODE>token</CODE>s. There are seven kinds of expansion performed:
2000 <LI>parameter and variable expansion
2001 <LI>command substitution
2002 <LI>arithmetic expansion
2004 <LI>filename expansion
2008 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
2009 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR>
2010 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR>
2011 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR>
2012 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.4 Command Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Using the output of a command as an argument.</TD></TR>
2013 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR>
2014 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC35">3.5.6 Process Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a
2016 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the results of expansion are split into separate
2017 arguments.</TD></TR>
2018 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A shorthand for specifying filenames matching patterns.</TD></TR>
2019 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC39">3.5.9 Quote Removal</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How and when quote characters are removed from
2021 </TABLE></BLOCKQUOTE>
2024 The order of expansions is: brace expansion, tilde expansion,
2025 parameter, variable, and arithmetic expansion and
2026 command substitution
2027 (done in a left-to-right fashion), word splitting, and filename
2031 On systems that can support it, there is an additional expansion
2032 available: <VAR>process substitution</VAR>. This is performed at the
2033 same time as parameter, variable, and arithmetic expansion and
2034 command substitution.
2037 Only brace expansion, word splitting, and filename expansion
2038 can change the number of words of the expansion; other expansions
2039 expand a single word to a single word.
2040 The only exceptions to this are the expansions of
2041 <CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE>
2042 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
2045 After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC39">3.5.9 Quote Removal</A>)
2049 <A NAME="Brace Expansion"></A>
2051 <A NAME="SEC30"></A>
2052 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2053 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> < </A>]</TD>
2054 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> > </A>]</TD>
2055 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> << </A>]</TD>
2056 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2057 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2058 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2059 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2060 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2061 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2063 <H3> 3.5.1 Brace Expansion </H3>
2064 <!--docid::SEC30::-->
2067 Brace expansion is a mechanism by which arbitrary strings may be generated.
2068 This mechanism is similar to
2069 <VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>),
2070 but the file names generated need not exist.
2071 Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>,
2072 followed by either a series of comma-separated strings or a seqeunce expression
2073 between a pair of braces,
2074 followed by an optional <VAR>postscript</VAR>.
2075 The preamble is prefixed to each string contained within the braces, and
2076 the postscript is then appended to each resulting string, expanding left
2080 Brace expansions may be nested.
2081 The results of each expanded string are not sorted; left to right order
2084 <TABLE><tr><td> </td><td class=example><pre>bash$ echo a{d,c,b}e
2086 </pre></td></tr></table></P><P>
2088 A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>[..<VAR>incr</VAR>]}</CODE>,
2089 where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters,
2090 and <VAR>incr</VAR>, an optional increment, is an integer.
2091 When integers are supplied, the expression expands to each number between
2092 <VAR>x</VAR> and <VAR>y</VAR>, inclusive.
2093 Supplied integers may be prefixed with <SAMP>`0'</SAMP> to force each term to have the
2094 same width. When either <VAR>x</VAR> or <VAR>y</VAR> begins with a zero, the shell
2095 attempts to force all generated terms to contain the same number of digits,
2096 zero-padding where necessary.
2097 When characters are supplied, the expression expands to each character
2098 lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive. Note that
2099 both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type.
2100 When the increment is supplied, it is used as the difference between
2101 each term. The default increment is 1 or -1 as appropriate.
2104 Brace expansion is performed before any other expansions,
2105 and any characters special to other expansions are preserved
2106 in the result. It is strictly textual. Bash
2107 does not apply any syntactic interpretation to the context of the
2108 expansion or the text between the braces.
2109 To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2110 is not considered eligible for brace expansion.
2113 A correctly-formed brace expansion must contain unquoted opening
2114 and closing braces, and at least one unquoted comma or a valid
2115 sequence expression.
2116 Any incorrectly formed brace expansion is left unchanged.
2119 A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its
2120 being considered part of a brace expression.
2121 To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2122 is not considered eligible for brace expansion.
2125 This construct is typically used as shorthand when the common
2126 prefix of the strings to be generated is longer than in the
2128 <TABLE><tr><td> </td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs}
2129 </pre></td></tr></table>or
2130 <TABLE><tr><td> </td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
2131 </pre></td></tr></table></P><P>
2133 <A NAME="Tilde Expansion"></A>
2135 <A NAME="SEC31"></A>
2136 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2137 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> < </A>]</TD>
2138 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> > </A>]</TD>
2139 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> << </A>]</TD>
2140 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2141 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2142 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2143 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2144 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2145 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2147 <H3> 3.5.2 Tilde Expansion </H3>
2148 <!--docid::SEC31::-->
2151 If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the
2152 characters up to the first unquoted slash (or all characters,
2153 if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>.
2154 If none of the characters in the tilde-prefix are quoted, the
2155 characters in the tilde-prefix following the tilde are treated as a
2156 possible <VAR>login name</VAR>.
2157 If this login name is the null string, the tilde is replaced with the
2158 value of the <CODE>HOME</CODE> shell variable.
2159 If <CODE>HOME</CODE> is unset, the home directory of the user executing the
2160 shell is substituted instead.
2161 Otherwise, the tilde-prefix is replaced with the home directory
2162 associated with the specified login name.
2165 If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of
2166 the shell variable <CODE>PWD</CODE> replaces the tilde-prefix.
2167 If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable
2168 <CODE>OLDPWD</CODE>, if it is set, is substituted.
2171 If the characters following the tilde in the tilde-prefix consist of a
2172 number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>,
2173 the tilde-prefix is replaced with the
2174 corresponding element from the directory stack, as it would be displayed
2175 by the <CODE>dirs</CODE> builtin invoked with the characters following tilde
2176 in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC87">6.8 The Directory Stack</A>).
2177 If the tilde-prefix, sans the tilde, consists of a number without a
2178 leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed.
2181 If the login name is invalid, or the tilde expansion fails, the word is
2185 Each variable assignment is checked for unquoted tilde-prefixes immediately
2186 following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>.
2187 In these cases, tilde expansion is also performed.
2188 Consequently, one may use file names with tildes in assignments to
2189 <CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>,
2190 and the shell assigns the expanded value.
2193 The following table shows how Bash treats unquoted tilde-prefixes:
2198 <DD>The value of <CODE>$HOME</CODE>
2199 <DT><CODE>~/foo</CODE>
2200 <DD><TT>`$HOME/foo'</TT>
2203 <DT><CODE>~fred/foo</CODE>
2204 <DD>The subdirectory <CODE>foo</CODE> of the home directory of the user
2208 <DT><CODE>~+/foo</CODE>
2209 <DD><TT>`$PWD/foo'</TT>
2212 <DT><CODE>~-/foo</CODE>
2213 <DD><TT>`${OLDPWD-'~-'}/foo'</TT>
2216 <DT><CODE>~<VAR>N</VAR></CODE>
2217 <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2220 <DT><CODE>~+<VAR>N</VAR></CODE>
2221 <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2224 <DT><CODE>~-<VAR>N</VAR></CODE>
2225 <DD>The string that would be displayed by <SAMP>`dirs -<VAR>N</VAR>'</SAMP>
2231 <A NAME="Shell Parameter Expansion"></A>
2233 <A NAME="SEC32"></A>
2234 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2235 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> < </A>]</TD>
2236 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> > </A>]</TD>
2237 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> << </A>]</TD>
2238 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2239 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2240 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2241 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2242 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2243 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2245 <H3> 3.5.3 Shell Parameter Expansion </H3>
2246 <!--docid::SEC32::-->
2249 The <SAMP>`$'</SAMP> character introduces parameter expansion,
2250 command substitution, or arithmetic expansion. The parameter name
2251 or symbol to be expanded may be enclosed in braces, which
2252 are optional but serve to protect the variable to be expanded from
2253 characters immediately following it which could be
2254 interpreted as part of the name.
2257 When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP>
2258 not escaped by a backslash or within a quoted string, and not within an
2259 embedded arithmetic expansion, command substitution, or parameter
2263 The basic form of parameter expansion is ${<VAR>parameter</VAR>}.
2264 The value of <VAR>parameter</VAR> is substituted. The braces are required
2265 when <VAR>parameter</VAR>
2266 is a positional parameter with more than one digit,
2267 or when <VAR>parameter</VAR>
2268 is followed by a character that is not to be
2269 interpreted as part of its name.
2272 If the first character of <VAR>parameter</VAR> is an exclamation point (!),
2273 a level of variable indirection is introduced.
2274 Bash uses the value of the variable formed from the rest of
2275 <VAR>parameter</VAR> as the name of the variable; this variable is then
2276 expanded and that value is used in the rest of the substitution, rather
2277 than the value of <VAR>parameter</VAR> itself.
2278 This is known as <CODE>indirect expansion</CODE>.
2279 The exceptions to this are the expansions of ${!<VAR>prefix</VAR><BR>}
2280 and ${!<VAR>name</VAR>[@]}
2282 The exclamation point must immediately follow the left brace in order to
2283 introduce indirection.
2286 In each of the cases below, <VAR>word</VAR> is subject to tilde expansion,
2287 parameter expansion, command substitution, and arithmetic expansion.
2290 When not performing substring expansion, using the form described
2291 below, Bash tests for a parameter that is unset or null.
2292 Omitting the colon results in a test only for a parameter that is unset.
2293 Put another way, if the colon is included,
2294 the operator tests for both <VAR>parameter</VAR>'s existence and that its value
2295 is not null; if the colon is omitted, the operator tests only for existence.
2300 <DT><CODE>${<VAR>parameter</VAR>:-<VAR>word</VAR>}</CODE>
2301 <DD>If <VAR>parameter</VAR> is unset or null, the expansion of
2302 <VAR>word</VAR> is substituted. Otherwise, the value of
2303 <VAR>parameter</VAR> is substituted.
2306 <DT><CODE>${<VAR>parameter</VAR>:=<VAR>word</VAR>}</CODE>
2307 <DD>If <VAR>parameter</VAR>
2308 is unset or null, the expansion of <VAR>word</VAR>
2309 is assigned to <VAR>parameter</VAR>.
2310 The value of <VAR>parameter</VAR> is then substituted.
2311 Positional parameters and special parameters may not be assigned to
2315 <DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE>
2316 <DD>If <VAR>parameter</VAR>
2317 is null or unset, the expansion of <VAR>word</VAR> (or a message
2318 to that effect if <VAR>word</VAR>
2319 is not present) is written to the standard error and the shell, if it
2320 is not interactive, exits. Otherwise, the value of <VAR>parameter</VAR> is
2324 <DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE>
2325 <DD>If <VAR>parameter</VAR>
2326 is null or unset, nothing is substituted, otherwise the expansion of
2327 <VAR>word</VAR> is substituted.
2330 <DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>}</CODE>
2331 <DD><DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>:<VAR>length</VAR>}</CODE>
2332 <DD>Expands to up to <VAR>length</VAR> characters of <VAR>parameter</VAR>
2333 starting at the character specified by <VAR>offset</VAR>.
2334 If <VAR>length</VAR> is omitted, expands to the substring of
2335 <VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>.
2336 <VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions
2337 (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
2338 This is referred to as Substring Expansion.
2341 If <VAR>offset</VAR> evaluates to a number less than zero, the value
2342 is used as an offset from the end of the value of <VAR>parameter</VAR>.
2343 If <VAR>length</VAR> evaluates to a number less than zero, and <VAR>parameter</VAR>
2344 is not <SAMP>`@'</SAMP> and not an indexed or associative array, it is interpreted
2345 as an offset from the end of the value of <VAR>parameter</VAR> rather than
2346 a number of characters, and the expansion is the characters between the
2348 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional
2349 parameters beginning at <VAR>offset</VAR>.
2350 If <VAR>parameter</VAR> is an indexed array name subscripted
2351 by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the result is the <VAR>length</VAR>
2352 members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>.
2353 A negative <VAR>offset</VAR> is taken relative to one greater than the maximum
2354 index of the specified array.
2355 Substring expansion applied to an associative array produces undefined
2359 Note that a negative offset must be separated from the colon by at least
2360 one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion.
2361 Substring indexing is zero-based unless the positional parameters
2362 are used, in which case the indexing starts at 1 by default.
2363 If <VAR>offset</VAR> is 0, and the positional parameters are used, <CODE>$@</CODE> is
2364 prefixed to the list.
2367 <DT><CODE>${!<VAR>prefix</VAR>*}</CODE>
2368 <DD><DT><CODE>${!<VAR>prefix</VAR>@}</CODE>
2369 <DD>Expands to the names of variables whose names begin with <VAR>prefix</VAR>,
2370 separated by the first character of the <CODE>IFS</CODE> special variable.
2371 When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2372 variable name expands to a separate word.
2375 <DT><CODE>${!<VAR>name</VAR>[@]}</CODE>
2376 <DD><DT><CODE>${!<VAR>name</VAR>[*]}</CODE>
2377 <DD>If <VAR>name</VAR> is an array variable, expands to the list of array indices
2378 (keys) assigned in <VAR>name</VAR>.
2379 If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null
2381 When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2382 key expands to a separate word.
2385 <DT><CODE>${#<VAR>parameter</VAR>}</CODE>
2386 <DD>The length in characters of the expanded value of <VAR>parameter</VAR> is
2388 If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted
2389 is the number of positional parameters.
2390 If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>,
2391 the value substituted is the number of elements in the array.
2394 <DT><CODE>${<VAR>parameter</VAR>#<VAR>word</VAR>}</CODE>
2395 <DD><DT><CODE>${<VAR>parameter</VAR>##<VAR>word</VAR>}</CODE>
2396 <DD>The <VAR>word</VAR>
2397 is expanded to produce a pattern just as in filename
2398 expansion (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>). If the pattern matches
2399 the beginning of the expanded value of <VAR>parameter</VAR>,
2400 then the result of the expansion is the expanded value of <VAR>parameter</VAR>
2401 with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the
2402 longest matching pattern (the <SAMP>`##'</SAMP> case) deleted.
2403 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2404 the pattern removal operation is applied to each positional
2405 parameter in turn, and the expansion is the resultant list.
2406 If <VAR>parameter</VAR> is an array variable subscripted with
2407 <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2408 the pattern removal operation is applied to each member of the
2409 array in turn, and the expansion is the resultant list.
2412 <DT><CODE>${<VAR>parameter</VAR>%<VAR>word</VAR>}</CODE>
2413 <DD><DT><CODE>${<VAR>parameter</VAR>%%<VAR>word</VAR>}</CODE>
2414 <DD>The <VAR>word</VAR> is expanded to produce a pattern just as in
2416 If the pattern matches a trailing portion of the expanded value of
2417 <VAR>parameter</VAR>, then the result of the expansion is the value of
2418 <VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case)
2419 or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted.
2420 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2421 the pattern removal operation is applied to each positional
2422 parameter in turn, and the expansion is the resultant list.
2423 If <VAR>parameter</VAR>
2424 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2425 the pattern removal operation is applied to each member of the
2426 array in turn, and the expansion is the resultant list.
2429 <DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE>
2432 The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2434 <VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR>
2435 against its value is replaced with <VAR>string</VAR>.
2436 If <VAR>pattern</VAR> begins with <SAMP>`/'</SAMP>, all matches of <VAR>pattern</VAR> are
2437 replaced with <VAR>string</VAR>. Normally only the first match is replaced.
2438 If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning
2439 of the expanded value of <VAR>parameter</VAR>.
2440 If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end
2441 of the expanded value of <VAR>parameter</VAR>.
2442 If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted
2443 and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted.
2444 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2445 the substitution operation is applied to each positional
2446 parameter in turn, and the expansion is the resultant list.
2447 If <VAR>parameter</VAR>
2448 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2449 the substitution operation is applied to each member of the
2450 array in turn, and the expansion is the resultant list.
2453 <DT><CODE>${<VAR>parameter</VAR>^<VAR>pattern</VAR>}</CODE>
2454 <DD><DT><CODE>${<VAR>parameter</VAR>^^<VAR>pattern</VAR>}</CODE>
2455 <DD><DT><CODE>${<VAR>parameter</VAR>,<VAR>pattern</VAR>}</CODE>
2456 <DD><DT><CODE>${<VAR>parameter</VAR>,,<VAR>pattern</VAR>}</CODE>
2457 <DD>This expansion modifies the case of alphabetic characters in <VAR>parameter</VAR>.
2458 The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2460 The <SAMP>`^'</SAMP> operator converts lowercase letters matching <VAR>pattern</VAR>
2461 to uppercase; the <SAMP>`,'</SAMP> operator converts matching uppercase letters
2463 The <SAMP>`^^'</SAMP> and <SAMP>`,,'</SAMP> expansions convert each matched character in the
2464 expanded value; the <SAMP>`^'</SAMP> and <SAMP>`,'</SAMP> expansions match and convert only
2465 the first character in the expanded value.
2466 If <VAR>pattern</VAR> is omitted, it is treated like a <SAMP>`?'</SAMP>, which matches
2468 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2469 the case modification operation is applied to each positional
2470 parameter in turn, and the expansion is the resultant list.
2471 If <VAR>parameter</VAR>
2472 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2473 the case modification operation is applied to each member of the
2474 array in turn, and the expansion is the resultant list.
2480 <A NAME="Command Substitution"></A>
2482 <A NAME="SEC33"></A>
2483 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2484 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> < </A>]</TD>
2485 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> > </A>]</TD>
2486 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> << </A>]</TD>
2487 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2488 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2489 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2490 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2491 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2492 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2494 <H3> 3.5.4 Command Substitution </H3>
2495 <!--docid::SEC33::-->
2498 Command substitution allows the output of a command to replace
2500 Command substitution occurs when a command is enclosed as follows:
2501 <TABLE><tr><td> </td><td class=example><pre>$(<VAR>command</VAR>)
2502 </pre></td></tr></table>or
2503 <TABLE><tr><td> </td><td class=example><pre>`<VAR>command</VAR>`
2504 </pre></td></tr></table></P><P>
2506 Bash performs the expansion by executing <VAR>command</VAR> and
2507 replacing the command substitution with the standard output of the
2508 command, with any trailing newlines deleted.
2509 Embedded newlines are not deleted, but they may be removed during
2511 The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be
2512 replaced by the equivalent but faster <CODE>$(< <VAR>file</VAR>)</CODE>.
2515 When the old-style backquote form of substitution is used,
2516 backslash retains its literal meaning except when followed by
2517 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>.
2518 The first backquote not preceded by a backslash terminates the
2519 command substitution.
2520 When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between
2521 the parentheses make up the command; none are treated specially.
2524 Command substitutions may be nested. To nest when using the backquoted
2525 form, escape the inner backquotes with backslashes.
2528 If the substitution appears within double quotes, word splitting and
2529 filename expansion are not performed on the results.
2532 <A NAME="Arithmetic Expansion"></A>
2534 <A NAME="SEC34"></A>
2535 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2536 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> < </A>]</TD>
2537 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> > </A>]</TD>
2538 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> << </A>]</TD>
2539 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2540 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2541 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2542 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2543 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2544 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2546 <H3> 3.5.5 Arithmetic Expansion </H3>
2547 <!--docid::SEC34::-->
2550 Arithmetic expansion allows the evaluation of an arithmetic expression
2551 and the substitution of the result. The format for arithmetic expansion is:
2554 <TABLE><tr><td> </td><td class=example><pre>$(( <VAR>expression</VAR> ))
2555 </pre></td></tr></table></P><P>
2557 The expression is treated as if it were within double quotes, but
2558 a double quote inside the parentheses is not treated specially.
2559 All tokens in the expression undergo parameter expansion, command
2560 substitution, and quote removal.
2561 Arithmetic expansions may be nested.
2564 The evaluation is performed according to the rules listed below
2565 (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
2566 If the expression is invalid, Bash prints a message indicating
2567 failure to the standard error and no substitution occurs.
2570 <A NAME="Process Substitution"></A>
2572 <A NAME="SEC35"></A>
2573 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2574 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> < </A>]</TD>
2575 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> > </A>]</TD>
2576 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> << </A>]</TD>
2577 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2578 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2579 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2580 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2581 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2582 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2584 <H3> 3.5.6 Process Substitution </H3>
2585 <!--docid::SEC35::-->
2588 Process substitution is supported on systems that support named
2589 pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files.
2590 It takes the form of
2591 <TABLE><tr><td> </td><td class=example><pre><(<VAR>list</VAR>)
2592 </pre></td></tr></table>or
2593 <TABLE><tr><td> </td><td class=example><pre>>(<VAR>list</VAR>)
2594 </pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a
2595 FIFO or some file in <TT>`/dev/fd'</TT>. The name of this file is
2596 passed as an argument to the current command as the result of the
2597 expansion. If the <CODE>>(<VAR>list</VAR>)</CODE> form is used, writing to
2598 the file will provide input for <VAR>list</VAR>. If the
2599 <CODE><(<VAR>list</VAR>)</CODE> form is used, the file passed as an
2600 argument should be read to obtain the output of <VAR>list</VAR>.
2601 Note that no space may appear between the <CODE><</CODE> or <CODE>></CODE>
2602 and the left parenthesis, otherwise the construct would be interpreted
2606 When available, process substitution is performed simultaneously with
2607 parameter and variable expansion, command substitution, and arithmetic
2611 <A NAME="Word Splitting"></A>
2613 <A NAME="SEC36"></A>
2614 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2615 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> < </A>]</TD>
2616 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> > </A>]</TD>
2617 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> << </A>]</TD>
2618 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2619 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2620 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2621 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2622 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2623 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2625 <H3> 3.5.7 Word Splitting </H3>
2626 <!--docid::SEC36::-->
2629 The shell scans the results of parameter expansion, command substitution,
2630 and arithmetic expansion that did not occur within double quotes for
2634 The shell treats each character of <CODE>$IFS</CODE> as a delimiter, and splits
2635 the results of the other expansions into words on these characters.
2636 If <CODE>IFS</CODE> is unset, or its value is exactly <CODE><space><tab><newline></CODE>,
2637 the default, then sequences of
2638 <CODE> <space></CODE>, <CODE><tab></CODE>, and <CODE><newline></CODE>
2639 at the beginning and end of the results of the previous
2640 expansions are ignored, and any sequence of <CODE>IFS</CODE>
2641 characters not at the beginning or end serves to delimit words.
2642 If <CODE>IFS</CODE> has a value other than the default, then sequences of
2643 the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE>
2644 are ignored at the beginning and end of the
2645 word, as long as the whitespace character is in the
2646 value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character).
2647 Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE>
2648 whitespace, along with any adjacent <CODE>IFS</CODE>
2649 whitespace characters, delimits a field. A sequence of <CODE>IFS</CODE>
2650 whitespace characters is also treated as a delimiter.
2651 If the value of <CODE>IFS</CODE> is null, no word splitting occurs.
2654 Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained.
2655 Unquoted implicit null arguments, resulting from the expansion of
2656 parameters that have no values, are removed.
2657 If a parameter with no value is expanded within double quotes, a
2658 null argument results and is retained.
2661 Note that if no expansion occurs, no splitting
2665 <A NAME="Filename Expansion"></A>
2667 <A NAME="SEC37"></A>
2668 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2669 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> < </A>]</TD>
2670 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> > </A>]</TD>
2671 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD>
2672 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2673 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2674 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2675 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2676 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2677 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2679 <H3> 3.5.8 Filename Expansion </H3>
2680 <!--docid::SEC37::-->
2681 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
2682 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell matches patterns.</TD></TR>
2683 </TABLE></BLOCKQUOTE>
2684 <A NAME="IDX64"></A>
2685 <A NAME="IDX65"></A>
2686 <A NAME="IDX66"></A>
2687 <A NAME="IDX67"></A>
2690 After word splitting, unless the <SAMP>`-f'</SAMP> option has been set
2691 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>), Bash scans each word for the characters
2692 <SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>.
2693 If one of these characters appears, then the word is
2694 regarded as a <VAR>pattern</VAR>,
2695 and replaced with an alphabetically sorted list of
2696 file names matching the pattern. If no matching file names are found,
2697 and the shell option <CODE>nullglob</CODE> is disabled, the word is left
2699 If the <CODE>nullglob</CODE> option is set, and no matches are found, the word
2701 If the <CODE>failglob</CODE> shell option is set, and no matches are found,
2702 an error message is printed and the command is not executed.
2703 If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed
2704 without regard to the case of alphabetic characters.
2707 When a pattern is used for filename expansion, the character <SAMP>`.'</SAMP>
2708 at the start of a filename or immediately following a slash
2709 must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set.
2710 When matching a file name, the slash character must always be
2712 In other cases, the <SAMP>`.'</SAMP> character is not treated specially.
2715 See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>,
2716 for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>,
2717 <CODE>failglob</CODE>, and <CODE>dotglob</CODE> options.
2720 The <CODE>GLOBIGNORE</CODE>
2721 shell variable may be used to restrict the set of filenames matching a
2722 pattern. If <CODE>GLOBIGNORE</CODE>
2723 is set, each matching filename that also matches one of the patterns in
2724 <CODE>GLOBIGNORE</CODE> is removed from the list of matches. The filenames
2725 <TT>`.'</TT> and <TT>`..'</TT>
2726 are always ignored when <CODE>GLOBIGNORE</CODE>
2727 is set and not null.
2728 However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of
2729 enabling the <CODE>dotglob</CODE>
2730 shell option, so all other filenames beginning with a
2731 <SAMP>`.'</SAMP> will match.
2732 To get the old behavior of ignoring filenames beginning with a
2733 <SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>.
2734 The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE>
2738 <A NAME="Pattern Matching"></A>
2740 <A NAME="SEC38"></A>
2741 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2742 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> < </A>]</TD>
2743 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> > </A>]</TD>
2744 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD>
2745 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> Up </A>]</TD>
2746 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2747 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2748 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2749 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2750 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2752 <H4> 3.5.8.1 Pattern Matching </H4>
2753 <!--docid::SEC38::-->
2756 Any character that appears in a pattern, other than the special pattern
2757 characters described below, matches itself.
2758 The NUL character may not occur in a pattern.
2759 A backslash escapes the following character; the
2760 escaping backslash is discarded when matching.
2761 The special pattern characters must be quoted if they are to be matched
2765 The special pattern characters have the following meanings:
2768 <DD>Matches any string, including the null string.
2769 When the <CODE>globstar</CODE> shell option is enabled, and <SAMP>`*'</SAMP> is used in
2770 a filename expansion context, two adjacent <SAMP>`*'</SAMP>s used as a single
2771 pattern will match all files and zero or more directories and
2773 If followed by a <SAMP>`/'</SAMP>, two adjacent <SAMP>`*'</SAMP>s will match only
2774 directories and subdirectories.
2776 <DD>Matches any single character.
2777 <DT><CODE>[<small>...</small>]</CODE>
2778 <DD>Matches any one of the enclosed characters. A pair of characters
2779 separated by a hyphen denotes a <VAR>range expression</VAR>;
2780 any character that sorts between those two characters, inclusive,
2781 using the current locale's collating sequence and character set,
2782 is matched. If the first character following the
2783 <SAMP>`['</SAMP> is a <SAMP>`!'</SAMP> or a <SAMP>`^'</SAMP>
2784 then any character not enclosed is matched. A <SAMP>`-'</SAMP>
2785 may be matched by including it as the first or last character
2786 in the set. A <SAMP>`]'</SAMP> may be matched by including it as the first
2787 character in the set.
2788 The sorting order of characters in range expressions is determined by
2789 the current locale and the value of the <CODE>LC_COLLATE</CODE> shell variable,
2793 For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to
2794 <SAMP>`[abcdxyz]'</SAMP>. Many locales sort characters in dictionary order, and in
2795 these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>;
2796 it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example. To obtain
2797 the traditional interpretation of ranges in bracket expressions, you can
2798 force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or
2799 <CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>.
2802 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified
2804 <CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the
2805 following classes defined in the POSIX standard:
2806 <TABLE><tr><td> </td><td class=example><pre>alnum alpha ascii blank cntrl digit graph lower
2807 print punct space upper word xdigit
2808 </pre></td></tr></table>A character class matches any character belonging to that class.
2809 The <CODE>word</CODE> character class matches letters, digits, and the character
2813 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be
2814 specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which
2815 matches all characters with the same collation weight (as defined
2816 by the current locale) as the character <VAR>c</VAR>.
2819 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE>
2820 matches the collating symbol <VAR>symbol</VAR>.
2824 If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE>
2825 builtin, several extended pattern matching operators are recognized.
2826 In the following description, a <VAR>pattern-list</VAR> is a list of one
2827 or more patterns separated by a <SAMP>`|'</SAMP>.
2828 Composite patterns may be formed using one or more of the following
2833 <DT><CODE>?(<VAR>pattern-list</VAR>)</CODE>
2834 <DD>Matches zero or one occurrence of the given patterns.
2837 <DT><CODE>*(<VAR>pattern-list</VAR>)</CODE>
2838 <DD>Matches zero or more occurrences of the given patterns.
2841 <DT><CODE>+(<VAR>pattern-list</VAR>)</CODE>
2842 <DD>Matches one or more occurrences of the given patterns.
2845 <DT><CODE>@(<VAR>pattern-list</VAR>)</CODE>
2846 <DD>Matches one of the given patterns.
2849 <DT><CODE>!(<VAR>pattern-list</VAR>)</CODE>
2850 <DD>Matches anything except one of the given patterns.
2854 <A NAME="Quote Removal"></A>
2856 <A NAME="SEC39"></A>
2857 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2858 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> < </A>]</TD>
2859 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> > </A>]</TD>
2860 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> << </A>]</TD>
2861 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2862 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> >> </A>]</TD>
2863 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2864 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2865 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2866 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2868 <H3> 3.5.9 Quote Removal </H3>
2869 <!--docid::SEC39::-->
2872 After the preceding expansions, all unquoted occurrences of the
2873 characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not
2874 result from one of the above expansions are removed.
2877 <A NAME="Redirections"></A>
2879 <A NAME="SEC40"></A>
2880 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2881 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> < </A>]</TD>
2882 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> > </A>]</TD>
2883 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> << </A>]</TD>
2884 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
2885 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
2886 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2887 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2888 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2889 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2891 <H2> 3.6 Redirections </H2>
2892 <!--docid::SEC40::-->
2895 Before a command is executed, its input and output
2896 may be <VAR>redirected</VAR>
2897 using a special notation interpreted by the shell.
2898 Redirection may also be used to open and close files for the
2899 current shell execution environment. The following redirection
2900 operators may precede or appear anywhere within a
2901 simple command or may follow a command.
2902 Redirections are processed in the order they appear, from
2906 Each redirection that may be preceded by a file descriptor number
2907 may instead be preceded by a word of the form {<VAR>varname</VAR>}.
2908 In this case, for each redirection operator except
2909 >&- and <&-, the shell will allocate a file descriptor greater
2910 than 10 and assign it to {<VAR>varname</VAR>}. If >&- or <&- is preceded
2911 by {<VAR>varname</VAR>}, the value of <VAR>varname</VAR> defines the file
2912 descriptor to close.
2915 In the following descriptions, if the file descriptor number is
2916 omitted, and the first character of the redirection operator is
2917 <SAMP>`<'</SAMP>, the redirection refers to the standard input (file
2918 descriptor 0). If the first character of the redirection operator
2919 is <SAMP>`>'</SAMP>, the redirection refers to the standard output (file
2923 The word following the redirection operator in the following
2924 descriptions, unless otherwise noted, is subjected to brace expansion,
2925 tilde expansion, parameter expansion, command substitution, arithmetic
2926 expansion, quote removal, filename expansion, and word splitting.
2927 If it expands to more than one word, Bash reports an error.
2930 Note that the order of redirections is significant. For example,
2932 <TABLE><tr><td> </td><td class=example><pre>ls > <VAR>dirlist</VAR> 2>&1
2933 </pre></td></tr></table>directs both standard output (file descriptor 1) and standard error
2934 (file descriptor 2) to the file <VAR>dirlist</VAR>, while the command
2935 <TABLE><tr><td> </td><td class=example><pre>ls 2>&1 > <VAR>dirlist</VAR>
2936 </pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>,
2937 because the standard error was made a copy of the standard output
2938 before the standard output was redirected to <VAR>dirlist</VAR>.
2941 Bash handles several filenames specially when they are used in
2942 redirections, as described in the following table:
2946 <DT><CODE>/dev/fd/<VAR>fd</VAR></CODE>
2947 <DD>If <VAR>fd</VAR> is a valid integer, file descriptor <VAR>fd</VAR> is duplicated.
2950 <DT><CODE>/dev/stdin</CODE>
2951 <DD>File descriptor 0 is duplicated.
2954 <DT><CODE>/dev/stdout</CODE>
2955 <DD>File descriptor 1 is duplicated.
2958 <DT><CODE>/dev/stderr</CODE>
2959 <DD>File descriptor 2 is duplicated.
2962 <DT><CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2963 <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2964 is an integer port number or service name, Bash attempts to open a TCP
2965 connection to the corresponding socket.
2968 <DT><CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2969 <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2970 is an integer port number or service name, Bash attempts to open a UDP
2971 connection to the corresponding socket.
2977 A failure to open or create a file causes the redirection to fail.
2980 Redirections using file descriptors greater than 9 should be used with
2981 care, as they may conflict with file descriptors the shell uses
2986 <A NAME="SEC41"></A>
2987 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2988 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> < </A>]</TD>
2989 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> > </A>]</TD>
2990 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> << </A>]</TD>
2991 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
2992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
2993 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2994 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2995 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
2996 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2998 <H3> 3.6.1 Redirecting Input </H3>
2999 <!--docid::SEC41::-->
3000 Redirection of input causes the file whose name results from
3001 the expansion of <VAR>word</VAR>
3002 to be opened for reading on file descriptor <CODE>n</CODE>,
3003 or the standard input (file descriptor 0) if <CODE>n</CODE>
3007 The general format for redirecting input is:
3008 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<<VAR>word</VAR>
3009 </pre></td></tr></table></P><P>
3012 <A NAME="SEC42"></A>
3013 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3014 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> < </A>]</TD>
3015 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> > </A>]</TD>
3016 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> << </A>]</TD>
3017 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3018 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3019 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3020 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3021 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3022 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3024 <H3> 3.6.2 Redirecting Output </H3>
3025 <!--docid::SEC42::-->
3026 Redirection of output causes the file whose name results from
3027 the expansion of <VAR>word</VAR>
3028 to be opened for writing on file descriptor <VAR>n</VAR>,
3029 or the standard output (file descriptor 1) if <VAR>n</VAR>
3030 is not specified. If the file does not exist it is created;
3031 if it does exist it is truncated to zero size.
3034 The general format for redirecting output is:
3035 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>[|]<VAR>word</VAR>
3036 </pre></td></tr></table></P><P>
3038 If the redirection operator is <SAMP>`>'</SAMP>, and the <CODE>noclobber</CODE>
3039 option to the <CODE>set</CODE> builtin has been enabled, the redirection
3040 will fail if the file whose name results from the expansion of
3041 <VAR>word</VAR> exists and is a regular file.
3042 If the redirection operator is <SAMP>`>|'</SAMP>, or the redirection operator is
3043 <SAMP>`>'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection
3044 is attempted even if the file named by <VAR>word</VAR> exists.
3048 <A NAME="SEC43"></A>
3049 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3050 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> < </A>]</TD>
3051 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> > </A>]</TD>
3052 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> << </A>]</TD>
3053 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3054 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3055 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3056 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3057 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3058 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3060 <H3> 3.6.3 Appending Redirected Output </H3>
3061 <!--docid::SEC43::-->
3062 Redirection of output in this fashion
3063 causes the file whose name results from
3064 the expansion of <VAR>word</VAR>
3065 to be opened for appending on file descriptor <VAR>n</VAR>,
3066 or the standard output (file descriptor 1) if <VAR>n</VAR>
3067 is not specified. If the file does not exist it is created.
3070 The general format for appending output is:
3071 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>><VAR>word</VAR>
3072 </pre></td></tr></table></P><P>
3075 <A NAME="SEC44"></A>
3076 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3077 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> < </A>]</TD>
3078 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> > </A>]</TD>
3079 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> << </A>]</TD>
3080 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3081 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3082 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3083 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3084 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3085 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3087 <H3> 3.6.4 Redirecting Standard Output and Standard Error </H3>
3088 <!--docid::SEC44::-->
3089 This construct allows both the
3090 standard output (file descriptor 1) and
3091 the standard error output (file descriptor 2)
3092 to be redirected to the file whose name is the
3093 expansion of <VAR>word</VAR>.
3096 There are two formats for redirecting standard output and
3098 <TABLE><tr><td> </td><td class=example><pre>&><VAR>word</VAR>
3099 </pre></td></tr></table>and
3100 <TABLE><tr><td> </td><td class=example><pre>>&<VAR>word</VAR>
3101 </pre></td></tr></table>Of the two forms, the first is preferred.
3102 This is semantically equivalent to
3103 <TABLE><tr><td> </td><td class=example><pre>><VAR>word</VAR> 2>&1
3104 </pre></td></tr></table></P><P>
3107 <A NAME="SEC45"></A>
3108 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3109 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> < </A>]</TD>
3110 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> > </A>]</TD>
3111 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> << </A>]</TD>
3112 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3113 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3114 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3115 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3116 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3117 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3119 <H3> 3.6.5 Appending Standard Output and Standard Error </H3>
3120 <!--docid::SEC45::-->
3121 This construct allows both the
3122 standard output (file descriptor 1) and
3123 the standard error output (file descriptor 2)
3124 to be appended to the file whose name is the
3125 expansion of <VAR>word</VAR>.
3128 The format for appending standard output and standard error is:
3129 <TABLE><tr><td> </td><td class=example><pre>&>><VAR>word</VAR>
3130 </pre></td></tr></table>This is semantically equivalent to
3131 <TABLE><tr><td> </td><td class=example><pre>>><VAR>word</VAR> 2>&1
3132 </pre></td></tr></table></P><P>
3135 <A NAME="SEC46"></A>
3136 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3137 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> < </A>]</TD>
3138 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> > </A>]</TD>
3139 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> << </A>]</TD>
3140 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3141 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3142 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3143 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3144 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3145 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3147 <H3> 3.6.6 Here Documents </H3>
3148 <!--docid::SEC46::-->
3149 This type of redirection instructs the shell to read input from the
3150 current source until a line containing only <VAR>word</VAR>
3151 (with no trailing blanks) is seen. All of
3152 the lines read up to that point are then used as the standard
3153 input for a command.
3156 The format of here-documents is:
3157 <TABLE><tr><td> </td><td class=example><pre><<[-]<VAR>word</VAR>
3158 <VAR>here-document</VAR>
3159 <VAR>delimiter</VAR>
3160 </pre></td></tr></table></P><P>
3162 No parameter expansion, command substitution, arithmetic expansion,
3163 or filename expansion is performed on
3164 <VAR>word</VAR>. If any characters in <VAR>word</VAR> are quoted, the
3165 <VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>,
3166 and the lines in the here-document are not expanded.
3167 If <VAR>word</VAR> is unquoted,
3168 all lines of the here-document are subjected to parameter expansion,
3169 command substitution, and arithmetic expansion. In the latter
3170 case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP>
3171 must be used to quote the characters
3172 <SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>.
3175 If the redirection operator is <SAMP>`<<-'</SAMP>,
3176 then all leading tab characters are stripped from input lines and the
3177 line containing <VAR>delimiter</VAR>.
3178 This allows here-documents within shell scripts to be indented in a
3183 <A NAME="SEC47"></A>
3184 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3185 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> < </A>]</TD>
3186 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> > </A>]</TD>
3187 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> << </A>]</TD>
3188 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3189 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3190 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3191 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3192 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3193 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3195 <H3> 3.6.7 Here Strings </H3>
3196 <!--docid::SEC47::-->
3197 A variant of here documents, the format is:
3198 <TABLE><tr><td> </td><td class=example><pre><<< <VAR>word</VAR>
3199 </pre></td></tr></table><P>
3201 The <VAR>word</VAR> is expanded and supplied to the command on its standard
3206 <A NAME="SEC48"></A>
3207 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3208 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> < </A>]</TD>
3209 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> > </A>]</TD>
3210 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> << </A>]</TD>
3211 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3212 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3213 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3214 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3215 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3216 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3218 <H3> 3.6.8 Duplicating File Descriptors </H3>
3219 <!--docid::SEC48::-->
3220 The redirection operator
3221 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>word</VAR>
3222 </pre></td></tr></table>is used to duplicate input file descriptors.
3224 expands to one or more digits, the file descriptor denoted by <VAR>n</VAR>
3225 is made to be a copy of that file descriptor.
3226 If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3227 input, a redirection error occurs.
3229 evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed. If
3230 <VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used.
3234 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>word</VAR>
3235 </pre></td></tr></table>is used similarly to duplicate output file descriptors. If
3236 <VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used.
3237 If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3238 output, a redirection error occurs.
3239 As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not
3240 expand to one or more digits, the standard output and standard
3241 error are redirected as described previously.
3245 <A NAME="SEC49"></A>
3246 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3247 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> < </A>]</TD>
3248 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> > </A>]</TD>
3249 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> << </A>]</TD>
3250 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3251 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3252 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3253 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3254 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3255 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3257 <H3> 3.6.9 Moving File Descriptors </H3>
3258 <!--docid::SEC49::-->
3259 The redirection operator
3260 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>digit</VAR>-
3261 </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3262 or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified.
3263 <VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>.
3266 Similarly, the redirection operator
3267 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>digit</VAR>-
3268 </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3269 or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified.
3273 <A NAME="SEC50"></A>
3274 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3275 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> < </A>]</TD>
3276 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> > </A>]</TD>
3277 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> << </A>]</TD>
3278 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3279 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> >> </A>]</TD>
3280 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3281 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3282 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3283 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3285 <H3> 3.6.10 Opening File Descriptors for Reading and Writing </H3>
3286 <!--docid::SEC50::-->
3287 The redirection operator
3288 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<><VAR>word</VAR>
3289 </pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR>
3290 to be opened for both reading and writing on file descriptor
3291 <VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR>
3292 is not specified. If the file does not exist, it is created.
3295 <A NAME="Executing Commands"></A>
3297 <A NAME="SEC51"></A>
3298 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3299 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> < </A>]</TD>
3300 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> > </A>]</TD>
3301 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD>
3302 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3303 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3304 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3305 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3306 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3307 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3309 <H2> 3.7 Executing Commands </H2>
3310 <!--docid::SEC51::-->
3313 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3314 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.1 Simple Command Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before
3315 executing them.</TD></TR>
3316 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.2 Command Search and Execution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash finds commands and runs them.</TD></TR>
3317 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash
3318 executes commands that are not
3319 shell builtins.</TD></TR>
3320 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.7.4 Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR>
3321 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC56">3.7.5 Exit Status</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash
3322 interprets it.</TD></TR>
3323 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC57">3.7.6 Signals</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs
3324 receives a signal.</TD></TR>
3325 </TABLE></BLOCKQUOTE>
3328 <A NAME="Simple Command Expansion"></A>
3330 <A NAME="SEC52"></A>
3331 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3332 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> < </A>]</TD>
3333 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> > </A>]</TD>
3334 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD>
3335 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3336 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3337 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3338 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3339 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3340 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3342 <H3> 3.7.1 Simple Command Expansion </H3>
3343 <!--docid::SEC52::-->
3346 When a simple command is executed, the shell performs the following
3347 expansions, assignments, and redirections, from left to right.
3352 The words that the parser has marked as variable assignments (those
3353 preceding the command name) and redirections are saved for later
3358 The words that are not variable assignments or redirections are
3359 expanded (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
3360 If any words remain after expansion, the first word
3361 is taken to be the name of the command and the remaining words are
3366 Redirections are performed as described above (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
3370 The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde
3371 expansion, parameter expansion, command substitution, arithmetic expansion,
3372 and quote removal before being assigned to the variable.
3376 If no command name results, the variable assignments affect the current
3377 shell environment. Otherwise, the variables are added to the environment
3378 of the executed command and do not affect the current shell environment.
3379 If any of the assignments attempts to assign a value to a readonly variable,
3380 an error occurs, and the command exits with a non-zero status.
3383 If no command name results, redirections are performed, but do not
3384 affect the current shell environment. A redirection error causes the
3385 command to exit with a non-zero status.
3388 If there is a command name left after expansion, execution proceeds as
3389 described below. Otherwise, the command exits. If one of the expansions
3390 contained a command substitution, the exit status of the command is
3391 the exit status of the last command substitution performed. If there
3392 were no command substitutions, the command exits with a status of zero.
3395 <A NAME="Command Search and Execution"></A>
3397 <A NAME="SEC53"></A>
3398 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3399 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> < </A>]</TD>
3400 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> > </A>]</TD>
3401 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> << </A>]</TD>
3402 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3403 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3404 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3405 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3406 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3407 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3409 <H3> 3.7.2 Command Search and Execution </H3>
3410 <!--docid::SEC53::-->
3413 After a command has been split into words, if it results in a
3414 simple command and an optional list of arguments, the following
3420 If the command name contains no slashes, the shell attempts to
3421 locate it. If there exists a shell function by that name, that
3422 function is invoked as described in <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>.
3426 If the name does not match a function, the shell searches for
3427 it in the list of shell builtins. If a match is found, that
3432 If the name is neither a shell function nor a builtin,
3433 and contains no slashes, Bash searches each element of
3434 <CODE>$PATH</CODE> for a directory containing an executable file
3435 by that name. Bash uses a hash table to remember the full
3436 pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches
3437 (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
3438 A full search of the directories in <CODE>$PATH</CODE>
3439 is performed only if the command is not found in the hash table.
3440 If the search is unsuccessful, the shell searches for a defined shell
3441 function named <CODE>command_not_found_handle</CODE>.
3442 If that function exists, it is invoked with the original command and
3443 the original command's arguments as its arguments, and the function's
3444 exit status becomes the exit status of the shell.
3445 If that function is not defined, the shell prints an error
3446 message and returns an exit status of 127.
3450 If the search is successful, or if the command name contains
3451 one or more slashes, the shell executes the named program in
3452 a separate execution environment.
3453 Argument 0 is set to the name given, and the remaining arguments
3454 to the command are set to the arguments supplied, if any.
3458 If this execution fails because the file is not in executable
3459 format, and the file is not a directory, it is assumed to be a
3460 <VAR>shell script</VAR> and the shell executes it as described in
3461 <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>.
3465 If the command was not begun asynchronously, the shell waits for
3466 the command to complete and collects its exit status.
3472 <A NAME="Command Execution Environment"></A>
3474 <A NAME="SEC54"></A>
3475 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3476 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> < </A>]</TD>
3477 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> > </A>]</TD>
3478 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> << </A>]</TD>
3479 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3480 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3481 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3482 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3483 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3484 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3486 <H3> 3.7.3 Command Execution Environment </H3>
3487 <!--docid::SEC54::-->
3490 The shell has an <VAR>execution environment</VAR>, which consists of the
3496 open files inherited by the shell at invocation, as modified by
3497 redirections supplied to the <CODE>exec</CODE> builtin
3501 the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or
3502 <CODE>popd</CODE>, or inherited by the shell at invocation
3506 the file creation mode mask as set by <CODE>umask</CODE> or inherited from
3511 current traps set by <CODE>trap</CODE>
3515 shell parameters that are set by variable assignment or with <CODE>set</CODE>
3516 or inherited from the shell's parent in the environment
3520 shell functions defined during execution or inherited from the shell's
3521 parent in the environment
3525 options enabled at invocation (either by default or with command-line
3526 arguments) or by <CODE>set</CODE>
3530 options enabled by <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
3534 shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>)
3538 various process IDs, including those of background jobs
3539 (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of
3546 When a simple command other than a builtin or shell function
3547 is to be executed, it
3548 is invoked in a separate execution environment that consists of
3549 the following. Unless otherwise noted, the values are inherited
3555 the shell's open files, plus any modifications and additions specified
3556 by redirections to the command
3560 the current working directory
3564 the file creation mode mask
3568 shell variables and functions marked for export, along with variables
3569 exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC55">3.7.4 Environment</A>)
3573 traps caught by the shell are reset to the values inherited from the
3574 shell's parent, and traps ignored by the shell are ignored
3580 A command invoked in this separate environment cannot affect the
3581 shell's execution environment.
3584 Command substitution, commands grouped with parentheses,
3585 and asynchronous commands are invoked in a
3586 subshell environment that is a duplicate of the shell environment,
3587 except that traps caught by the shell are reset to the values
3588 that the shell inherited from its parent at invocation. Builtin
3589 commands that are invoked as part of a pipeline are also executed
3590 in a subshell environment. Changes made to the subshell environment
3591 cannot affect the shell's execution environment.
3594 Subshells spawned to execute command substitutions inherit the value of
3595 the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
3596 Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
3599 If a command is followed by a <SAMP>`&'</SAMP> and job control is not active, the
3600 default standard input for the command is the empty file <TT>`/dev/null'</TT>.
3601 Otherwise, the invoked command inherits the file descriptors of the calling
3602 shell as modified by redirections.
3605 <A NAME="Environment"></A>
3607 <A NAME="SEC55"></A>
3608 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3609 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> < </A>]</TD>
3610 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> > </A>]</TD>
3611 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> << </A>]</TD>
3612 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3613 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3614 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3615 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3616 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3617 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3619 <H3> 3.7.4 Environment </H3>
3620 <!--docid::SEC55::-->
3623 When a program is invoked it is given an array of strings
3624 called the <VAR>environment</VAR>.
3625 This is a list of name-value pairs, of the form <CODE>name=value</CODE>.
3628 Bash provides several ways to manipulate the environment.
3629 On invocation, the shell scans its own environment and
3630 creates a parameter for each name found, automatically marking
3631 it for <VAR>export</VAR>
3632 to child processes. Executed commands inherit the environment.
3633 The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP>
3634 commands allow parameters and functions to be added to and
3635 deleted from the environment. If the value of a parameter
3636 in the environment is modified, the new value becomes part
3637 of the environment, replacing the old. The environment
3638 inherited by any executed command consists of the shell's
3639 initial environment, whose values may be modified in the shell,
3640 less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP>
3641 commands, plus any additions via the <CODE>export</CODE> and
3642 <SAMP>`declare -x'</SAMP> commands.
3645 The environment for any simple command
3646 or function may be augmented temporarily by prefixing it with
3647 parameter assignments, as described in <A HREF="bashref.html#SEC26">3.4 Shell Parameters</A>.
3648 These assignment statements affect only the environment seen
3652 If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>), then all
3653 parameter assignments are placed in the environment for a command,
3654 not just those that precede the command name.
3657 When Bash invokes an external command, the variable <SAMP>`$_'</SAMP>
3658 is set to the full path name of the command and passed to that
3659 command in its environment.
3662 <A NAME="Exit Status"></A>
3664 <A NAME="SEC56"></A>
3665 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3666 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> < </A>]</TD>
3667 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> > </A>]</TD>
3668 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD>
3669 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3670 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3671 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3672 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3673 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3674 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3676 <H3> 3.7.5 Exit Status </H3>
3677 <!--docid::SEC56::-->
3680 The exit status of an executed command is the value returned by the
3681 <VAR>waitpid</VAR> system call or equivalent function. Exit statuses
3682 fall between 0 and 255, though, as explained below, the shell may
3683 use values above 125 specially. Exit statuses from shell builtins and
3684 compound commands are also limited to this range. Under certain
3685 circumstances, the shell will use special values to indicate specific
3689 For the shell's purposes, a command which exits with a
3690 zero exit status has succeeded.
3691 A non-zero exit status indicates failure.
3692 This seemingly counter-intuitive scheme is used so there
3693 is one well-defined way to indicate success and a variety of
3694 ways to indicate various failure modes.
3695 When a command terminates on a fatal signal whose number is <VAR>N</VAR>,
3696 Bash uses the value 128+<VAR>N</VAR> as the exit status.
3699 If a command is not found, the child process created to
3700 execute it returns a status of 127. If a command is found
3701 but is not executable, the return status is 126.
3704 If a command fails because of an error during expansion or redirection,
3705 the exit status is greater than zero.
3708 The exit status is used by the Bash conditional commands
3709 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list
3710 constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>).
3713 All of the Bash builtins return an exit status of zero if they succeed
3714 and a non-zero status on failure, so they may be used by the
3715 conditional and list constructs.
3716 All builtins return an exit status of 2 to indicate incorrect usage.
3719 <A NAME="Signals"></A>
3721 <A NAME="SEC57"></A>
3722 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3723 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> < </A>]</TD>
3724 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> > </A>]</TD>
3725 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD>
3726 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3727 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3728 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3729 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3730 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3731 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3733 <H3> 3.7.6 Signals </H3>
3734 <!--docid::SEC57::-->
3737 When Bash is interactive, in the absence of any traps, it ignores
3738 <CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell),
3739 and <CODE>SIGINT</CODE>
3740 is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible).
3741 When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops.
3742 In all cases, Bash ignores <CODE>SIGQUIT</CODE>.
3743 If job control is in effect (see section <A HREF="bashref.html#SEC92">7. Job Control</A>), Bash
3744 ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3747 Non-builtin commands started by Bash have signal handlers set to the
3748 values inherited by the shell from its parent.
3749 When job control is not in effect, asynchronous commands
3750 ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited
3752 Commands run as a result of
3753 command substitution ignore the keyboard-generated job control signals
3754 <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3757 The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>.
3758 Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to
3759 all jobs, running or stopped.
3760 Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive
3761 the <CODE>SIGHUP</CODE>.
3762 To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a
3763 particular job, it should be removed
3764 from the jobs table with the <CODE>disown</CODE>
3765 builtin (see section <A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>) or marked
3766 to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>.
3769 If the <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE>
3770 (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when
3771 an interactive login shell exits.
3774 If Bash is waiting for a command to complete and receives a signal
3775 for which a trap has been set, the trap will not be executed until
3776 the command completes.
3777 When Bash is waiting for an asynchronous
3778 command via the <CODE>wait</CODE> builtin, the reception of a signal for
3779 which a trap has been set will cause the <CODE>wait</CODE> builtin to return
3780 immediately with an exit status greater than 128, immediately after
3781 which the trap is executed.
3784 <A NAME="Shell Scripts"></A>
3786 <A NAME="SEC58"></A>
3787 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3788 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> < </A>]</TD>
3789 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> > </A>]</TD>
3790 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
3791 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3792 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> >> </A>]</TD>
3793 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3794 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3795 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3796 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3798 <H2> 3.8 Shell Scripts </H2>
3799 <!--docid::SEC58::-->
3802 A shell script is a text file containing shell commands. When such
3803 a file is used as the first non-option argument when invoking Bash,
3804 and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied
3805 (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>),
3806 Bash reads and executes commands from the file, then exits. This
3807 mode of operation creates a non-interactive shell. The shell first
3808 searches for the file in the current directory, and looks in the
3809 directories in <CODE>$PATH</CODE> if not found there.
3813 a shell script, it sets the special parameter <CODE>0</CODE> to the name
3814 of the file, rather than the name of the shell, and the positional
3815 parameters are set to the remaining arguments, if any are given.
3816 If no additional arguments are supplied, the positional parameters
3820 A shell script may be made executable by using the <CODE>chmod</CODE> command
3821 to turn on the execute bit. When Bash finds such a file while
3822 searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to
3823 execute it. In other words, executing
3824 <TABLE><tr><td> </td><td class=example><pre>filename <VAR>arguments</VAR>
3825 </pre></td></tr></table>is equivalent to executing
3826 <TABLE><tr><td> </td><td class=example><pre>bash filename <VAR>arguments</VAR>
3827 </pre></td></tr></table></P><P>
3829 if <CODE>filename</CODE> is an executable shell script.
3830 This subshell reinitializes itself, so that the effect is as if a
3831 new shell had been invoked to interpret the script, with the
3832 exception that the locations of commands remembered by the parent
3833 (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
3834 are retained by the child.
3837 Most versions of Unix make this a part of the operating system's command
3838 execution mechanism. If the first line of a script begins with
3839 the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies
3840 an interpreter for the program.
3841 Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other
3842 interpreter and write the rest of the script file in that language.
3845 The arguments to the interpreter
3846 consist of a single optional argument following the interpreter
3847 name on the first line of the script file, followed by the name of
3848 the script file, followed by the rest of the arguments. Bash
3849 will perform this action on operating systems that do not handle it
3850 themselves. Note that some older versions of Unix limit the interpreter
3851 name and argument to a maximum of 32 characters.
3854 Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that
3855 Bash has been installed in <TT>`/bin'</TT>), since this ensures that
3856 Bash will be used to interpret the script, even if it is executed
3857 under another shell.
3860 <A NAME="Shell Builtin Commands"></A>
3862 <A NAME="SEC59"></A>
3863 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3864 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> < </A>]</TD>
3865 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> > </A>]</TD>
3866 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> << </A>]</TD>
3867 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
3868 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> >> </A>]</TD>
3869 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3870 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3871 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3872 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3874 <H1> 4. Shell Builtin Commands </H1>
3875 <!--docid::SEC59::-->
3878 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3879 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands inherited from the Bourne
3881 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Table of builtins specific to Bash.</TD></TR>
3882 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC62">4.3 Modifying Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtins to modify shell attributes and
3883 optional behavior.</TD></TR>
3884 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC65">4.4 Special Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands classified specially by
3886 </TABLE></BLOCKQUOTE>
3889 Builtin commands are contained within the shell itself.
3890 When the name of a builtin command is used as the first word of
3891 a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes
3892 the command directly, without invoking another program.
3893 Builtin commands are necessary to implement functionality impossible
3894 or inconvenient to obtain with separate utilities.
3897 This section briefly describes the builtins which Bash inherits from
3898 the Bourne Shell, as well as the builtin commands which are unique
3899 to or have been extended in Bash.
3902 Several builtin commands are described in other chapters: builtin
3903 commands which provide the Bash interface to the job control
3904 facilities (see section <A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>), the directory stack
3905 (see section <A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A>), the command history
3906 (see section <A HREF="bashref.html#SEC122">9.2 Bash History Builtins</A>), and the programmable completion
3907 facilities (see section <A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>).
3910 Many of the builtins have been extended by POSIX or Bash.
3913 Unless otherwise noted, each builtin command documented as accepting
3914 options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP>
3915 to signify the end of the options.
3916 The <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE>
3917 builtins do not accept options and do not treat <SAMP>`--'</SAMP> specially.
3918 The <CODE>exit</CODE>, <CODE>logout</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, <CODE>let</CODE>,
3919 and <CODE>shift</CODE> builtins accept and process arguments beginning
3920 with <SAMP>`-'</SAMP> without requiring <SAMP>`--'</SAMP>.
3921 Other builtins that accept arguments but are not specified as accepting
3922 options interpret arguments beginning with <SAMP>`-'</SAMP> as invalid options and
3923 require <SAMP>`--'</SAMP> to prevent this interpretation.
3926 <A NAME="Bourne Shell Builtins"></A>
3928 <A NAME="SEC60"></A>
3929 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3930 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> < </A>]</TD>
3931 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> > </A>]</TD>
3932 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> << </A>]</TD>
3933 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
3934 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> >> </A>]</TD>
3935 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3936 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3937 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
3938 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3940 <H2> 4.1 Bourne Shell Builtins </H2>
3941 <!--docid::SEC60::-->
3944 The following shell builtin commands are inherited from the Bourne Shell.
3945 These commands are implemented as specified by the POSIX standard.
3949 <DT><CODE>: (a colon)</CODE>
3950 <DD><A NAME="IDX68"></A>
3951 <TABLE><tr><td> </td><td class=example><pre>: [<VAR>arguments</VAR>]
3952 </pre></td></tr></table>Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections.
3953 The return status is zero.
3956 <DT><CODE>. (a period)</CODE>
3957 <DD><A NAME="IDX69"></A>
3958 <TABLE><tr><td> </td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>]
3959 </pre></td></tr></table>Read and execute commands from the <VAR>filename</VAR> argument in the
3960 current shell context. If <VAR>filename</VAR> does not contain a slash,
3961 the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>.
3962 When Bash is not in POSIX mode, the current directory is searched
3963 if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>.
3964 If any <VAR>arguments</VAR> are supplied, they become the positional
3965 parameters when <VAR>filename</VAR> is executed. Otherwise the positional
3966 parameters are unchanged.
3967 The return status is the exit status of the last command executed, or
3968 zero if no commands are executed. If <VAR>filename</VAR> is not found, or
3969 cannot be read, the return status is non-zero.
3970 This builtin is equivalent to <CODE>source</CODE>.
3973 <DT><CODE>break</CODE>
3974 <DD><A NAME="IDX70"></A>
3975 <TABLE><tr><td> </td><td class=example><pre>break [<VAR>n</VAR>]
3976 </pre></td></tr></table>Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop.
3977 If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited.
3978 <VAR>n</VAR> must be greater than or equal to 1.
3979 The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
3983 <DD><A NAME="IDX71"></A>
3984 <TABLE><tr><td> </td><td class=example><pre>cd [-L|[-P [-e]]] [<VAR>directory</VAR>]
3985 </pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>.
3986 If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell
3988 If the shell variable <CODE>CDPATH</CODE> exists, it is used as a search path.
3989 If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used.
3992 The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic
3993 links are followed by default or with the <SAMP>`-L'</SAMP> option.
3994 If the <SAMP>`-e'</SAMP> option is supplied with <SAMP>`-P'</SAMP>
3995 and the current working directory cannot be successfully determined
3996 after a successful directory change, <CODE>cd</CODE> will return an unsuccessful
3998 If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>.
4001 If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if
4002 <SAMP>`-'</SAMP> is the first argument, and the directory change is
4003 successful, the absolute pathname of the new working directory is
4004 written to the standard output.
4007 The return status is zero if the directory is successfully changed,
4011 <DT><CODE>continue</CODE>
4012 <DD><A NAME="IDX72"></A>
4013 <TABLE><tr><td> </td><td class=example><pre>continue [<VAR>n</VAR>]
4014 </pre></td></tr></table>Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>,
4015 <CODE>until</CODE>, or <CODE>select</CODE> loop.
4016 If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop
4018 <VAR>n</VAR> must be greater than or equal to 1.
4019 The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
4022 <DT><CODE>eval</CODE>
4023 <DD><A NAME="IDX73"></A>
4024 <TABLE><tr><td> </td><td class=example><pre>eval [<VAR>arguments</VAR>]
4025 </pre></td></tr></table>The arguments are concatenated together into a single command, which is
4026 then read and executed, and its exit status returned as the exit status
4027 of <CODE>eval</CODE>.
4028 If there are no arguments or only empty arguments, the return status is
4032 <DT><CODE>exec</CODE>
4033 <DD><A NAME="IDX74"></A>
4034 <TABLE><tr><td> </td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]]
4035 </pre></td></tr></table>If <VAR>command</VAR>
4036 is supplied, it replaces the shell without creating a new process.
4037 If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the
4038 beginning of the zeroth argument passed to <VAR>command</VAR>.
4039 This is what the <CODE>login</CODE> program does.
4040 The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty
4042 If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth
4043 argument to <VAR>command</VAR>.
4044 If no <VAR>command</VAR> is specified, redirections may be used to affect
4045 the current shell environment. If there are no redirection errors, the
4046 return status is zero; otherwise the return status is non-zero.
4049 <DT><CODE>exit</CODE>
4050 <DD><A NAME="IDX75"></A>
4051 <TABLE><tr><td> </td><td class=example><pre>exit [<VAR>n</VAR>]
4052 </pre></td></tr></table>Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent.
4053 If <VAR>n</VAR> is omitted, the exit status is that of the last command executed.
4054 Any trap on <CODE>EXIT</CODE> is executed before the shell terminates.
4057 <DT><CODE>export</CODE>
4058 <DD><A NAME="IDX76"></A>
4059 <TABLE><tr><td> </td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]]
4060 </pre></td></tr></table>Mark each <VAR>name</VAR> to be passed to child processes
4061 in the environment. If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s
4062 refer to shell functions; otherwise the names refer to shell variables.
4063 The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export.
4064 If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a
4065 list of exported names is displayed.
4066 The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input.
4067 If a variable name is followed by =<VAR>value</VAR>, the value of
4068 the variable is set to <VAR>value</VAR>.
4071 The return status is zero unless an invalid option is supplied, one of
4072 the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied
4073 with a name that is not a shell function.
4076 <DT><CODE>getopts</CODE>
4077 <DD><A NAME="IDX77"></A>
4078 <TABLE><tr><td> </td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>]
4079 </pre></td></tr></table><CODE>getopts</CODE> is used by shell scripts to parse positional parameters.
4080 <VAR>optstring</VAR> contains the option characters to be recognized; if a
4081 character is followed by a colon, the option is expected to have an
4082 argument, which should be separated from it by white space.
4083 The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be
4084 used as option characters.
4085 Each time it is invoked, <CODE>getopts</CODE>
4086 places the next option in the shell variable <VAR>name</VAR>, initializing
4087 <VAR>name</VAR> if it does not exist,
4088 and the index of the next argument to be processed into the
4089 variable <CODE>OPTIND</CODE>.
4090 <CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script
4092 When an option requires an argument,
4093 <CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>.
4094 The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually
4095 reset between multiple calls to <CODE>getopts</CODE> within the same shell
4096 invocation if a new set of parameters is to be used.
4099 When the end of options is encountered, <CODE>getopts</CODE> exits with a
4100 return value greater than zero.
4101 <CODE>OPTIND</CODE> is set to the index of the first non-option argument,
4102 and <VAR>name</VAR> is set to <SAMP>`?'</SAMP>.
4105 <CODE>getopts</CODE>
4106 normally parses the positional parameters, but if more arguments are
4107 given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead.
4110 <CODE>getopts</CODE> can report errors in two ways. If the first character of
4111 <VAR>optstring</VAR> is a colon, <VAR>silent</VAR>
4112 error reporting is used. In normal operation diagnostic messages
4113 are printed when invalid options or missing option arguments are
4115 If the variable <CODE>OPTERR</CODE>
4116 is set to 0, no error messages will be displayed, even if the first
4117 character of <CODE>optstring</CODE> is not a colon.
4120 If an invalid option is seen,
4121 <CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent,
4122 prints an error message and unsets <CODE>OPTARG</CODE>.
4123 If <CODE>getopts</CODE> is silent, the option character found is placed in
4124 <CODE>OPTARG</CODE> and no diagnostic message is printed.
4127 If a required argument is not found, and <CODE>getopts</CODE>
4128 is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>,
4129 <CODE>OPTARG</CODE> is unset, and a diagnostic message is printed.
4130 If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in
4131 <VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found.
4134 <DT><CODE>hash</CODE>
4135 <DD><A NAME="IDX78"></A>
4136 <TABLE><tr><td> </td><td class=example><pre>hash [-r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>]
4137 </pre></td></tr></table>Each time <CODE>hash</CODE> is invoked, it remembers the full pathnames of the
4138 commands specified as <VAR>name</VAR> arguments,
4139 so they need not be searched for on subsequent invocations.
4140 The commands are found by searching through the directories listed in
4142 Any previously-remembered pathname is discarded.
4143 The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is
4144 used as the location of <VAR>name</VAR>.
4145 The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations.
4146 The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location
4147 of each <VAR>name</VAR>.
4148 If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each
4149 <VAR>name</VAR> corresponds is printed. If multiple <VAR>name</VAR> arguments are
4150 supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed
4152 The <SAMP>`-l'</SAMP> option causes output to be displayed in a format
4153 that may be reused as input.
4154 If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied,
4155 information about remembered commands is printed.
4156 The return status is zero unless a <VAR>name</VAR> is not found or an invalid
4160 <DT><CODE>pwd</CODE>
4161 <DD><A NAME="IDX79"></A>
4162 <TABLE><tr><td> </td><td class=example><pre>pwd [-LP]
4163 </pre></td></tr></table>Print the absolute pathname of the current working directory.
4164 If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not
4165 contain symbolic links.
4166 If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain
4168 The return status is zero unless an error is encountered while
4169 determining the name of the current directory or an invalid option
4173 <DT><CODE>readonly</CODE>
4174 <DD><A NAME="IDX80"></A>
4175 <TABLE><tr><td> </td><td class=example><pre>readonly [-aApf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small>
4176 </pre></td></tr></table>Mark each <VAR>name</VAR> as readonly.
4177 The values of these names may not be changed by subsequent assignment.
4178 If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell
4180 The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed
4181 array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers
4182 to an associative array variable.
4183 If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP>
4184 option is supplied, a list of all readonly names is printed.
4185 The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that
4186 may be reused as input.
4187 If a variable name is followed by =<VAR>value</VAR>, the value of
4188 the variable is set to <VAR>value</VAR>.
4189 The return status is zero unless an invalid option is supplied, one of
4190 the <VAR>name</VAR> arguments is not a valid shell variable or function name,
4191 or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function.
4194 <DT><CODE>return</CODE>
4195 <DD><A NAME="IDX81"></A>
4196 <TABLE><tr><td> </td><td class=example><pre>return [<VAR>n</VAR>]
4197 </pre></td></tr></table>Cause a shell function to exit with the return value <VAR>n</VAR>.
4198 If <VAR>n</VAR> is not supplied, the return value is the exit status of the
4199 last command executed in the function.
4200 This may also be used to terminate execution of a script being executed
4201 with the <CODE>.</CODE> (or <CODE>source</CODE>) builtin, returning either <VAR>n</VAR> or
4202 the exit status of the last command executed within the script as the exit
4203 status of the script.
4204 Any command associated with the <CODE>RETURN</CODE> trap is executed
4205 before execution resumes after the function or script.
4206 The return status is non-zero if <CODE>return</CODE> is used outside a function
4207 and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>.
4210 <DT><CODE>shift</CODE>
4211 <DD><A NAME="IDX82"></A>
4212 <TABLE><tr><td> </td><td class=example><pre>shift [<VAR>n</VAR>]
4213 </pre></td></tr></table>Shift the positional parameters to the left by <VAR>n</VAR>.
4214 The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are
4215 renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>.
4216 Parameters represented by the numbers <CODE>$#</CODE> to <CODE>$#</CODE>-<VAR>n</VAR>+1
4218 <VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>.
4219 If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters
4221 If <VAR>n</VAR> is not supplied, it is assumed to be 1.
4222 The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or
4223 less than zero, non-zero otherwise.
4226 <DT><CODE>test</CODE>
4227 <DD><DT><CODE>[</CODE>
4228 <DD><A NAME="IDX83"></A>
4229 <A NAME="IDX84"></A>
4230 Evaluate a conditional expression <VAR>expr</VAR>.
4231 Each operator and operand must be a separate argument.
4232 Expressions are composed of the primaries described below in
4233 <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>.
4234 <CODE>test</CODE> does not accept any options, nor does it accept and ignore
4235 an argument of <SAMP>`--'</SAMP> as signifying the end of options.
4238 When the <CODE>[</CODE> form is used, the last argument to the command must
4239 be a <CODE>]</CODE>.
4242 Expressions may be combined using the following operators, listed in
4243 decreasing order of precedence.
4244 The evaluation depends on the number of arguments; see below.
4245 Operator precedence is used when there are five or more arguments.
4249 <DT><CODE>! <VAR>expr</VAR></CODE>
4250 <DD>True if <VAR>expr</VAR> is false.
4253 <DT><CODE>( <VAR>expr</VAR> )</CODE>
4254 <DD>Returns the value of <VAR>expr</VAR>.
4255 This may be used to override the normal precedence of operators.
4258 <DT><CODE><VAR>expr1</VAR> -a <VAR>expr2</VAR></CODE>
4259 <DD>True if both <VAR>expr1</VAR> and <VAR>expr2</VAR> are true.
4262 <DT><CODE><VAR>expr1</VAR> -o <VAR>expr2</VAR></CODE>
4263 <DD>True if either <VAR>expr1</VAR> or <VAR>expr2</VAR> is true.
4267 The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional
4268 expressions using a set of rules based on the number of arguments.
4273 <DD>The expression is false.
4277 <DD>The expression is true if and only if the argument is not null.
4281 <DD>If the first argument is <SAMP>`!'</SAMP>, the expression is true if and
4282 only if the second argument is null.
4283 If the first argument is one of the unary conditional operators
4284 (see section <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>), the expression
4285 is true if the unary test is true.
4286 If the first argument is not a valid unary operator, the expression is
4291 <DD>The following conditions are applied in the order listed.
4292 If the second argument is one of the binary conditional
4293 operators (see section <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>), the
4294 result of the expression is the result of the binary test using the
4295 first and third arguments as operands.
4296 The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators
4297 when there are three arguments.
4298 If the first argument is <SAMP>`!'</SAMP>, the value is the negation of
4299 the two-argument test using the second and third arguments.
4300 If the first argument is exactly <SAMP>`('</SAMP> and the third argument is
4301 exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second
4303 Otherwise, the expression is false.
4307 <DD>If the first argument is <SAMP>`!'</SAMP>, the result is the negation of
4308 the three-argument expression composed of the remaining arguments.
4309 Otherwise, the expression is parsed and evaluated according to
4310 precedence using the rules listed above.
4313 <DT>5 or more arguments
4314 <DD>The expression is parsed and evaluated according to precedence
4315 using the rules listed above.
4319 When used with <CODE>test</CODE> or <SAMP>`['</SAMP>, the <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP>
4320 operators sort lexicographically using ASCII ordering.
4323 <DT><CODE>times</CODE>
4324 <DD><A NAME="IDX85"></A>
4325 <TABLE><tr><td> </td><td class=example><pre>times
4326 </pre></td></tr></table>Print out the user and system times used by the shell and its children.
4327 The return status is zero.
4330 <DT><CODE>trap</CODE>
4331 <DD><A NAME="IDX86"></A>
4332 <TABLE><tr><td> </td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>]
4333 </pre></td></tr></table>The commands in <VAR>arg</VAR> are to be read and executed when the
4334 shell receives signal <VAR>sigspec</VAR>. If <VAR>arg</VAR> is absent (and
4335 there is a single <VAR>sigspec</VAR>) or
4336 equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset
4337 to the value it had when the shell was started.
4338 If <VAR>arg</VAR> is the null string, then the signal specified by
4339 each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes.
4340 If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied,
4341 the shell displays the trap commands associated with each <VAR>sigspec</VAR>.
4342 If no arguments are supplied, or
4343 only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands
4344 associated with each signal number in a form that may be reused as
4346 The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names
4347 and their corresponding numbers.
4348 Each <VAR>sigspec</VAR> is either a signal name or a signal number.
4349 Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional.
4352 If a <VAR>sigspec</VAR>
4353 is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits.
4354 If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed
4355 before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
4356 <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
4357 the first command executes in a shell function.
4358 Refer to the description of the <CODE>extdebug</CODE> option to the
4359 <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>) for details of its
4360 effect on the <CODE>DEBUG</CODE> trap.
4361 If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed
4362 each time a shell function or a script executed with the <CODE>.</CODE> or
4363 <CODE>source</CODE> builtins finishes executing.
4366 If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR>
4367 is executed whenever a simple command has a non-zero exit status,
4368 subject to the following conditions.
4369 The <CODE>ERR</CODE> trap is not executed if the failed command is part of the
4370 command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword,
4371 part of the test following the <CODE>if</CODE> or <CODE>elif</CODE> reserved words,
4372 part of a command executed in a <CODE>&&</CODE> or <CODE>||</CODE> list,
4373 or if the command's return
4374 status is being inverted using <CODE>!</CODE>.
4375 These are the same conditions obeyed by the <CODE>errexit</CODE> option.
4378 Signals ignored upon entry to the shell cannot be trapped or reset.
4379 Trapped signals that are not being ignored are reset to their original
4380 values in a subshell or subshell environment when one is created.
4383 The return status is zero unless a <VAR>sigspec</VAR> does not specify a
4387 <DT><CODE>umask</CODE>
4388 <DD><A NAME="IDX87"></A>
4389 <TABLE><tr><td> </td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>]
4390 </pre></td></tr></table>Set the shell process's file creation mask to <VAR>mode</VAR>. If
4391 <VAR>mode</VAR> begins with a digit, it is interpreted as an octal number;
4392 if not, it is interpreted as a symbolic mode mask similar
4393 to that accepted by the <CODE>chmod</CODE> command. If <VAR>mode</VAR> is
4394 omitted, the current value of the mask is printed. If the <SAMP>`-S'</SAMP>
4395 option is supplied without a <VAR>mode</VAR> argument, the mask is printed
4396 in a symbolic format.
4397 If the <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR>
4398 is omitted, the output is in a form that may be reused as input.
4399 The return status is zero if the mode is successfully changed or if
4400 no <VAR>mode</VAR> argument is supplied, and non-zero otherwise.
4403 Note that when the mode is interpreted as an octal number, each number
4404 of the umask is subtracted from <CODE>7</CODE>. Thus, a umask of <CODE>022</CODE>
4405 results in permissions of <CODE>755</CODE>.
4408 <DT><CODE>unset</CODE>
4409 <DD><A NAME="IDX88"></A>
4410 <TABLE><tr><td> </td><td class=example><pre>unset [-fv] [<VAR>name</VAR>]
4411 </pre></td></tr></table>Each variable or function <VAR>name</VAR> is removed.
4412 If no options are supplied, or the <SAMP>`-v'</SAMP> option is given, each
4413 <VAR>name</VAR> refers to a shell variable.
4414 If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell
4415 functions, and the function definition is removed.
4416 Readonly variables and functions may not be unset.
4417 The return status is zero unless a <VAR>name</VAR> is readonly.
4421 <A NAME="Bash Builtins"></A>
4423 <A NAME="SEC61"></A>
4424 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4425 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> < </A>]</TD>
4426 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> > </A>]</TD>
4427 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> << </A>]</TD>
4428 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
4429 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> >> </A>]</TD>
4430 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4431 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4432 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
4433 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4435 <H2> 4.2 Bash Builtin Commands </H2>
4436 <!--docid::SEC61::-->
4439 This section describes builtin commands which are unique to
4440 or have been extended in Bash.
4441 Some of these commands are specified in the POSIX standard.
4446 <DT><CODE>alias</CODE>
4447 <DD><A NAME="IDX89"></A>
4448 <TABLE><tr><td> </td><td class=example><pre>alias [<CODE>-p</CODE>] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4449 </pre></td></tr></table><P>
4451 Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints
4452 the list of aliases on the standard output in a form that allows
4453 them to be reused as input.
4454 If arguments are supplied, an alias is defined for each <VAR>name</VAR>
4455 whose <VAR>value</VAR> is given. If no <VAR>value</VAR> is given, the name
4456 and value of the alias is printed.
4457 Aliases are described in <A HREF="bashref.html#SEC85">6.6 Aliases</A>.
4460 <DT><CODE>bind</CODE>
4461 <DD><A NAME="IDX90"></A>
4462 <TABLE><tr><td> </td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSV]
4463 bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>]
4464 bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR>
4465 bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR>
4466 bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR>
4467 bind <VAR>readline-command</VAR>
4468 </pre></td></tr></table><P>
4470 Display current Readline (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>)
4471 key and function bindings,
4472 bind a key sequence to a Readline function or macro,
4473 or set a Readline variable.
4474 Each non-option argument is a command as it would appear in a
4475 Readline initialization file (see section <A HREF="bashref.html#SEC104">8.3 Readline Init File</A>),
4476 but each binding or command must be passed as a separate argument; e.g.,
4477 <SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>.
4480 Options, if supplied, have the following meanings:
4484 <DT><CODE>-m <VAR>keymap</VAR></CODE>
4485 <DD>Use <VAR>keymap</VAR> as the keymap to be affected by
4486 the subsequent bindings. Acceptable <VAR>keymap</VAR>
4489 <CODE>emacs-standard</CODE>,
4490 <CODE>emacs-meta</CODE>,
4491 <CODE>emacs-ctlx</CODE>,
4493 <CODE>vi-move</CODE>,
4494 <CODE>vi-command</CODE>, and
4495 <CODE>vi-insert</CODE>.
4496 <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>;
4497 <CODE>emacs</CODE> is equivalent to <CODE>emacs-standard</CODE>.
4501 <DD>List the names of all Readline functions.
4505 <DD>Display Readline function names and bindings in such a way that they
4506 can be used as input or in a Readline initialization file.
4510 <DD>List current Readline function names and bindings.
4514 <DD>Display Readline variable names and values in such a way that they
4515 can be used as input or in a Readline initialization file.
4519 <DD>List current Readline variable names and values.
4523 <DD>Display Readline key sequences bound to macros and the strings they output
4524 in such a way that they can be used as input or in a Readline
4525 initialization file.
4529 <DD>Display Readline key sequences bound to macros and the strings they output.
4532 <DT><CODE>-f <VAR>filename</VAR></CODE>
4533 <DD>Read key bindings from <VAR>filename</VAR>.
4536 <DT><CODE>-q <VAR>function</VAR></CODE>
4537 <DD>Query about which keys invoke the named <VAR>function</VAR>.
4540 <DT><CODE>-u <VAR>function</VAR></CODE>
4541 <DD>Unbind all keys bound to the named <VAR>function</VAR>.
4544 <DT><CODE>-r <VAR>keyseq</VAR></CODE>
4545 <DD>Remove any current binding for <VAR>keyseq</VAR>.
4548 <DT><CODE>-x <VAR>keyseq:shell-command</VAR></CODE>
4549 <DD>Cause <VAR>shell-command</VAR> to be executed whenever <VAR>keyseq</VAR> is
4551 When <VAR>shell-command</VAR> is executed, the shell sets the
4552 <CODE>READLINE_LINE</CODE> variable to the contents of the Readline line
4553 buffer and the <CODE>READLINE_POINT</CODE> variable to the current location
4554 of the insertion point.
4555 If the executed command changes the value of <CODE>READLINE_LINE</CODE> or
4556 <CODE>READLINE_POINT</CODE>, those new values will be reflected in the
4561 The return status is zero unless an invalid option is supplied or an
4565 <DT><CODE>builtin</CODE>
4566 <DD><A NAME="IDX91"></A>
4567 <TABLE><tr><td> </td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]]
4568 </pre></td></tr></table>Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status.
4569 This is useful when defining a shell function with the same
4570 name as a shell builtin, retaining the functionality of the builtin within
4572 The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell
4576 <DT><CODE>caller</CODE>
4577 <DD><A NAME="IDX92"></A>
4578 <TABLE><tr><td> </td><td class=example><pre>caller [<VAR>expr</VAR>]
4579 </pre></td></tr></table>Returns the context of any active subroutine call (a shell function or
4580 a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins).
4583 Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source
4584 filename of the current subroutine call.
4585 If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE>
4586 displays the line number, subroutine name, and source file corresponding
4587 to that position in the current execution call stack. This extra
4588 information may be used, for example, to print a stack trace. The
4589 current frame is frame 0.
4592 The return value is 0 unless the shell is not executing a subroutine
4593 call or <VAR>expr</VAR> does not correspond to a valid position in the
4597 <DT><CODE>command</CODE>
4598 <DD><A NAME="IDX93"></A>
4599 <TABLE><tr><td> </td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>]
4600 </pre></td></tr></table>Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function
4601 named <VAR>command</VAR>.
4602 Only shell builtin commands or commands found by searching the
4603 <CODE>PATH</CODE> are executed.
4604 If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP>
4605 within the function will execute the external command <CODE>ls</CODE>
4606 instead of calling the function recursively.
4607 The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE>
4608 that is guaranteed to find all of the standard utilities.
4609 The return status in this case is 127 if <VAR>command</VAR> cannot be
4610 found or an error occurred, and the exit status of <VAR>command</VAR>
4614 If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a
4615 description of <VAR>command</VAR> is printed. The <SAMP>`-v'</SAMP> option
4616 causes a single word indicating the command or file name used to
4617 invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces
4618 a more verbose description. In this case, the return status is
4619 zero if <VAR>command</VAR> is found, and non-zero if not.
4622 <DT><CODE>declare</CODE>
4623 <DD><A NAME="IDX94"></A>
4624 <TABLE><tr><td> </td><td class=example><pre>declare [-aAfFilrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4625 </pre></td></tr></table><P>
4627 Declare variables and give them attributes. If no <VAR>name</VAR>s
4628 are given, then display the values of variables instead.
4631 The <SAMP>`-p'</SAMP> option will display the attributes and values of each
4633 When <SAMP>`-p'</SAMP> is used with <VAR>name</VAR> arguments, additional options
4637 When <SAMP>`-p'</SAMP> is supplied without <VAR>name</VAR> arguments, <CODE>declare</CODE>
4638 will display the attributes and values of all variables having the
4639 attributes specified by the additional options.
4640 If no other options are supplied with <SAMP>`-p'</SAMP>, <CODE>declare</CODE> will
4641 display the attributes and values of all shell variables. The <SAMP>`-f'</SAMP>
4642 option will restrict the display to shell functions.
4645 The <SAMP>`-F'</SAMP> option inhibits the display of function definitions;
4646 only the function name and attributes are printed.
4647 If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE>
4648 (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), the source file name and line number where
4649 the function is defined are displayed as well.
4650 <SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>.
4653 The <SAMP>`-g'</SAMP> option forces variables to be created or modified at
4654 the global scope, even when \fBdeclare\fP is executed in a shell function.
4655 It is ignored in all other cases.
4658 The following options can be used to restrict output to variables with
4659 the specified attributes or to give variables attributes:
4664 <DD>Each <VAR>name</VAR> is an indexed array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
4668 <DD>Each <VAR>name</VAR> is an associative array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
4672 <DD>Use function names only.
4676 <DD>The variable is to be treated as
4677 an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>) is
4678 performed when the variable is assigned a value.
4682 <DD>When the variable is assigned a value, all upper-case characters are
4683 converted to lower-case.
4684 The upper-case attribute is disabled.
4688 <DD>Make <VAR>name</VAR>s readonly. These names cannot then be assigned values
4689 by subsequent assignment statements or unset.
4693 <DD>Give each <VAR>name</VAR> the <CODE>trace</CODE> attribute.
4694 Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from
4696 The trace attribute has no special meaning for variables.
4700 <DD>When the variable is assigned a value, all lower-case characters are
4701 converted to upper-case.
4702 The lower-case attribute is disabled.
4706 <DD>Mark each <VAR>name</VAR> for export to subsequent commands via
4711 Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead,
4712 with the exceptions that <SAMP>`+a'</SAMP>
4713 may not be used to destroy an array variable and <SAMP>`+r'</SAMP> will not
4714 remove the readonly attribute.
4715 When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local,
4716 as with the <CODE>local</CODE> command, unless the <SAMP>`-g'</SAMP> option is used.
4717 If a variable name is followed by =<VAR>value</VAR>, the value of the variable
4718 is set to <VAR>value</VAR>.
4721 The return status is zero unless an invalid option is encountered,
4722 an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>,
4723 an attempt is made to assign a value to a readonly variable,
4724 an attempt is made to assign a value to an array variable without
4725 using the compound assignment syntax (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>),
4726 one of the <VAR>names</VAR> is not a valid shell variable name,
4727 an attempt is made to turn off readonly status for a readonly variable,
4728 an attempt is made to turn off array status for an array variable,
4729 or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>.
4732 <DT><CODE>echo</CODE>
4733 <DD><A NAME="IDX95"></A>
4734 <TABLE><tr><td> </td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>]
4735 </pre></td></tr></table>Output the <VAR>arg</VAR>s, separated by spaces, terminated with a
4737 The return status is always 0.
4738 If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed.
4739 If the <SAMP>`-e'</SAMP> option is given, interpretation of the following
4740 backslash-escaped characters is enabled.
4741 The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters,
4742 even on systems where they are interpreted by default.
4743 The <CODE>xpg_echo</CODE> shell option may be used to
4744 dynamically determine whether or not <CODE>echo</CODE> expands these
4745 escape characters by default.
4746 <CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options.
4749 <CODE>echo</CODE> interprets the following escape sequences:
4756 <DD>suppress further output
4758 <DD><DT><CODE>\E</CODE>
4772 <DT><CODE>\0<VAR>nnn</VAR></CODE>
4773 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
4774 (zero to three octal digits)
4775 <DT><CODE>\x<VAR>HH</VAR></CODE>
4776 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
4777 (one or two hex digits)
4778 <DT><CODE>\u<VAR>HHHH</VAR></CODE>
4779 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
4780 <VAR>HHHH</VAR> (one to four hex digits)
4781 <DT><CODE>\U<VAR>HHHHHHHH</VAR></CODE>
4782 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
4783 <VAR>HHHHHHHH</VAR> (one to eight hex digits)
4787 <DT><CODE>enable</CODE>
4788 <DD><A NAME="IDX96"></A>
4789 <TABLE><tr><td> </td><td class=example><pre>enable [-a] [-dnps] [-f <VAR>filename</VAR>] [<VAR>name</VAR> <small>...</small>]
4790 </pre></td></tr></table>Enable and disable builtin shell commands.
4791 Disabling a builtin allows a disk command which has the same name
4792 as a shell builtin to be executed without specifying a full pathname,
4793 even though the shell normally searches for builtins before disk commands.
4794 If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled. Otherwise
4795 <VAR>name</VAR>s are enabled. For example, to use the <CODE>test</CODE> binary
4796 found via <CODE>$PATH</CODE> instead of the shell builtin version, type
4797 <SAMP>`enable -n test'</SAMP>.
4800 If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear,
4801 a list of shell builtins is printed. With no other arguments, the list
4802 consists of all enabled shell builtins.
4803 The <SAMP>`-a'</SAMP> option means to list
4804 each builtin with an indication of whether or not it is enabled.
4807 The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR>
4808 from shared object <VAR>filename</VAR>, on systems that support dynamic loading.
4809 The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>.
4812 If there are no options, a list of the shell builtins is displayed.
4813 The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special
4814 builtins. If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes
4815 a special builtin (see section <A HREF="bashref.html#SEC65">4.4 Special Builtins</A>).
4818 The return status is zero unless a <VAR>name</VAR> is not a shell builtin
4819 or there is an error loading a new builtin from a shared object.
4822 <DT><CODE>help</CODE>
4823 <DD><A NAME="IDX97"></A>
4824 <TABLE><tr><td> </td><td class=example><pre>help [-dms] [<VAR>pattern</VAR>]
4825 </pre></td></tr></table>Display helpful information about builtin commands.
4826 If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help
4827 on all commands matching <VAR>pattern</VAR>, otherwise a list of
4828 the builtins is printed.
4831 Options, if supplied, have the following meanings:
4836 <DD>Display a short description of each <VAR>pattern</VAR>
4838 <DD>Display the description of each <VAR>pattern</VAR> in a manpage-like format
4840 <DD>Display only a short usage synopsis for each <VAR>pattern</VAR>
4844 The return status is zero unless no command matches <VAR>pattern</VAR>.
4847 <DT><CODE>let</CODE>
4848 <DD><A NAME="IDX98"></A>
4849 <TABLE><tr><td> </td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR>]
4850 </pre></td></tr></table>The <CODE>let</CODE> builtin allows arithmetic to be performed on shell
4851 variables. Each <VAR>expression</VAR> is evaluated according to the
4852 rules given below in <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>. If the
4853 last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1;
4854 otherwise 0 is returned.
4857 <DT><CODE>local</CODE>
4858 <DD><A NAME="IDX99"></A>
4859 <TABLE><tr><td> </td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>
4860 </pre></td></tr></table>For each argument, a local variable named <VAR>name</VAR> is created,
4861 and assigned <VAR>value</VAR>.
4862 The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>.
4863 <CODE>local</CODE> can only be used within a function; it makes the variable
4864 <VAR>name</VAR> have a visible scope restricted to that function and its
4865 children. The return status is zero unless <CODE>local</CODE> is used outside
4866 a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a
4870 <DT><CODE>logout</CODE>
4871 <DD><A NAME="IDX100"></A>
4872 <TABLE><tr><td> </td><td class=example><pre>logout [<VAR>n</VAR>]
4873 </pre></td></tr></table>Exit a login shell, returning a status of <VAR>n</VAR> to the shell's
4877 <DT><CODE>mapfile</CODE>
4878 <DD><A NAME="IDX101"></A>
4879 <TABLE><tr><td> </td><td class=example><pre>mapfile [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [
4880 -C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
4881 </pre></td></tr></table>Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
4882 or from file descriptor <VAR>fd</VAR>
4883 if the <SAMP>`-u'</SAMP> option is supplied.
4884 The variable <CODE>MAPFILE</CODE> is the default <VAR>array</VAR>.
4885 Options, if supplied, have the following meanings:
4889 <DD>Copy at most <VAR>count</VAR> lines. If <VAR>count</VAR> is 0, all lines are copied.
4891 <DD>Begin assigning to <VAR>array</VAR> at index <VAR>origin</VAR>.
4892 The default index is 0.
4894 <DD>Discard the first <VAR>count</VAR> lines read.
4896 <DD>Remove a trailing newline from each line read.
4898 <DD>Read lines from file descriptor <VAR>fd</VAR> instead of the standard input.
4900 <DD>Evaluate <VAR>callback</VAR> each time <VAR>quantum</VAR>P lines are read.
4901 The <SAMP>`-c'</SAMP> option specifies <VAR>quantum</VAR>.
4903 <DD>Specify the number of lines read between each call to <VAR>callback</VAR>.
4907 If <SAMP>`-C'</SAMP> is specified without <SAMP>`-c'</SAMP>,
4908 the default quantum is 5000.
4909 When <VAR>callback</VAR> is evaluated, it is supplied the index of the next
4910 array element to be assigned and the line to be assigned to that element
4911 as additional arguments.
4912 <VAR>callback</VAR> is evaluated after the line is read but before the
4913 array element is assigned.
4916 If not supplied with an explicit origin, <CODE>mapfile</CODE> will clear <VAR>array</VAR>
4917 before assigning to it.
4920 <CODE>mapfile</CODE> returns successfully unless an invalid option or option
4921 argument is supplied, <VAR>array</VAR> is invalid or unassignable, or <VAR>array</VAR>
4922 is not an indexed array.
4925 <DT><CODE>printf</CODE>
4926 <DD><A NAME="IDX102"></A>
4927 <TABLE><tr><td> </td><td class=example><pre>printf [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>]
4928 </pre></td></tr></table>Write the formatted <VAR>arguments</VAR> to the standard output under the
4929 control of the <VAR>format</VAR>.
4930 The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable
4931 <VAR>var</VAR> rather than being printed to the standard output.
4934 The <VAR>format</VAR> is a character string which contains three types of objects:
4935 plain characters, which are simply copied to standard output, character
4936 escape sequences, which are converted and copied to the standard output, and
4937 format specifications, each of which causes printing of the next successive
4938 <VAR>argument</VAR>.
4939 In addition to the standard <CODE>printf(1)</CODE> formats, <CODE>printf</CODE>
4940 interprets the following extensions:
4945 <DD>causes <CODE>printf</CODE> to expand backslash escape sequences in the
4946 corresponding <VAR>argument</VAR>,
4947 (except that <SAMP>`\c'</SAMP> terminates output, backslashes in
4948 <SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes
4949 beginning with <SAMP>`\0'</SAMP> may contain up to four digits).
4951 <DD>causes <CODE>printf</CODE> to output the
4952 corresponding <VAR>argument</VAR> in a format that can be reused as shell input.
4953 <DT><CODE>%(<VAR>datefmt</VAR>)T</CODE>
4954 <DD>causes <CODE>printf</CODE> to output the date-time string resulting from using
4955 <VAR>datefmt</VAR> as a format string for <CODE>strftime</CODE>(3). The corresponding
4956 <VAR>argument</VAR> is an integer representing the number of seconds since the
4957 epoch. Two special argument values may be used: -1 represents the current
4958 time, and -2 represents the time the shell was invoked.
4962 Arguments to non-string format specifiers are treated as C language constants,
4963 except that a leading plus or minus sign is allowed, and if the leading
4964 character is a single or double quote, the value is the ASCII value of
4965 the following character.
4968 The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>.
4969 If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the
4970 extra format specifications behave as if a zero value or null string, as
4971 appropriate, had been supplied. The return value is zero on success,
4972 non-zero on failure.
4975 <DT><CODE>read</CODE>
4976 <DD><A NAME="IDX103"></A>
4977 <TABLE><tr><td> </td><td class=example><pre>read [-ers] [-a <VAR>aname</VAR>] [-d <VAR>delim</VAR>] [-i <VAR>text</VAR>] [-n <VAR>nchars</VAR>] [-N <VAR>nchars</VAR>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>]
4978 </pre></td></tr></table>One line is read from the standard input, or from the file descriptor
4979 <VAR>fd</VAR> supplied as an argument to the <SAMP>`-u'</SAMP> option, and the first word
4980 is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>,
4981 and so on, with leftover words and their intervening separators assigned
4982 to the last <VAR>name</VAR>.
4983 If there are fewer words read from the input stream than names,
4984 the remaining names are assigned empty values.
4985 The characters in the value of the <CODE>IFS</CODE> variable
4986 are used to split the line into words.
4987 The backslash character <SAMP>`\'</SAMP> may be used to remove any special
4988 meaning for the next character read and for line continuation.
4989 If no names are supplied, the line read is assigned to the
4990 variable <CODE>REPLY</CODE>.
4991 The return code is zero, unless end-of-file is encountered, <CODE>read</CODE>
4992 times out (in which case the return code is greater than 128), or an
4993 invalid file descriptor is supplied as the argument to <SAMP>`-u'</SAMP>.
4996 Options, if supplied, have the following meanings:
5000 <DT><CODE>-a <VAR>aname</VAR></CODE>
5001 <DD>The words are assigned to sequential indices of the array variable
5002 <VAR>aname</VAR>, starting at 0.
5003 All elements are removed from <VAR>aname</VAR> before the assignment.
5004 Other <VAR>name</VAR> arguments are ignored.
5007 <DT><CODE>-d <VAR>delim</VAR></CODE>
5008 <DD>The first character of <VAR>delim</VAR> is used to terminate the input line,
5009 rather than newline.
5013 <DD>Readline (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>) is used to obtain the line.
5014 Readline uses the current (or default, if line editing was not previously
5015 active) editing settings.
5018 <DT><CODE>-i <VAR>text</VAR></CODE>
5019 <DD>If Readline is being used to read the line, <VAR>text</VAR> is placed into
5020 the editing buffer before editing begins.
5023 <DT><CODE>-n <VAR>nchars</VAR></CODE>
5024 <DD><CODE>read</CODE> returns after reading <VAR>nchars</VAR> characters rather than
5025 waiting for a complete line of input, but honor a delimiter if fewer
5026 than <VAR>nchars</VAR> characters are read before the delimiter.
5029 <DT><CODE>-N <VAR>nchars</VAR></CODE>
5030 <DD><CODE>read</CODE> returns after reading exactly <VAR>nchars</VAR> characters rather
5031 than waiting for a complete line of input, unless EOF is encountered or
5032 <CODE>read</CODE> times out.
5033 Delimiter characters encountered in the input are
5034 not treated specially and do not cause <CODE>read</CODE> to return until
5035 <VAR>nchars</VAR> characters are read.
5038 <DT><CODE>-p <VAR>prompt</VAR></CODE>
5039 <DD>Display <VAR>prompt</VAR>, without a trailing newline, before attempting
5041 The prompt is displayed only if input is coming from a terminal.
5045 <DD>If this option is given, backslash does not act as an escape character.
5046 The backslash is considered to be part of the line.
5047 In particular, a backslash-newline pair may not be used as a line
5052 <DD>Silent mode. If input is coming from a terminal, characters are
5056 <DT><CODE>-t <VAR>timeout</VAR></CODE>
5057 <DD>Cause <CODE>read</CODE> to time out and return failure if a complete line of
5058 input is not read within <VAR>timeout</VAR> seconds.
5059 <VAR>timeout</VAR> may be a decimal number with a fractional portion following
5061 This option is only effective if <CODE>read</CODE> is reading input from a
5062 terminal, pipe, or other special file; it has no effect when reading
5064 If <VAR>timeout</VAR> is 0, <CODE>read</CODE> returns success if input is available on
5065 the specified file descriptor, failure otherwise.
5066 The exit status is greater than 128 if the timeout is exceeded.
5069 <DT><CODE>-u <VAR>fd</VAR></CODE>
5070 <DD>Read input from file descriptor <VAR>fd</VAR>.
5076 <DT><CODE>readarray</CODE>
5077 <DD><A NAME="IDX104"></A>
5078 <TABLE><tr><td> </td><td class=example><pre>readarray [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [
5079 -C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
5080 </pre></td></tr></table>Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
5081 or from file descriptor <VAR>fd</VAR>
5082 if the <SAMP>`-u'</SAMP> option is supplied.
5085 A synonym for <CODE>mapfile</CODE>.
5088 <DT><CODE>source</CODE>
5089 <DD><A NAME="IDX105"></A>
5090 <TABLE><tr><td> </td><td class=example><pre>source <VAR>filename</VAR>
5091 </pre></td></tr></table>A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
5094 <DT><CODE>type</CODE>
5095 <DD><A NAME="IDX106"></A>
5096 <TABLE><tr><td> </td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>]
5097 </pre></td></tr></table>For each <VAR>name</VAR>, indicate how it would be interpreted if used as a
5101 If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word
5102 which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>,
5103 <SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>,
5104 if <VAR>name</VAR> is an alias, shell function, shell builtin,
5105 disk file, or shell reserved word, respectively.
5106 If the <VAR>name</VAR> is not found, then nothing is printed, and
5107 <CODE>type</CODE> returns a failure status.
5110 If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name
5111 of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP>
5112 would not return <SAMP>`file'</SAMP>.
5115 The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if
5116 <SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>.
5119 If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value,
5120 not necessarily the file that appears first in <CODE>$PATH</CODE>.
5123 If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places
5124 that contain an executable named <VAR>file</VAR>.
5125 This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option
5129 If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find
5130 shell functions, as with the <CODE>command</CODE> builtin.
5133 The return status is zero if all of the <VAR>names</VAR> are found, non-zero
5134 if any are not found.
5137 <DT><CODE>typeset</CODE>
5138 <DD><A NAME="IDX107"></A>
5139 <TABLE><tr><td> </td><td class=example><pre>typeset [-afFrxi] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
5140 </pre></td></tr></table>The <CODE>typeset</CODE> command is supplied for compatibility with the Korn
5141 shell; however, it has been deprecated in favor of the <CODE>declare</CODE>
5145 <DT><CODE>ulimit</CODE>
5146 <DD><A NAME="IDX108"></A>
5147 <TABLE><tr><td> </td><td class=example><pre>ulimit [-abcdefilmnpqrstuvxHST] [<VAR>limit</VAR>]
5148 </pre></td></tr></table><CODE>ulimit</CODE> provides control over the resources available to processes
5149 started by the shell, on systems that allow such control. If an
5150 option is given, it is interpreted as follows:
5153 <DD>Change and report the soft limit associated with a resource.
5157 <DD>Change and report the hard limit associated with a resource.
5161 <DD>All current limits are reported.
5165 <DD>The maximum socket buffer size.
5169 <DD>The maximum size of core files created.
5173 <DD>The maximum size of a process's data segment.
5177 <DD>The maximum scheduling priority ("nice").
5181 <DD>The maximum size of files written by the shell and its children.
5185 <DD>The maximum number of pending signals.
5189 <DD>The maximum size that may be locked into memory.
5193 <DD>The maximum resident set size (many systems do not honor this limit).
5197 <DD>The maximum number of open file descriptors (most systems do not
5198 allow this value to be set).
5202 <DD>The pipe buffer size.
5206 <DD>The maximum number of bytes in POSIX message queues.
5210 <DD>The maximum real-time scheduling priority.
5214 <DD>The maximum stack size.
5218 <DD>The maximum amount of cpu time in seconds.
5222 <DD>The maximum number of processes available to a single user.
5226 <DD>The maximum amount of virtual memory available to the shell, and, on
5227 some systems, to its children.
5231 <DD>The maximum number of file locks.
5235 <DD>The maximum number of threads.
5241 If <VAR>limit</VAR> is given, it is the new value of the specified resource;
5242 the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and
5243 <CODE>unlimited</CODE> stand for the current hard limit, the current soft limit,
5244 and no limit, respectively.
5245 A hard limit cannot be increased by a non-root user once it is set;
5246 a soft limit may be increased up to the value of the hard limit.
5247 Otherwise, the current value of the soft limit for the specified resource
5248 is printed, unless the <SAMP>`-H'</SAMP> option is supplied.
5249 When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied,
5250 both the hard and soft limits are set.
5251 If no option is given, then <SAMP>`-f'</SAMP> is assumed. Values are in 1024-byte
5252 increments, except for <SAMP>`-t'</SAMP>, which is in seconds, <SAMP>`-p'</SAMP>,
5253 which is in units of 512-byte blocks, and <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which
5254 are unscaled values.
5257 The return status is zero unless an invalid option or argument is supplied,
5258 or an error occurs while setting a new limit.
5261 <DT><CODE>unalias</CODE>
5262 <DD><A NAME="IDX109"></A>
5263 <TABLE><tr><td> </td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ]
5264 </pre></td></tr></table><P>
5266 Remove each <VAR>name</VAR> from the list of aliases. If <SAMP>`-a'</SAMP> is
5267 supplied, all aliases are removed.
5268 Aliases are described in <A HREF="bashref.html#SEC85">6.6 Aliases</A>.
5274 <A NAME="Modifying Shell Behavior"></A>
5276 <A NAME="SEC62"></A>
5277 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5278 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> < </A>]</TD>
5279 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> > </A>]</TD>
5280 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD>
5281 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
5282 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD>
5283 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5284 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5285 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
5286 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5288 <H2> 4.3 Modifying Shell Behavior </H2>
5289 <!--docid::SEC62::-->
5291 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
5292 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Change the values of shell attributes and
5293 positional parameters.</TD></TR>
5294 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modify shell optional behavior.</TD></TR>
5295 </TABLE></BLOCKQUOTE>
5298 <A NAME="The Set Builtin"></A>
5300 <A NAME="SEC63"></A>
5301 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5302 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> < </A>]</TD>
5303 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> > </A>]</TD>
5304 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD>
5305 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> Up </A>]</TD>
5306 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD>
5307 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5308 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5309 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
5310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5312 <H3> 4.3.1 The Set Builtin </H3>
5313 <!--docid::SEC63::-->
5316 This builtin is so complicated that it deserves its own section. <CODE>set</CODE>
5317 allows you to change the values of shell options and set the positional
5318 parameters, or to display the names and values of shell variables.
5322 <DT><CODE>set</CODE>
5323 <DD><A NAME="IDX110"></A>
5324 <TABLE><tr><td> </td><td class=example><pre>set [--abefhkmnptuvxBCEHPT] [-o <VAR>option-name</VAR>] [<VAR>argument</VAR> <small>...</small>]
5325 set [+abefhkmnptuvxBCEHPT] [+o <VAR>option-name</VAR>] [<VAR>argument</VAR> <small>...</small>]
5326 </pre></td></tr></table><P>
5328 If no options or arguments are supplied, <CODE>set</CODE> displays the names
5329 and values of all shell variables and functions, sorted according to the
5330 current locale, in a format that may be reused as input
5331 for setting or resetting the currently-set variables.
5332 Read-only variables cannot be reset.
5333 In POSIX mode, only shell variables are listed.
5336 When options are supplied, they set or unset shell attributes.
5337 Options, if specified, have the following meanings:
5342 <DD>Mark variables and function which are modified or created for export
5343 to the environment of subsequent commands.
5347 <DD>Cause the status of terminated background jobs to be reported
5348 immediately, rather than before printing the next primary prompt.
5352 <DD>Exit immediately if a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>), which may consist
5353 of a single simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>),
5354 a subshell command enclosed in parentheses (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>),
5355 or one of the commands executed as part of a command list enclosed
5356 by braces (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>)
5357 returns a non-zero status.
5358 The shell does not exit if the command that fails is part of the
5359 command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> keyword,
5360 part of the test in an <CODE>if</CODE> statement,
5361 part of any command executed in a <CODE>&&</CODE> or <CODE>||</CODE> list except
5362 the command following the final <CODE>&&</CODE> or <CODE>||</CODE>,
5363 any command in a pipeline but the last,
5364 or if the command's return status is being inverted with <CODE>!</CODE>.
5365 A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits.
5368 This option applies to the shell environment and each subshell environment
5369 separately (see section <A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>), and may cause
5370 subshells to exit before executing all the commands in the subshell.
5374 <DD>Disable filename expansion (globbing).
5378 <DD>Locate and remember (hash) commands as they are looked up for execution.
5379 This option is enabled by default.
5383 <DD>All arguments in the form of assignment statements are placed
5384 in the environment for a command, not just those that precede
5389 <DD>Job control is enabled (see section <A HREF="bashref.html#SEC92">7. Job Control</A>).
5393 <DD>Read commands but do not execute them; this may be used to check a
5394 script for syntax errors.
5395 This option is ignored by interactive shells.
5398 <DT><CODE>-o <VAR>option-name</VAR></CODE>
5401 Set the option corresponding to <VAR>option-name</VAR>:
5405 <DT><CODE>allexport</CODE>
5406 <DD>Same as <CODE>-a</CODE>.
5409 <DT><CODE>braceexpand</CODE>
5410 <DD>Same as <CODE>-B</CODE>.
5413 <DT><CODE>emacs</CODE>
5414 <DD>Use an <CODE>emacs</CODE>-style line editing interface (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>).
5415 This also affects the editing interface used for <CODE>read -e</CODE>.
5418 <DT><CODE>errexit</CODE>
5419 <DD>Same as <CODE>-e</CODE>.
5422 <DT><CODE>errtrace</CODE>
5423 <DD>Same as <CODE>-E</CODE>.
5426 <DT><CODE>functrace</CODE>
5427 <DD>Same as <CODE>-T</CODE>.
5430 <DT><CODE>hashall</CODE>
5431 <DD>Same as <CODE>-h</CODE>.
5434 <DT><CODE>histexpand</CODE>
5435 <DD>Same as <CODE>-H</CODE>.
5438 <DT><CODE>history</CODE>
5439 <DD>Enable command history, as described in <A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>.
5440 This option is on by default in interactive shells.
5443 <DT><CODE>ignoreeof</CODE>
5444 <DD>An interactive shell will not exit upon reading EOF.
5447 <DT><CODE>keyword</CODE>
5448 <DD>Same as <CODE>-k</CODE>.
5451 <DT><CODE>monitor</CODE>
5452 <DD>Same as <CODE>-m</CODE>.
5455 <DT><CODE>noclobber</CODE>
5456 <DD>Same as <CODE>-C</CODE>.
5459 <DT><CODE>noexec</CODE>
5460 <DD>Same as <CODE>-n</CODE>.
5463 <DT><CODE>noglob</CODE>
5464 <DD>Same as <CODE>-f</CODE>.
5467 <DT><CODE>nolog</CODE>
5468 <DD>Currently ignored.
5471 <DT><CODE>notify</CODE>
5472 <DD>Same as <CODE>-b</CODE>.
5475 <DT><CODE>nounset</CODE>
5476 <DD>Same as <CODE>-u</CODE>.
5479 <DT><CODE>onecmd</CODE>
5480 <DD>Same as <CODE>-t</CODE>.
5483 <DT><CODE>physical</CODE>
5484 <DD>Same as <CODE>-P</CODE>.
5487 <DT><CODE>pipefail</CODE>
5488 <DD>If set, the return value of a pipeline is the value of the last
5489 (rightmost) command to exit with a non-zero status, or zero if all
5490 commands in the pipeline exit successfully.
5491 This option is disabled by default.
5494 <DT><CODE>posix</CODE>
5495 <DD>Change the behavior of Bash where the default operation differs
5496 from the POSIX standard to match the standard
5497 (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
5498 This is intended to make Bash behave as a strict superset of that
5502 <DT><CODE>privileged</CODE>
5503 <DD>Same as <CODE>-p</CODE>.
5506 <DT><CODE>verbose</CODE>
5507 <DD>Same as <CODE>-v</CODE>.
5511 <DD>Use a <CODE>vi</CODE>-style line editing interface.
5512 This also affects the editing interface used for <CODE>read -e</CODE>.
5515 <DT><CODE>xtrace</CODE>
5516 <DD>Same as <CODE>-x</CODE>.
5521 <DD>Turn on privileged mode.
5522 In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not
5523 processed, shell functions are not inherited from the environment,
5524 and the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE> and <CODE>GLOBIGNORE</CODE>
5525 variables, if they appear in the environment, are ignored.
5526 If the shell is started with the effective user (group) id not equal to the
5527 real user (group) id, and the <CODE>-p</CODE> option is not supplied, these actions
5528 are taken and the effective user id is set to the real user id.
5529 If the <CODE>-p</CODE> option is supplied at startup, the effective user id is
5531 Turning this option off causes the effective user
5532 and group ids to be set to the real user and group ids.
5536 <DD>Exit after reading and executing one command.
5540 <DD>Treat unset variables and parameters other than the special parameters
5541 <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP> as an error when performing parameter expansion.
5542 An error message will be written to the standard error, and a non-interactive
5547 <DD>Print shell input lines as they are read.
5551 <DD>Print a trace of simple commands, <CODE>for</CODE> commands, <CODE>case</CODE>
5552 commands, <CODE>select</CODE> commands, and arithmetic <CODE>for</CODE> commands
5553 and their arguments or associated word lists after they are
5554 expanded and before they are executed. The value of the <CODE>PS4</CODE>
5555 variable is expanded and the resultant value is printed before
5556 the command and its expanded arguments.
5560 <DD>The shell will perform brace expansion (see section <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>).
5561 This option is on by default.
5565 <DD>Prevent output redirection using <SAMP>`>'</SAMP>, <SAMP>`>&'</SAMP>, and <SAMP>`<>'</SAMP>
5566 from overwriting existing files.
5570 <DD>If set, any trap on <CODE>ERR</CODE> is inherited by shell functions, command
5571 substitutions, and commands executed in a subshell environment.
5572 The <CODE>ERR</CODE> trap is normally not inherited in such cases.
5576 <DD>Enable <SAMP>`!'</SAMP> style history substitution (see section <A HREF="bashref.html#SEC123">9.3 History Expansion</A>).
5577 This option is on by default for interactive shells.
5581 <DD>If set, do not follow symbolic links when performing commands such as
5582 <CODE>cd</CODE> which change the current directory. The physical directory
5583 is used instead. By default, Bash follows
5584 the logical chain of directories when performing commands
5585 which change the current directory.
5588 For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT>
5590 <TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD
5594 </pre></td></tr></table></P><P>
5596 If <CODE>set -P</CODE> is on, then:
5597 <TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD
5601 </pre></td></tr></table></P><P>
5604 <DD>If set, any trap on <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> are inherited by
5605 shell functions, command substitutions, and commands executed
5606 in a subshell environment.
5607 The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited
5612 <DD>If no arguments follow this option, then the positional parameters are
5613 unset. Otherwise, the positional parameters are set to the
5614 <VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>.
5618 <DD>Signal the end of options, cause all remaining <VAR>arguments</VAR>
5619 to be assigned to the positional parameters. The <SAMP>`-x'</SAMP>
5620 and <SAMP>`-v'</SAMP> options are turned off.
5621 If there are no arguments, the positional parameters remain unchanged.
5625 Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be
5626 turned off. The options can also be used upon invocation of the
5627 shell. The current set of options may be found in <CODE>$-</CODE>.
5630 The remaining N <VAR>arguments</VAR> are positional parameters and are
5631 assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small> <CODE>$N</CODE>.
5632 The special parameter <CODE>#</CODE> is set to N.
5635 The return status is always zero unless an invalid option is supplied.
5639 <A NAME="The Shopt Builtin"></A>
5641 <A NAME="SEC64"></A>
5642 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5643 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> < </A>]</TD>
5644 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> > </A>]</TD>
5645 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD>
5646 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> Up </A>]</TD>
5647 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD>
5648 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5649 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5650 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
5651 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5653 <H3> 4.3.2 The Shopt Builtin </H3>
5654 <!--docid::SEC64::-->
5657 This builtin allows you to change additional shell optional behavior.
5662 <DT><CODE>shopt</CODE>
5663 <DD><A NAME="IDX111"></A>
5664 <TABLE><tr><td> </td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>]
5665 </pre></td></tr></table>Toggle the values of variables controlling optional shell behavior.
5666 With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable
5667 options is displayed, with an indication of whether or not each is set.
5668 The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that
5669 may be reused as input.
5670 Other options have the following meanings:
5675 <DD>Enable (set) each <VAR>optname</VAR>.
5679 <DD>Disable (unset) each <VAR>optname</VAR>.
5683 <DD>Suppresses normal output; the return status
5684 indicates whether the <VAR>optname</VAR> is set or unset.
5685 If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>,
5686 the return status is zero if all <VAR>optnames</VAR> are enabled;
5691 <DD>Restricts the values of
5692 <VAR>optname</VAR> to be those defined for the <SAMP>`-o'</SAMP> option to the
5693 <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
5697 If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP>
5698 is used with no <VAR>optname</VAR> arguments, the display is limited to
5699 those options which are set or unset, respectively.
5702 Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off)
5706 The return status when listing options is zero if all <VAR>optnames</VAR>
5707 are enabled, non-zero otherwise. When setting or unsetting options,
5708 the return status is zero unless an <VAR>optname</VAR> is not a valid shell
5712 The list of <CODE>shopt</CODE> options is:
5715 <DT><CODE>autocd</CODE>
5716 <DD>If set, a command name that is the name of a directory is executed as if
5717 it were the argument to the <CODE>cd</CODE> command.
5718 This option is only used by interactive shells.
5721 <DT><CODE>cdable_vars</CODE>
5722 <DD>If this is set, an argument to the <CODE>cd</CODE> builtin command that
5723 is not a directory is assumed to be the name of a variable whose
5724 value is the directory to change to.
5727 <DT><CODE>cdspell</CODE>
5728 <DD>If set, minor errors in the spelling of a directory component in a
5729 <CODE>cd</CODE> command will be corrected.
5730 The errors checked for are transposed characters,
5731 a missing character, and a character too many.
5732 If a correction is found, the corrected path is printed,
5733 and the command proceeds.
5734 This option is only used by interactive shells.
5737 <DT><CODE>checkhash</CODE>
5738 <DD>If this is set, Bash checks that a command found in the hash
5739 table exists before trying to execute it. If a hashed command no
5740 longer exists, a normal path search is performed.
5743 <DT><CODE>checkjobs</CODE>
5744 <DD>If set, Bash lists the status of any stopped and running jobs before
5745 exiting an interactive shell. If any jobs are running, this causes
5746 the exit to be deferred until a second exit is attempted without an
5747 intervening command (see section <A HREF="bashref.html#SEC92">7. Job Control</A>).
5748 The shell always postpones exiting if any jobs are stopped.
5751 <DT><CODE>checkwinsize</CODE>
5752 <DD>If set, Bash checks the window size after each command
5753 and, if necessary, updates the values of
5754 <CODE>LINES</CODE> and <CODE>COLUMNS</CODE>.
5757 <DT><CODE>cmdhist</CODE>
5759 attempts to save all lines of a multiple-line
5760 command in the same history entry. This allows
5761 easy re-editing of multi-line commands.
5764 <DT><CODE>compat31</CODE>
5766 changes its behavior to that of version 3.1 with respect to quoted
5767 arguments to the conditional command's <SAMP>`=~'</SAMP> operator.
5770 <DT><CODE>compat32</CODE>
5772 changes its behavior to that of version 3.2 with respect to locale-specific
5773 string comparison when using the <SAMP>`[['</SAMP>
5774 conditional command's <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators.
5775 Bash versions prior to bash-4.0 use ASCII collation and strcmp(3);
5776 bash-4.1 and later use the current locale's collation sequence and strcoll(3).
5779 <DT><CODE>compat40</CODE>
5781 changes its behavior to that of version 4.0 with respect to locale-specific
5782 string comparison when using the <SAMP>`[['</SAMP>
5783 conditional command's <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators (see previous item)
5784 and the effect of interrupting a command list.
5787 <DT><CODE>compat41</CODE>
5788 <DD>If set, Bash, when in posix mode, treats a single quote in a double-quoted
5789 parameter expansion as a special character. The single quotes must match
5790 (an even number) and the characters between the single quotes are considered
5791 quoted. This is the behavior of POSIX mode through version 4.1.
5792 The default Bash behavior remains as in previous versions.
5795 <DT><CODE>dirspell</CODE>
5797 attempts spelling correction on directory names during word completion
5798 if the directory name initially supplied does not exist.
5801 <DT><CODE>dotglob</CODE>
5802 <DD>If set, Bash includes filenames beginning with a `.' in
5803 the results of filename expansion.
5806 <DT><CODE>execfail</CODE>
5807 <DD>If this is set, a non-interactive shell will not exit if
5808 it cannot execute the file specified as an argument to the <CODE>exec</CODE>
5809 builtin command. An interactive shell does not exit if <CODE>exec</CODE>
5813 <DT><CODE>expand_aliases</CODE>
5814 <DD>If set, aliases are expanded as described below under Aliases,
5815 <A HREF="bashref.html#SEC85">6.6 Aliases</A>.
5816 This option is enabled by default for interactive shells.
5819 <DT><CODE>extdebug</CODE>
5820 <DD>If set, behavior intended for use by debuggers is enabled:
5825 The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>)
5826 displays the source file name and line number corresponding to each function
5827 name supplied as an argument.
5831 If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the
5832 next command is skipped and not executed.
5836 If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the
5837 shell is executing in a subroutine (a shell function or a shell script
5838 executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to
5839 <CODE>return</CODE> is simulated.
5843 <CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their
5844 descriptions (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
5848 Function tracing is enabled: command substitution, shell functions, and
5849 subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5850 <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps.
5854 Error tracing is enabled: command substitution, shell functions, and
5855 subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5856 <CODE>ERR</CODE> trap.
5860 <DT><CODE>extglob</CODE>
5861 <DD>If set, the extended pattern matching features described above
5862 (see section <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>) are enabled.
5865 <DT><CODE>extquote</CODE>
5866 <DD>If set, <CODE>$'<VAR>string</VAR>'</CODE> and <CODE>$"<VAR>string</VAR>"</CODE> quoting is
5867 performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions
5868 enclosed in double quotes. This option is enabled by default.
5871 <DT><CODE>failglob</CODE>
5872 <DD>If set, patterns which fail to match filenames during filename expansion
5873 result in an expansion error.
5876 <DT><CODE>force_fignore</CODE>
5877 <DD>If set, the suffixes specified by the <CODE>FIGNORE</CODE> shell variable
5878 cause words to be ignored when performing word completion even if
5879 the ignored words are the only possible completions.
5880 See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
5881 This option is enabled by default.
5884 <DT><CODE>globstar</CODE>
5885 <DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename expansion context will
5886 match a files and zero or more directories and subdirectories.
5887 If the pattern is followed by a <SAMP>`/'</SAMP>, only directories and
5888 subdirectories match.
5891 <DT><CODE>gnu_errfmt</CODE>
5892 <DD>If set, shell error messages are written in the standard GNU error
5896 <DT><CODE>histappend</CODE>
5897 <DD>If set, the history list is appended to the file named by the value
5898 of the <CODE>HISTFILE</CODE>
5899 variable when the shell exits, rather than overwriting the file.
5902 <DT><CODE>histreedit</CODE>
5903 <DD>If set, and Readline
5904 is being used, a user is given the opportunity to re-edit a
5905 failed history substitution.
5908 <DT><CODE>histverify</CODE>
5909 <DD>If set, and Readline
5910 is being used, the results of history substitution are not immediately
5911 passed to the shell parser. Instead, the resulting line is loaded into
5912 the Readline editing buffer, allowing further modification.
5915 <DT><CODE>hostcomplete</CODE>
5916 <DD>If set, and Readline is being used, Bash will attempt to perform
5917 hostname completion when a word containing a <SAMP>`@'</SAMP> is being
5918 completed (see section <A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A>). This option is enabled
5922 <DT><CODE>huponexit</CODE>
5923 <DD>If set, Bash will send <CODE>SIGHUP</CODE> to all jobs when an interactive
5924 login shell exits (see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
5927 <DT><CODE>interactive_comments</CODE>
5928 <DD>Allow a word beginning with <SAMP>`#'</SAMP>
5929 to cause that word and all remaining characters on that
5930 line to be ignored in an interactive shell.
5931 This option is enabled by default.
5934 <DT><CODE>lastpipe</CODE>
5935 <DD>If set, and job control is not active, the shell runs the last command of
5936 a pipeline not executed in the background in the current shell environment.
5939 <DT><CODE>lithist</CODE>
5940 <DD>If enabled, and the <CODE>cmdhist</CODE>
5941 option is enabled, multi-line commands are saved to the history with
5942 embedded newlines rather than using semicolon separators where possible.
5945 <DT><CODE>login_shell</CODE>
5946 <DD>The shell sets this option if it is started as a login shell
5947 (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>).
5948 The value may not be changed.
5951 <DT><CODE>mailwarn</CODE>
5952 <DD>If set, and a file that Bash is checking for mail has been
5953 accessed since the last time it was checked, the message
5954 <CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed.
5957 <DT><CODE>no_empty_cmd_completion</CODE>
5958 <DD>If set, and Readline is being used, Bash will not attempt to search
5959 the <CODE>PATH</CODE> for possible completions when completion is attempted
5963 <DT><CODE>nocaseglob</CODE>
5964 <DD>If set, Bash matches filenames in a case-insensitive fashion when
5965 performing filename expansion.
5968 <DT><CODE>nocasematch</CODE>
5969 <DD>If set, Bash matches patterns in a case-insensitive fashion when
5970 performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE>
5971 conditional commands.
5974 <DT><CODE>nullglob</CODE>
5975 <DD>If set, Bash allows filename patterns which match no
5976 files to expand to a null string, rather than themselves.
5979 <DT><CODE>progcomp</CODE>
5980 <DD>If set, the programmable completion facilities
5981 (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>) are enabled.
5982 This option is enabled by default.
5985 <DT><CODE>promptvars</CODE>
5986 <DD>If set, prompt strings undergo
5987 parameter expansion, command substitution, arithmetic
5988 expansion, and quote removal after being expanded
5989 as described below (see section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>).
5990 This option is enabled by default.
5993 <DT><CODE>restricted_shell</CODE>
5994 <DD>The shell sets this option if it is started in restricted mode
5995 (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>).
5996 The value may not be changed.
5997 This is not reset when the startup files are executed, allowing
5998 the startup files to discover whether or not a shell is restricted.
6001 <DT><CODE>shift_verbose</CODE>
6002 <DD>If this is set, the <CODE>shift</CODE>
6003 builtin prints an error message when the shift count exceeds the
6004 number of positional parameters.
6007 <DT><CODE>sourcepath</CODE>
6008 <DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE>
6009 to find the directory containing the file supplied as an argument.
6010 This option is enabled by default.
6013 <DT><CODE>xpg_echo</CODE>
6014 <DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences
6021 The return status when listing options is zero if all <VAR>optnames</VAR>
6022 are enabled, non-zero otherwise.
6023 When setting or unsetting options, the return status is zero unless an
6024 <VAR>optname</VAR> is not a valid shell option.
6030 <A NAME="Special Builtins"></A>
6032 <A NAME="SEC65"></A>
6033 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6034 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> < </A>]</TD>
6035 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> > </A>]</TD>
6036 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> << </A>]</TD>
6037 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
6038 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> >> </A>]</TD>
6039 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6040 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6041 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
6042 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6044 <H2> 4.4 Special Builtins </H2>
6045 <!--docid::SEC65::-->
6048 For historical reasons, the POSIX standard has classified
6049 several builtin commands as <EM>special</EM>.
6050 When Bash is executing in POSIX mode, the special builtins
6051 differ from other builtin commands in three respects:
6056 Special builtins are found before shell functions during command lookup.
6060 If a special builtin returns an error status, a non-interactive shell exits.
6064 Assignment statements preceding the command stay in effect in the shell
6065 environment after the command completes.
6069 When Bash is not executing in POSIX mode, these builtins behave no
6070 differently than the rest of the Bash builtin commands.
6071 The Bash POSIX mode is described in <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>.
6074 These are the POSIX special builtins:
6075 <TABLE><tr><td> </td><td class=example><pre>break : . continue eval exec exit export readonly return set
6077 </pre></td></tr></table></P><P>
6079 <A NAME="Shell Variables"></A>
6081 <A NAME="SEC66"></A>
6082 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6083 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> < </A>]</TD>
6084 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> > </A>]</TD>
6085 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> << </A>]</TD>
6086 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
6087 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> >> </A>]</TD>
6088 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6089 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6090 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
6091 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6093 <H1> 5. Shell Variables </H1>
6094 <!--docid::SEC66::-->
6097 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
6098 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way
6099 as the Bourne Shell.</TD></TR>
6100 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR>
6101 </TABLE></BLOCKQUOTE>
6104 This chapter describes the shell variables that Bash uses.
6105 Bash automatically assigns default values to a number of variables.
6108 <A NAME="Bourne Shell Variables"></A>
6110 <A NAME="SEC67"></A>
6111 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6112 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> < </A>]</TD>
6113 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> > </A>]</TD>
6114 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> << </A>]</TD>
6115 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> Up </A>]</TD>
6116 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> >> </A>]</TD>
6117 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6118 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6119 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
6120 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6122 <H2> 5.1 Bourne Shell Variables </H2>
6123 <!--docid::SEC67::-->
6126 Bash uses certain shell variables in the same way as the Bourne shell.
6127 In some cases, Bash assigns a default value to the variable.
6132 <A NAME="IDX112"></A>
6133 <DT><CODE>CDPATH</CODE>
6134 <DD><A NAME="IDX113"></A>
6135 A colon-separated list of directories used as a search path for
6136 the <CODE>cd</CODE> builtin command.
6139 <A NAME="IDX114"></A>
6140 <DT><CODE>HOME</CODE>
6141 <DD><A NAME="IDX115"></A>
6142 The current user's home directory; the default for the <CODE>cd</CODE> builtin
6144 The value of this variable is also used by tilde expansion
6145 (see section <A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>).
6148 <A NAME="IDX116"></A>
6149 <DT><CODE>IFS</CODE>
6150 <DD><A NAME="IDX117"></A>
6151 A list of characters that separate fields; used when the shell splits
6152 words as part of expansion.
6155 <A NAME="IDX118"></A>
6156 <DT><CODE>MAIL</CODE>
6157 <DD><A NAME="IDX119"></A>
6158 If this parameter is set to a filename or directory name
6159 and the <CODE>MAILPATH</CODE> variable
6160 is not set, Bash informs the user of the arrival of mail in
6161 the specified file or Maildir-format directory.
6164 <A NAME="IDX120"></A>
6165 <DT><CODE>MAILPATH</CODE>
6166 <DD><A NAME="IDX121"></A>
6167 A colon-separated list of filenames which the shell periodically checks
6169 Each list entry can specify the message that is printed when new mail
6170 arrives in the mail file by separating the file name from the message with
6172 When used in the text of the message, <CODE>$_</CODE> expands to the name of
6173 the current mail file.
6176 <A NAME="IDX122"></A>
6177 <DT><CODE>OPTARG</CODE>
6178 <DD><A NAME="IDX123"></A>
6179 The value of the last option argument processed by the <CODE>getopts</CODE> builtin.
6182 <A NAME="IDX124"></A>
6183 <DT><CODE>OPTIND</CODE>
6184 <DD><A NAME="IDX125"></A>
6185 The index of the last option argument processed by the <CODE>getopts</CODE> builtin.
6188 <A NAME="IDX126"></A>
6189 <DT><CODE>PATH</CODE>
6190 <DD><A NAME="IDX127"></A>
6191 A colon-separated list of directories in which the shell looks for
6193 A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the
6195 A null directory name may appear as two adjacent colons, or as an initial
6199 <A NAME="IDX128"></A>
6200 <DT><CODE>PS1</CODE>
6201 <DD><A NAME="IDX129"></A>
6202 The primary prompt string. The default value is <SAMP>`\s-\v\$ '</SAMP>.
6203 See section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>, for the complete list of escape
6204 sequences that are expanded before <CODE>PS1</CODE> is displayed.
6207 <A NAME="IDX130"></A>
6208 <DT><CODE>PS2</CODE>
6209 <DD><A NAME="IDX131"></A>
6210 The secondary prompt string. The default value is <SAMP>`> '</SAMP>.
6216 <A NAME="Bash Variables"></A>
6218 <A NAME="SEC68"></A>
6219 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6220 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> < </A>]</TD>
6221 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> > </A>]</TD>
6222 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> << </A>]</TD>
6223 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> Up </A>]</TD>
6224 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> >> </A>]</TD>
6225 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6226 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6227 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
6228 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6230 <H2> 5.2 Bash Variables </H2>
6231 <!--docid::SEC68::-->
6234 These variables are set or used by Bash, but other shells
6235 do not normally treat them specially.
6238 A few variables used by Bash are described in different chapters:
6239 variables for controlling the job control facilities
6240 (see section <A HREF="bashref.html#SEC95">7.3 Job Control Variables</A>).
6245 <A NAME="IDX132"></A>
6246 <DT><CODE>BASH</CODE>
6247 <DD><A NAME="IDX133"></A>
6248 The full pathname used to execute the current instance of Bash.
6251 <A NAME="IDX134"></A>
6252 <DT><CODE>BASHOPTS</CODE>
6253 <DD><A NAME="IDX135"></A>
6254 A colon-separated list of enabled shell options. Each word in
6255 the list is a valid argument for the <SAMP>`-s'</SAMP> option to the
6256 <CODE>shopt</CODE> builtin command (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
6257 The options appearing in <CODE>BASHOPTS</CODE> are those reported
6258 as <SAMP>`on'</SAMP> by <SAMP>`shopt'</SAMP>.
6259 If this variable is in the environment when Bash
6260 starts up, each shell option in the list will be enabled before
6261 reading any startup files. This variable is readonly.
6264 <A NAME="IDX136"></A>
6265 <DT><CODE>BASHPID</CODE>
6266 <DD><A NAME="IDX137"></A>
6267 Expands to the process ID of the current Bash process.
6268 This differs from <CODE>$$</CODE> under certain circumstances, such as subshells
6269 that do not require Bash to be re-initialized.
6272 <A NAME="IDX138"></A>
6273 <DT><CODE>BASH_ALIASES</CODE>
6274 <DD><A NAME="IDX139"></A>
6275 An associative array variable whose members correspond to the internal
6276 list of aliases as maintained by the <CODE>alias</CODE> builtin.
6277 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
6278 Elements added to this array appear in the alias list; unsetting array
6279 elements cause aliases to be removed from the alias list.
6282 <A NAME="IDX140"></A>
6283 <DT><CODE>BASH_ARGC</CODE>
6284 <DD><A NAME="IDX141"></A>
6285 An array variable whose values are the number of parameters in each
6286 frame of the current bash execution call stack. The number of
6287 parameters to the current subroutine (shell function or script executed
6288 with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack. When a
6289 subroutine is executed, the number of parameters passed is pushed onto
6290 <CODE>BASH_ARGC</CODE>.
6291 The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode
6292 (see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
6293 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6297 <A NAME="IDX142"></A>
6298 <DT><CODE>BASH_ARGV</CODE>
6299 <DD><A NAME="IDX143"></A>
6300 An array variable containing all of the parameters in the current bash
6301 execution call stack. The final parameter of the last subroutine call
6302 is at the top of the stack; the first parameter of the initial call is
6303 at the bottom. When a subroutine is executed, the parameters supplied
6304 are pushed onto <CODE>BASH_ARGV</CODE>.
6305 The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode
6306 (see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
6307 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6311 <A NAME="IDX144"></A>
6312 <DT><CODE>BASH_CMDS</CODE>
6313 <DD><A NAME="IDX145"></A>
6314 An associative array variable whose members correspond to the internal
6315 hash table of commands as maintained by the <CODE>hash</CODE> builtin
6316 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
6317 Elements added to this array appear in the hash table; unsetting array
6318 elements cause commands to be removed from the hash table.
6321 <A NAME="IDX146"></A>
6322 <DT><CODE>BASH_COMMAND</CODE>
6323 <DD><A NAME="IDX147"></A>
6324 The command currently being executed or about to be executed, unless the
6325 shell is executing a command as the result of a trap,
6326 in which case it is the command executing at the time of the trap.
6329 <A NAME="IDX148"></A>
6330 <DT><CODE>BASH_ENV</CODE>
6331 <DD><A NAME="IDX149"></A>
6332 If this variable is set when Bash is invoked to execute a shell
6333 script, its value is expanded and used as the name of a startup file
6334 to read before executing the script. See section <A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>.
6337 <A NAME="IDX150"></A>
6338 <DT><CODE>BASH_EXECUTION_STRING</CODE>
6339 <DD><A NAME="IDX151"></A>
6340 The command argument to the <SAMP>`-c'</SAMP> invocation option.
6343 <A NAME="IDX152"></A>
6344 <DT><CODE>BASH_LINENO</CODE>
6345 <DD><A NAME="IDX153"></A>
6346 An array variable whose members are the line numbers in source files
6347 where each corresponding member of <VAR>FUNCNAME</VAR> was invoked.
6348 <CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file
6349 (<CODE>${BASH_SOURCE[$i+1]}</CODE>) where
6350 <CODE>${FUNCNAME[$i]}</CODE> was called (or <CODE>${BASH_LINENO[$i-1]}</CODE> if
6351 referenced within another shell function).
6352 Use <CODE>LINENO</CODE> to obtain the current line number.
6355 <A NAME="IDX154"></A>
6356 <DT><CODE>BASH_REMATCH</CODE>
6357 <DD><A NAME="IDX155"></A>
6358 An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary
6359 operator to the <CODE>[[</CODE> conditional command
6360 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
6361 The element with index 0 is the portion of the string
6362 matching the entire regular expression.
6363 The element with index <VAR>n</VAR> is the portion of the
6364 string matching the <VAR>n</VAR>th parenthesized subexpression.
6365 This variable is read-only.
6368 <A NAME="IDX156"></A>
6369 <DT><CODE>BASH_SOURCE</CODE>
6370 <DD><A NAME="IDX157"></A>
6371 An array variable whose members are the source filenames where the
6372 corresponding shell function names in the <CODE>FUNCNAME</CODE> array
6373 variable are defined.
6374 The shell function <CODE>${FUNCNAME[$i]}</CODE> is defined in the file
6375 <CODE>${BASH_SOURCE[$i]}</CODE> and called from <CODE>${BASH_SOURCE[$i+1]}</CODE>
6378 <A NAME="IDX158"></A>
6379 <DT><CODE>BASH_SUBSHELL</CODE>
6380 <DD><A NAME="IDX159"></A>
6381 Incremented by one each time a subshell or subshell environment is spawned.
6382 The initial value is 0.
6385 <A NAME="IDX160"></A>
6386 <DT><CODE>BASH_VERSINFO</CODE>
6387 <DD><A NAME="IDX161"></A>
6388 A readonly array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>)
6389 whose members hold version information for this instance of Bash.
6390 The values assigned to the array members are as follows:
6395 <DT><CODE>BASH_VERSINFO[0]</CODE>
6396 <DD>The major version number (the <VAR>release</VAR>).
6399 <DT><CODE>BASH_VERSINFO[1]</CODE>
6400 <DD>The minor version number (the <VAR>version</VAR>).
6403 <DT><CODE>BASH_VERSINFO[2]</CODE>
6404 <DD>The patch level.
6407 <DT><CODE>BASH_VERSINFO[3]</CODE>
6408 <DD>The build version.
6411 <DT><CODE>BASH_VERSINFO[4]</CODE>
6412 <DD>The release status (e.g., <VAR>beta1</VAR>).
6415 <DT><CODE>BASH_VERSINFO[5]</CODE>
6416 <DD>The value of <CODE>MACHTYPE</CODE>.
6422 <A NAME="IDX162"></A>
6423 <DT><CODE>BASH_VERSION</CODE>
6424 <DD><A NAME="IDX163"></A>
6425 The version number of the current instance of Bash.
6428 <A NAME="IDX164"></A>
6429 <DT><CODE>BASH_XTRACEFD</CODE>
6430 <DD><A NAME="IDX165"></A>
6431 If set to an integer corresponding to a valid file descriptor, Bash
6432 will write the trace output generated when <SAMP>`set -x'</SAMP>
6433 is enabled to that file descriptor.
6434 This allows tracing output to be separated from diagnostic and error
6436 The file descriptor is closed when <CODE>BASH_XTRACEFD</CODE> is unset or assigned
6438 Unsetting <CODE>BASH_XTRACEFD</CODE> or assigning it the empty string causes the
6439 trace output to be sent to the standard error.
6440 Note that setting <CODE>BASH_XTRACEFD</CODE> to 2 (the standard error file
6441 descriptor) and then unsetting it will result in the standard error
6445 <A NAME="IDX166"></A>
6446 <DT><CODE>COLUMNS</CODE>
6447 <DD><A NAME="IDX167"></A>
6448 Used by the <CODE>select</CODE> command to determine the terminal width
6449 when printing selection lists. Automatically set upon receipt of a
6450 <CODE>SIGWINCH</CODE>.
6453 <A NAME="IDX168"></A>
6454 <DT><CODE>COMP_CWORD</CODE>
6455 <DD><A NAME="IDX169"></A>
6456 An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current
6458 This variable is available only in shell functions invoked by the
6459 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
6462 <A NAME="IDX170"></A>
6463 <DT><CODE>COMP_LINE</CODE>
6464 <DD><A NAME="IDX171"></A>
6465 The current command line.
6466 This variable is available only in shell functions and external
6467 commands invoked by the
6468 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
6471 <A NAME="IDX172"></A>
6472 <DT><CODE>COMP_POINT</CODE>
6473 <DD><A NAME="IDX173"></A>
6474 The index of the current cursor position relative to the beginning of
6475 the current command.
6476 If the current cursor position is at the end of the current command,
6477 the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>.
6478 This variable is available only in shell functions and external
6479 commands invoked by the
6480 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
6483 <A NAME="IDX174"></A>
6484 <DT><CODE>COMP_TYPE</CODE>
6485 <DD><A NAME="IDX175"></A>
6486 Set to an integer value corresponding to the type of completion attempted
6487 that caused a completion function to be called:
6488 <VAR>TAB</VAR>, for normal completion,
6489 <SAMP>`?'</SAMP>, for listing completions after successive tabs,
6490 <SAMP>`!'</SAMP>, for listing alternatives on partial word completion,
6491 <SAMP>`@'</SAMP>, to list completions if the word is not unmodified,
6493 <SAMP>`%'</SAMP>, for menu completion.
6494 This variable is available only in shell functions and external
6495 commands invoked by the
6496 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
6499 <A NAME="IDX176"></A>
6500 <DT><CODE>COMP_KEY</CODE>
6501 <DD><A NAME="IDX177"></A>
6502 The key (or final key of a key sequence) used to invoke the current
6503 completion function.
6506 <A NAME="IDX178"></A>
6507 <DT><CODE>COMP_WORDBREAKS</CODE>
6508 <DD><A NAME="IDX179"></A>
6509 The set of characters that the Readline library treats as word
6510 separators when performing word completion.
6511 If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties,
6512 even if it is subsequently reset.
6515 <A NAME="IDX180"></A>
6516 <DT><CODE>COMP_WORDS</CODE>
6517 <DD><A NAME="IDX181"></A>
6518 An array variable consisting of the individual
6519 words in the current command line.
6520 The line is split into words as Readline would split it, using
6521 <CODE>COMP_WORDBREAKS</CODE> as described above.
6522 This variable is available only in shell functions invoked by the
6523 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
6526 <A NAME="IDX182"></A>
6527 <DT><CODE>COMPREPLY</CODE>
6528 <DD><A NAME="IDX183"></A>
6529 An array variable from which Bash reads the possible completions
6530 generated by a shell function invoked by the programmable completion
6531 facility (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
6534 <A NAME="IDX184"></A>
6535 <DT><CODE>COPROC</CODE>
6536 <DD><A NAME="IDX185"></A>
6537 An array variable created to hold the file descriptors
6538 for output from and input to an unnamed coprocess (see section <A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A>).
6541 <A NAME="IDX186"></A>
6542 <DT><CODE>DIRSTACK</CODE>
6543 <DD><A NAME="IDX187"></A>
6544 An array variable containing the current contents of the directory stack.
6545 Directories appear in the stack in the order they are displayed by the
6546 <CODE>dirs</CODE> builtin.
6547 Assigning to members of this array variable may be used to modify
6548 directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE>
6549 builtins must be used to add and remove directories.
6550 Assignment to this variable will not change the current directory.
6551 If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if
6552 it is subsequently reset.
6555 <A NAME="IDX188"></A>
6556 <DT><CODE>EMACS</CODE>
6557 <DD><A NAME="IDX189"></A>
6558 If Bash finds this variable in the environment when the shell
6559 starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an
6560 Emacs shell buffer and disables line editing.
6563 <A NAME="IDX190"></A>
6564 <DT><CODE>ENV</CODE>
6565 <DD><A NAME="IDX191"></A>
6566 Similar to <CODE>BASH_ENV</CODE>; used when the shell is invoked in
6567 POSIX Mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
6570 <A NAME="IDX192"></A>
6571 <DT><CODE>EUID</CODE>
6572 <DD><A NAME="IDX193"></A>
6573 The numeric effective user id of the current user. This variable
6577 <A NAME="IDX194"></A>
6578 <DT><CODE>FCEDIT</CODE>
6579 <DD><A NAME="IDX195"></A>
6580 The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE>
6584 <A NAME="IDX196"></A>
6585 <DT><CODE>FIGNORE</CODE>
6586 <DD><A NAME="IDX197"></A>
6587 A colon-separated list of suffixes to ignore when performing
6588 filename completion.
6589 A file name whose suffix matches one of the entries in
6590 <CODE>FIGNORE</CODE>
6591 is excluded from the list of matched file names. A sample
6592 value is <SAMP>`.o:~'</SAMP>
6595 <A NAME="IDX198"></A>
6596 <DT><CODE>FUNCNAME</CODE>
6597 <DD><A NAME="IDX199"></A>
6598 An array variable containing the names of all shell functions
6599 currently in the execution call stack.
6600 The element with index 0 is the name of any currently-executing
6602 The bottom-most element (the one with the highest index)
6603 is <CODE>"main"</CODE>.
6604 This variable exists only when a shell function is executing.
6605 Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status.
6606 If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if
6607 it is subsequently reset.
6610 This variable can be used with <CODE>BASH_LINENO</CODE> and <CODE>BASH_SOURCE</CODE>.
6611 Each element of <CODE>FUNCNAME</CODE> has corresponding elements in
6612 <CODE>BASH_LINENO</CODE> and <CODE>BASH_SOURCE</CODE> to describe the call stack.
6613 For instance, <CODE>${FUNCNAME[$i]}</CODE> was called from the file
6614 <CODE>${BASH_SOURCE[$i+1]}</CODE> at line number <CODE>${BASH_LINENO[$i]}</CODE>.
6615 The <CODE>caller</CODE> builtin displays the current call stack using this
6619 <A NAME="IDX200"></A>
6620 <DT><CODE>FUNCNEST</CODE>
6621 <DD><A NAME="IDX201"></A>
6622 If set to a numeric value greater than 0, defines a maximum function
6623 nesting level. Function invocations that exceed this nesting level
6624 will cause the current command to abort.
6627 <A NAME="IDX202"></A>
6628 <DT><CODE>GLOBIGNORE</CODE>
6629 <DD><A NAME="IDX203"></A>
6630 A colon-separated list of patterns defining the set of filenames to
6631 be ignored by filename expansion.
6632 If a filename matched by a filename expansion pattern also matches one
6633 of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list
6637 <A NAME="IDX204"></A>
6638 <DT><CODE>GROUPS</CODE>
6639 <DD><A NAME="IDX205"></A>
6640 An array variable containing the list of groups of which the current
6642 Assignments to <CODE>GROUPS</CODE> have no effect and return an error status.
6643 If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is
6647 <A NAME="IDX206"></A>
6648 <DT><CODE>histchars</CODE>
6649 <DD><A NAME="IDX207"></A>
6650 Up to three characters which control history expansion, quick
6651 substitution, and tokenization (see section <A HREF="bashref.html#SEC123">9.3 History Expansion</A>).
6652 The first character is the
6653 <VAR>history expansion</VAR> character, that is, the character which signifies the
6654 start of a history expansion, normally <SAMP>`!'</SAMP>. The second character is the
6655 character which signifies `quick substitution' when seen as the first
6656 character on a line, normally <SAMP>`^'</SAMP>. The optional third character is the
6657 character which indicates that the remainder of the line is a comment when
6658 found as the first character of a word, usually <SAMP>`#'</SAMP>. The history
6659 comment character causes history substitution to be skipped for the
6660 remaining words on the line. It does not necessarily cause the shell
6661 parser to treat the rest of the line as a comment.
6664 <A NAME="IDX208"></A>
6665 <DT><CODE>HISTCMD</CODE>
6666 <DD><A NAME="IDX209"></A>
6667 The history number, or index in the history list, of the current
6668 command. If <CODE>HISTCMD</CODE> is unset, it loses its special properties,
6669 even if it is subsequently reset.
6672 <A NAME="IDX210"></A>
6673 <DT><CODE>HISTCONTROL</CODE>
6674 <DD><A NAME="IDX211"></A>
6675 A colon-separated list of values controlling how commands are saved on
6677 If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin
6678 with a space character are not saved in the history list.
6679 A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous
6680 history entry to not be saved.
6681 A value of <SAMP>`ignoreboth'</SAMP> is shorthand for
6682 <SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>.
6683 A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the
6684 current line to be removed from the history list before that line
6686 Any value not in the above list is ignored.
6687 If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value,
6688 all lines read by the shell parser are saved on the history list,
6689 subject to the value of <CODE>HISTIGNORE</CODE>.
6690 The second and subsequent lines of a multi-line compound command are
6691 not tested, and are added to the history regardless of the value of
6692 <CODE>HISTCONTROL</CODE>.
6695 <A NAME="IDX212"></A>
6696 <DT><CODE>HISTFILE</CODE>
6697 <DD><A NAME="IDX213"></A>
6698 The name of the file to which the command history is saved. The
6699 default value is <TT>`~/.bash_history'</TT>.
6702 <A NAME="IDX214"></A>
6703 <DT><CODE>HISTFILESIZE</CODE>
6704 <DD><A NAME="IDX215"></A>
6705 The maximum number of lines contained in the history file. When this
6706 variable is assigned a value, the history file is truncated, if
6707 necessary, by removing the oldest entries,
6708 to contain no more than that number of lines.
6709 The history file is also truncated to this size after
6710 writing it when an interactive shell exits.
6711 The default value is 500.
6714 <A NAME="IDX216"></A>
6715 <DT><CODE>HISTIGNORE</CODE>
6716 <DD><A NAME="IDX217"></A>
6717 A colon-separated list of patterns used to decide which command
6718 lines should be saved on the history list. Each pattern is
6719 anchored at the beginning of the line and must match the complete
6720 line (no implicit <SAMP>`*'</SAMP> is appended). Each pattern is tested
6721 against the line after the checks specified by <CODE>HISTCONTROL</CODE>
6722 are applied. In addition to the normal shell pattern matching
6723 characters, <SAMP>`&'</SAMP> matches the previous history line. <SAMP>`&'</SAMP>
6724 may be escaped using a backslash; the backslash is removed
6725 before attempting a match.
6726 The second and subsequent lines of a multi-line compound command are
6727 not tested, and are added to the history regardless of the value of
6728 <CODE>HISTIGNORE</CODE>.
6731 <CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>. A
6732 pattern of <SAMP>`&'</SAMP> is identical to <CODE>ignoredups</CODE>, and a
6733 pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>.
6734 Combining these two patterns, separating them with a colon,
6735 provides the functionality of <CODE>ignoreboth</CODE>.
6738 <A NAME="IDX218"></A>
6739 <DT><CODE>HISTSIZE</CODE>
6740 <DD><A NAME="IDX219"></A>
6741 The maximum number of commands to remember on the history list.
6742 The default value is 500.
6745 <A NAME="IDX220"></A>
6746 <DT><CODE>HISTTIMEFORMAT</CODE>
6747 <DD><A NAME="IDX221"></A>
6748 If this variable is set and not null, its value is used as a format string
6749 for <VAR>strftime</VAR> to print the time stamp associated with each history
6750 entry displayed by the <CODE>history</CODE> builtin.
6751 If this variable is set, time stamps are written to the history file so
6752 they may be preserved across shell sessions.
6753 This uses the history comment character to distinguish timestamps from
6754 other history lines.
6757 <A NAME="IDX222"></A>
6758 <DT><CODE>HOSTFILE</CODE>
6759 <DD><A NAME="IDX223"></A>
6760 Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that
6761 should be read when the shell needs to complete a hostname.
6762 The list of possible hostname completions may be changed while the shell
6764 the next time hostname completion is attempted after the
6765 value is changed, Bash adds the contents of the new file to the
6767 If <CODE>HOSTFILE</CODE> is set, but has no value, or does not name a readable file,
6768 Bash attempts to read
6769 <TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions.
6770 When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared.
6773 <A NAME="IDX224"></A>
6774 <DT><CODE>HOSTNAME</CODE>
6775 <DD><A NAME="IDX225"></A>
6776 The name of the current host.
6779 <A NAME="IDX226"></A>
6780 <DT><CODE>HOSTTYPE</CODE>
6781 <DD><A NAME="IDX227"></A>
6782 A string describing the machine Bash is running on.
6785 <A NAME="IDX228"></A>
6786 <DT><CODE>IGNOREEOF</CODE>
6787 <DD><A NAME="IDX229"></A>
6788 Controls the action of the shell on receipt of an <CODE>EOF</CODE> character
6789 as the sole input. If set, the value denotes the number
6790 of consecutive <CODE>EOF</CODE> characters that can be read as the
6791 first character on an input line
6792 before the shell will exit. If the variable exists but does not
6793 have a numeric value (or has no value) then the default is 10.
6794 If the variable does not exist, then <CODE>EOF</CODE> signifies the end of
6795 input to the shell. This is only in effect for interactive shells.
6798 <A NAME="IDX230"></A>
6799 <DT><CODE>INPUTRC</CODE>
6800 <DD><A NAME="IDX231"></A>
6801 The name of the Readline initialization file, overriding the default
6802 of <TT>`~/.inputrc'</TT>.
6805 <A NAME="IDX232"></A>
6806 <DT><CODE>LANG</CODE>
6807 <DD><A NAME="IDX233"></A>
6808 Used to determine the locale category for any category not specifically
6809 selected with a variable starting with <CODE>LC_</CODE>.
6812 <A NAME="IDX234"></A>
6813 <DT><CODE>LC_ALL</CODE>
6814 <DD><A NAME="IDX235"></A>
6815 This variable overrides the value of <CODE>LANG</CODE> and any other
6816 <CODE>LC_</CODE> variable specifying a locale category.
6819 <A NAME="IDX236"></A>
6820 <DT><CODE>LC_COLLATE</CODE>
6821 <DD><A NAME="IDX237"></A>
6822 This variable determines the collation order used when sorting the
6823 results of filename expansion, and
6824 determines the behavior of range expressions, equivalence classes,
6825 and collating sequences within filename expansion and pattern matching
6826 (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>).
6829 <A NAME="IDX238"></A>
6830 <DT><CODE>LC_CTYPE</CODE>
6831 <DD><A NAME="IDX239"></A>
6832 This variable determines the interpretation of characters and the
6833 behavior of character classes within filename expansion and pattern
6834 matching (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>).
6837 <A NAME="IDX240"></A>
6838 <DT><CODE>LC_MESSAGES</CODE>
6839 <DD><A NAME="IDX241"></A>
6840 This variable determines the locale used to translate double-quoted
6841 strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
6844 <A NAME="IDX242"></A>
6845 <DT><CODE>LC_NUMERIC</CODE>
6846 <DD><A NAME="IDX243"></A>
6847 This variable determines the locale category used for number formatting.
6850 <A NAME="IDX244"></A>
6851 <DT><CODE>LINENO</CODE>
6852 <DD><A NAME="IDX245"></A>
6853 The line number in the script or shell function currently executing.
6856 <A NAME="IDX246"></A>
6857 <DT><CODE>LINES</CODE>
6858 <DD><A NAME="IDX247"></A>
6859 Used by the <CODE>select</CODE> command to determine the column length
6860 for printing selection lists. Automatically set upon receipt of a
6861 <CODE>SIGWINCH</CODE>.
6864 <A NAME="IDX248"></A>
6865 <DT><CODE>MACHTYPE</CODE>
6866 <DD><A NAME="IDX249"></A>
6867 A string that fully describes the system type on which Bash
6868 is executing, in the standard GNU <VAR>cpu-company-system</VAR> format.
6871 <A NAME="IDX250"></A>
6872 <DT><CODE>MAILCHECK</CODE>
6873 <DD><A NAME="IDX251"></A>
6874 How often (in seconds) that the shell should check for mail in the
6875 files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables.
6876 The default is 60 seconds. When it is time to check
6877 for mail, the shell does so before displaying the primary prompt.
6878 If this variable is unset, or set to a value that is not a number
6879 greater than or equal to zero, the shell disables mail checking.
6882 <A NAME="IDX252"></A>
6883 <DT><CODE>MAPFILE</CODE>
6884 <DD><A NAME="IDX253"></A>
6885 An array variable created to hold the text read by the
6886 <CODE>mapfile</CODE> builtin when no variable name is supplied.
6889 <A NAME="IDX254"></A>
6890 <DT><CODE>OLDPWD</CODE>
6891 <DD><A NAME="IDX255"></A>
6892 The previous working directory as set by the <CODE>cd</CODE> builtin.
6895 <A NAME="IDX256"></A>
6896 <DT><CODE>OPTERR</CODE>
6897 <DD><A NAME="IDX257"></A>
6898 If set to the value 1, Bash displays error messages
6899 generated by the <CODE>getopts</CODE> builtin command.
6902 <A NAME="IDX258"></A>
6903 <DT><CODE>OSTYPE</CODE>
6904 <DD><A NAME="IDX259"></A>
6905 A string describing the operating system Bash is running on.
6908 <A NAME="IDX260"></A>
6909 <DT><CODE>PIPESTATUS</CODE>
6910 <DD><A NAME="IDX261"></A>
6911 An array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>)
6912 containing a list of exit status values from the processes
6913 in the most-recently-executed foreground pipeline (which may
6914 contain only a single command).
6917 <A NAME="IDX262"></A>
6918 <DT><CODE>POSIXLY_CORRECT</CODE>
6919 <DD><A NAME="IDX263"></A>
6920 If this variable is in the environment when <CODE>bash</CODE> starts, the shell
6921 enters POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>) before reading the
6922 startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied.
6923 If it is set while the shell is running, <CODE>bash</CODE> enables POSIX mode,
6925 <TABLE><tr><td> </td><td class=example><pre><CODE>set -o posix</CODE>
6926 </pre></td></tr></table>had been executed.
6929 <A NAME="IDX264"></A>
6930 <DT><CODE>PPID</CODE>
6931 <DD><A NAME="IDX265"></A>
6932 The process ID of the shell's parent process. This variable
6936 <A NAME="IDX266"></A>
6937 <DT><CODE>PROMPT_COMMAND</CODE>
6938 <DD><A NAME="IDX267"></A>
6939 If set, the value is interpreted as a command to execute
6940 before the printing of each primary prompt (<CODE>$PS1</CODE>).
6943 <A NAME="IDX268"></A>
6944 <DT><CODE>PROMPT_DIRTRIM</CODE>
6945 <DD><A NAME="IDX269"></A>
6946 If set to a number greater than zero, the value is used as the number of
6947 trailing directory components to retain when expanding the <CODE>\w</CODE> and
6948 <CODE>\W</CODE> prompt string escapes (see section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>).
6949 Characters removed are replaced with an ellipsis.
6952 <A NAME="IDX270"></A>
6953 <DT><CODE>PS3</CODE>
6954 <DD><A NAME="IDX271"></A>
6955 The value of this variable is used as the prompt for the
6956 <CODE>select</CODE> command. If this variable is not set, the
6957 <CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP>
6960 <A NAME="IDX272"></A>
6961 <DT><CODE>PS4</CODE>
6962 <DD><A NAME="IDX273"></A>
6963 The value is the prompt printed before the command line is echoed
6964 when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
6965 The first character of <CODE>PS4</CODE> is replicated multiple times, as
6966 necessary, to indicate multiple levels of indirection.
6967 The default is <SAMP>`+ '</SAMP>.
6970 <A NAME="IDX274"></A>
6971 <DT><CODE>PWD</CODE>
6972 <DD><A NAME="IDX275"></A>
6973 The current working directory as set by the <CODE>cd</CODE> builtin.
6976 <A NAME="IDX276"></A>
6977 <DT><CODE>RANDOM</CODE>
6978 <DD><A NAME="IDX277"></A>
6979 Each time this parameter is referenced, a random integer
6980 between 0 and 32767 is generated. Assigning a value to this
6981 variable seeds the random number generator.
6984 <A NAME="IDX278"></A>
6985 <DT><CODE>READLINE_LINE</CODE>
6986 <DD><A NAME="IDX279"></A>
6987 The contents of the Readline line buffer, for use
6988 with <SAMP>`bind -x'</SAMP> (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
6991 <A NAME="IDX280"></A>
6992 <DT><CODE>READLINE_POINT</CODE>
6993 <DD><A NAME="IDX281"></A>
6994 The position of the insertion point in the Readline line buffer, for use
6995 with <SAMP>`bind -x'</SAMP> (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
6998 <A NAME="IDX282"></A>
6999 <DT><CODE>REPLY</CODE>
7000 <DD><A NAME="IDX283"></A>
7001 The default variable for the <CODE>read</CODE> builtin.
7004 <A NAME="IDX284"></A>
7005 <DT><CODE>SECONDS</CODE>
7006 <DD><A NAME="IDX285"></A>
7007 This variable expands to the number of seconds since the
7008 shell was started. Assignment to this variable resets
7009 the count to the value assigned, and the expanded value
7010 becomes the value assigned plus the number of seconds
7011 since the assignment.
7014 <A NAME="IDX286"></A>
7015 <DT><CODE>SHELL</CODE>
7016 <DD><A NAME="IDX287"></A>
7017 The full pathname to the shell is kept in this environment variable.
7018 If it is not set when the shell starts,
7019 Bash assigns to it the full pathname of the current user's login shell.
7022 <A NAME="IDX288"></A>
7023 <DT><CODE>SHELLOPTS</CODE>
7024 <DD><A NAME="IDX289"></A>
7025 A colon-separated list of enabled shell options. Each word in
7026 the list is a valid argument for the <SAMP>`-o'</SAMP> option to the
7027 <CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
7028 The options appearing in <CODE>SHELLOPTS</CODE> are those reported
7029 as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>.
7030 If this variable is in the environment when Bash
7031 starts up, each shell option in the list will be enabled before
7032 reading any startup files. This variable is readonly.
7035 <A NAME="IDX290"></A>
7036 <DT><CODE>SHLVL</CODE>
7037 <DD><A NAME="IDX291"></A>
7038 Incremented by one each time a new instance of Bash is started. This is
7039 intended to be a count of how deeply your Bash shells are nested.
7042 <A NAME="IDX292"></A>
7043 <DT><CODE>TIMEFORMAT</CODE>
7044 <DD><A NAME="IDX293"></A>
7045 The value of this parameter is used as a format string specifying
7046 how the timing information for pipelines prefixed with the <CODE>time</CODE>
7047 reserved word should be displayed.
7048 The <SAMP>`%'</SAMP> character introduces an
7049 escape sequence that is expanded to a time value or other
7051 The escape sequences and their meanings are as
7052 follows; the braces denote optional portions.
7058 <DD>A literal <SAMP>`%'</SAMP>.
7061 <DT><CODE>%[<VAR>p</VAR>][l]R</CODE>
7062 <DD>The elapsed time in seconds.
7065 <DT><CODE>%[<VAR>p</VAR>][l]U</CODE>
7066 <DD>The number of CPU seconds spent in user mode.
7069 <DT><CODE>%[<VAR>p</VAR>][l]S</CODE>
7070 <DD>The number of CPU seconds spent in system mode.
7074 <DD>The CPU percentage, computed as (%U + %S) / %R.
7078 The optional <VAR>p</VAR> is a digit specifying the precision, the number of
7079 fractional digits after a decimal point.
7080 A value of 0 causes no decimal point or fraction to be output.
7081 At most three places after the decimal point may be specified; values
7082 of <VAR>p</VAR> greater than 3 are changed to 3.
7083 If <VAR>p</VAR> is not specified, the value 3 is used.
7086 The optional <CODE>l</CODE> specifies a longer format, including minutes, of
7087 the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s.
7088 The value of <VAR>p</VAR> determines whether or not the fraction is included.
7091 If this variable is not set, Bash acts as if it had the value
7092 <TABLE><tr><td> </td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE>
7093 </pre></td></tr></table>If the value is null, no timing information is displayed.
7094 A trailing newline is added when the format string is displayed.
7097 <A NAME="IDX294"></A>
7098 <DT><CODE>TMOUT</CODE>
7099 <DD><A NAME="IDX295"></A>
7100 If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the
7101 default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
7102 The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates
7103 if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming
7107 In an interactive shell, the value is interpreted as
7108 the number of seconds to wait for input after issuing the primary
7109 prompt when the shell is interactive.
7110 Bash terminates after that number of seconds if input does
7114 <A NAME="IDX296"></A>
7115 <DT><CODE>TMPDIR</CODE>
7116 <DD><A NAME="IDX297"></A>
7117 If set, Bash uses its value as the name of a directory in which
7118 Bash creates temporary files for the shell's use.
7121 <A NAME="IDX298"></A>
7122 <DT><CODE>UID</CODE>
7123 <DD><A NAME="IDX299"></A>
7124 The numeric real user id of the current user. This variable is readonly.
7130 <A NAME="Bash Features"></A>
7132 <A NAME="SEC69"></A>
7133 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7134 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> < </A>]</TD>
7135 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> > </A>]</TD>
7136 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> << </A>]</TD>
7137 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
7138 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
7139 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7140 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7141 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7142 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7144 <H1> 6. Bash Features </H1>
7145 <!--docid::SEC69::-->
7148 This section describes features unique to Bash.
7151 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
7152 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC70">6.1 Invoking Bash</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command line options that you can give
7154 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">When and how Bash executes scripts.</TD></TR>
7155 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC79">6.3 Interactive Shells</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What an interactive shell is.</TD></TR>
7156 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Primitives used in composing expressions for
7157 the <CODE>test</CODE> builtin.</TD></TR>
7158 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR>
7159 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.6 Aliases</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR>
7160 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.7 Arrays</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR>
7161 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC87">6.8 The Directory Stack</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR>
7162 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the PS1 string.</TD></TR>
7163 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR>
7164 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what
7165 the POSIX standard specifies.</TD></TR>
7166 </TABLE></BLOCKQUOTE>
7169 <A NAME="Invoking Bash"></A>
7171 <A NAME="SEC70"></A>
7172 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7173 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> < </A>]</TD>
7174 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> > </A>]</TD>
7175 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> << </A>]</TD>
7176 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
7177 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
7178 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7179 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7180 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7181 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7183 <H2> 6.1 Invoking Bash </H2>
7184 <!--docid::SEC70::-->
7187 <TABLE><tr><td> </td><td class=example><pre>bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
7188 bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>]
7189 bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
7190 </pre></td></tr></table></P><P>
7192 All of the single-character options used with the <CODE>set</CODE> builtin
7193 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>) can be used as options when the shell is invoked.
7194 In addition, there are several multi-character
7195 options that you can use. These options must appear on the command
7196 line before the single-character options to be recognized.
7200 <DT><CODE>--debugger</CODE>
7201 <DD>Arrange for the debugger profile to be executed before the shell
7202 starts. Turns on extended debugging mode (see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
7203 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
7207 <DT><CODE>--dump-po-strings</CODE>
7208 <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
7209 is printed on the standard output
7210 in the GNU <CODE>gettext</CODE> PO (portable object) file format.
7211 Equivalent to <SAMP>`-D'</SAMP> except for the output format.
7214 <DT><CODE>--dump-strings</CODE>
7215 <DD>Equivalent to <SAMP>`-D'</SAMP>.
7218 <DT><CODE>--help</CODE>
7219 <DD>Display a usage message on standard output and exit successfully.
7222 <DT><CODE>--init-file <VAR>filename</VAR></CODE>
7223 <DD><DT><CODE>--rcfile <VAR>filename</VAR></CODE>
7224 <DD>Execute commands from <VAR>filename</VAR> (instead of <TT>`~/.bashrc'</TT>)
7225 in an interactive shell.
7228 <DT><CODE>--login</CODE>
7229 <DD>Equivalent to <SAMP>`-l'</SAMP>.
7232 <DT><CODE>--noediting</CODE>
7233 <DD>Do not use the GNU Readline library (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>)
7234 to read command lines when the shell is interactive.
7237 <DT><CODE>--noprofile</CODE>
7238 <DD>Don't load the system-wide startup file <TT>`/etc/profile'</TT>
7239 or any of the personal initialization files
7240 <TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT>
7241 when Bash is invoked as a login shell.
7244 <DT><CODE>--norc</CODE>
7245 <DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an
7246 interactive shell. This is on by default if the shell is
7247 invoked as <CODE>sh</CODE>.
7250 <DT><CODE>--posix</CODE>
7251 <DD>Change the behavior of Bash where the default operation differs
7252 from the POSIX standard to match the standard. This
7253 is intended to make Bash behave as a strict superset of that
7254 standard. See section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>, for a description of the Bash
7258 <DT><CODE>--restricted</CODE>
7259 <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>).
7262 <DT><CODE>--verbose</CODE>
7263 <DD>Equivalent to <SAMP>`-v'</SAMP>. Print shell input lines as they're read.
7266 <DT><CODE>--version</CODE>
7267 <DD>Show version information for this instance of
7268 Bash on the standard output and exit successfully.
7274 There are several single-character options that may be supplied at
7275 invocation which are not available with the <CODE>set</CODE> builtin.
7279 <DT><CODE>-c <VAR>string</VAR></CODE>
7280 <DD>Read and execute commands from <VAR>string</VAR> after processing the
7281 options, then exit. Any remaining arguments are assigned to the
7282 positional parameters, starting with <CODE>$0</CODE>.
7286 <DD>Force the shell to run interactively. Interactive shells are
7287 described in <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>.
7291 <DD>Make this shell act as if it had been directly invoked by login.
7292 When the shell is interactive, this is equivalent to starting a
7293 login shell with <SAMP>`exec -l bash'</SAMP>.
7294 When the shell is not interactive, the login shell startup files will
7296 <SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP>
7297 will replace the current shell with a Bash login shell.
7298 See section <A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>, for a description of the special behavior
7303 <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>).
7307 <DD>If this option is present, or if no arguments remain after option
7308 processing, then commands are read from the standard input.
7309 This option allows the positional parameters to be set
7310 when invoking an interactive shell.
7314 <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
7315 is printed on the standard output.
7316 These are the strings that
7317 are subject to language translation when the current locale
7318 is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
7319 This implies the <SAMP>`-n'</SAMP> option; no commands will be executed.
7322 <DT><CODE>[-+]O [<VAR>shopt_option</VAR>]</CODE>
7323 <DD><VAR>shopt_option</VAR> is one of the shell options accepted by the
7324 <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
7325 If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option;
7326 <SAMP>`+O'</SAMP> unsets it.
7327 If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell
7328 options accepted by <CODE>shopt</CODE> are printed on the standard output.
7329 If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format
7330 that may be reused as input.
7334 <DD>A <CODE>--</CODE> signals the end of options and disables further option
7336 Any arguments after the <CODE>--</CODE> are treated as filenames and arguments.
7342 <A NAME="IDX300"></A>
7343 A <EM>login</EM> shell is one whose first character of argument zero is
7344 <SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option.
7347 <A NAME="IDX301"></A>
7348 An <EM>interactive</EM> shell is one started without non-option arguments,
7349 unless <SAMP>`-s'</SAMP> is specified,
7350 without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both
7351 connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one
7352 started with the <SAMP>`-i'</SAMP> option. See section <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>, for more
7356 If arguments remain after option processing, and neither the
7357 <SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP>
7358 option has been supplied, the first argument is assumed to
7359 be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>).
7360 When Bash is invoked in this fashion, <CODE>$0</CODE>
7361 is set to the name of the file, and the positional parameters
7362 are set to the remaining arguments.
7363 Bash reads and executes commands from this file, then exits.
7364 Bash's exit status is the exit status of the last command executed
7365 in the script. If no commands are executed, the exit status is 0.
7368 <A NAME="Bash Startup Files"></A>
7370 <A NAME="SEC71"></A>
7371 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7372 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> < </A>]</TD>
7373 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> > </A>]</TD>
7374 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> << </A>]</TD>
7375 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
7376 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
7377 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7378 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7379 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7380 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7382 <H2> 6.2 Bash Startup Files </H2>
7383 <!--docid::SEC71::-->
7386 This section describes how Bash executes its startup files.
7387 If any of the files exist but cannot be read, Bash reports an error.
7388 Tildes are expanded in file names as described above under
7389 Tilde Expansion (see section <A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>).
7392 Interactive shells are described in <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>.
7395 <A NAME="SEC72"></A>
7396 <H4> Invoked as an interactive login shell, or with <SAMP>`--login'</SAMP> </H4>
7397 <!--docid::SEC72::-->
7400 When Bash is invoked as an interactive login shell, or as a
7401 non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and
7402 executes commands from the file <TT>`/etc/profile'</TT>, if that file exists.
7403 After reading that file, it looks for <TT>`~/.bash_profile'</TT>,
7404 <TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads
7405 and executes commands from the first one that exists and is readable.
7406 The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to
7407 inhibit this behavior.
7410 When a login shell exits, Bash reads and executes commands from
7411 the file <TT>`~/.bash_logout'</TT>, if it exists.
7414 <A NAME="SEC73"></A>
7415 <H4> Invoked as an interactive non-login shell </H4>
7416 <!--docid::SEC73::-->
7419 When an interactive shell that is not a login shell is started, Bash
7420 reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists.
7421 This may be inhibited by using the <SAMP>`--norc'</SAMP> option.
7422 The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and
7423 execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>.
7426 So, typically, your <TT>`~/.bash_profile'</TT> contains the line
7427 <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE>
7428 </pre></td></tr></table>after (or before) any login-specific initializations.
7431 <A NAME="SEC74"></A>
7432 <H4> Invoked non-interactively </H4>
7433 <!--docid::SEC74::-->
7436 When Bash is started non-interactively, to run a shell script,
7437 for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment,
7438 expands its value if it appears there, and uses the expanded value as
7439 the name of a file to read and execute. Bash behaves as if the
7440 following command were executed:
7441 <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE>
7442 </pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the
7446 As noted above, if a non-interactive shell is invoked with the
7447 <SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the
7448 login shell startup files.
7451 <A NAME="SEC75"></A>
7452 <H4> Invoked with name <CODE>sh</CODE> </H4>
7453 <!--docid::SEC75::-->
7456 If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the
7457 startup behavior of historical versions of <CODE>sh</CODE> as closely as
7458 possible, while conforming to the POSIX standard as well.
7461 When invoked as an interactive login shell, or as a non-interactive
7462 shell with the <SAMP>`--login'</SAMP> option, it first attempts to read
7463 and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in
7465 The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior.
7466 When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash
7467 looks for the variable <CODE>ENV</CODE>, expands its value if it is defined,
7468 and uses the expanded value as the name of a file to read and execute.
7469 Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute
7470 commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has
7472 A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt
7473 to read any other startup files.
7476 When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after
7477 the startup files are read.
7480 <A NAME="SEC76"></A>
7481 <H4> Invoked in POSIX mode </H4>
7482 <!--docid::SEC76::-->
7485 When Bash is started in POSIX mode, as with the
7486 <SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard
7488 In this mode, interactive shells expand the <CODE>ENV</CODE> variable
7489 and commands are read and executed from the file whose name is the
7491 No other startup files are read.
7494 <A NAME="SEC77"></A>
7495 <H4> Invoked by remote shell daemon </H4>
7496 <!--docid::SEC77::-->
7499 Bash attempts to determine when it is being run with its standard input
7500 connected to a network connection, as when executed by the remote shell
7501 daemon, usually <CODE>rshd</CODE>, or the secure shell daemon <CODE>sshd</CODE>.
7502 If Bash determines it is being run in
7503 this fashion, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that
7504 file exists and is readable.
7505 It will not do this if invoked as <CODE>sh</CODE>.
7506 The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the
7507 <SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but
7508 <CODE>rshd</CODE> does not generally invoke the shell with those options or
7509 allow them to be specified.
7512 <A NAME="SEC78"></A>
7513 <H4> Invoked with unequal effective and real UID/GIDs </H4>
7514 <!--docid::SEC78::-->
7517 If Bash is started with the effective user (group) id not equal to the
7518 real user (group) id, and the <CODE>-p</CODE> option is not supplied, no startup
7519 files are read, shell functions are not inherited from the environment,
7520 the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE>, and <CODE>GLOBIGNORE</CODE>
7521 variables, if they appear in the environment, are ignored, and the effective
7522 user id is set to the real user id.
7523 If the <CODE>-p</CODE> option is supplied at invocation, the startup behavior is
7524 the same, but the effective user id is not reset.
7527 <A NAME="Interactive Shells"></A>
7529 <A NAME="SEC79"></A>
7530 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7531 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> < </A>]</TD>
7532 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> > </A>]</TD>
7533 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> << </A>]</TD>
7534 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
7535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> >> </A>]</TD>
7536 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7537 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7538 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7539 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7541 <H2> 6.3 Interactive Shells </H2>
7542 <!--docid::SEC79::-->
7545 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
7546 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.3.1 What is an Interactive Shell?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What determines whether a shell is Interactive.</TD></TR>
7547 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.3.2 Is this Shell Interactive?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to tell if a shell is interactive.</TD></TR>
7548 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC82">6.3.3 Interactive Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR>
7549 </TABLE></BLOCKQUOTE>
7552 <A NAME="What is an Interactive Shell?"></A>
7554 <A NAME="SEC80"></A>
7555 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7556 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> < </A>]</TD>
7557 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> > </A>]</TD>
7558 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> << </A>]</TD>
7559 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> Up </A>]</TD>
7560 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> >> </A>]</TD>
7561 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7562 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7563 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7564 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7566 <H3> 6.3.1 What is an Interactive Shell? </H3>
7567 <!--docid::SEC80::-->
7570 An interactive shell
7571 is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is
7572 specified, without specifying the <SAMP>`-c'</SAMP> option, and
7573 whose input and error output are both
7574 connected to terminals (as determined by <CODE>isatty(3)</CODE>),
7575 or one started with the <SAMP>`-i'</SAMP> option.
7578 An interactive shell generally reads from and writes to a user's
7582 The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters
7583 when an interactive shell is started.
7586 <A NAME="Is this Shell Interactive?"></A>
7588 <A NAME="SEC81"></A>
7589 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7590 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> < </A>]</TD>
7591 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> > </A>]</TD>
7592 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD>
7593 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> Up </A>]</TD>
7594 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> >> </A>]</TD>
7595 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7596 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7597 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7598 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7600 <H3> 6.3.2 Is this Shell Interactive? </H3>
7601 <!--docid::SEC81::-->
7604 To determine within a startup script whether or not Bash is
7605 running interactively,
7606 test the value of the <SAMP>`-'</SAMP> special parameter.
7607 It contains <CODE>i</CODE> when the shell is interactive. For example:
7610 <TABLE><tr><td> </td><td class=example><pre>case "$-" in
7611 *i*) echo This shell is interactive ;;
7612 *) echo This shell is not interactive ;;
7614 </pre></td></tr></table></P><P>
7616 Alternatively, startup scripts may examine the variable
7617 <CODE>PS1</CODE>; it is unset in non-interactive shells, and set in
7618 interactive shells. Thus:
7621 <TABLE><tr><td> </td><td class=example><pre>if [ -z "$PS1" ]; then
7622 echo This shell is not interactive
7624 echo This shell is interactive
7626 </pre></td></tr></table></P><P>
7628 <A NAME="Interactive Shell Behavior"></A>
7630 <A NAME="SEC82"></A>
7631 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7632 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> < </A>]</TD>
7633 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> > </A>]</TD>
7634 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> << </A>]</TD>
7635 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> Up </A>]</TD>
7636 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> >> </A>]</TD>
7637 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7638 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7639 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7640 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7642 <H3> 6.3.3 Interactive Shell Behavior </H3>
7643 <!--docid::SEC82::-->
7646 When the shell is running interactively, it changes its behavior in
7652 Startup files are read and executed as described in <A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>.
7656 Job Control (see section <A HREF="bashref.html#SEC92">7. Job Control</A>) is enabled by default. When job
7657 control is in effect, Bash ignores the keyboard-generated job control
7658 signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
7662 Bash expands and displays <CODE>PS1</CODE> before reading the first line
7663 of a command, and expands and displays <CODE>PS2</CODE> before reading the
7664 second and subsequent lines of a multi-line command.
7668 Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command
7669 before printing the primary prompt, <CODE>$PS1</CODE>
7670 (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
7674 Readline (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>) is used to read commands from
7675 the user's terminal.
7679 Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE>
7680 instead of exiting immediately when it receives an <CODE>EOF</CODE> on its
7681 standard input when reading a command (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
7685 Command history (see section <A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>)
7686 and history expansion (see section <A HREF="bashref.html#SEC123">9.3 History Expansion</A>)
7687 are enabled by default.
7688 Bash will save the command history to the file named by <CODE>$HISTFILE</CODE>
7689 when an interactive shell exits.
7693 Alias expansion (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>) is performed by default.
7697 In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE>
7698 (see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
7702 In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled
7703 ((see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
7704 <CODE>SIGINT</CODE> will interrupt some shell builtins.
7708 An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit
7709 if the <CODE>huponexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
7713 The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has
7714 no effect (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
7718 Bash will check for mail periodically, depending on the values of the
7719 <CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables
7720 (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
7724 Expansion errors due to references to unbound shell variables after
7725 <SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit
7726 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
7730 The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset
7731 or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions
7732 (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
7736 Redirection errors encountered by shell builtins will not cause the
7741 When running in POSIX mode, a special builtin returning an error
7742 status will not cause the shell to exit (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
7746 A failed <CODE>exec</CODE> will not cause the shell to exit
7747 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
7751 Parser syntax errors will not cause the shell to exit.
7755 Simple spelling correction for directory arguments to the <CODE>cd</CODE>
7756 builtin is enabled by default (see the description of the <CODE>cdspell</CODE>
7757 option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
7761 The shell will check the value of the <CODE>TMOUT</CODE> variable and exit
7762 if a command is not read within the specified number of seconds after
7763 printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
7769 <A NAME="Bash Conditional Expressions"></A>
7771 <A NAME="SEC83"></A>
7772 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7773 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> < </A>]</TD>
7774 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> > </A>]</TD>
7775 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> << </A>]</TD>
7776 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
7777 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
7778 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7779 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7780 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7781 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7783 <H2> 6.4 Bash Conditional Expressions </H2>
7784 <!--docid::SEC83::-->
7787 Conditional expressions are used by the <CODE>[[</CODE> compound command
7788 and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands.
7791 Expressions may be unary or binary.
7792 Unary expressions are often used to examine the status of a file.
7793 There are string operators and numeric comparison operators as well.
7794 If the <VAR>file</VAR> argument to one of the primaries is of the form
7795 <TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked.
7796 If the <VAR>file</VAR> argument to one of the primaries is one of
7797 <TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file
7798 descriptor 0, 1, or 2, respectively, is checked.
7801 When used with <SAMP>`[['</SAMP>, the <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators sort
7802 lexicographically using the current locale.
7803 The <CODE>test</CODE> command uses ASCII ordering.
7806 Unless otherwise specified, primaries that operate on files follow symbolic
7807 links and operate on the target of the link, rather than the link itself.
7811 <DT><CODE>-a <VAR>file</VAR></CODE>
7812 <DD>True if <VAR>file</VAR> exists.
7815 <DT><CODE>-b <VAR>file</VAR></CODE>
7816 <DD>True if <VAR>file</VAR> exists and is a block special file.
7819 <DT><CODE>-c <VAR>file</VAR></CODE>
7820 <DD>True if <VAR>file</VAR> exists and is a character special file.
7823 <DT><CODE>-d <VAR>file</VAR></CODE>
7824 <DD>True if <VAR>file</VAR> exists and is a directory.
7827 <DT><CODE>-e <VAR>file</VAR></CODE>
7828 <DD>True if <VAR>file</VAR> exists.
7831 <DT><CODE>-f <VAR>file</VAR></CODE>
7832 <DD>True if <VAR>file</VAR> exists and is a regular file.
7835 <DT><CODE>-g <VAR>file</VAR></CODE>
7836 <DD>True if <VAR>file</VAR> exists and its set-group-id bit is set.
7839 <DT><CODE>-h <VAR>file</VAR></CODE>
7840 <DD>True if <VAR>file</VAR> exists and is a symbolic link.
7843 <DT><CODE>-k <VAR>file</VAR></CODE>
7844 <DD>True if <VAR>file</VAR> exists and its "sticky" bit is set.
7847 <DT><CODE>-p <VAR>file</VAR></CODE>
7848 <DD>True if <VAR>file</VAR> exists and is a named pipe (FIFO).
7851 <DT><CODE>-r <VAR>file</VAR></CODE>
7852 <DD>True if <VAR>file</VAR> exists and is readable.
7855 <DT><CODE>-s <VAR>file</VAR></CODE>
7856 <DD>True if <VAR>file</VAR> exists and has a size greater than zero.
7859 <DT><CODE>-t <VAR>fd</VAR></CODE>
7860 <DD>True if file descriptor <VAR>fd</VAR> is open and refers to a terminal.
7863 <DT><CODE>-u <VAR>file</VAR></CODE>
7864 <DD>True if <VAR>file</VAR> exists and its set-user-id bit is set.
7867 <DT><CODE>-w <VAR>file</VAR></CODE>
7868 <DD>True if <VAR>file</VAR> exists and is writable.
7871 <DT><CODE>-x <VAR>file</VAR></CODE>
7872 <DD>True if <VAR>file</VAR> exists and is executable.
7875 <DT><CODE>-G <VAR>file</VAR></CODE>
7876 <DD>True if <VAR>file</VAR> exists and is owned by the effective group id.
7879 <DT><CODE>-L <VAR>file</VAR></CODE>
7880 <DD>True if <VAR>file</VAR> exists and is a symbolic link.
7883 <DT><CODE>-N <VAR>file</VAR></CODE>
7884 <DD>True if <VAR>file</VAR> exists and has been modified since it was last read.
7887 <DT><CODE>-O <VAR>file</VAR></CODE>
7888 <DD>True if <VAR>file</VAR> exists and is owned by the effective user id.
7891 <DT><CODE>-S <VAR>file</VAR></CODE>
7892 <DD>True if <VAR>file</VAR> exists and is a socket.
7895 <DT><CODE><VAR>file1</VAR> -ef <VAR>file2</VAR></CODE>
7896 <DD>True if <VAR>file1</VAR> and <VAR>file2</VAR> refer to the same device and
7900 <DT><CODE><VAR>file1</VAR> -nt <VAR>file2</VAR></CODE>
7901 <DD>True if <VAR>file1</VAR> is newer (according to modification date)
7902 than <VAR>file2</VAR>, or if <VAR>file1</VAR> exists and <VAR>file2</VAR> does not.
7905 <DT><CODE><VAR>file1</VAR> -ot <VAR>file2</VAR></CODE>
7906 <DD>True if <VAR>file1</VAR> is older than <VAR>file2</VAR>,
7907 or if <VAR>file2</VAR> exists and <VAR>file1</VAR> does not.
7910 <DT><CODE>-o <VAR>optname</VAR></CODE>
7911 <DD>True if the shell option <VAR>optname</VAR> is enabled.
7912 The list of options appears in the description of the <SAMP>`-o'</SAMP>
7913 option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
7916 <DT><CODE>-v <VAR>varname</VAR></CODE>
7917 <DD>True if the shell variable <VAR>varname</VAR> is set (has been assigned a value).
7920 <DT><CODE>-z <VAR>string</VAR></CODE>
7921 <DD>True if the length of <VAR>string</VAR> is zero.
7924 <DT><CODE>-n <VAR>string</VAR></CODE>
7925 <DD><DT><CODE><VAR>string</VAR></CODE>
7926 <DD>True if the length of <VAR>string</VAR> is non-zero.
7929 <DT><CODE><VAR>string1</VAR> == <VAR>string2</VAR></CODE>
7930 <DD><DT><CODE><VAR>string1</VAR> = <VAR>string2</VAR></CODE>
7931 <DD>True if the strings are equal.
7932 <SAMP>`='</SAMP> should be used with the <CODE>test</CODE> command for POSIX conformance.
7935 <DT><CODE><VAR>string1</VAR> != <VAR>string2</VAR></CODE>
7936 <DD>True if the strings are not equal.
7939 <DT><CODE><VAR>string1</VAR> < <VAR>string2</VAR></CODE>
7940 <DD>True if <VAR>string1</VAR> sorts before <VAR>string2</VAR> lexicographically.
7943 <DT><CODE><VAR>string1</VAR> > <VAR>string2</VAR></CODE>
7944 <DD>True if <VAR>string1</VAR> sorts after <VAR>string2</VAR> lexicographically.
7947 <DT><CODE><VAR>arg1</VAR> OP <VAR>arg2</VAR></CODE>
7948 <DD><CODE>OP</CODE> is one of
7949 <SAMP>`-eq'</SAMP>, <SAMP>`-ne'</SAMP>, <SAMP>`-lt'</SAMP>, <SAMP>`-le'</SAMP>, <SAMP>`-gt'</SAMP>, or <SAMP>`-ge'</SAMP>.
7950 These arithmetic binary operators return true if <VAR>arg1</VAR>
7951 is equal to, not equal to, less than, less than or equal to,
7952 greater than, or greater than or equal to <VAR>arg2</VAR>,
7953 respectively. <VAR>Arg1</VAR> and <VAR>arg2</VAR>
7954 may be positive or negative integers.
7960 <A NAME="Shell Arithmetic"></A>
7962 <A NAME="SEC84"></A>
7963 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7964 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> < </A>]</TD>
7965 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> > </A>]</TD>
7966 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> << </A>]</TD>
7967 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
7968 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
7969 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7970 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7971 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
7972 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7974 <H2> 6.5 Shell Arithmetic </H2>
7975 <!--docid::SEC84::-->
7978 The shell allows arithmetic expressions to be evaluated, as one of
7979 the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option
7980 to the <CODE>declare</CODE> builtins.
7983 Evaluation is done in fixed-width integers with no check for overflow,
7984 though division by 0 is trapped and flagged as an error.
7985 The operators and their precedence, associativity, and values
7986 are the same as in the C language.
7987 The following list of operators is grouped into levels of
7988 equal-precedence operators.
7989 The levels are listed in order of decreasing precedence.
7994 <DT><CODE><VAR>id</VAR>++ <VAR>id</VAR>--</CODE>
7995 <DD>variable post-increment and post-decrement
7998 <DT><CODE>++<VAR>id</VAR> --<VAR>id</VAR></CODE>
7999 <DD>variable pre-increment and pre-decrement
8002 <DT><CODE>- +</CODE>
8003 <DD>unary minus and plus
8006 <DT><CODE>! ~</CODE>
8007 <DD>logical and bitwise negation
8014 <DT><CODE>* / %</CODE>
8015 <DD>multiplication, division, remainder
8018 <DT><CODE>+ -</CODE>
8019 <DD>addition, subtraction
8022 <DT><CODE><< >></CODE>
8023 <DD>left and right bitwise shifts
8026 <DT><CODE><= >= < ></CODE>
8030 <DT><CODE>== !=</CODE>
8031 <DD>equality and inequality
8034 <DT><CODE>&</CODE>
8039 <DD>bitwise exclusive OR
8046 <DT><CODE>&&</CODE>
8054 <DT><CODE>expr ? expr : expr</CODE>
8055 <DD>conditional operator
8058 <DT><CODE>= *= /= %= += -= <<= >>= &= ^= |=</CODE>
8062 <DT><CODE>expr1 , expr2</CODE>
8067 Shell variables are allowed as operands; parameter expansion is
8068 performed before the expression is evaluated.
8069 Within an expression, shell variables may also be referenced by name
8070 without using the parameter expansion syntax.
8071 A shell variable that is null or unset evaluates to 0 when referenced
8072 by name without using the parameter expansion syntax.
8073 The value of a variable is evaluated as an arithmetic expression
8074 when it is referenced, or when a variable which has been given the
8075 <VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value.
8076 A null value evaluates to 0.
8077 A shell variable need not have its <VAR>integer</VAR> attribute turned on
8078 to be used in an expression.
8081 Constants with a leading 0 are interpreted as octal numbers.
8082 A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal. Otherwise,
8083 numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where the optional <VAR>base</VAR>
8084 is a decimal number between 2 and 64 representing the arithmetic
8085 base, and <VAR>n</VAR> is a number in that base. If <VAR>base</VAR><CODE>#</CODE> is
8086 omitted, then base 10 is used.
8087 The digits greater than 9 are represented by the lowercase letters,
8088 the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order.
8089 If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase
8090 letters may be used interchangeably to represent numbers between 10
8094 Operators are evaluated in order of precedence. Sub-expressions in
8095 parentheses are evaluated first and may override the precedence
8099 <A NAME="Aliases"></A>
8101 <A NAME="SEC85"></A>
8102 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8103 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> < </A>]</TD>
8104 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> > </A>]</TD>
8105 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> << </A>]</TD>
8106 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8107 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
8108 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8109 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8110 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8111 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8113 <H2> 6.6 Aliases </H2>
8114 <!--docid::SEC85::-->
8117 <VAR>Aliases</VAR> allow a string to be substituted for a word when it is used
8118 as the first word of a simple command.
8119 The shell maintains a list of aliases that may be set and unset with
8120 the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands.
8123 The first word of each simple command, if unquoted, is checked to see
8125 If so, that word is replaced by the text of the alias.
8126 The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the
8127 shell metacharacters or quoting characters listed above may not appear
8129 The replacement text may contain any valid
8130 shell input, including shell metacharacters.
8131 The first word of the replacement text is tested for
8132 aliases, but a word that is identical to an alias being expanded
8133 is not expanded a second time.
8134 This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>,
8135 for instance, and Bash does not try to recursively expand the
8136 replacement text. If the last character of the alias value is a
8137 space or tab character, then the next command word following the
8138 alias is also checked for alias expansion.
8141 Aliases are created and listed with the <CODE>alias</CODE>
8142 command, and removed with the <CODE>unalias</CODE> command.
8145 There is no mechanism for using arguments in the replacement text,
8146 as in <CODE>csh</CODE>.
8147 If arguments are needed, a shell function should be used
8148 (see section <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>).
8151 Aliases are not expanded when the shell is not interactive,
8152 unless the <CODE>expand_aliases</CODE> shell option is set using
8153 <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
8156 The rules concerning the definition and use of aliases are
8157 somewhat confusing. Bash
8158 always reads at least one complete line
8159 of input before executing any
8160 of the commands on that line. Aliases are expanded when a
8161 command is read, not when it is executed. Therefore, an
8162 alias definition appearing on the same line as another
8163 command does not take effect until the next line of input is read.
8164 The commands following the alias definition
8165 on that line are not affected by the new alias.
8166 This behavior is also an issue when functions are executed.
8167 Aliases are expanded when a function definition is read,
8168 not when the function is executed, because a function definition
8169 is itself a compound command. As a consequence, aliases
8170 defined in a function are not available until after that
8171 function is executed. To be safe, always put
8172 alias definitions on a separate line, and do not use <CODE>alias</CODE>
8173 in compound commands.
8176 For almost every purpose, shell functions are preferred over aliases.
8179 <A NAME="Arrays"></A>
8181 <A NAME="SEC86"></A>
8182 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8183 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> < </A>]</TD>
8184 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> > </A>]</TD>
8185 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> << </A>]</TD>
8186 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8187 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
8188 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8189 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8190 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8191 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8193 <H2> 6.7 Arrays </H2>
8194 <!--docid::SEC86::-->
8197 Bash provides one-dimensional indexed and associative array variables.
8198 Any variable may be used as an indexed array;
8199 the <CODE>declare</CODE> builtin will explicitly declare an array.
8201 limit on the size of an array, nor any requirement that members
8202 be indexed or assigned contiguously.
8203 Indexed arrays are referenced using integers (including arithmetic
8204 expressions (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>) and are zero-based;
8205 associative arrays use arbitrary strings.
8208 An indexed array is created automatically if any variable is assigned to
8210 <TABLE><tr><td> </td><td class=example><pre>name[<VAR>subscript</VAR>]=<VAR>value</VAR>
8211 </pre></td></tr></table></P><P>
8213 The <VAR>subscript</VAR>
8214 is treated as an arithmetic expression that must evaluate to a number.
8215 If <VAR>subscript</VAR> evaluates to a number less than zero, it is used as
8216 an offset from one greater than the array's maximum index (so a subcript
8217 of -1 refers to the last element of the array).
8218 To explicitly declare an array, use
8219 <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR>
8220 </pre></td></tr></table>The syntax
8221 <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>]
8222 </pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored.
8225 Associative arrays are created using
8226 <TABLE><tr><td> </td><td class=example><pre>declare -A <VAR>name</VAR>.
8227 </pre></td></tr></table></P><P>
8230 specified for an array variable using the <CODE>declare</CODE> and
8231 <CODE>readonly</CODE> builtins. Each attribute applies to all members of
8235 Arrays are assigned to using compound assignments of the form
8236 <TABLE><tr><td> </td><td class=example><pre>name=(value<VAR>1</VAR> <small>...</small> value<VAR>n</VAR>)
8237 </pre></td></tr></table>where each
8238 <VAR>value</VAR> is of the form <CODE>[<VAR>subscript</VAR>]=</CODE><VAR>string</VAR>.
8239 Indexed array assignments do not require the bracket and subscript.
8240 When assigning to indexed arrays, if
8241 the optional subscript is supplied, that index is assigned to;
8242 otherwise the index of the element assigned is the last index assigned
8243 to by the statement plus one. Indexing starts at zero.
8246 When assigning to an associative array, the subscript is required.
8249 This syntax is also accepted by the <CODE>declare</CODE>
8250 builtin. Individual array elements may be assigned to using the
8251 <CODE>name[</CODE><VAR>subscript</VAR><CODE>]=</CODE><VAR>value</VAR> syntax introduced above.
8254 Any element of an array may be referenced using
8255 <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
8256 The braces are required to avoid
8257 conflicts with the shell's filename expansion operators. If the
8258 <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members
8259 of the array <VAR>name</VAR>. These subscripts differ only when the word
8260 appears within double quotes.
8261 If the word is double-quoted,
8262 <CODE>${name[*]}</CODE> expands to a single word with
8263 the value of each array member separated by the first character of the
8264 <CODE>IFS</CODE> variable, and <CODE>${name[@]}</CODE> expands each element of
8265 <VAR>name</VAR> to a separate word. When there are no array members,
8266 <CODE>${name[@]}</CODE> expands to nothing.
8267 If the double-quoted expansion occurs within a word, the expansion of
8268 the first parameter is joined with the beginning part of the original
8269 word, and the expansion of the last parameter is joined with the last
8270 part of the original word.
8271 This is analogous to the
8272 expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>.
8273 <CODE>${#name[</CODE><VAR>subscript</VAR><CODE>]}</CODE> expands to the length of
8274 <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
8275 If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or
8276 <SAMP>`*'</SAMP>, the expansion is the number of elements in the array.
8277 Referencing an array variable without a subscript is equivalent to
8278 referencing with a subscript of 0.
8281 An array variable is considered set if a subscript has been assigned a
8282 value. The null string is a valid value.
8285 The <CODE>unset</CODE> builtin is used to destroy arrays.
8286 <CODE>unset</CODE> <VAR>name</VAR>[<VAR>subscript</VAR>]
8287 destroys the array element at index <VAR>subscript</VAR>.
8288 Care must be taken to avoid unwanted side effects caused by filename
8290 <CODE>unset</CODE> <VAR>name</VAR>, where <VAR>name</VAR> is an array, removes the
8291 entire array. A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the
8295 The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE>
8296 builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed
8297 array and a <SAMP>`-A'</SAMP> option to specify an associative array.
8298 The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP>
8299 option to assign a list of words read from the standard input
8300 to an array, and can read values from the standard input into
8301 individual array elements. The <CODE>set</CODE> and <CODE>declare</CODE>
8302 builtins display array values in a way that allows them to be
8306 <A NAME="The Directory Stack"></A>
8308 <A NAME="SEC87"></A>
8309 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8310 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> < </A>]</TD>
8311 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> > </A>]</TD>
8312 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> << </A>]</TD>
8313 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8314 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> >> </A>]</TD>
8315 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8316 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8317 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8318 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8320 <H2> 6.8 The Directory Stack </H2>
8321 <!--docid::SEC87::-->
8324 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8325 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate
8326 the directory stack.</TD></TR>
8327 </TABLE></BLOCKQUOTE>
8330 The directory stack is a list of recently-visited directories. The
8331 <CODE>pushd</CODE> builtin adds directories to the stack as it changes
8332 the current directory, and the <CODE>popd</CODE> builtin removes specified
8333 directories from the stack and changes the current directory to
8334 the directory removed. The <CODE>dirs</CODE> builtin displays the contents
8335 of the directory stack.
8338 The contents of the directory stack are also visible
8339 as the value of the <CODE>DIRSTACK</CODE> shell variable.
8342 <A NAME="Directory Stack Builtins"></A>
8344 <A NAME="SEC88"></A>
8345 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8346 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> < </A>]</TD>
8347 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> > </A>]</TD>
8348 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> << </A>]</TD>
8349 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> Up </A>]</TD>
8350 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> >> </A>]</TD>
8351 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8352 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8353 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8354 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8356 <H3> 6.8.1 Directory Stack Builtins </H3>
8357 <!--docid::SEC88::-->
8362 <DT><CODE>dirs</CODE>
8363 <DD><A NAME="IDX302"></A>
8364 <TABLE><tr><td> </td><td class=example><pre>dirs [+<VAR>N</VAR> | -<VAR>N</VAR>] [-clpv]
8365 </pre></td></tr></table>Display the list of currently remembered directories. Directories
8366 are added to the list with the <CODE>pushd</CODE> command; the
8367 <CODE>popd</CODE> command removes directories from the list.
8369 <DT><CODE>+<VAR>N</VAR></CODE>
8370 <DD>Displays the <VAR>N</VAR>th directory (counting from the left of the
8371 list printed by <CODE>dirs</CODE> when invoked without options), starting
8373 <DT><CODE>-<VAR>N</VAR></CODE>
8374 <DD>Displays the <VAR>N</VAR>th directory (counting from the right of the
8375 list printed by <CODE>dirs</CODE> when invoked without options), starting
8378 <DD>Clears the directory stack by deleting all of the elements.
8380 <DD>Produces a longer listing; the default listing format uses a
8381 tilde to denote the home directory.
8383 <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8386 <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8387 line, prefixing each entry with its index in the stack.
8391 <DT><CODE>popd</CODE>
8392 <DD><A NAME="IDX303"></A>
8393 <TABLE><tr><td> </td><td class=example><pre>popd [+<VAR>N</VAR> | -<VAR>N</VAR>] [-n]
8394 </pre></td></tr></table><P>
8396 Remove the top entry from the directory stack, and <CODE>cd</CODE>
8397 to the new top directory.
8398 When no arguments are given, <CODE>popd</CODE>
8399 removes the top directory from the stack and
8400 performs a <CODE>cd</CODE> to the new top directory. The
8401 elements are numbered from 0 starting at the first directory listed with
8402 <CODE>dirs</CODE>; i.e., <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>.
8404 <DT><CODE>+<VAR>N</VAR></CODE>
8405 <DD>Removes the <VAR>N</VAR>th directory (counting from the left of the
8406 list printed by <CODE>dirs</CODE>), starting with zero.
8407 <DT><CODE>-<VAR>N</VAR></CODE>
8408 <DD>Removes the <VAR>N</VAR>th directory (counting from the right of the
8409 list printed by <CODE>dirs</CODE>), starting with zero.
8411 <DD>Suppresses the normal change of directory when removing directories
8412 from the stack, so that only the stack is manipulated.
8416 <A NAME="IDX304"></A>
8417 <DT><CODE>pushd</CODE>
8418 <DD><TABLE><tr><td> </td><td class=example><pre>pushd [-n] [<VAR>+N</VAR> | <VAR>-N</VAR> | <VAR>dir</VAR> ]
8419 </pre></td></tr></table><P>
8421 Save the current directory on the top of the directory stack
8422 and then <CODE>cd</CODE> to <VAR>dir</VAR>.
8423 With no arguments, <CODE>pushd</CODE> exchanges the top two directories.
8428 <DD>Suppresses the normal change of directory when adding directories
8429 to the stack, so that only the stack is manipulated.
8430 <DT><CODE>+<VAR>N</VAR></CODE>
8431 <DD>Brings the <VAR>N</VAR>th directory (counting from the left of the
8432 list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8433 the list by rotating the stack.
8434 <DT><CODE>-<VAR>N</VAR></CODE>
8435 <DD>Brings the <VAR>N</VAR>th directory (counting from the right of the
8436 list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8437 the list by rotating the stack.
8438 <DT><CODE><VAR>dir</VAR></CODE>
8439 <DD>Makes the current working directory be the top of the stack, and then
8440 executes the equivalent of `<CODE>cd</CODE> <VAR>dir</VAR>'.
8441 <CODE>cd</CODE>s to <VAR>dir</VAR>.
8448 <A NAME="Printing a Prompt"></A>
8450 <A NAME="SEC89"></A>
8451 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8452 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> < </A>]</TD>
8453 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> > </A>]</TD>
8454 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> << </A>]</TD>
8455 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8456 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
8457 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8458 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8459 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8460 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8462 <H2> 6.9 Controlling the Prompt </H2>
8463 <!--docid::SEC89::-->
8466 The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before
8467 Bash prints each primary prompt. If <CODE>PROMPT_COMMAND</CODE> is set and
8468 has a non-null value, then the
8469 value is executed just as if it had been typed on the command line.
8472 In addition, the following table describes the special characters which
8473 can appear in the prompt variables:
8478 <DD>A bell character.
8480 <DD>The date, in "Weekday Month Date" format (e.g., "Tue May 26").
8481 <DT><CODE>\D{<VAR>format</VAR>}</CODE>
8482 <DD>The <VAR>format</VAR> is passed to <CODE>strftime</CODE>(3) and the result is inserted
8483 into the prompt string; an empty <VAR>format</VAR> results in a locale-specific
8484 time representation. The braces are required.
8486 <DD>An escape character.
8488 <DD>The hostname, up to the first `.'.
8492 <DD>The number of jobs currently managed by the shell.
8494 <DD>The basename of the shell's terminal device name.
8498 <DD>A carriage return.
8500 <DD>The name of the shell, the basename of <CODE>$0</CODE> (the portion
8501 following the final slash).
8503 <DD>The time, in 24-hour HH:MM:SS format.
8505 <DD>The time, in 12-hour HH:MM:SS format.
8507 <DD>The time, in 12-hour am/pm format.
8509 <DD>The time, in 24-hour HH:MM format.
8511 <DD>The username of the current user.
8513 <DD>The version of Bash (e.g., 2.00)
8515 <DD>The release of Bash, version + patchlevel (e.g., 2.00.0)
8517 <DD>The current working directory, with <CODE>$HOME</CODE> abbreviated with a tilde
8518 (uses the <CODE>$PROMPT_DIRTRIM</CODE> variable).
8520 <DD>The basename of <CODE>$PWD</CODE>, with <CODE>$HOME</CODE> abbreviated with a tilde.
8522 <DD>The history number of this command.
8524 <DD>The command number of this command.
8526 <DD>If the effective uid is 0, <CODE>#</CODE>, otherwise <CODE>$</CODE>.
8527 <DT><CODE>\<VAR>nnn</VAR></CODE>
8528 <DD>The character whose ASCII code is the octal value <VAR>nnn</VAR>.
8532 <DD>Begin a sequence of non-printing characters. This could be used to
8533 embed a terminal control sequence into the prompt.
8535 <DD>End a sequence of non-printing characters.
8539 The command number and the history number are usually different:
8540 the history number of a command is its position in the history
8541 list, which may include commands restored from the history file
8542 (see section <A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>), while the command number is
8543 the position in the sequence of commands executed during the current
8547 After the string is decoded, it is expanded via
8548 parameter expansion, command substitution, arithmetic
8549 expansion, and quote removal, subject to the value of the
8550 <CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
8553 <A NAME="The Restricted Shell"></A>
8555 <A NAME="SEC90"></A>
8556 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8557 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> < </A>]</TD>
8558 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> > </A>]</TD>
8559 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> << </A>]</TD>
8560 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8561 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
8562 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8563 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8564 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8565 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8567 <H2> 6.10 The Restricted Shell </H2>
8568 <!--docid::SEC90::-->
8571 If Bash is started with the name <CODE>rbash</CODE>, or the
8572 <SAMP>`--restricted'</SAMP>
8575 option is supplied at invocation, the shell becomes restricted.
8576 A restricted shell is used to
8577 set up an environment more controlled than the standard shell.
8578 A restricted shell behaves identically to <CODE>bash</CODE>
8579 with the exception that the following are disallowed or not performed:
8584 Changing directories with the <CODE>cd</CODE> builtin.
8586 Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>,
8587 <CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables.
8589 Specifying command names containing slashes.
8591 Specifying a filename containing a slash as an argument to the <CODE>.</CODE>
8594 Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP>
8595 option to the <CODE>hash</CODE> builtin command.
8597 Importing function definitions from the shell environment at startup.
8599 Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup.
8601 Redirecting output using the <SAMP>`>'</SAMP>, <SAMP>`>|'</SAMP>, <SAMP>`<>'</SAMP>, <SAMP>`>&'</SAMP>,
8602 <SAMP>`&>'</SAMP>, and <SAMP>`>>'</SAMP> redirection operators.
8604 Using the <CODE>exec</CODE> builtin to replace the shell with another command.
8606 Adding or deleting builtin commands with the
8607 <SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin.
8609 Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins.
8611 Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin.
8613 Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>.
8617 These restrictions are enforced after any startup files are read.
8620 When a command that is found to be a shell script is executed
8621 (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in
8622 the shell spawned to execute the script.
8625 <A NAME="Bash POSIX Mode"></A>
8627 <A NAME="SEC91"></A>
8628 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8629 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> < </A>]</TD>
8630 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> > </A>]</TD>
8631 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> << </A>]</TD>
8632 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8633 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> >> </A>]</TD>
8634 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8635 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8636 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8637 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8639 <H2> 6.11 Bash POSIX Mode </H2>
8640 <!--docid::SEC91::-->
8643 Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing
8644 <SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more
8645 closely to the POSIX standard by changing the behavior to
8646 match that specified by POSIX in areas where the Bash default differs.
8649 When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the
8653 The following list is what's changed when `POSIX mode' is in effect:
8658 When a command in the hash table no longer exists, Bash will re-search
8659 <CODE>$PATH</CODE> to find the new location. This is also available with
8660 <SAMP>`shopt -s checkhash'</SAMP>.
8664 The message printed by the job control code and builtins when a job
8665 exits with a non-zero status is `Done(status)'.
8669 The message printed by the job control code and builtins when a job
8670 is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for
8671 example, <CODE>SIGTSTP</CODE>.
8675 The <CODE>bg</CODE> builtin uses the required format to describe each job placed
8676 in the background, which does not include an indication of whether the job
8677 is the current or previous job.
8681 Reserved words appearing in a context where reserved words are recognized
8682 do not undergo alias expansion.
8686 The POSIX <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to
8687 the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled,
8688 and parameter expansion is performed on the values of <CODE>PS1</CODE> and
8689 <CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option.
8693 The POSIX startup files are executed (<CODE>$ENV</CODE>) rather than
8694 the normal Bash files.
8698 Tilde expansion is only performed on assignments preceding a command
8699 name, rather than on all assignment statements on the line.
8703 The default history file is <TT>`~/.sh_history'</TT> (this is the
8704 default value of <CODE>$HISTFILE</CODE>).
8708 The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line,
8709 separated by spaces, without the <SAMP>`SIG'</SAMP> prefix.
8713 The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP>
8718 Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR>
8723 Non-interactive shells exit if a syntax error in an arithmetic expansion
8724 results in an invalid expression.
8728 Non-interactive shells exit if there is a syntax error in a script read
8729 with the <CODE>.</CODE> or <CODE>source</CODE> builtins, or in a string processed by
8730 the <CODE>eval</CODE> builtin.
8734 Redirection operators do not perform filename expansion on the word
8735 in the redirection unless the shell is interactive.
8739 Redirection operators do not perform word splitting on the word in the
8744 Function names must be valid shell <CODE>name</CODE>s. That is, they may not
8745 contain characters other than letters, digits, and underscores, and
8746 may not start with a digit. Declaring a function with an invalid name
8747 causes a fatal syntax error in non-interactive shells.
8751 POSIX special builtins are found before shell functions
8752 during command lookup.
8756 The <CODE>time</CODE> reserved word may be used by itself as a command. When
8757 used in this way, it displays timing statistics for the shell and its
8758 completed children. The <CODE>TIMEFORMAT</CODE> variable controls the format
8759 of the timing information.
8763 When parsing and expanding a ${<small>...</small>} expansion that appears within
8764 double quotes, single quotes are no longer special and cannot be used to
8765 quote a closing brace or other special character, unless the operator is
8766 one of those defined to perform pattern removal. In this case, they do
8767 not have to appear as matched pairs.
8771 The parser does not recognize <CODE>time</CODE> as a reserved word if the next
8772 token begins with a <SAMP>`-'</SAMP>.
8776 If a POSIX special builtin returns an error status, a
8777 non-interactive shell exits. The fatal errors are those listed in
8778 the POSIX standard, and include things like passing incorrect options,
8779 redirection errors, variable assignment errors for assignments preceding
8780 the command name, and so on.
8784 A non-interactive shell exits with an error status if a variable
8785 assignment error occurs when no command name follows the assignment
8787 A variable assignment error occurs, for example, when trying to assign
8788 a value to a readonly variable.
8792 A non-interactive shell exists with an error status if a variable
8793 assignment error occurs in an assignment statement preceding a special
8794 builtin, but not with any other simple command.
8798 A non-interactive shell exits with an error status if the iteration
8799 variable in a <CODE>for</CODE> statement or the selection variable in a
8800 <CODE>select</CODE> statement is a readonly variable.
8804 Process substitution is not available.
8808 Assignment statements preceding POSIX special builtins
8809 persist in the shell environment after the builtin completes.
8813 Assignment statements preceding shell function calls persist in the
8814 shell environment after the function returns, as if a POSIX
8815 special builtin command had been executed.
8819 The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their
8820 output in the format required by POSIX.
8824 The <CODE>trap</CODE> builtin displays signal names without the leading
8829 The <CODE>trap</CODE> builtin doesn't check the first argument for a possible
8830 signal specification and revert the signal handling to the original
8831 disposition if it is, unless that argument consists solely of digits and
8832 is a valid signal number. If users want to reset the handler for a given
8833 signal to the original disposition, they should use <SAMP>`-'</SAMP> as the
8838 The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory
8839 for the filename argument if it is not found by searching <CODE>PATH</CODE>.
8843 Subshells spawned to execute command substitutions inherit the value of
8844 the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
8845 Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
8849 Alias expansion is always enabled, even in non-interactive shells.
8853 When the <CODE>alias</CODE> builtin displays alias definitions, it does not
8854 display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option
8859 When the <CODE>set</CODE> builtin is invoked without options, it does not display
8860 shell function names and definitions.
8864 When the <CODE>set</CODE> builtin is invoked without options, it displays
8865 variable values without quotes, unless they contain shell metacharacters,
8866 even if the result contains nonprinting characters.
8870 When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname
8871 constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument
8872 does not refer to an existing directory, <CODE>cd</CODE> will fail instead of
8873 falling back to <VAR>physical</VAR> mode.
8877 The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the
8878 current directory, even if it is not asked to check the file system with the
8879 <SAMP>`-P'</SAMP> option.
8883 When listing the history, the <CODE>fc</CODE> builtin does not include an
8884 indication of whether or not a history entry has been modified.
8888 The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>.
8892 The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable
8893 file as having been found, though the shell will attempt to execute such a
8894 file if it is the only so-named file found in <CODE>$PATH</CODE>.
8898 The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when
8899 the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$VISUAL</CODE> and
8900 <CODE>$EDITOR</CODE>.
8904 When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret
8905 any arguments to <CODE>echo</CODE> as options. Each argument is displayed, after
8906 escape characters are converted.
8910 The <CODE>ulimit</CODE> builtin uses a block size of 512 bytes for the <SAMP>`-c'</SAMP>
8911 and <SAMP>`-f'</SAMP> options.
8915 The arrival of <CODE>SIGCHLD</CODE> when a trap is set on <CODE>SIGCHLD</CODE> does
8916 not interrupt the <CODE>wait</CODE> builtin and cause it to return immediately.
8917 The trap command is run once for each child that exits.
8923 There is other POSIX behavior that Bash does not implement by
8924 default even when in POSIX mode.
8931 The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history
8932 entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to
8933 <CODE>ed</CODE>. <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset.
8937 As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for
8938 the <CODE>echo</CODE> builtin to be fully conformant.
8944 Bash can be configured to be POSIX-conformant by default, by specifying
8945 the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building
8946 (see section <A HREF="bashref.html#SEC135">10.8 Optional Features</A>).
8949 <A NAME="Job Control"></A>
8951 <A NAME="SEC92"></A>
8952 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8953 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> < </A>]</TD>
8954 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> > </A>]</TD>
8955 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> << </A>]</TD>
8956 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
8957 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> >> </A>]</TD>
8958 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8959 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8960 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8961 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8963 <H1> 7. Job Control </H1>
8964 <!--docid::SEC92::-->
8967 This chapter discusses what job control is, how it works, and how
8968 Bash allows you to access its facilities.
8971 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8972 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">7.1 Job Control Basics</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR>
8973 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact
8974 with job control.</TD></TR>
8975 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job
8977 </TABLE></BLOCKQUOTE>
8980 <A NAME="Job Control Basics"></A>
8982 <A NAME="SEC93"></A>
8983 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8984 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> < </A>]</TD>
8985 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> > </A>]</TD>
8986 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> << </A>]</TD>
8987 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> Up </A>]</TD>
8988 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> >> </A>]</TD>
8989 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8990 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8991 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
8992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8994 <H2> 7.1 Job Control Basics </H2>
8995 <!--docid::SEC93::-->
8999 refers to the ability to selectively stop (suspend)
9000 the execution of processes and continue (resume)
9001 their execution at a later point. A user typically employs
9002 this facility via an interactive interface supplied jointly
9003 by the operating system kernel's terminal driver and Bash.
9006 The shell associates a <VAR>job</VAR> with each pipeline. It keeps a
9007 table of currently executing jobs, which may be listed with the
9008 <CODE>jobs</CODE> command. When Bash starts a job
9009 asynchronously, it prints a line that looks
9011 <TABLE><tr><td> </td><td class=example><pre>[1] 25647
9012 </pre></td></tr></table>indicating that this job is job number 1 and that the process ID
9013 of the last process in the pipeline associated with this job is
9014 25647. All of the processes in a single pipeline are members of
9015 the same job. Bash uses the <VAR>job</VAR> abstraction as the
9016 basis for job control.
9019 To facilitate the implementation of the user interface to job
9020 control, the operating system maintains the notion of a current terminal
9021 process group ID. Members of this process group (processes whose
9022 process group ID is equal to the current terminal process group
9023 ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>.
9024 These processes are said to be in the foreground. Background
9025 processes are those whose process group ID differs from the
9026 terminal's; such processes are immune to keyboard-generated
9027 signals. Only foreground processes are allowed to read from or, if
9028 the user so specifies with <CODE>stty tostop</CODE>, write to the terminal.
9029 Background processes which attempt to
9030 read from (write to when <CODE>stty tostop</CODE> is in effect) the
9031 terminal are sent a <CODE>SIGTTIN</CODE> (<CODE>SIGTTOU</CODE>)
9032 signal by the kernel's terminal driver,
9033 which, unless caught, suspends the process.
9036 If the operating system on which Bash is running supports
9037 job control, Bash contains facilities to use it. Typing the
9038 <VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a
9039 process is running causes that process to be stopped and returns
9040 control to Bash. Typing the <VAR>delayed suspend</VAR> character
9041 (typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped
9042 when it attempts to read input from the terminal, and control to
9043 be returned to Bash. The user then manipulates the state of
9044 this job, using the <CODE>bg</CODE> command to continue it in the
9045 background, the <CODE>fg</CODE> command to continue it in the
9046 foreground, or the <CODE>kill</CODE> command to kill it. A <SAMP>`^Z'</SAMP>
9047 takes effect immediately, and has the additional side effect of
9048 causing pending output and typeahead to be discarded.
9051 There are a number of ways to refer to a job in the shell. The
9052 character <SAMP>`%'</SAMP> introduces a job specification (<VAR>jobspec</VAR>).
9055 Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>.
9056 The symbols <SAMP>`%%'</SAMP> and <SAMP>`%+'</SAMP> refer to the shell's notion of the
9057 current job, which is the last job stopped while it was in the foreground
9058 or started in the background.
9059 A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers
9061 The previous job may be referenced using <SAMP>`%-'</SAMP>.
9062 If there is only a single job, <SAMP>`%+'</SAMP> and <SAMP>`%-'</SAMP> can both be used
9063 to refer to that job.
9064 In output pertaining to jobs (e.g., the output of the <CODE>jobs</CODE>
9065 command), the current job is always flagged with a <SAMP>`+'</SAMP>, and the
9066 previous job with a <SAMP>`-'</SAMP>.
9069 A job may also be referred to
9070 using a prefix of the name used to start it, or using a substring
9071 that appears in its command line. For example, <SAMP>`%ce'</SAMP> refers
9072 to a stopped <CODE>ce</CODE> job. Using <SAMP>`%?ce'</SAMP>, on the
9073 other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in
9074 its command line. If the prefix or substring matches more than one job,
9075 Bash reports an error.
9078 Simply naming a job can be used to bring it into the foreground:
9079 <SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the
9080 background into the foreground. Similarly, <SAMP>`%1 &'</SAMP> resumes
9081 job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP>
9084 The shell learns immediately whenever a job changes state.
9085 Normally, Bash waits until it is about to print a prompt
9086 before reporting changes in a job's status so as to not interrupt
9088 If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled,
9089 Bash reports such changes immediately (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
9090 Any trap on <CODE>SIGCHLD</CODE> is executed for each child process
9094 If an attempt to exit Bash is made while jobs are stopped, (or running, if
9095 the <CODE>checkjobs</CODE> option is enabled -- see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), the
9096 shell prints a warning message, and if the <CODE>checkjobs</CODE> option is
9097 enabled, lists the jobs and their statuses.
9098 The <CODE>jobs</CODE> command may then be used to inspect their status.
9099 If a second attempt to exit is made without an intervening command,
9100 Bash does not print another warning, and any stopped jobs are terminated.
9103 <A NAME="Job Control Builtins"></A>
9105 <A NAME="SEC94"></A>
9106 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9107 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> < </A>]</TD>
9108 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> > </A>]</TD>
9109 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD>
9110 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> Up </A>]</TD>
9111 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> >> </A>]</TD>
9112 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9113 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9114 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9115 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9117 <H2> 7.2 Job Control Builtins </H2>
9118 <!--docid::SEC94::-->
9124 <DD><A NAME="IDX305"></A>
9125 <TABLE><tr><td> </td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>]
9126 </pre></td></tr></table>Resume each suspended job <VAR>jobspec</VAR> in the background, as if it
9127 had been started with <SAMP>`&'</SAMP>.
9128 If <VAR>jobspec</VAR> is not supplied, the current job is used.
9129 The return status is zero unless it is run when job control is not
9130 enabled, or, when run with job control enabled, any
9131 <VAR>jobspec</VAR> was not found or specifies a job
9132 that was started without job control.
9136 <DD><A NAME="IDX306"></A>
9137 <TABLE><tr><td> </td><td class=example><pre>fg [<VAR>jobspec</VAR>]
9138 </pre></td></tr></table>Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job.
9139 If <VAR>jobspec</VAR> is not supplied, the current job is used.
9140 The return status is that of the command placed into the foreground,
9141 or non-zero if run when job control is disabled or, when run with
9142 job control enabled, <VAR>jobspec</VAR> does not specify a valid job or
9143 <VAR>jobspec</VAR> specifies a job that was started without job control.
9146 <DT><CODE>jobs</CODE>
9147 <DD><A NAME="IDX307"></A>
9148 <TABLE><tr><td> </td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>]
9149 jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>]
9150 </pre></td></tr></table><P>
9152 The first form lists the active jobs. The options have the
9158 <DD>List process IDs in addition to the normal information.
9162 <DD>Display information only about jobs that have changed status since
9163 the user was last notified of their status.
9167 <DD>List only the process ID of the job's process group leader.
9171 <DD>Restrict output to running jobs.
9175 <DD>Restrict output to stopped jobs.
9179 If <VAR>jobspec</VAR> is given,
9180 output is restricted to information about that job.
9181 If <VAR>jobspec</VAR> is not supplied, the status of all jobs is
9185 If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any
9186 <VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the
9187 corresponding process group ID, and executes <VAR>command</VAR>,
9188 passing it <VAR>argument</VAR>s, returning its exit status.
9191 <DT><CODE>kill</CODE>
9192 <DD><A NAME="IDX308"></A>
9193 <TABLE><tr><td> </td><td class=example><pre>kill [-s <VAR>sigspec</VAR>] [-n <VAR>signum</VAR>] [-<VAR>sigspec</VAR>] <VAR>jobspec</VAR> or <VAR>pid</VAR>
9194 kill -l [<VAR>exit_status</VAR>]
9195 </pre></td></tr></table>Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process
9196 named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>.
9197 <VAR>sigspec</VAR> is either a case-insensitive signal name such as
9198 <CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix)
9199 or a signal number; <VAR>signum</VAR> is a signal number.
9200 If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used.
9201 The <SAMP>`-l'</SAMP> option lists the signal names.
9202 If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the
9203 signals corresponding to the arguments are listed, and the return status
9205 <VAR>exit_status</VAR> is a number specifying a signal number or the exit
9206 status of a process terminated by a signal.
9207 The return status is zero if at least one signal was successfully sent,
9208 or non-zero if an error occurs or an invalid option is encountered.
9211 <DT><CODE>wait</CODE>
9212 <DD><A NAME="IDX309"></A>
9213 <TABLE><tr><td> </td><td class=example><pre>wait [<VAR>jobspec</VAR> or <VAR>pid</VAR> ...]
9214 </pre></td></tr></table>Wait until the child process specified by each process ID <VAR>pid</VAR>
9215 or job specification <VAR>jobspec</VAR> exits and return the exit status of the
9216 last command waited for.
9217 If a job spec is given, all processes in the job are waited for.
9218 If no arguments are given, all currently active child processes are
9219 waited for, and the return status is zero.
9220 If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process
9221 of the shell, the return status is 127.
9224 <DT><CODE>disown</CODE>
9225 <DD><A NAME="IDX310"></A>
9226 <TABLE><tr><td> </td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>]
9227 </pre></td></tr></table>Without options, each <VAR>jobspec</VAR> is removed from the table of
9229 If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table,
9230 but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell
9231 receives a <CODE>SIGHUP</CODE>.
9232 If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor <SAMP>`-r'</SAMP>
9233 option is supplied, the current job is used.
9234 If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or
9235 mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR>
9236 argument restricts operation to running jobs.
9239 <DT><CODE>suspend</CODE>
9240 <DD><A NAME="IDX311"></A>
9241 <TABLE><tr><td> </td><td class=example><pre>suspend [-f]
9242 </pre></td></tr></table>Suspend the execution of this shell until it receives a
9243 <CODE>SIGCONT</CODE> signal.
9244 A login shell cannot be suspended; the <SAMP>`-f'</SAMP>
9245 option can be used to override this and force the suspension.
9251 When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE>
9252 builtins do not accept <VAR>jobspec</VAR> arguments. They must be
9253 supplied process IDs.
9256 <A NAME="Job Control Variables"></A>
9258 <A NAME="SEC95"></A>
9259 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9260 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> < </A>]</TD>
9261 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> > </A>]</TD>
9262 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> << </A>]</TD>
9263 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> Up </A>]</TD>
9264 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> >> </A>]</TD>
9265 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9266 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9267 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9268 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9270 <H2> 7.3 Job Control Variables </H2>
9271 <!--docid::SEC95::-->
9276 <A NAME="IDX312"></A>
9277 <DT><CODE>auto_resume</CODE>
9278 <DD><A NAME="IDX313"></A>
9279 This variable controls how the shell interacts with the user and
9280 job control. If this variable exists then single word simple
9281 commands without redirections are treated as candidates for resumption
9282 of an existing job. There is no ambiguity allowed; if there is
9283 more than one job beginning with the string typed, then
9284 the most recently accessed job will be selected.
9285 The name of a stopped job, in this context, is the command line
9286 used to start it. If this variable is set to the value <SAMP>`exact'</SAMP>,
9287 the string supplied must match the name of a stopped job exactly;
9288 if set to <SAMP>`substring'</SAMP>,
9289 the string supplied needs to match a substring of the name of a
9290 stopped job. The <SAMP>`substring'</SAMP> value provides functionality
9291 analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC93">7.1 Job Control Basics</A>).
9292 If set to any other value, the supplied string must
9293 be a prefix of a stopped job's name; this provides functionality
9294 analogous to the <SAMP>`%'</SAMP> job ID.
9300 <A NAME="IDX314"></A>
9303 <A NAME="Command Line Editing"></A>
9305 <A NAME="SEC96"></A>
9306 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9307 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> < </A>]</TD>
9308 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> > </A>]</TD>
9309 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> << </A>]</TD>
9310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
9311 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> >> </A>]</TD>
9312 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9313 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9314 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9315 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9317 <H1> 8. Command Line Editing </H1>
9318 <!--docid::SEC96::-->
9321 This chapter describes the basic features of the GNU
9322 command line editing interface.
9323 Command line editing is provided by the Readline library, which is
9324 used by several different programs, including Bash.
9325 Command line editing is enabled by default when using an interactive shell,
9326 unless the <SAMP>`--noediting'</SAMP> option is supplied at shell invocation.
9327 Line editing is also used when using the <SAMP>`-e'</SAMP> option to the
9328 <CODE>read</CODE> builtin command (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
9329 By default, the line editing commands are similar to those of Emacs.
9330 A vi-style line editing interface is also available.
9331 Line editing can be enabled at any time using the <SAMP>`-o emacs'</SAMP> or
9332 <SAMP>`-o vi'</SAMP> options to the <CODE>set</CODE> builtin command
9333 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>), or disabled using the <SAMP>`+o emacs'</SAMP> or
9334 <SAMP>`+o vi'</SAMP> options to <CODE>set</CODE>.
9337 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9338 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.1 Introduction to Line Editing</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR>
9339 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC98">8.2 Readline Interaction</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR>
9340 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC104">8.3 Readline Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR>
9341 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC108">8.4 Bindable Readline Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands
9342 available for binding</TD></TR>
9343 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">8.5 Readline vi Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline
9344 behave like the vi editor.</TD></TR>
9345 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">8.6 Programmable Completion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for
9346 a specific command.</TD></TR>
9347 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to
9348 complete arguments for a particular command.</TD></TR>
9349 </TABLE></BLOCKQUOTE>
9352 <A NAME="Introduction and Notation"></A>
9354 <A NAME="SEC97"></A>
9355 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9356 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> < </A>]</TD>
9357 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> > </A>]</TD>
9358 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> << </A>]</TD>
9359 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
9360 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> >> </A>]</TD>
9361 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9362 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9363 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9364 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9366 <H2> 8.1 Introduction to Line Editing </H2>
9367 <!--docid::SEC97::-->
9370 The following paragraphs describe the notation used to represent
9374 The text <KBD>C-k</KBD> is read as `Control-K' and describes the character
9375 produced when the <KBD>k</KBD> key is pressed while the Control key
9379 The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character
9380 produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD>
9382 The Meta key is labeled <KBD>ALT</KBD> on many keyboards.
9383 On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of
9384 the space bar), the <KBD>ALT</KBD> on the left side is generally set to
9386 The <KBD>ALT</KBD> key on the right may also be configured to work as a
9387 Meta key or may be configured as some other modifier, such as a
9388 Compose key for typing accented characters.
9391 If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as
9392 a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD>
9393 <EM>first</EM>, and then typing <KBD>k</KBD>.
9394 Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key.
9397 The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the
9398 character produced by <EM>metafying</EM> <KBD>C-k</KBD>.
9401 In addition, several keys have their own names. Specifically,
9402 <KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all
9403 stand for themselves when seen in this text, or in an init file
9404 (see section <A HREF="bashref.html#SEC104">8.3 Readline Init File</A>).
9405 If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will
9406 produce the desired character.
9407 The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on
9411 <A NAME="Readline Interaction"></A>
9413 <A NAME="SEC98"></A>
9414 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9415 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> < </A>]</TD>
9416 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> > </A>]</TD>
9417 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> << </A>]</TD>
9418 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
9419 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> >> </A>]</TD>
9420 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9421 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9422 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9423 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9425 <H2> 8.2 Readline Interaction </H2>
9426 <!--docid::SEC98::-->
9429 Often during an interactive session you type in a long line of text,
9430 only to notice that the first word on the line is misspelled. The
9431 Readline library gives you a set of commands for manipulating the text
9432 as you type it in, allowing you to just fix your typo, and not forcing
9433 you to retype the majority of the line. Using these editing commands,
9434 you move the cursor to the place that needs correction, and delete or
9435 insert the text of the corrections. Then, when you are satisfied with
9436 the line, you simply press <KBD>RET</KBD>. You do not have to be at the
9437 end of the line to press <KBD>RET</KBD>; the entire line is accepted
9438 regardless of the location of the cursor within the line.
9441 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9442 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.2.1 Readline Bare Essentials</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The least you need to know about Readline.</TD></TR>
9443 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">8.2.2 Readline Movement Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR>
9444 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to delete text, and how to get it back!</TD></TR>
9445 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.2.4 Readline Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR>
9446 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.2.5 Searching for Commands in the History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR>
9447 </TABLE></BLOCKQUOTE>
9450 <A NAME="Readline Bare Essentials"></A>
9452 <A NAME="SEC99"></A>
9453 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9454 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> < </A>]</TD>
9455 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> > </A>]</TD>
9456 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> << </A>]</TD>
9457 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
9458 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> >> </A>]</TD>
9459 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9460 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9461 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9462 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9464 <H3> 8.2.1 Readline Bare Essentials </H3>
9465 <!--docid::SEC99::-->
9468 In order to enter characters into the line, simply type them. The typed
9469 character appears where the cursor was, and then the cursor moves one
9470 space to the right. If you mistype a character, you can use your
9471 erase character to back up and delete the mistyped character.
9474 Sometimes you may mistype a character, and
9475 not notice the error until you have typed several other characters. In
9476 that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then
9477 correct your mistake. Afterwards, you can move the cursor to the right
9478 with <KBD>C-f</KBD>.
9481 When you add text in the middle of a line, you will notice that characters
9482 to the right of the cursor are `pushed over' to make room for the text
9483 that you have inserted. Likewise, when you delete text behind the cursor,
9484 characters to the right of the cursor are `pulled back' to fill in the
9485 blank space created by the removal of the text. A list of the bare
9486 essentials for editing the text of an input line follows.
9491 <DD>Move back one character.
9493 <DD>Move forward one character.
9494 <DT><KBD>DEL</KBD> or <KBD>Backspace</KBD>
9495 <DD>Delete the character to the left of the cursor.
9497 <DD>Delete the character underneath the cursor.
9498 <DT>Printing characters
9499 <DD>Insert the character into the line at the cursor.
9500 <DT><KBD>C-_</KBD> or <KBD>C-x C-u</KBD>
9501 <DD>Undo the last editing command. You can undo all the way back to an
9506 (Depending on your configuration, the <KBD>Backspace</KBD> key be set to
9507 delete the character to the left of the cursor and the <KBD>DEL</KBD> key set
9508 to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather
9509 than the character to the left of the cursor.)
9512 <A NAME="Readline Movement Commands"></A>
9514 <A NAME="SEC100"></A>
9515 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9516 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> < </A>]</TD>
9517 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> > </A>]</TD>
9518 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> << </A>]</TD>
9519 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
9520 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> >> </A>]</TD>
9521 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9522 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9523 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9524 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9526 <H3> 8.2.2 Readline Movement Commands </H3>
9527 <!--docid::SEC100::-->
9530 The above table describes the most basic keystrokes that you need
9531 in order to do editing of the input line. For your convenience, many
9532 other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>,
9533 <KBD>C-d</KBD>, and <KBD>DEL</KBD>. Here are some commands for moving more rapidly
9539 <DD>Move to the start of the line.
9541 <DD>Move to the end of the line.
9543 <DD>Move forward a word, where a word is composed of letters and digits.
9545 <DD>Move backward a word.
9547 <DD>Clear the screen, reprinting the current line at the top.
9551 Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves
9552 forward a word. It is a loose convention that control keystrokes
9553 operate on characters while meta keystrokes operate on words.
9556 <A NAME="Readline Killing Commands"></A>
9558 <A NAME="SEC101"></A>
9559 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9560 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> < </A>]</TD>
9561 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> > </A>]</TD>
9562 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> << </A>]</TD>
9563 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
9564 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> >> </A>]</TD>
9565 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9566 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9567 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9568 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9570 <H3> 8.2.3 Readline Killing Commands </H3>
9571 <!--docid::SEC101::-->
9574 <A NAME="IDX315"></A>
9575 <A NAME="IDX316"></A>
9578 <EM>Killing</EM> text means to delete the text from the line, but to save
9579 it away for later use, usually by <EM>yanking</EM> (re-inserting)
9580 it back into the line.
9581 (`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
9584 If the description for a command says that it `kills' text, then you can
9585 be sure that you can get the text back in a different (or the same)
9589 When you use a kill command, the text is saved in a <EM>kill-ring</EM>.
9590 Any number of consecutive kills save all of the killed text together, so
9591 that when you yank it back, you get it all. The kill
9592 ring is not line specific; the text that you killed on a previously
9593 typed line is available to be yanked back later, when you are typing
9595 <A NAME="IDX317"></A>
9598 Here is the list of commands for killing text.
9603 <DD>Kill the text from the current cursor position to the end of the line.
9607 <DD>Kill from the cursor to the end of the current word, or, if between
9608 words, to the end of the next word.
9609 Word boundaries are the same as those used by <KBD>M-f</KBD>.
9612 <DT><KBD>M-<KBD>DEL</KBD></KBD>
9613 <DD>Kill from the cursor the start of the current word, or, if between
9614 words, to the start of the previous word.
9615 Word boundaries are the same as those used by <KBD>M-b</KBD>.
9619 <DD>Kill from the cursor to the previous whitespace. This is different than
9620 <KBD>M-<KBD>DEL</KBD></KBD> because the word boundaries differ.
9626 Here is how to <EM>yank</EM> the text back into the line. Yanking
9627 means to copy the most-recently-killed text from the kill buffer.
9632 <DD>Yank the most recently killed text back into the buffer at the cursor.
9636 <DD>Rotate the kill-ring, and yank the new top. You can only do this if
9637 the prior command is <KBD>C-y</KBD> or <KBD>M-y</KBD>.
9641 <A NAME="Readline Arguments"></A>
9643 <A NAME="SEC102"></A>
9644 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9645 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> < </A>]</TD>
9646 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> > </A>]</TD>
9647 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD>
9648 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
9649 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> >> </A>]</TD>
9650 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9651 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9652 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9653 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9655 <H3> 8.2.4 Readline Arguments </H3>
9656 <!--docid::SEC102::-->
9659 You can pass numeric arguments to Readline commands. Sometimes the
9660 argument acts as a repeat count, other times it is the <I>sign</I> of the
9661 argument that is significant. If you pass a negative argument to a
9662 command which normally acts in a forward direction, that command will
9663 act in a backward direction. For example, to kill text back to the
9664 start of the line, you might type <SAMP>`M-- C-k'</SAMP>.
9667 The general way to pass numeric arguments to a command is to type meta
9668 digits before the command. If the first `digit' typed is a minus
9669 sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative. Once
9670 you have typed one meta digit to get the argument started, you can type
9671 the remainder of the digits, and then the command. For example, to give
9672 the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>,
9673 which will delete the next ten characters on the input line.
9676 <A NAME="Searching"></A>
9678 <A NAME="SEC103"></A>
9679 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9680 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> < </A>]</TD>
9681 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> > </A>]</TD>
9682 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> << </A>]</TD>
9683 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
9684 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> >> </A>]</TD>
9685 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9686 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9687 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9688 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9690 <H3> 8.2.5 Searching for Commands in the History </H3>
9691 <!--docid::SEC103::-->
9694 Readline provides commands for searching through the command history
9695 (see section <A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>)
9696 for lines containing a specified string.
9697 There are two search modes: <EM>incremental</EM> and <EM>non-incremental</EM>.
9700 Incremental searches begin before the user has finished typing the
9702 As each character of the search string is typed, Readline displays
9703 the next entry from the history matching the string typed so far.
9704 An incremental search requires only as many characters as needed to
9705 find the desired history entry.
9706 To search backward in the history for a particular string, type
9707 <KBD>C-r</KBD>. Typing <KBD>C-s</KBD> searches forward through the history.
9708 The characters present in the value of the <CODE>isearch-terminators</CODE> variable
9709 are used to terminate an incremental search.
9710 If that variable has not been assigned a value, the <KBD>ESC</KBD> and
9711 <KBD>C-J</KBD> characters will terminate an incremental search.
9712 <KBD>C-g</KBD> will abort an incremental search and restore the original line.
9713 When the search is terminated, the history entry containing the
9714 search string becomes the current line.
9717 To find other matching entries in the history list, type <KBD>C-r</KBD> or
9718 <KBD>C-s</KBD> as appropriate.
9719 This will search backward or forward in the history for the next
9720 entry matching the search string typed so far.
9721 Any other key sequence bound to a Readline command will terminate
9722 the search and execute that command.
9723 For instance, a <KBD>RET</KBD> will terminate the search and accept
9724 the line, thereby executing the command from the history list.
9725 A movement command will terminate the search, make the last line found
9726 the current line, and begin editing.
9729 Readline remembers the last incremental search string. If two
9730 <KBD>C-r</KBD>s are typed without any intervening characters defining a new
9731 search string, any remembered search string is used.
9734 Non-incremental searches read the entire search string before starting
9735 to search for matching history lines. The search string may be
9736 typed by the user or be part of the contents of the current line.
9739 <A NAME="Readline Init File"></A>
9741 <A NAME="SEC104"></A>
9742 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9743 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> < </A>]</TD>
9744 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> > </A>]</TD>
9745 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> << </A>]</TD>
9746 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
9747 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> >> </A>]</TD>
9748 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9749 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9750 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9751 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9753 <H2> 8.3 Readline Init File </H2>
9754 <!--docid::SEC104::-->
9757 Although the Readline library comes with a set of Emacs-like
9758 keybindings installed by default, it is possible to use a different set
9760 Any user can customize programs that use Readline by putting
9761 commands in an <EM>inputrc</EM> file, conventionally in his home directory.
9763 file is taken from the value of the shell variable <CODE>INPUTRC</CODE>. If
9764 that variable is unset, the default is <TT>`~/.inputrc'</TT>. If that
9765 file does not exist or cannot be read, the ultimate default is
9766 <TT>`/etc/inputrc'</TT>.
9769 When a program which uses the Readline library starts up, the
9770 init file is read, and the key bindings are set.
9773 In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus
9774 incorporating any changes that you might have made to it.
9777 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9778 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Syntax for the commands in the inputrc file.</TD></TR>
9782 <TABLE BORDER=0 CELLSPACING=0>
9783 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC106">8.3.2 Conditional Init Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Conditional key bindings in the inputrc file.</TD></TR>
9787 <TABLE BORDER=0 CELLSPACING=0>
9788 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.3.3 Sample Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">An example inputrc file.</TD></TR>
9789 </TABLE></BLOCKQUOTE>
9792 <A NAME="Readline Init File Syntax"></A>
9794 <A NAME="SEC105"></A>
9795 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9796 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> < </A>]</TD>
9797 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> > </A>]</TD>
9798 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> << </A>]</TD>
9799 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> Up </A>]</TD>
9800 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> >> </A>]</TD>
9801 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9802 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9803 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
9804 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9806 <H3> 8.3.1 Readline Init File Syntax </H3>
9807 <!--docid::SEC105::-->
9810 There are only a few basic constructs allowed in the
9811 Readline init file. Blank lines are ignored.
9812 Lines beginning with a <SAMP>`#'</SAMP> are comments.
9813 Lines beginning with a <SAMP>`$'</SAMP> indicate conditional
9814 constructs (see section <A HREF="bashref.html#SEC106">8.3.2 Conditional Init Constructs</A>). Other lines
9815 denote variable settings and key bindings.
9819 <DT>Variable Settings
9820 <DD>You can modify the run-time behavior of Readline by
9821 altering the values of variables in Readline
9822 using the <CODE>set</CODE> command within the init file.
9823 The syntax is simple:
9826 <TABLE><tr><td> </td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR>
9827 </pre></td></tr></table></P><P>
9829 Here, for example, is how to
9830 change from the default Emacs-like key binding to use
9831 <CODE>vi</CODE> line editing commands:
9834 <TABLE><tr><td> </td><td class=example><pre>set editing-mode vi
9835 </pre></td></tr></table></P><P>
9837 Variable names and values, where appropriate, are recognized without regard
9838 to case. Unrecognized variable names are ignored.
9841 Boolean variables (those that can be set to on or off) are set to on if
9842 the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1. Any other
9843 value results in the variable being set to off.
9846 The <CODE>bind -V</CODE> command lists the current Readline variable names
9847 and values. See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>.
9850 A great deal of run-time behavior is changeable with the following
9854 <A NAME="IDX318"></A>
9857 <DT><CODE>bell-style</CODE>
9858 <DD><A NAME="IDX319"></A>
9859 Controls what happens when Readline wants to ring the terminal bell.
9860 If set to <SAMP>`none'</SAMP>, Readline never rings the bell. If set to
9861 <SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available.
9862 If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring
9863 the terminal's bell.
9866 <DT><CODE>bind-tty-special-chars</CODE>
9867 <DD><A NAME="IDX320"></A>
9868 If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters
9869 treated specially by the kernel's terminal driver to their Readline
9873 <DT><CODE>comment-begin</CODE>
9874 <DD><A NAME="IDX321"></A>
9875 The string to insert at the beginning of the line when the
9876 <CODE>insert-comment</CODE> command is executed. The default value
9877 is <CODE>"#"</CODE>.
9880 <DT><CODE>completion-display-width</CODE>
9881 <DD><A NAME="IDX322"></A>
9882 The number of screen columns used to display possible matches
9883 when performing completion.
9884 The value is ignored if it is less than 0 or greater than the terminal
9886 A value of 0 will cause matches to be displayed one per line.
9887 The default value is -1.
9890 <DT><CODE>completion-ignore-case</CODE>
9891 <DD><A NAME="IDX323"></A>
9892 If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion
9893 in a case-insensitive fashion.
9894 The default value is <SAMP>`off'</SAMP>.
9897 <DT><CODE>completion-map-case</CODE>
9898 <DD><A NAME="IDX324"></A>
9899 If set to <SAMP>`on'</SAMP>, and <VAR>completion-ignore-case</VAR> is enabled, Readline
9900 treats hyphens (<SAMP>`-'</SAMP>) and underscores (<SAMP>`_'</SAMP>) as equivalent when
9901 performing case-insensitive filename matching and completion.
9904 <DT><CODE>completion-prefix-display-length</CODE>
9905 <DD><A NAME="IDX325"></A>
9906 The length in characters of the common prefix of a list of possible
9907 completions that is displayed without modification. When set to a
9908 value greater than zero, common prefixes longer than this value are
9909 replaced with an ellipsis when displaying possible completions.
9912 <DT><CODE>completion-query-items</CODE>
9913 <DD><A NAME="IDX326"></A>
9914 The number of possible completions that determines when the user is
9915 asked whether the list of possibilities should be displayed.
9916 If the number of possible completions is greater than this value,
9917 Readline will ask the user whether or not he wishes to view
9918 them; otherwise, they are simply listed.
9919 This variable must be set to an integer value greater than or equal to 0.
9920 A negative value means Readline should never ask.
9921 The default limit is <CODE>100</CODE>.
9924 <DT><CODE>convert-meta</CODE>
9925 <DD><A NAME="IDX327"></A>
9926 If set to <SAMP>`on'</SAMP>, Readline will convert characters with the
9927 eighth bit set to an ASCII key sequence by stripping the eighth
9928 bit and prefixing an <KBD>ESC</KBD> character, converting them to a
9929 meta-prefixed key sequence. The default value is <SAMP>`on'</SAMP>.
9932 <DT><CODE>disable-completion</CODE>
9933 <DD><A NAME="IDX328"></A>
9934 If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion.
9935 Completion characters will be inserted into the line as if they had
9936 been mapped to <CODE>self-insert</CODE>. The default is <SAMP>`off'</SAMP>.
9939 <DT><CODE>editing-mode</CODE>
9940 <DD><A NAME="IDX329"></A>
9941 The <CODE>editing-mode</CODE> variable controls which default set of
9942 key bindings is used. By default, Readline starts up in Emacs editing
9943 mode, where the keystrokes are most similar to Emacs. This variable can be
9944 set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>.
9947 <DT><CODE>echo-control-characters</CODE>
9948 <DD>When set to <SAMP>`on'</SAMP>, on operating systems that indicate they support it,
9949 readline echoes a character corresponding to a signal generated from the
9950 keyboard. The default is <SAMP>`on'</SAMP>.
9953 <DT><CODE>enable-keypad</CODE>
9954 <DD><A NAME="IDX330"></A>
9955 When set to <SAMP>`on'</SAMP>, Readline will try to enable the application
9956 keypad when it is called. Some systems need this to enable the
9957 arrow keys. The default is <SAMP>`off'</SAMP>.
9960 <DT><CODE>enable-meta-key</CODE>
9961 <DD>When set to <SAMP>`on'</SAMP>, Readline will try to enable any meta modifier
9962 key the terminal claims to support when it is called. On many terminals,
9963 the meta key is used to send eight-bit characters.
9964 The default is <SAMP>`on'</SAMP>.
9967 <DT><CODE>expand-tilde</CODE>
9968 <DD><A NAME="IDX331"></A>
9969 If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline
9970 attempts word completion. The default is <SAMP>`off'</SAMP>.
9973 <DT><CODE>history-preserve-point</CODE>
9974 <DD><A NAME="IDX332"></A>
9975 If set to <SAMP>`on'</SAMP>, the history code attempts to place the point (the
9976 current cursor position) at the
9977 same location on each history line retrieved with <CODE>previous-history</CODE>
9978 or <CODE>next-history</CODE>. The default is <SAMP>`off'</SAMP>.
9981 <DT><CODE>history-size</CODE>
9982 <DD><A NAME="IDX333"></A>
9983 Set the maximum number of history entries saved in the history list. If
9984 set to zero, the number of entries in the history list is not limited.
9987 <DT><CODE>horizontal-scroll-mode</CODE>
9988 <DD><A NAME="IDX334"></A>
9989 This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>. Setting it
9990 to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll
9991 horizontally on a single screen line when they are longer than the width
9992 of the screen, instead of wrapping onto a new screen line. By default,
9993 this variable is set to <SAMP>`off'</SAMP>.
9996 <DT><CODE>input-meta</CODE>
9997 <DD><A NAME="IDX335"></A>
9998 <A NAME="IDX336"></A>
9999 If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it
10000 will not clear the eighth bit in the characters it reads),
10001 regardless of what the terminal claims it can support. The
10002 default value is <SAMP>`off'</SAMP>. The name <CODE>meta-flag</CODE> is a
10003 synonym for this variable.
10006 <DT><CODE>isearch-terminators</CODE>
10007 <DD><A NAME="IDX337"></A>
10008 The string of characters that should terminate an incremental search without
10009 subsequently executing the character as a command (see section <A HREF="bashref.html#SEC103">8.2.5 Searching for Commands in the History</A>).
10010 If this variable has not been given a value, the characters <KBD>ESC</KBD> and
10011 <KBD>C-J</KBD> will terminate an incremental search.
10014 <DT><CODE>keymap</CODE>
10015 <DD><A NAME="IDX338"></A>
10016 Sets Readline's idea of the current keymap for key binding commands.
10017 Acceptable <CODE>keymap</CODE> names are
10018 <CODE>emacs</CODE>,
10019 <CODE>emacs-standard</CODE>,
10020 <CODE>emacs-meta</CODE>,
10021 <CODE>emacs-ctlx</CODE>,
10023 <CODE>vi-move</CODE>,
10024 <CODE>vi-command</CODE>, and
10025 <CODE>vi-insert</CODE>.
10026 <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; <CODE>emacs</CODE> is
10027 equivalent to <CODE>emacs-standard</CODE>. The default value is <CODE>emacs</CODE>.
10028 The value of the <CODE>editing-mode</CODE> variable also affects the
10032 <DT><CODE>mark-directories</CODE>
10033 <DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash
10034 appended. The default is <SAMP>`on'</SAMP>.
10037 <DT><CODE>mark-modified-lines</CODE>
10038 <DD><A NAME="IDX339"></A>
10039 This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an
10040 asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified.
10041 This variable is <SAMP>`off'</SAMP> by default.
10044 <DT><CODE>mark-symlinked-directories</CODE>
10045 <DD><A NAME="IDX340"></A>
10046 If set to <SAMP>`on'</SAMP>, completed names which are symbolic links
10047 to directories have a slash appended (subject to the value of
10048 <CODE>mark-directories</CODE>).
10049 The default is <SAMP>`off'</SAMP>.
10052 <DT><CODE>match-hidden-files</CODE>
10053 <DD><A NAME="IDX341"></A>
10054 This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose
10055 names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename
10057 If set to <SAMP>`off'</SAMP>, the leading <SAMP>`.'</SAMP> must be
10058 supplied by the user in the filename to be completed.
10059 This variable is <SAMP>`on'</SAMP> by default.
10062 <DT><CODE>menu-complete-display-prefix</CODE>
10063 <DD><A NAME="IDX342"></A>
10064 If set to <SAMP>`on'</SAMP>, menu completion displays the common prefix of the
10065 list of possible completions (which may be empty) before cycling through
10066 the list. The default is <SAMP>`off'</SAMP>.
10069 <DT><CODE>output-meta</CODE>
10070 <DD><A NAME="IDX343"></A>
10071 If set to <SAMP>`on'</SAMP>, Readline will display characters with the
10072 eighth bit set directly rather than as a meta-prefixed escape
10073 sequence. The default is <SAMP>`off'</SAMP>.
10076 <DT><CODE>page-completions</CODE>
10077 <DD><A NAME="IDX344"></A>
10078 If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager
10079 to display a screenful of possible completions at a time.
10080 This variable is <SAMP>`on'</SAMP> by default.
10083 <DT><CODE>print-completions-horizontally</CODE>
10084 <DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches
10085 sorted horizontally in alphabetical order, rather than down the screen.
10086 The default is <SAMP>`off'</SAMP>.
10089 <DT><CODE>revert-all-at-newline</CODE>
10090 <DD><A NAME="IDX345"></A>
10091 If set to <SAMP>`on'</SAMP>, Readline will undo all changes to history lines
10092 before returning when <CODE>accept-line</CODE> is executed. By default,
10093 history lines may be modified and retain individual undo lists across
10094 calls to <CODE>readline</CODE>. The default is <SAMP>`off'</SAMP>.
10097 <DT><CODE>show-all-if-ambiguous</CODE>
10098 <DD><A NAME="IDX346"></A>
10099 This alters the default behavior of the completion functions. If
10100 set to <SAMP>`on'</SAMP>,
10101 words which have more than one possible completion cause the
10102 matches to be listed immediately instead of ringing the bell.
10103 The default value is <SAMP>`off'</SAMP>.
10106 <DT><CODE>show-all-if-unmodified</CODE>
10107 <DD><A NAME="IDX347"></A>
10108 This alters the default behavior of the completion functions in
10109 a fashion similar to <VAR>show-all-if-ambiguous</VAR>.
10110 If set to <SAMP>`on'</SAMP>,
10111 words which have more than one possible completion without any
10112 possible partial completion (the possible completions don't share
10113 a common prefix) cause the matches to be listed immediately instead
10114 of ringing the bell.
10115 The default value is <SAMP>`off'</SAMP>.
10118 <DT><CODE>skip-completed-text</CODE>
10119 <DD><A NAME="IDX348"></A>
10120 If set to <SAMP>`on'</SAMP>, this alters the default completion behavior when
10121 inserting a single match into the line. It's only active when
10122 performing completion in the middle of a word. If enabled, readline
10123 does not insert characters from the completion that match characters
10124 after point in the word being completed, so portions of the word
10125 following the cursor are not duplicated.
10126 For instance, if this is enabled, attempting completion when the cursor
10127 is after the <SAMP>`e'</SAMP> in <SAMP>`Makefile'</SAMP> will result in <SAMP>`Makefile'</SAMP>
10128 rather than <SAMP>`Makefilefile'</SAMP>, assuming there is a single possible
10130 The default value is <SAMP>`off'</SAMP>.
10133 <DT><CODE>visible-stats</CODE>
10134 <DD><A NAME="IDX349"></A>
10135 If set to <SAMP>`on'</SAMP>, a character denoting a file's type
10136 is appended to the filename when listing possible
10137 completions. The default is <SAMP>`off'</SAMP>.
10144 <DD>The syntax for controlling key bindings in the init file is
10145 simple. First you need to find the name of the command that you
10146 want to change. The following sections contain tables of the command
10147 name, the default keybinding, if any, and a short description of what
10151 Once you know the name of the command, simply place on a line
10152 in the init file the name of the key
10153 you wish to bind the command to, a colon, and then the name of the
10155 There can be no space between the key name and the colon -- that will be
10156 interpreted as part of the key name.
10157 The name of the key can be expressed in different ways, depending on
10158 what you find most comfortable.
10161 In addition to command names, readline allows keys to be bound
10162 to a string that is inserted when the key is pressed (a <VAR>macro</VAR>).
10165 The <CODE>bind -p</CODE> command displays Readline function names and
10166 bindings in a format that can put directly into an initialization file.
10167 See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>.
10171 <DT><VAR>keyname</VAR>: <VAR>function-name</VAR> or <VAR>macro</VAR>
10172 <DD><VAR>keyname</VAR> is the name of a key spelled out in English. For example:
10173 <TABLE><tr><td> </td><td class=example><pre>Control-u: universal-argument
10174 Meta-Rubout: backward-kill-word
10175 Control-o: "> output"
10176 </pre></td></tr></table><P>
10178 In the above example, <KBD>C-u</KBD> is bound to the function
10179 <CODE>universal-argument</CODE>,
10180 <KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and
10181 <KBD>C-o</KBD> is bound to run the macro
10182 expressed on the right hand side (that is, to insert the text
10183 <SAMP>`> output'</SAMP> into the line).
10186 A number of symbolic character names are recognized while
10187 processing this key binding syntax:
10192 <VAR>NEWLINE</VAR>,
10202 <DT>"<VAR>keyseq</VAR>": <VAR>function-name</VAR> or <VAR>macro</VAR>
10203 <DD><VAR>keyseq</VAR> differs from <VAR>keyname</VAR> above in that strings
10204 denoting an entire key sequence can be specified, by placing
10205 the key sequence in double quotes. Some GNU Emacs style key
10206 escapes can be used, as in the following example, but the
10207 special character names are not recognized.
10210 <TABLE><tr><td> </td><td class=example><pre>"\C-u": universal-argument
10211 "\C-x\C-r": re-read-init-file
10212 "\e[11~": "Function Key 1"
10213 </pre></td></tr></table></P><P>
10215 In the above example, <KBD>C-u</KBD> is again bound to the function
10216 <CODE>universal-argument</CODE> (just as it was in the first example),
10217 <SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>,
10218 and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert
10219 the text <SAMP>`Function Key 1'</SAMP>.
10225 The following GNU Emacs style escape sequences are available when
10226 specifying key sequences:
10230 <DT><CODE><KBD>\C-</KBD></CODE>
10232 <DT><CODE><KBD>\M-</KBD></CODE>
10234 <DT><CODE><KBD>\e</KBD></CODE>
10235 <DD>an escape character
10236 <DT><CODE><KBD>\\</KBD></CODE>
10238 <DT><CODE><KBD>\"</KBD></CODE>
10239 <DD><KBD>"</KBD>, a double quotation mark
10240 <DT><CODE><KBD>\'</KBD></CODE>
10241 <DD><KBD>'</KBD>, a single quote or apostrophe
10245 In addition to the GNU Emacs style escape sequences, a second
10246 set of backslash escapes is available:
10250 <DT><CODE>\a</CODE>
10252 <DT><CODE>\b</CODE>
10254 <DT><CODE>\d</CODE>
10256 <DT><CODE>\f</CODE>
10258 <DT><CODE>\n</CODE>
10260 <DT><CODE>\r</CODE>
10261 <DD>carriage return
10262 <DT><CODE>\t</CODE>
10264 <DT><CODE>\v</CODE>
10266 <DT><CODE>\<VAR>nnn</VAR></CODE>
10267 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
10268 (one to three digits)
10269 <DT><CODE>\x<VAR>HH</VAR></CODE>
10270 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
10271 (one or two hex digits)
10275 When entering the text of a macro, single or double quotes must
10276 be used to indicate a macro definition.
10277 Unquoted text is assumed to be a function name.
10278 In the macro body, the backslash escapes described above are expanded.
10279 Backslash will quote any other character in the macro text,
10280 including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>.
10281 For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP>
10282 insert a single <SAMP>`\'</SAMP> into the line:
10283 <TABLE><tr><td> </td><td class=example><pre>"\C-x\\": "\\"
10284 </pre></td></tr></table></P><P>
10289 <A NAME="Conditional Init Constructs"></A>
10291 <A NAME="SEC106"></A>
10292 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10293 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> < </A>]</TD>
10294 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> > </A>]</TD>
10295 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD>
10296 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> Up </A>]</TD>
10297 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> >> </A>]</TD>
10298 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10299 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10300 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
10301 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10303 <H3> 8.3.2 Conditional Init Constructs </H3>
10304 <!--docid::SEC106::-->
10307 Readline implements a facility similar in spirit to the conditional
10308 compilation features of the C preprocessor which allows key
10309 bindings and variable settings to be performed as the result
10310 of tests. There are four parser directives used.
10314 <DT><CODE>$if</CODE>
10315 <DD>The <CODE>$if</CODE> construct allows bindings to be made based on the
10316 editing mode, the terminal being used, or the application using
10317 Readline. The text of the test extends to the end of the line;
10318 no characters are required to isolate it.
10322 <DT><CODE>mode</CODE>
10323 <DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test
10324 whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode.
10325 This may be used in conjunction
10326 with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in
10327 the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if
10328 Readline is starting out in <CODE>emacs</CODE> mode.
10331 <DT><CODE>term</CODE>
10332 <DD>The <CODE>term=</CODE> form may be used to include terminal-specific
10333 key bindings, perhaps to bind the key sequences output by the
10334 terminal's function keys. The word on the right side of the
10335 <SAMP>`='</SAMP> is tested against both the full name of the terminal and
10336 the portion of the terminal name before the first <SAMP>`-'</SAMP>. This
10337 allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>,
10341 <DT><CODE>application</CODE>
10342 <DD>The <VAR>application</VAR> construct is used to include
10343 application-specific settings. Each program using the Readline
10344 library sets the <VAR>application name</VAR>, and you can test for
10345 a particular value.
10346 This could be used to bind key sequences to functions useful for
10347 a specific program. For instance, the following command adds a
10348 key sequence that quotes the current or previous word in Bash:
10349 <TABLE><tr><td> </td><td class=example><pre>$if Bash
10350 # Quote the current or previous word
10351 "\C-xq": "\eb\"\ef\""
10353 </pre></td></tr></table></DL>
10356 <DT><CODE>$endif</CODE>
10357 <DD>This command, as seen in the previous example, terminates an
10358 <CODE>$if</CODE> command.
10361 <DT><CODE>$else</CODE>
10362 <DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if
10366 <DT><CODE>$include</CODE>
10367 <DD>This directive takes a single filename as an argument and reads commands
10368 and bindings from that file.
10369 For example, the following directive reads from <TT>`/etc/inputrc'</TT>:
10370 <TABLE><tr><td> </td><td class=example><pre>$include /etc/inputrc
10371 </pre></td></tr></table></DL>
10374 <A NAME="Sample Init File"></A>
10376 <A NAME="SEC107"></A>
10377 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10378 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> < </A>]</TD>
10379 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> > </A>]</TD>
10380 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> << </A>]</TD>
10381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> Up </A>]</TD>
10382 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> >> </A>]</TD>
10383 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
10386 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10388 <H3> 8.3.3 Sample Init File </H3>
10389 <!--docid::SEC107::-->
10392 Here is an example of an <VAR>inputrc</VAR> file. This illustrates key
10393 binding, variable assignment, and conditional syntax.
10396 <TABLE><tr><td> </td><td class=example><pre># This file controls the behaviour of line input editing for
10397 # programs that use the GNU Readline library. Existing
10398 # programs include FTP, Bash, and GDB.
10400 # You can re-read the inputrc file with C-x C-r.
10401 # Lines beginning with '#' are comments.
10403 # First, include any systemwide bindings and variable
10404 # assignments from /etc/Inputrc
10405 $include /etc/Inputrc
10408 # Set various bindings for emacs mode.
10410 set editing-mode emacs
10414 Meta-Control-h: backward-kill-word Text after the function name is ignored
10417 # Arrow keys in keypad mode
10419 #"\M-OD": backward-char
10420 #"\M-OC": forward-char
10421 #"\M-OA": previous-history
10422 #"\M-OB": next-history
10424 # Arrow keys in ANSI mode
10426 "\M-[D": backward-char
10427 "\M-[C": forward-char
10428 "\M-[A": previous-history
10429 "\M-[B": next-history
10431 # Arrow keys in 8 bit keypad mode
10433 #"\M-\C-OD": backward-char
10434 #"\M-\C-OC": forward-char
10435 #"\M-\C-OA": previous-history
10436 #"\M-\C-OB": next-history
10438 # Arrow keys in 8 bit ANSI mode
10440 #"\M-\C-[D": backward-char
10441 #"\M-\C-[C": forward-char
10442 #"\M-\C-[A": previous-history
10443 #"\M-\C-[B": next-history
10449 # An old-style binding. This happens to be the default.
10452 # Macros that are convenient for shell interaction
10455 "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
10456 # prepare to type a quoted word --
10457 # insert open and close double quotes
10458 # and move to just after the open quote
10459 "\C-x\"": "\"\"\C-b"
10460 # insert a backslash (testing backslash escapes
10461 # in sequences and macros)
10463 # Quote the current or previous word
10464 "\C-xq": "\eb\"\ef\""
10465 # Add a binding to refresh the line, which is unbound
10466 "\C-xr": redraw-current-line
10467 # Edit variable on current line.
10468 "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
10471 # use a visible bell if one is available
10472 set bell-style visible
10474 # don't strip characters to 7 bits when reading
10477 # allow iso-latin1 characters to be inserted rather
10478 # than converted to prefix-meta sequences
10479 set convert-meta off
10481 # display characters with the eighth bit set directly
10482 # rather than as meta-prefixed characters
10485 # if there are more than 150 possible completions for
10486 # a word, ask the user if he wants to see all of them
10487 set completion-query-items 150
10491 "\C-xg": "get \M-?"
10492 "\C-xt": "put \M-?"
10493 "\M-.": yank-last-arg
10495 </pre></td></tr></table></P><P>
10497 <A NAME="Bindable Readline Commands"></A>
10499 <A NAME="SEC108"></A>
10500 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10501 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> < </A>]</TD>
10502 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> > </A>]</TD>
10503 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> << </A>]</TD>
10504 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
10505 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
10506 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10507 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10508 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
10509 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10511 <H2> 8.4 Bindable Readline Commands </H2>
10512 <!--docid::SEC108::-->
10515 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
10516 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR>
10517 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR>
10518 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR>
10519 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR>
10520 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR>
10521 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting Readline to do the typing for you.</TD></TR>
10522 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR>
10523 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR>
10524 </TABLE></BLOCKQUOTE>
10527 This section describes Readline commands that may be bound to key
10529 You can list your key bindings by executing
10530 <CODE>bind -P</CODE> or, for a more terse format, suitable for an
10531 <VAR>inputrc</VAR> file, <CODE>bind -p</CODE>. (See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>.)
10532 Command names without an accompanying key sequence are unbound by default.
10535 In the following descriptions, <EM>point</EM> refers to the current cursor
10536 position, and <EM>mark</EM> refers to a cursor position saved by the
10537 <CODE>set-mark</CODE> command.
10538 The text between the point and mark is referred to as the <EM>region</EM>.
10541 <A NAME="Commands For Moving"></A>
10543 <A NAME="SEC109"></A>
10544 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10545 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> < </A>]</TD>
10546 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> > </A>]</TD>
10547 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> << </A>]</TD>
10548 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
10549 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
10550 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10551 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10552 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
10553 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10555 <H3> 8.4.1 Commands For Moving </H3>
10556 <!--docid::SEC109::-->
10558 <A NAME="IDX350"></A>
10559 <DT><CODE>beginning-of-line (C-a)</CODE>
10560 <DD><A NAME="IDX351"></A>
10561 Move to the start of the current line.
10564 <A NAME="IDX352"></A>
10565 <DT><CODE>end-of-line (C-e)</CODE>
10566 <DD><A NAME="IDX353"></A>
10567 Move to the end of the line.
10570 <A NAME="IDX354"></A>
10571 <DT><CODE>forward-char (C-f)</CODE>
10572 <DD><A NAME="IDX355"></A>
10573 Move forward a character.
10576 <A NAME="IDX356"></A>
10577 <DT><CODE>backward-char (C-b)</CODE>
10578 <DD><A NAME="IDX357"></A>
10579 Move back a character.
10582 <A NAME="IDX358"></A>
10583 <DT><CODE>forward-word (M-f)</CODE>
10584 <DD><A NAME="IDX359"></A>
10585 Move forward to the end of the next word.
10586 Words are composed of letters and digits.
10589 <A NAME="IDX360"></A>
10590 <DT><CODE>backward-word (M-b)</CODE>
10591 <DD><A NAME="IDX361"></A>
10592 Move back to the start of the current or previous word.
10593 Words are composed of letters and digits.
10596 <A NAME="IDX362"></A>
10597 <DT><CODE>shell-forward-word ()</CODE>
10598 <DD><A NAME="IDX363"></A>
10599 Move forward to the end of the next word.
10600 Words are delimited by non-quoted shell metacharacters.
10603 <A NAME="IDX364"></A>
10604 <DT><CODE>shell-backward-word ()</CODE>
10605 <DD><A NAME="IDX365"></A>
10606 Move back to the start of the current or previous word.
10607 Words are delimited by non-quoted shell metacharacters.
10610 <A NAME="IDX366"></A>
10611 <DT><CODE>clear-screen (C-l)</CODE>
10612 <DD><A NAME="IDX367"></A>
10613 Clear the screen and redraw the current line,
10614 leaving the current line at the top of the screen.
10617 <A NAME="IDX368"></A>
10618 <DT><CODE>redraw-current-line ()</CODE>
10619 <DD><A NAME="IDX369"></A>
10620 Refresh the current line. By default, this is unbound.
10626 <A NAME="Commands For History"></A>
10628 <A NAME="SEC110"></A>
10629 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10630 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> < </A>]</TD>
10631 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> > </A>]</TD>
10632 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> << </A>]</TD>
10633 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
10634 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
10635 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10636 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10637 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
10638 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10640 <H3> 8.4.2 Commands For Manipulating The History </H3>
10641 <!--docid::SEC110::-->
10645 <A NAME="IDX370"></A>
10646 <DT><CODE>accept-line (Newline or Return)</CODE>
10647 <DD><A NAME="IDX371"></A>
10648 Accept the line regardless of where the cursor is.
10650 non-empty, add it to the history list according to the setting of
10651 the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables.
10652 If this line is a modified history line, then restore the history line
10653 to its original state.
10656 <A NAME="IDX372"></A>
10657 <DT><CODE>previous-history (C-p)</CODE>
10658 <DD><A NAME="IDX373"></A>
10659 Move `back' through the history list, fetching the previous command.
10662 <A NAME="IDX374"></A>
10663 <DT><CODE>next-history (C-n)</CODE>
10664 <DD><A NAME="IDX375"></A>
10665 Move `forward' through the history list, fetching the next command.
10668 <A NAME="IDX376"></A>
10669 <DT><CODE>beginning-of-history (M-<)</CODE>
10670 <DD><A NAME="IDX377"></A>
10671 Move to the first line in the history.
10674 <A NAME="IDX378"></A>
10675 <DT><CODE>end-of-history (M->)</CODE>
10676 <DD><A NAME="IDX379"></A>
10677 Move to the end of the input history, i.e., the line currently
10681 <A NAME="IDX380"></A>
10682 <DT><CODE>reverse-search-history (C-r)</CODE>
10683 <DD><A NAME="IDX381"></A>
10684 Search backward starting at the current line and moving `up' through
10685 the history as necessary. This is an incremental search.
10688 <A NAME="IDX382"></A>
10689 <DT><CODE>forward-search-history (C-s)</CODE>
10690 <DD><A NAME="IDX383"></A>
10691 Search forward starting at the current line and moving `down' through
10692 the the history as necessary. This is an incremental search.
10695 <A NAME="IDX384"></A>
10696 <DT><CODE>non-incremental-reverse-search-history (M-p)</CODE>
10697 <DD><A NAME="IDX385"></A>
10698 Search backward starting at the current line and moving `up'
10699 through the history as necessary using a non-incremental search
10700 for a string supplied by the user.
10703 <A NAME="IDX386"></A>
10704 <DT><CODE>non-incremental-forward-search-history (M-n)</CODE>
10705 <DD><A NAME="IDX387"></A>
10706 Search forward starting at the current line and moving `down'
10707 through the the history as necessary using a non-incremental search
10708 for a string supplied by the user.
10711 <A NAME="IDX388"></A>
10712 <DT><CODE>history-search-forward ()</CODE>
10713 <DD><A NAME="IDX389"></A>
10714 Search forward through the history for the string of characters
10715 between the start of the current line and the point.
10716 This is a non-incremental search.
10717 By default, this command is unbound.
10720 <A NAME="IDX390"></A>
10721 <DT><CODE>history-search-backward ()</CODE>
10722 <DD><A NAME="IDX391"></A>
10723 Search backward through the history for the string of characters
10724 between the start of the current line and the point. This
10725 is a non-incremental search. By default, this command is unbound.
10728 <A NAME="IDX392"></A>
10729 <DT><CODE>yank-nth-arg (M-C-y)</CODE>
10730 <DD><A NAME="IDX393"></A>
10731 Insert the first argument to the previous command (usually
10732 the second word on the previous line) at point.
10733 With an argument <VAR>n</VAR>,
10734 insert the <VAR>n</VAR>th word from the previous command (the words
10735 in the previous command begin with word 0). A negative argument
10736 inserts the <VAR>n</VAR>th word from the end of the previous command.
10737 Once the argument <VAR>n</VAR> is computed, the argument is extracted
10738 as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified.
10741 <A NAME="IDX394"></A>
10742 <DT><CODE>yank-last-arg (M-. or M-_)</CODE>
10743 <DD><A NAME="IDX395"></A>
10744 Insert last argument to the previous command (the last word of the
10745 previous history entry).
10746 With a numeric argument, behave exactly like <CODE>yank-nth-arg</CODE>.
10747 Successive calls to <CODE>yank-last-arg</CODE> move back through the history
10748 list, inserting the last word (or the word specified by the argument to
10749 the first call) of each line in turn.
10750 Any numeric argument supplied to these successive calls determines
10751 the direction to move through the history. A negative argument switches
10752 the direction through the history (back or forward).
10753 The history expansion facilities are used to extract the last argument,
10754 as if the <SAMP>`!$'</SAMP> history expansion had been specified.
10760 <A NAME="Commands For Text"></A>
10762 <A NAME="SEC111"></A>
10763 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10764 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> < </A>]</TD>
10765 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> > </A>]</TD>
10766 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> << </A>]</TD>
10767 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
10768 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
10769 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10770 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10771 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
10772 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10774 <H3> 8.4.3 Commands For Changing Text </H3>
10775 <!--docid::SEC111::-->
10779 <A NAME="IDX396"></A>
10780 <DT><CODE>delete-char (C-d)</CODE>
10781 <DD><A NAME="IDX397"></A>
10782 Delete the character at point. If point is at the
10783 beginning of the line, there are no characters in the line, and
10784 the last character typed was not bound to <CODE>delete-char</CODE>, then
10788 <A NAME="IDX398"></A>
10789 <DT><CODE>backward-delete-char (Rubout)</CODE>
10790 <DD><A NAME="IDX399"></A>
10791 Delete the character behind the cursor. A numeric argument means
10792 to kill the characters instead of deleting them.
10795 <A NAME="IDX400"></A>
10796 <DT><CODE>forward-backward-delete-char ()</CODE>
10797 <DD><A NAME="IDX401"></A>
10798 Delete the character under the cursor, unless the cursor is at the
10799 end of the line, in which case the character behind the cursor is
10800 deleted. By default, this is not bound to a key.
10803 <A NAME="IDX402"></A>
10804 <DT><CODE>quoted-insert (C-q or C-v)</CODE>
10805 <DD><A NAME="IDX403"></A>
10806 Add the next character typed to the line verbatim. This is
10807 how to insert key sequences like <KBD>C-q</KBD>, for example.
10810 <A NAME="IDX404"></A>
10811 <DT><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE>
10812 <DD><A NAME="IDX405"></A>
10816 <A NAME="IDX406"></A>
10817 <DT><CODE>transpose-chars (C-t)</CODE>
10818 <DD><A NAME="IDX407"></A>
10819 Drag the character before the cursor forward over
10820 the character at the cursor, moving the
10821 cursor forward as well. If the insertion point
10822 is at the end of the line, then this
10823 transposes the last two characters of the line.
10824 Negative arguments have no effect.
10827 <A NAME="IDX408"></A>
10828 <DT><CODE>transpose-words (M-t)</CODE>
10829 <DD><A NAME="IDX409"></A>
10830 Drag the word before point past the word after point,
10831 moving point past that word as well.
10832 If the insertion point is at the end of the line, this transposes
10833 the last two words on the line.
10836 <A NAME="IDX410"></A>
10837 <DT><CODE>upcase-word (M-u)</CODE>
10838 <DD><A NAME="IDX411"></A>
10839 Uppercase the current (or following) word. With a negative argument,
10840 uppercase the previous word, but do not move the cursor.
10843 <A NAME="IDX412"></A>
10844 <DT><CODE>downcase-word (M-l)</CODE>
10845 <DD><A NAME="IDX413"></A>
10846 Lowercase the current (or following) word. With a negative argument,
10847 lowercase the previous word, but do not move the cursor.
10850 <A NAME="IDX414"></A>
10851 <DT><CODE>capitalize-word (M-c)</CODE>
10852 <DD><A NAME="IDX415"></A>
10853 Capitalize the current (or following) word. With a negative argument,
10854 capitalize the previous word, but do not move the cursor.
10857 <A NAME="IDX416"></A>
10858 <DT><CODE>overwrite-mode ()</CODE>
10859 <DD><A NAME="IDX417"></A>
10860 Toggle overwrite mode. With an explicit positive numeric argument,
10861 switches to overwrite mode. With an explicit non-positive numeric
10862 argument, switches to insert mode. This command affects only
10863 <CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently.
10864 Each call to <CODE>readline()</CODE> starts in insert mode.
10867 In overwrite mode, characters bound to <CODE>self-insert</CODE> replace
10868 the text at point rather than pushing the text to the right.
10869 Characters bound to <CODE>backward-delete-char</CODE> replace the character
10870 before point with a space.
10873 By default, this command is unbound.
10879 <A NAME="Commands For Killing"></A>
10881 <A NAME="SEC112"></A>
10882 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10883 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> < </A>]</TD>
10884 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> > </A>]</TD>
10885 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> << </A>]</TD>
10886 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
10887 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
10888 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10889 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10890 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
10891 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10893 <H3> 8.4.4 Killing And Yanking </H3>
10894 <!--docid::SEC112::-->
10899 <A NAME="IDX418"></A>
10900 <DT><CODE>kill-line (C-k)</CODE>
10901 <DD><A NAME="IDX419"></A>
10902 Kill the text from point to the end of the line.
10905 <A NAME="IDX420"></A>
10906 <DT><CODE>backward-kill-line (C-x Rubout)</CODE>
10907 <DD><A NAME="IDX421"></A>
10908 Kill backward to the beginning of the line.
10911 <A NAME="IDX422"></A>
10912 <DT><CODE>unix-line-discard (C-u)</CODE>
10913 <DD><A NAME="IDX423"></A>
10914 Kill backward from the cursor to the beginning of the current line.
10917 <A NAME="IDX424"></A>
10918 <DT><CODE>kill-whole-line ()</CODE>
10919 <DD><A NAME="IDX425"></A>
10920 Kill all characters on the current line, no matter where point is.
10921 By default, this is unbound.
10924 <A NAME="IDX426"></A>
10925 <DT><CODE>kill-word (M-d)</CODE>
10926 <DD><A NAME="IDX427"></A>
10927 Kill from point to the end of the current word, or if between
10928 words, to the end of the next word.
10929 Word boundaries are the same as <CODE>forward-word</CODE>.
10932 <A NAME="IDX428"></A>
10933 <DT><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE>
10934 <DD><A NAME="IDX429"></A>
10935 Kill the word behind point.
10936 Word boundaries are the same as <CODE>backward-word</CODE>.
10939 <A NAME="IDX430"></A>
10940 <DT><CODE>shell-kill-word ()</CODE>
10941 <DD><A NAME="IDX431"></A>
10942 Kill from point to the end of the current word, or if between
10943 words, to the end of the next word.
10944 Word boundaries are the same as <CODE>shell-forward-word</CODE>.
10947 <A NAME="IDX432"></A>
10948 <DT><CODE>shell-backward-kill-word ()</CODE>
10949 <DD><A NAME="IDX433"></A>
10950 Kill the word behind point.
10951 Word boundaries are the same as <CODE>shell-backward-word</CODE>.
10954 <A NAME="IDX434"></A>
10955 <DT><CODE>unix-word-rubout (C-w)</CODE>
10956 <DD><A NAME="IDX435"></A>
10957 Kill the word behind point, using white space as a word boundary.
10958 The killed text is saved on the kill-ring.
10961 <A NAME="IDX436"></A>
10962 <DT><CODE>unix-filename-rubout ()</CODE>
10963 <DD><A NAME="IDX437"></A>
10964 Kill the word behind point, using white space and the slash character
10965 as the word boundaries.
10966 The killed text is saved on the kill-ring.
10969 <A NAME="IDX438"></A>
10970 <DT><CODE>delete-horizontal-space ()</CODE>
10971 <DD><A NAME="IDX439"></A>
10972 Delete all spaces and tabs around point. By default, this is unbound.
10975 <A NAME="IDX440"></A>
10976 <DT><CODE>kill-region ()</CODE>
10977 <DD><A NAME="IDX441"></A>
10978 Kill the text in the current region.
10979 By default, this command is unbound.
10982 <A NAME="IDX442"></A>
10983 <DT><CODE>copy-region-as-kill ()</CODE>
10984 <DD><A NAME="IDX443"></A>
10985 Copy the text in the region to the kill buffer, so it can be yanked
10986 right away. By default, this command is unbound.
10989 <A NAME="IDX444"></A>
10990 <DT><CODE>copy-backward-word ()</CODE>
10991 <DD><A NAME="IDX445"></A>
10992 Copy the word before point to the kill buffer.
10993 The word boundaries are the same as <CODE>backward-word</CODE>.
10994 By default, this command is unbound.
10997 <A NAME="IDX446"></A>
10998 <DT><CODE>copy-forward-word ()</CODE>
10999 <DD><A NAME="IDX447"></A>
11000 Copy the word following point to the kill buffer.
11001 The word boundaries are the same as <CODE>forward-word</CODE>.
11002 By default, this command is unbound.
11005 <A NAME="IDX448"></A>
11006 <DT><CODE>yank (C-y)</CODE>
11007 <DD><A NAME="IDX449"></A>
11008 Yank the top of the kill ring into the buffer at point.
11011 <A NAME="IDX450"></A>
11012 <DT><CODE>yank-pop (M-y)</CODE>
11013 <DD><A NAME="IDX451"></A>
11014 Rotate the kill-ring, and yank the new top. You can only do this if
11015 the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>.
11019 <A NAME="Numeric Arguments"></A>
11021 <A NAME="SEC113"></A>
11022 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11023 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> < </A>]</TD>
11024 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> > </A>]</TD>
11025 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> << </A>]</TD>
11026 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11027 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
11028 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11029 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11030 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
11031 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11033 <H3> 8.4.5 Specifying Numeric Arguments </H3>
11034 <!--docid::SEC113::-->
11037 <A NAME="IDX452"></A>
11038 <DT><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE>
11039 <DD><A NAME="IDX453"></A>
11040 Add this digit to the argument already accumulating, or start a new
11041 argument. <KBD>M--</KBD> starts a negative argument.
11044 <A NAME="IDX454"></A>
11045 <DT><CODE>universal-argument ()</CODE>
11046 <DD><A NAME="IDX455"></A>
11047 This is another way to specify an argument.
11048 If this command is followed by one or more digits, optionally with a
11049 leading minus sign, those digits define the argument.
11050 If the command is followed by digits, executing <CODE>universal-argument</CODE>
11051 again ends the numeric argument, but is otherwise ignored.
11052 As a special case, if this command is immediately followed by a
11053 character that is neither a digit or minus sign, the argument count
11054 for the next command is multiplied by four.
11055 The argument count is initially one, so executing this function the
11056 first time makes the argument count four, a second time makes the
11057 argument count sixteen, and so on.
11058 By default, this is not bound to a key.
11062 <A NAME="Commands For Completion"></A>
11064 <A NAME="SEC114"></A>
11065 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11066 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> < </A>]</TD>
11067 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> > </A>]</TD>
11068 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> << </A>]</TD>
11069 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11070 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
11071 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11072 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11073 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
11074 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11076 <H3> 8.4.6 Letting Readline Type For You </H3>
11077 <!--docid::SEC114::-->
11081 <A NAME="IDX456"></A>
11082 <DT><CODE>complete (<KBD>TAB</KBD>)</CODE>
11083 <DD><A NAME="IDX457"></A>
11084 Attempt to perform completion on the text before point.
11085 The actual completion performed is application-specific.
11086 Bash attempts completion treating the text as a variable (if the
11087 text begins with <SAMP>`$'</SAMP>), username (if the text begins with
11088 <SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or
11089 command (including aliases and functions) in turn. If none
11090 of these produces a match, filename completion is attempted.
11093 <A NAME="IDX458"></A>
11094 <DT><CODE>possible-completions (M-?)</CODE>
11095 <DD><A NAME="IDX459"></A>
11096 List the possible completions of the text before point.
11097 When displaying completions, Readline sets the number of columns used
11098 for display to the value of <CODE>completion-display-width</CODE>, the value of
11099 the environment variable <CODE>COLUMNS</CODE>, or the screen width, in that order.
11102 <A NAME="IDX460"></A>
11103 <DT><CODE>insert-completions (M-*)</CODE>
11104 <DD><A NAME="IDX461"></A>
11105 Insert all completions of the text before point that would have
11106 been generated by <CODE>possible-completions</CODE>.
11109 <A NAME="IDX462"></A>
11110 <DT><CODE>menu-complete ()</CODE>
11111 <DD><A NAME="IDX463"></A>
11112 Similar to <CODE>complete</CODE>, but replaces the word to be completed
11113 with a single match from the list of possible completions.
11114 Repeated execution of <CODE>menu-complete</CODE> steps through the list
11115 of possible completions, inserting each match in turn.
11116 At the end of the list of completions, the bell is rung
11117 (subject to the setting of <CODE>bell-style</CODE>)
11118 and the original text is restored.
11119 An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list
11120 of matches; a negative argument may be used to move backward
11122 This command is intended to be bound to <KBD>TAB</KBD>, but is unbound
11126 <A NAME="IDX464"></A>
11127 <DT><CODE>menu-complete-backward ()</CODE>
11128 <DD><A NAME="IDX465"></A>
11129 Identical to <CODE>menu-complete</CODE>, but moves backward through the list
11130 of possible completions, as if <CODE>menu-complete</CODE> had been given a
11134 <A NAME="IDX466"></A>
11135 <DT><CODE>delete-char-or-list ()</CODE>
11136 <DD><A NAME="IDX467"></A>
11137 Deletes the character under the cursor if not at the beginning or
11138 end of the line (like <CODE>delete-char</CODE>).
11139 If at the end of the line, behaves identically to
11140 <CODE>possible-completions</CODE>.
11141 This command is unbound by default.
11144 <A NAME="IDX468"></A>
11145 <DT><CODE>complete-filename (M-/)</CODE>
11146 <DD><A NAME="IDX469"></A>
11147 Attempt filename completion on the text before point.
11150 <A NAME="IDX470"></A>
11151 <DT><CODE>possible-filename-completions (C-x /)</CODE>
11152 <DD><A NAME="IDX471"></A>
11153 List the possible completions of the text before point,
11154 treating it as a filename.
11157 <A NAME="IDX472"></A>
11158 <DT><CODE>complete-username (M-~)</CODE>
11159 <DD><A NAME="IDX473"></A>
11160 Attempt completion on the text before point, treating
11164 <A NAME="IDX474"></A>
11165 <DT><CODE>possible-username-completions (C-x ~)</CODE>
11166 <DD><A NAME="IDX475"></A>
11167 List the possible completions of the text before point,
11168 treating it as a username.
11171 <A NAME="IDX476"></A>
11172 <DT><CODE>complete-variable (M-$)</CODE>
11173 <DD><A NAME="IDX477"></A>
11174 Attempt completion on the text before point, treating
11175 it as a shell variable.
11178 <A NAME="IDX478"></A>
11179 <DT><CODE>possible-variable-completions (C-x $)</CODE>
11180 <DD><A NAME="IDX479"></A>
11181 List the possible completions of the text before point,
11182 treating it as a shell variable.
11185 <A NAME="IDX480"></A>
11186 <DT><CODE>complete-hostname (M-@)</CODE>
11187 <DD><A NAME="IDX481"></A>
11188 Attempt completion on the text before point, treating
11192 <A NAME="IDX482"></A>
11193 <DT><CODE>possible-hostname-completions (C-x @)</CODE>
11194 <DD><A NAME="IDX483"></A>
11195 List the possible completions of the text before point,
11196 treating it as a hostname.
11199 <A NAME="IDX484"></A>
11200 <DT><CODE>complete-command (M-!)</CODE>
11201 <DD><A NAME="IDX485"></A>
11202 Attempt completion on the text before point, treating
11203 it as a command name. Command completion attempts to
11204 match the text against aliases, reserved words, shell
11205 functions, shell builtins, and finally executable filenames,
11209 <A NAME="IDX486"></A>
11210 <DT><CODE>possible-command-completions (C-x !)</CODE>
11211 <DD><A NAME="IDX487"></A>
11212 List the possible completions of the text before point,
11213 treating it as a command name.
11216 <A NAME="IDX488"></A>
11217 <DT><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE>
11218 <DD><A NAME="IDX489"></A>
11219 Attempt completion on the text before point, comparing
11220 the text against lines from the history list for possible
11221 completion matches.
11224 <A NAME="IDX490"></A>
11225 <DT><CODE>dabbrev-expand ()</CODE>
11226 <DD><A NAME="IDX491"></A>
11227 Attempt menu completion on the text before point, comparing
11228 the text against lines from the history list for possible
11229 completion matches.
11232 <A NAME="IDX492"></A>
11233 <DT><CODE>complete-into-braces (M-{)</CODE>
11234 <DD><A NAME="IDX493"></A>
11235 Perform filename completion and insert the list of possible completions
11236 enclosed within braces so the list is available to the shell
11237 (see section <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>).
11243 <A NAME="Keyboard Macros"></A>
11245 <A NAME="SEC115"></A>
11246 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11247 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> < </A>]</TD>
11248 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> > </A>]</TD>
11249 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD>
11250 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11251 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
11252 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11253 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11254 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
11255 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11257 <H3> 8.4.7 Keyboard Macros </H3>
11258 <!--docid::SEC115::-->
11261 <A NAME="IDX494"></A>
11262 <DT><CODE>start-kbd-macro (C-x ()</CODE>
11263 <DD><A NAME="IDX495"></A>
11264 Begin saving the characters typed into the current keyboard macro.
11267 <A NAME="IDX496"></A>
11268 <DT><CODE>end-kbd-macro (C-x ))</CODE>
11269 <DD><A NAME="IDX497"></A>
11270 Stop saving the characters typed into the current keyboard macro
11271 and save the definition.
11274 <A NAME="IDX498"></A>
11275 <DT><CODE>call-last-kbd-macro (C-x e)</CODE>
11276 <DD><A NAME="IDX499"></A>
11277 Re-execute the last keyboard macro defined, by making the characters
11278 in the macro appear as if typed at the keyboard.
11284 <A NAME="Miscellaneous Commands"></A>
11286 <A NAME="SEC116"></A>
11287 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11288 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> < </A>]</TD>
11289 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> > </A>]</TD>
11290 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> << </A>]</TD>
11291 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11292 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> >> </A>]</TD>
11293 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11294 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11295 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
11296 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11298 <H3> 8.4.8 Some Miscellaneous Commands </H3>
11299 <!--docid::SEC116::-->
11302 <A NAME="IDX500"></A>
11303 <DT><CODE>re-read-init-file (C-x C-r)</CODE>
11304 <DD><A NAME="IDX501"></A>
11305 Read in the contents of the <VAR>inputrc</VAR> file, and incorporate
11306 any bindings or variable assignments found there.
11309 <A NAME="IDX502"></A>
11310 <DT><CODE>abort (C-g)</CODE>
11311 <DD><A NAME="IDX503"></A>
11312 Abort the current editing command and
11313 ring the terminal's bell (subject to the setting of
11314 <CODE>bell-style</CODE>).
11317 <A NAME="IDX504"></A>
11318 <DT><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE>
11319 <DD><A NAME="IDX505"></A>
11320 If the metafied character <VAR>x</VAR> is lowercase, run the command
11321 that is bound to the corresponding uppercase character.
11324 <A NAME="IDX506"></A>
11325 <DT><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE>
11326 <DD><A NAME="IDX507"></A>
11327 Metafy the next character typed. This is for keyboards
11328 without a meta key. Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing
11332 <A NAME="IDX508"></A>
11333 <DT><CODE>undo (C-_ or C-x C-u)</CODE>
11334 <DD><A NAME="IDX509"></A>
11335 Incremental undo, separately remembered for each line.
11338 <A NAME="IDX510"></A>
11339 <DT><CODE>revert-line (M-r)</CODE>
11340 <DD><A NAME="IDX511"></A>
11341 Undo all changes made to this line. This is like executing the <CODE>undo</CODE>
11342 command enough times to get back to the beginning.
11345 <A NAME="IDX512"></A>
11346 <DT><CODE>tilde-expand (M-&)</CODE>
11347 <DD><A NAME="IDX513"></A>
11348 Perform tilde expansion on the current word.
11351 <A NAME="IDX514"></A>
11352 <DT><CODE>set-mark (C-@)</CODE>
11353 <DD><A NAME="IDX515"></A>
11354 Set the mark to the point. If a
11355 numeric argument is supplied, the mark is set to that position.
11358 <A NAME="IDX516"></A>
11359 <DT><CODE>exchange-point-and-mark (C-x C-x)</CODE>
11360 <DD><A NAME="IDX517"></A>
11361 Swap the point with the mark. The current cursor position is set to
11362 the saved position, and the old cursor position is saved as the mark.
11365 <A NAME="IDX518"></A>
11366 <DT><CODE>character-search (C-])</CODE>
11367 <DD><A NAME="IDX519"></A>
11368 A character is read and point is moved to the next occurrence of that
11369 character. A negative count searches for previous occurrences.
11372 <A NAME="IDX520"></A>
11373 <DT><CODE>character-search-backward (M-C-])</CODE>
11374 <DD><A NAME="IDX521"></A>
11375 A character is read and point is moved to the previous occurrence
11376 of that character. A negative count searches for subsequent
11380 <A NAME="IDX522"></A>
11381 <DT><CODE>skip-csi-sequence ()</CODE>
11382 <DD><A NAME="IDX523"></A>
11383 Read enough characters to consume a multi-key sequence such as those
11384 defined for keys like Home and End. Such sequences begin with a
11385 Control Sequence Indicator (CSI), usually ESC-[. If this sequence is
11386 bound to "\e[", keys producing such sequences will have no effect
11387 unless explicitly bound to a readline command, instead of inserting
11388 stray characters into the editing buffer. This is unbound by default,
11389 but usually bound to ESC-[.
11392 <A NAME="IDX524"></A>
11393 <DT><CODE>insert-comment (M-#)</CODE>
11394 <DD><A NAME="IDX525"></A>
11395 Without a numeric argument, the value of the <CODE>comment-begin</CODE>
11396 variable is inserted at the beginning of the current line.
11397 If a numeric argument is supplied, this command acts as a toggle: if
11398 the characters at the beginning of the line do not match the value
11399 of <CODE>comment-begin</CODE>, the value is inserted, otherwise
11400 the characters in <CODE>comment-begin</CODE> are deleted from the beginning of
11402 In either case, the line is accepted as if a newline had been typed.
11403 The default value of <CODE>comment-begin</CODE> causes this command
11404 to make the current line a shell comment.
11405 If a numeric argument causes the comment character to be removed, the line
11406 will be executed by the shell.
11409 <A NAME="IDX526"></A>
11410 <DT><CODE>dump-functions ()</CODE>
11411 <DD><A NAME="IDX527"></A>
11412 Print all of the functions and their key bindings to the
11413 Readline output stream. If a numeric argument is supplied,
11414 the output is formatted in such a way that it can be made part
11415 of an <VAR>inputrc</VAR> file. This command is unbound by default.
11418 <A NAME="IDX528"></A>
11419 <DT><CODE>dump-variables ()</CODE>
11420 <DD><A NAME="IDX529"></A>
11421 Print all of the settable variables and their values to the
11422 Readline output stream. If a numeric argument is supplied,
11423 the output is formatted in such a way that it can be made part
11424 of an <VAR>inputrc</VAR> file. This command is unbound by default.
11427 <A NAME="IDX530"></A>
11428 <DT><CODE>dump-macros ()</CODE>
11429 <DD><A NAME="IDX531"></A>
11430 Print all of the Readline key sequences bound to macros and the
11431 strings they output. If a numeric argument is supplied,
11432 the output is formatted in such a way that it can be made part
11433 of an <VAR>inputrc</VAR> file. This command is unbound by default.
11436 <A NAME="IDX532"></A>
11437 <DT><CODE>glob-complete-word (M-g)</CODE>
11438 <DD><A NAME="IDX533"></A>
11439 The word before point is treated as a pattern for pathname expansion,
11440 with an asterisk implicitly appended. This pattern is used to
11441 generate a list of matching file names for possible completions.
11444 <A NAME="IDX534"></A>
11445 <DT><CODE>glob-expand-word (C-x *)</CODE>
11446 <DD><A NAME="IDX535"></A>
11447 The word before point is treated as a pattern for pathname expansion,
11448 and the list of matching file names is inserted, replacing the word.
11449 If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11450 pathname expansion.
11453 <A NAME="IDX536"></A>
11454 <DT><CODE>glob-list-expansions (C-x g)</CODE>
11455 <DD><A NAME="IDX537"></A>
11456 The list of expansions that would have been generated by
11457 <CODE>glob-expand-word</CODE> is displayed, and the line is redrawn.
11458 If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11459 pathname expansion.
11462 <A NAME="IDX538"></A>
11463 <DT><CODE>display-shell-version (C-x C-v)</CODE>
11464 <DD><A NAME="IDX539"></A>
11465 Display version information about the current instance of Bash.
11468 <A NAME="IDX540"></A>
11469 <DT><CODE>shell-expand-line (M-C-e)</CODE>
11470 <DD><A NAME="IDX541"></A>
11471 Expand the line as the shell does.
11472 This performs alias and history expansion as well as all of the shell
11473 word expansions (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
11476 <A NAME="IDX542"></A>
11477 <DT><CODE>history-expand-line (M-^)</CODE>
11478 <DD><A NAME="IDX543"></A>
11479 Perform history expansion on the current line.
11482 <A NAME="IDX544"></A>
11483 <DT><CODE>magic-space ()</CODE>
11484 <DD><A NAME="IDX545"></A>
11485 Perform history expansion on the current line and insert a space
11486 (see section <A HREF="bashref.html#SEC123">9.3 History Expansion</A>).
11489 <A NAME="IDX546"></A>
11490 <DT><CODE>alias-expand-line ()</CODE>
11491 <DD><A NAME="IDX547"></A>
11492 Perform alias expansion on the current line (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
11495 <A NAME="IDX548"></A>
11496 <DT><CODE>history-and-alias-expand-line ()</CODE>
11497 <DD><A NAME="IDX549"></A>
11498 Perform history and alias expansion on the current line.
11501 <A NAME="IDX550"></A>
11502 <DT><CODE>insert-last-argument (M-. or M-_)</CODE>
11503 <DD><A NAME="IDX551"></A>
11504 A synonym for <CODE>yank-last-arg</CODE>.
11507 <A NAME="IDX552"></A>
11508 <DT><CODE>operate-and-get-next (C-o)</CODE>
11509 <DD><A NAME="IDX553"></A>
11510 Accept the current line for execution and fetch the next line
11511 relative to the current line from the history for editing. Any
11512 argument is ignored.
11515 <A NAME="IDX554"></A>
11516 <DT><CODE>edit-and-execute-command (C-xC-e)</CODE>
11517 <DD><A NAME="IDX555"></A>
11518 Invoke an editor on the current command line, and execute the result as shell
11520 Bash attempts to invoke
11521 <CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE>
11522 as the editor, in that order.
11528 <A NAME="Readline vi Mode"></A>
11530 <A NAME="SEC117"></A>
11531 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11532 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> < </A>]</TD>
11533 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> > </A>]</TD>
11534 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> << </A>]</TD>
11535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
11536 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> >> </A>]</TD>
11537 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11538 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11539 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
11540 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11542 <H2> 8.5 Readline vi Mode </H2>
11543 <!--docid::SEC117::-->
11546 While the Readline library does not have a full set of <CODE>vi</CODE>
11547 editing functions, it does contain enough to allow simple editing
11548 of the line. The Readline <CODE>vi</CODE> mode behaves as specified in
11549 the POSIX standard.
11552 In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE>
11553 editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP>
11554 commands (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
11555 The Readline default is <CODE>emacs</CODE> mode.
11558 When you enter a line in <CODE>vi</CODE> mode, you are already placed in
11559 `insertion' mode, as if you had typed an <SAMP>`i'</SAMP>. Pressing <KBD>ESC</KBD>
11560 switches you into `command' mode, where you can edit the text of the
11561 line with the standard <CODE>vi</CODE> movement keys, move to previous
11562 history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and
11566 <A NAME="Programmable Completion"></A>
11568 <A NAME="SEC118"></A>
11569 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11570 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> < </A>]</TD>
11571 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> > </A>]</TD>
11572 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> << </A>]</TD>
11573 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
11574 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> >> </A>]</TD>
11575 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11576 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11577 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
11578 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11580 <H2> 8.6 Programmable Completion </H2>
11581 <!--docid::SEC118::-->
11584 When word completion is attempted for an argument to a command for
11585 which a completion specification (a <VAR>compspec</VAR>) has been defined
11586 using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>),
11587 the programmable completion facilities are invoked.
11590 First, the command name is identified.
11591 If a compspec has been defined for that command, the
11592 compspec is used to generate the list of possible completions for the word.
11593 If the command word is the empty string (completion attempted at the
11594 beginning of an empty line), any compspec defined with
11595 the <SAMP>`-E'</SAMP> option to <CODE>complete</CODE> is used.
11596 If the command word is a full pathname, a compspec for the full
11597 pathname is searched for first.
11598 If no compspec is found for the full pathname, an attempt is made to
11599 find a compspec for the portion following the final slash.
11600 If those searches do not result in a compspec, any compspec defined with
11601 the <SAMP>`-D'</SAMP> option to <CODE>complete</CODE> is used as the default.
11604 Once a compspec has been found, it is used to generate the list of
11606 If a compspec is not found, the default Bash completion
11607 described above (see section <A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A>) is performed.
11610 First, the actions specified by the compspec are used.
11611 Only matches which are prefixed by the word being completed are
11613 When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or
11614 directory name completion, the shell variable <CODE>FIGNORE</CODE> is
11615 used to filter the matches.
11616 See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
11619 Any completions specified by a filename expansion pattern to the
11620 <SAMP>`-G'</SAMP> option are generated next.
11621 The words generated by the pattern need not match the word being completed.
11622 The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches,
11623 but the <CODE>FIGNORE</CODE> shell variable is used.
11626 Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option
11628 The string is first split using the characters in the <CODE>IFS</CODE>
11629 special variable as delimiters.
11630 Shell quoting is honored.
11631 Each word is then expanded using
11632 brace expansion, tilde expansion, parameter and variable expansion,
11633 command substitution, and arithmetic expansion,
11634 as described above (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
11635 The results are split using the rules described above
11636 (see section <A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A>).
11637 The results of the expansion are prefix-matched against the word being
11638 completed, and the matching words become the possible completions.
11641 After these matches have been generated, any shell function or command
11642 specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked.
11643 When the command or function is invoked, the <CODE>COMP_LINE</CODE>,
11644 <CODE>COMP_POINT</CODE>, <CODE>COMP_KEY</CODE>, and <CODE>COMP_TYPE</CODE> variables are
11645 assigned values as described above (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
11646 If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and
11647 <CODE>COMP_CWORD</CODE> variables are also set.
11648 When the function or command is invoked, the first argument is the
11649 name of the command whose arguments are being completed, the
11650 second argument is the word being completed, and the third argument
11651 is the word preceding the word being completed on the current command line.
11652 No filtering of the generated completions against the word being completed
11653 is performed; the function or command has complete freedom in generating
11657 Any function specified with <SAMP>`-F'</SAMP> is invoked first.
11658 The function may use any of the shell facilities, including the
11659 <CODE>compgen</CODE> and <CODE>compopt</CODE> builtins described below
11660 (see section <A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>), to generate the matches.
11661 It must put the possible completions in the <CODE>COMPREPLY</CODE> array
11665 Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked
11666 in an environment equivalent to command substitution.
11667 It should print a list of completions, one per line, to
11668 the standard output.
11669 Backslash may be used to escape a newline, if necessary.
11672 After all of the possible completions are generated, any filter
11673 specified with the <SAMP>`-X'</SAMP> option is applied to the list.
11674 The filter is a pattern as used for pathname expansion; a <SAMP>`&'</SAMP>
11675 in the pattern is replaced with the text of the word being completed.
11676 A literal <SAMP>`&'</SAMP> may be escaped with a backslash; the backslash
11677 is removed before attempting a match.
11678 Any completion that matches the pattern will be removed from the list.
11679 A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion
11680 not matching the pattern will be removed.
11683 Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP>
11684 options are added to each member of the completion list, and the result is
11685 returned to the Readline completion code as the list of possible
11689 If the previously-applied actions do not generate any matches, and the
11690 <SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the
11691 compspec was defined, directory name completion is attempted.
11694 If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when
11695 the compspec was defined, directory name completion is attempted and any
11696 matches are added to the results of the other actions.
11699 By default, if a compspec is found, whatever it generates is returned to
11700 the completion code as the full set of possible completions.
11701 The default Bash completions are not attempted, and the Readline default
11702 of filename completion is disabled.
11703 If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when
11704 the compspec was defined, the default Bash completions are attempted
11705 if the compspec generates no matches.
11706 If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the
11707 compspec was defined, Readline's default completion will be performed
11708 if the compspec (and, if attempted, the default Bash completions)
11709 generate no matches.
11712 When a compspec indicates that directory name completion is desired,
11713 the programmable completion functions force Readline to append a slash
11714 to completed names which are symbolic links to directories, subject to
11715 the value of the <VAR>mark-directories</VAR> Readline variable, regardless
11716 of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable.
11719 There is some support for dynamically modifying completions. This is
11720 most useful when used in combination with a default completion specified
11721 with <SAMP>`-D'</SAMP>. It's possible for shell functions executed as completion
11722 handlers to indicate that completion should be retried by returning an
11723 exit status of 124. If a shell function returns 124, and changes
11724 the compspec associated with the command on which completion is being
11725 attempted (supplied as the first argument when the function is executed),
11726 programmable completion restarts from the beginning, with an
11727 attempt to find a new compspec for that command. This allows a set of
11728 completions to be built dynamically as completion is attempted, rather than
11729 being loaded all at once.
11732 For instance, assuming that there is a library of compspecs, each kept in a
11733 file corresponding to the name of the command, the following default
11734 completion function would load completions dynamically:
11737 <TABLE><tr><td> </td><td class=example><pre>_completion_loader()
11739 . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
11741 complete -D -F _completion_loader
11742 </pre></td></tr></table></P><P>
11744 <A NAME="Programmable Completion Builtins"></A>
11746 <A NAME="SEC119"></A>
11747 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11748 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> < </A>]</TD>
11749 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> > </A>]</TD>
11750 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> << </A>]</TD>
11751 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
11752 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> >> </A>]</TD>
11753 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11754 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11755 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
11756 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11758 <H2> 8.7 Programmable Completion Builtins </H2>
11759 <!--docid::SEC119::-->
11762 Two builtin commands are available to manipulate the programmable completion
11767 <DT><CODE>compgen</CODE>
11768 <DD><A NAME="IDX556"></A>
11769 <TABLE><tr><td> </td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE>
11770 </pre></td></tr></table><P>
11772 Generate possible completion matches for <VAR>word</VAR> according to
11773 the <VAR>option</VAR>s, which may be any option accepted by the
11774 <CODE>complete</CODE>
11775 builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write
11776 the matches to the standard output.
11777 When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables
11778 set by the programmable completion facilities, while available, will not
11779 have useful values.
11782 The matches will be generated in the same way as if the programmable
11783 completion code had generated them directly from a completion specification
11784 with the same flags.
11785 If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR>
11789 The return value is true unless an invalid option is supplied, or no
11790 matches were generated.
11793 <DT><CODE>complete</CODE>
11794 <DD><A NAME="IDX557"></A>
11795 <TABLE><tr><td> </td><td class=example><pre><CODE>complete [-abcdefgjksuv] [-o <VAR>comp-option</VAR>] [-DE] [-A <VAR>action</VAR>] [-G <VAR>globpat</VAR>] [-W <VAR>wordlist</VAR>]
11796 [-F <VAR>function</VAR>] [-C <VAR>command</VAR>] [-X <VAR>filterpat</VAR>]
11797 [-P <VAR>prefix</VAR>] [-S <VAR>suffix</VAR>] <VAR>name</VAR> [<VAR>name</VAR> <small>...</small>]</CODE>
11798 <CODE>complete -pr [-DE] [<VAR>name</VAR> <small>...</small>]</CODE>
11799 </pre></td></tr></table><P>
11801 Specify how arguments to each <VAR>name</VAR> should be completed.
11802 If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing
11803 completion specifications are printed in a way that allows them to be
11805 The <SAMP>`-r'</SAMP> option removes a completion specification for
11806 each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all
11807 completion specifications.
11808 The <SAMP>`-D'</SAMP> option indicates that the remaining options and actions should
11809 apply to the "default" command completion; that is, completion attempted
11810 on a command for which no completion has previously been defined.
11811 The <SAMP>`-E'</SAMP> option indicates that the remaining options and actions should
11812 apply to "empty" command completion; that is, completion attempted on a
11816 The process of applying these completion specifications when word completion
11817 is attempted is described above (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>). The
11818 <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
11821 Other options, if specified, have the following meanings.
11822 The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options
11823 (and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options)
11824 should be quoted to protect them from expansion before the
11825 <CODE>complete</CODE> builtin is invoked.
11829 <DT><CODE>-o <VAR>comp-option</VAR></CODE>
11830 <DD>The <VAR>comp-option</VAR> controls several aspects of the compspec's behavior
11831 beyond the simple generation of completions.
11832 <VAR>comp-option</VAR> may be one of:
11837 <DT><CODE>bashdefault</CODE>
11838 <DD>Perform the rest of the default Bash completions if the compspec
11839 generates no matches.
11842 <DT><CODE>default</CODE>
11843 <DD>Use Readline's default filename completion if the compspec generates
11847 <DT><CODE>dirnames</CODE>
11848 <DD>Perform directory name completion if the compspec generates no matches.
11851 <DT><CODE>filenames</CODE>
11852 <DD>Tell Readline that the compspec generates filenames, so it can perform any
11853 filename-specific processing (like adding a slash to directory names
11854 quoting special characters, or suppressing trailing spaces).
11855 This option is intended to be used with shell functions specified
11856 with <SAMP>`-F'</SAMP>.
11859 <DT><CODE>nospace</CODE>
11860 <DD>Tell Readline not to append a space (the default) to words completed at
11861 the end of the line.
11864 <DT><CODE>plusdirs</CODE>
11865 <DD>After any matches defined by the compspec are generated,
11866 directory name completion is attempted and any
11867 matches are added to the results of the other actions.
11873 <DT><CODE>-A <VAR>action</VAR></CODE>
11874 <DD>The <VAR>action</VAR> may be one of the following to generate a list of possible
11879 <DT><CODE>alias</CODE>
11880 <DD>Alias names. May also be specified as <SAMP>`-a'</SAMP>.
11883 <DT><CODE>arrayvar</CODE>
11884 <DD>Array variable names.
11887 <DT><CODE>binding</CODE>
11888 <DD>Readline key binding names (see section <A HREF="bashref.html#SEC108">8.4 Bindable Readline Commands</A>).
11891 <DT><CODE>builtin</CODE>
11892 <DD>Names of shell builtin commands. May also be specified as <SAMP>`-b'</SAMP>.
11895 <DT><CODE>command</CODE>
11896 <DD>Command names. May also be specified as <SAMP>`-c'</SAMP>.
11899 <DT><CODE>directory</CODE>
11900 <DD>Directory names. May also be specified as <SAMP>`-d'</SAMP>.
11903 <DT><CODE>disabled</CODE>
11904 <DD>Names of disabled shell builtins.
11907 <DT><CODE>enabled</CODE>
11908 <DD>Names of enabled shell builtins.
11911 <DT><CODE>export</CODE>
11912 <DD>Names of exported shell variables. May also be specified as <SAMP>`-e'</SAMP>.
11915 <DT><CODE>file</CODE>
11916 <DD>File names. May also be specified as <SAMP>`-f'</SAMP>.
11919 <DT><CODE>function</CODE>
11920 <DD>Names of shell functions.
11923 <DT><CODE>group</CODE>
11924 <DD>Group names. May also be specified as <SAMP>`-g'</SAMP>.
11927 <DT><CODE>helptopic</CODE>
11928 <DD>Help topics as accepted by the <CODE>help</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
11931 <DT><CODE>hostname</CODE>
11932 <DD>Hostnames, as taken from the file specified by the
11933 <CODE>HOSTFILE</CODE> shell variable (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
11936 <DT><CODE>job</CODE>
11937 <DD>Job names, if job control is active. May also be specified as <SAMP>`-j'</SAMP>.
11940 <DT><CODE>keyword</CODE>
11941 <DD>Shell reserved words. May also be specified as <SAMP>`-k'</SAMP>.
11944 <DT><CODE>running</CODE>
11945 <DD>Names of running jobs, if job control is active.
11948 <DT><CODE>service</CODE>
11949 <DD>Service names. May also be specified as <SAMP>`-s'</SAMP>.
11952 <DT><CODE>setopt</CODE>
11953 <DD>Valid arguments for the <SAMP>`-o'</SAMP> option to the <CODE>set</CODE> builtin
11954 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
11957 <DT><CODE>shopt</CODE>
11958 <DD>Shell option names as accepted by the <CODE>shopt</CODE> builtin
11959 (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
11962 <DT><CODE>signal</CODE>
11966 <DT><CODE>stopped</CODE>
11967 <DD>Names of stopped jobs, if job control is active.
11970 <DT><CODE>user</CODE>
11971 <DD>User names. May also be specified as <SAMP>`-u'</SAMP>.
11974 <DT><CODE>variable</CODE>
11975 <DD>Names of all shell variables. May also be specified as <SAMP>`-v'</SAMP>.
11979 <DT><CODE>-C <VAR>command</VAR></CODE>
11980 <DD><VAR>command</VAR> is executed in a subshell environment, and its output is
11981 used as the possible completions.
11984 <DT><CODE>-F <VAR>function</VAR></CODE>
11985 <DD>The shell function <VAR>function</VAR> is executed in the current shell
11987 When it finishes, the possible completions are retrieved from the value
11988 of the <CODE>COMPREPLY</CODE> array variable.
11991 <DT><CODE>-G <VAR>globpat</VAR></CODE>
11992 <DD>The filename expansion pattern <VAR>globpat</VAR> is expanded to generate
11993 the possible completions.
11996 <DT><CODE>-P <VAR>prefix</VAR></CODE>
11997 <DD><VAR>prefix</VAR> is added at the beginning of each possible completion
11998 after all other options have been applied.
12001 <DT><CODE>-S <VAR>suffix</VAR></CODE>
12002 <DD><VAR>suffix</VAR> is appended to each possible completion
12003 after all other options have been applied.
12006 <DT><CODE>-W <VAR>wordlist</VAR></CODE>
12007 <DD>The <VAR>wordlist</VAR> is split using the characters in the
12008 <CODE>IFS</CODE> special variable as delimiters, and each resultant word
12010 The possible completions are the members of the resultant list which
12011 match the word being completed.
12014 <DT><CODE>-X <VAR>filterpat</VAR></CODE>
12015 <DD><VAR>filterpat</VAR> is a pattern as used for filename expansion.
12016 It is applied to the list of possible completions generated by the
12017 preceding options and arguments, and each completion matching
12018 <VAR>filterpat</VAR> is removed from the list.
12019 A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this
12020 case, any completion not matching <VAR>filterpat</VAR> is removed.
12024 The return value is true unless an invalid option is supplied, an option
12025 other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR>
12026 argument, an attempt is made to remove a completion specification for
12027 a <VAR>name</VAR> for which no specification exists, or
12028 an error occurs adding a completion specification.
12031 <DT><CODE>compopt</CODE>
12032 <DD><A NAME="IDX558"></A>
12033 <TABLE><tr><td> </td><td class=example><pre><CODE>compopt</CODE> [-o <VAR>option</VAR>] [-DE] [+o <VAR>option</VAR>] [<VAR>name</VAR>]
12034 </pre></td></tr></table>Modify completion options for each <VAR>name</VAR> according to the
12035 <VAR>option</VAR>s, or for the currently-executing completion if no <VAR>name</VAR>s
12037 If no <VAR>option</VAR>s are given, display the completion options for each
12038 <VAR>name</VAR> or the current completion.
12039 The possible values of <VAR>option</VAR> are those valid for the <CODE>complete</CODE>
12040 builtin described above.
12041 The <SAMP>`-D'</SAMP> option indicates that the remaining options should
12042 apply to the "default" command completion; that is, completion attempted
12043 on a command for which no completion has previously been defined.
12044 The <SAMP>`-E'</SAMP> option indicates that the remaining options should
12045 apply to "empty" command completion; that is, completion attempted on a
12049 The <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
12052 The return value is true unless an invalid option is supplied, an attempt
12053 is made to modify the options for a <VAR>name</VAR> for which no completion
12054 specification exists, or an output error occurs.
12060 <A NAME="IDX559"></A>
12063 <A NAME="Using History Interactively"></A>
12065 <A NAME="SEC120"></A>
12066 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12067 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> < </A>]</TD>
12068 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> > </A>]</TD>
12069 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12070 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12071 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> >> </A>]</TD>
12072 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12073 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12074 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12075 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12077 <H1> 9. Using History Interactively </H1>
12078 <!--docid::SEC120::-->
12081 This chapter describes how to use the GNU History Library
12082 interactively, from a user's standpoint.
12083 It should be considered a user's guide.
12084 For information on using the GNU History Library in other programs,
12085 see the GNU Readline Library Manual.
12088 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12089 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash lets you manipulate your command
12091 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">9.2 Bash History Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The Bash builtin commands that manipulate
12092 the command history.</TD></TR>
12093 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC123">9.3 History Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR>
12094 </TABLE></BLOCKQUOTE>
12097 <A NAME="Bash History Facilities"></A>
12099 <A NAME="SEC121"></A>
12100 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12101 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> < </A>]</TD>
12102 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> > </A>]</TD>
12103 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12104 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> Up </A>]</TD>
12105 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> >> </A>]</TD>
12106 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12107 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12108 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12109 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12111 <H2> 9.1 Bash History Facilities </H2>
12112 <!--docid::SEC121::-->
12115 When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin
12116 is enabled (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>),
12117 the shell provides access to the <EM>command history</EM>,
12118 the list of commands previously typed.
12119 The value of the <CODE>HISTSIZE</CODE> shell variable is used as the
12120 number of commands to save in a history list.
12121 The text of the last <CODE>$HISTSIZE</CODE>
12122 commands (default 500) is saved.
12123 The shell stores each command in the history list prior to
12124 parameter and variable expansion
12125 but after history expansion is performed, subject to the
12126 values of the shell variables
12127 <CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>.
12130 When the shell starts up, the history is initialized from the
12131 file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>).
12132 The file named by the value of <CODE>HISTFILE</CODE> is truncated, if
12133 necessary, to contain no more than the number of lines specified by
12134 the value of the <CODE>HISTFILESIZE</CODE> variable.
12135 When an interactive shell exits, the last
12136 <CODE>$HISTSIZE</CODE> lines are copied from the history list to the file
12137 named by <CODE>$HISTFILE</CODE>.
12138 If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>),
12139 the lines are appended to the history file,
12140 otherwise the history file is overwritten.
12141 If <CODE>HISTFILE</CODE>
12142 is unset, or if the history file is unwritable, the history is
12143 not saved. After saving the history, the history file is truncated
12144 to contain no more than <CODE>$HISTFILESIZE</CODE>
12145 lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed.
12148 If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information
12149 associated with each history entry is written to the history file,
12150 marked with the history comment character.
12151 When the history file is read, lines beginning with the history
12152 comment character followed immediately by a digit are interpreted
12153 as timestamps for the previous history line.
12156 The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute
12157 a portion of the history list.
12158 The <CODE>history</CODE> builtin may be used to display or modify the history
12159 list and manipulate the history file.
12160 When using command-line editing, search commands
12161 are available in each editing mode that provide access to the
12162 history list (see section <A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A>).
12165 The shell allows control over which commands are saved on the history
12166 list. The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE>
12167 variables may be set to cause the shell to save only a subset of the
12169 The <CODE>cmdhist</CODE>
12170 shell option, if enabled, causes the shell to attempt to save each
12171 line of a multi-line command in the same history entry, adding
12172 semicolons where necessary to preserve syntactic correctness.
12173 The <CODE>lithist</CODE>
12174 shell option causes the shell to save the command with embedded newlines
12175 instead of semicolons.
12176 The <CODE>shopt</CODE> builtin is used to set these options.
12177 See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>.
12180 <A NAME="Bash History Builtins"></A>
12182 <A NAME="SEC122"></A>
12183 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12184 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> < </A>]</TD>
12185 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> > </A>]</TD>
12186 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> << </A>]</TD>
12187 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> Up </A>]</TD>
12188 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> >> </A>]</TD>
12189 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12190 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12191 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12192 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12194 <H2> 9.2 Bash History Builtins </H2>
12195 <!--docid::SEC122::-->
12198 Bash provides two builtin commands which manipulate the
12199 history list and history file.
12204 <DT><CODE>fc</CODE>
12205 <DD><A NAME="IDX560"></A>
12206 <TABLE><tr><td> </td><td class=example><pre><CODE>fc [-e <VAR>ename</VAR>] [-lnr] [<VAR>first</VAR>] [<VAR>last</VAR>]</CODE>
12207 <CODE>fc -s [<VAR>pat</VAR>=<VAR>rep</VAR>] [<VAR>command</VAR>]</CODE>
12208 </pre></td></tr></table><P>
12210 Fix Command. In the first form, a range of commands from <VAR>first</VAR> to
12211 <VAR>last</VAR> is selected from the history list. Both <VAR>first</VAR> and
12212 <VAR>last</VAR> may be specified as a string (to locate the most recent
12213 command beginning with that string) or as a number (an index into the
12214 history list, where a negative number is used as an offset from the
12215 current command number). If <VAR>last</VAR> is not specified it is set to
12216 <VAR>first</VAR>. If <VAR>first</VAR> is not specified it is set to the previous
12217 command for editing and -16 for listing. If the <SAMP>`-l'</SAMP> flag is
12218 given, the commands are listed on standard output. The <SAMP>`-n'</SAMP> flag
12219 suppresses the command numbers when listing. The <SAMP>`-r'</SAMP> flag
12220 reverses the order of the listing. Otherwise, the editor given by
12221 <VAR>ename</VAR> is invoked on a file containing those commands. If
12222 <VAR>ename</VAR> is not given, the value of the following variable expansion
12223 is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>. This says to use the
12224 value of the <CODE>FCEDIT</CODE> variable if set, or the value of the
12225 <CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set.
12226 When editing is complete, the edited commands are echoed and executed.
12229 In the second form, <VAR>command</VAR> is re-executed after each instance
12230 of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>.
12233 A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so
12234 that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE>
12235 and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
12238 <DT><CODE>history</CODE>
12239 <DD><A NAME="IDX561"></A>
12240 <TABLE><tr><td> </td><td class=example><pre>history [<VAR>n</VAR>]
12242 history -d <VAR>offset</VAR>
12243 history [-anrw] [<VAR>filename</VAR>]
12244 history -ps <VAR>arg</VAR>
12245 </pre></td></tr></table><P>
12247 With no options, display the history list with line numbers.
12248 Lines prefixed with a <SAMP>`*'</SAMP> have been modified.
12249 An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines.
12250 If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null,
12251 it is used as a format string for <VAR>strftime</VAR> to display
12252 the time stamp associated with each displayed history entry.
12253 No intervening blank is printed between the formatted time stamp
12254 and the history line.
12257 Options, if supplied, have the following meanings:
12261 <DT><CODE>-c</CODE>
12262 <DD>Clear the history list. This may be combined
12263 with the other options to replace the history list completely.
12266 <DT><CODE>-d <VAR>offset</VAR></CODE>
12267 <DD>Delete the history entry at position <VAR>offset</VAR>.
12268 <VAR>offset</VAR> should be specified as it appears when the history is
12272 <DT><CODE>-a</CODE>
12274 history lines (history lines entered since the beginning of the
12275 current Bash session) to the history file.
12278 <DT><CODE>-n</CODE>
12279 <DD>Append the history lines not already read from the history file
12280 to the current history list. These are lines appended to the history
12281 file since the beginning of the current Bash session.
12284 <DT><CODE>-r</CODE>
12285 <DD>Read the current history file and append its contents to
12289 <DT><CODE>-w</CODE>
12290 <DD>Write out the current history to the history file.
12293 <DT><CODE>-p</CODE>
12294 <DD>Perform history substitution on the <VAR>arg</VAR>s and display the result
12295 on the standard output, without storing the results in the history list.
12298 <DT><CODE>-s</CODE>
12299 <DD>The <VAR>arg</VAR>s are added to the end of
12300 the history list as a single entry.
12306 When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is
12307 used, if <VAR>filename</VAR>
12308 is given, then it is used as the history file. If not, then
12309 the value of the <CODE>HISTFILE</CODE> variable is used.
12315 <A NAME="History Interaction"></A>
12317 <A NAME="SEC123"></A>
12318 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12319 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> < </A>]</TD>
12320 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> > </A>]</TD>
12321 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12322 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> Up </A>]</TD>
12323 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> >> </A>]</TD>
12324 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12325 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12326 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12327 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12329 <H2> 9.3 History Expansion </H2>
12330 <!--docid::SEC123::-->
12333 The History library provides a history expansion feature that is similar
12334 to the history expansion provided by <CODE>csh</CODE>. This section
12335 describes the syntax used to manipulate the history information.
12338 History expansions introduce words from the history list into
12339 the input stream, making it easy to repeat commands, insert the
12340 arguments to a previous command into the current input line, or
12341 fix errors in previous commands quickly.
12344 History expansion takes place in two parts. The first is to determine
12345 which line from the history list should be used during substitution.
12346 The second is to select portions of that line for inclusion into the
12347 current one. The line selected from the history is called the
12348 <EM>event</EM>, and the portions of that line that are acted upon are
12349 called <EM>words</EM>. Various <EM>modifiers</EM> are available to manipulate
12350 the selected words. The line is broken into words in the same fashion
12351 that Bash does, so that several words
12352 surrounded by quotes are considered one word.
12353 History expansions are introduced by the appearance of the
12354 history expansion character, which is <SAMP>`!'</SAMP> by default.
12355 Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion
12359 Several shell options settable with the <CODE>shopt</CODE>
12360 builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>) may be used to tailor
12361 the behavior of history expansion. If the
12362 <CODE>histverify</CODE> shell option is enabled, and Readline
12363 is being used, history substitutions are not immediately passed to
12365 Instead, the expanded line is reloaded into the Readline
12366 editing buffer for further modification.
12367 If Readline is being used, and the <CODE>histreedit</CODE>
12368 shell option is enabled, a failed history expansion will be
12369 reloaded into the Readline editing buffer for correction.
12370 The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command
12371 may be used to see what a history expansion will do before using it.
12372 The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to
12373 add commands to the end of the history list without actually executing
12374 them, so that they are available for subsequent recall.
12375 This is most useful in conjunction with Readline.
12378 The shell allows control of the various characters used by the
12379 history expansion mechanism with the <CODE>histchars</CODE> variable,
12380 as explained above (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>). The shell uses
12381 the history comment character to mark history timestamps when
12382 writing the history file.
12385 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12386 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">9.3.1 Event Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR>
12387 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">9.3.2 Word Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR>
12388 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC126">9.3.3 Modifiers</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR>
12389 </TABLE></BLOCKQUOTE>
12392 <A NAME="Event Designators"></A>
12394 <A NAME="SEC124"></A>
12395 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12396 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> < </A>]</TD>
12397 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> > </A>]</TD>
12398 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12399 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> Up </A>]</TD>
12400 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> >> </A>]</TD>
12401 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12402 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12403 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12404 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12406 <H3> 9.3.1 Event Designators </H3>
12407 <!--docid::SEC124::-->
12410 An event designator is a reference to a command line entry in the
12412 Unless the reference is absolute, events are relative to the current
12413 position in the history list.
12414 <A NAME="IDX562"></A>
12420 <DD>Start a history substitution, except when followed by a space, tab,
12421 the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the
12422 <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin).
12425 <DT><CODE>!<VAR>n</VAR></CODE>
12426 <DD>Refer to command line <VAR>n</VAR>.
12429 <DT><CODE>!-<VAR>n</VAR></CODE>
12430 <DD>Refer to the command <VAR>n</VAR> lines back.
12433 <DT><CODE>!!</CODE>
12434 <DD>Refer to the previous command. This is a synonym for <SAMP>`!-1'</SAMP>.
12437 <DT><CODE>!<VAR>string</VAR></CODE>
12438 <DD>Refer to the most recent command
12439 preceding the current position in the history list
12440 starting with <VAR>string</VAR>.
12443 <DT><CODE>!?<VAR>string</VAR>[?]</CODE>
12444 <DD>Refer to the most recent command
12445 preceding the current position in the history list
12446 containing <VAR>string</VAR>.
12448 <SAMP>`?'</SAMP> may be omitted if the <VAR>string</VAR> is followed immediately by
12452 <DT><CODE>^<VAR>string1</VAR>^<VAR>string2</VAR>^</CODE>
12453 <DD>Quick Substitution. Repeat the last command, replacing <VAR>string1</VAR>
12454 with <VAR>string2</VAR>. Equivalent to
12455 <CODE>!!:s/<VAR>string1</VAR>/<VAR>string2</VAR>/</CODE>.
12458 <DT><CODE>!#</CODE>
12459 <DD>The entire command line typed so far.
12465 <A NAME="Word Designators"></A>
12467 <A NAME="SEC125"></A>
12468 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12469 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> < </A>]</TD>
12470 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> > </A>]</TD>
12471 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD>
12472 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> Up </A>]</TD>
12473 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> >> </A>]</TD>
12474 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12475 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12476 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12477 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12479 <H3> 9.3.2 Word Designators </H3>
12480 <!--docid::SEC125::-->
12483 Word designators are used to select desired words from the event.
12484 A <SAMP>`:'</SAMP> separates the event specification from the word designator. It
12485 may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>,
12486 <SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>. Words are numbered from the beginning
12487 of the line, with the first word being denoted by 0 (zero). Words are
12488 inserted into the current line separated by single spaces.
12495 <DT><CODE>!!</CODE>
12496 <DD>designates the preceding command. When you type this, the preceding
12497 command is repeated in toto.
12500 <DT><CODE>!!:$</CODE>
12501 <DD>designates the last argument of the preceding command. This may be
12502 shortened to <CODE>!$</CODE>.
12505 <DT><CODE>!fi:2</CODE>
12506 <DD>designates the second argument of the most recent command starting with
12507 the letters <CODE>fi</CODE>.
12511 Here are the word designators:
12515 <DT><CODE>0 (zero)</CODE>
12516 <DD>The <CODE>0</CODE>th word. For many applications, this is the command word.
12519 <DT><CODE><VAR>n</VAR></CODE>
12520 <DD>The <VAR>n</VAR>th word.
12524 <DD>The first argument; that is, word 1.
12528 <DD>The last argument.
12532 <DD>The word matched by the most recent <SAMP>`?<VAR>string</VAR>?'</SAMP> search.
12535 <DT><CODE><VAR>x</VAR>-<VAR>y</VAR></CODE>
12536 <DD>A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>.
12540 <DD>All of the words, except the <CODE>0</CODE>th. This is a synonym for <SAMP>`1-$'</SAMP>.
12541 It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event;
12542 the empty string is returned in that case.
12545 <DT><CODE><VAR>x</VAR>*</CODE>
12546 <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP>
12549 <DT><CODE><VAR>x</VAR>-</CODE>
12550 <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omits the last word.
12556 If a word designator is supplied without an event specification, the
12557 previous command is used as the event.
12560 <A NAME="Modifiers"></A>
12562 <A NAME="SEC126"></A>
12563 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12564 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> < </A>]</TD>
12565 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> > </A>]</TD>
12566 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12567 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> Up </A>]</TD>
12568 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> >> </A>]</TD>
12569 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12570 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12571 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12572 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12574 <H3> 9.3.3 Modifiers </H3>
12575 <!--docid::SEC126::-->
12578 After the optional word designator, you can add a sequence of one or more
12579 of the following modifiers, each preceded by a <SAMP>`:'</SAMP>.
12585 <DD>Remove a trailing pathname component, leaving only the head.
12589 <DD>Remove all leading pathname components, leaving the tail.
12593 <DD>Remove a trailing suffix of the form <SAMP>`.<VAR>suffix</VAR>'</SAMP>, leaving
12598 <DD>Remove all but the trailing suffix.
12602 <DD>Print the new command but do not execute it.
12606 <DD>Quote the substituted words, escaping further substitutions.
12610 <DD>Quote the substituted words as with <SAMP>`q'</SAMP>,
12611 but break into words at spaces, tabs, and newlines.
12614 <DT><CODE>s/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>
12615 <DD>Substitute <VAR>new</VAR> for the first occurrence of <VAR>old</VAR> in the
12616 event line. Any delimiter may be used in place of <SAMP>`/'</SAMP>.
12617 The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR>
12618 with a single backslash. If <SAMP>`&'</SAMP> appears in <VAR>new</VAR>,
12619 it is replaced by <VAR>old</VAR>. A single backslash will quote
12620 the <SAMP>`&'</SAMP>. The final delimiter is optional if it is the last
12621 character on the input line.
12624 <DT><CODE>&</CODE>
12625 <DD>Repeat the previous substitution.
12629 <DD><DT><CODE>a</CODE>
12630 <DD>Cause changes to be applied over the entire event line. Used in
12631 conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>,
12632 or with <SAMP>`&'</SAMP>.
12636 <DD>Apply the following <SAMP>`s'</SAMP> modifier once to each word in the event.
12642 <A NAME="Installing Bash"></A>
12644 <A NAME="SEC127"></A>
12645 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12646 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> < </A>]</TD>
12647 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> > </A>]</TD>
12648 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> << </A>]</TD>
12649 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12650 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12651 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12652 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12653 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12654 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12656 <H1> 10. Installing Bash </H1>
12657 <!--docid::SEC127::-->
12660 This chapter provides basic instructions for installing Bash on
12661 the various supported platforms. The distribution supports the
12662 GNU operating systems, nearly every version of Unix, and several
12663 non-Unix systems such as BeOS and Interix.
12664 Other independent ports exist for
12665 MS-DOS, OS/2, and Windows platforms.
12668 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12669 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10.1 Basic Installation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR>
12670 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC129">10.2 Compilers and Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various
12672 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.3 Compiling For Multiple Architectures</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to compile Bash for more
12673 than one kind of system from
12674 the same source tree.</TD></TR>
12675 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC131">10.4 Installation Names</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set the various paths used by the installation.</TD></TR>
12676 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC132">10.5 Specifying the System Type</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to configure Bash for a particular system.</TD></TR>
12677 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC133">10.6 Sharing Defaults</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU
12678 programs.</TD></TR>
12679 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC134">10.7 Operation Controls</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR>
12680 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC135">10.8 Optional Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when
12681 building Bash.</TD></TR>
12682 </TABLE></BLOCKQUOTE>
12685 <A NAME="Basic Installation"></A>
12687 <A NAME="SEC128"></A>
12688 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12689 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> < </A>]</TD>
12690 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> > </A>]</TD>
12691 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> << </A>]</TD>
12692 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
12693 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12694 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12695 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12696 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12697 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12699 <H2> 10.1 Basic Installation </H2>
12700 <!--docid::SEC128::-->
12703 These are installation instructions for Bash.
12706 The simplest way to compile Bash is:
12711 <CODE>cd</CODE> to the directory containing the source code and type
12712 <SAMP>`./configure'</SAMP> to configure Bash for your system. If you're
12713 using <CODE>csh</CODE> on an old version of System V, you might need to
12714 type <SAMP>`sh ./configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying
12715 to execute <CODE>configure</CODE> itself.
12718 Running <CODE>configure</CODE> takes some time.
12719 While running, it prints messages telling which features it is
12724 Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug
12729 Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite.
12733 Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>.
12734 This will also install the manual pages and Info file.
12740 The <CODE>configure</CODE> shell script attempts to guess correct
12741 values for various system-dependent variables used during
12742 compilation. It uses those values to create a <TT>`Makefile'</TT> in
12743 each directory of the package (the top directory, the
12744 <TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories,
12745 each directory under <TT>`lib'</TT>, and several others). It also creates a
12746 <TT>`config.h'</TT> file containing system-dependent definitions.
12747 Finally, it creates a shell script named <CODE>config.status</CODE> that you
12748 can run in the future to recreate the current configuration, a
12749 file <TT>`config.cache'</TT> that saves the results of its tests to
12750 speed up reconfiguring, and a file <TT>`config.log'</TT> containing
12751 compiler output (useful mainly for debugging <CODE>configure</CODE>).
12753 <TT>`config.cache'</TT> contains results you don't want to keep, you
12754 may remove or edit it.
12757 To find out more about the options and arguments that the
12758 <CODE>configure</CODE> script understands, type
12761 <TABLE><tr><td> </td><td class=example><pre>bash-2.04$ ./configure --help
12762 </pre></td></tr></table></P><P>
12764 at the Bash prompt in your Bash source directory.
12767 If you need to do unusual things to compile Bash, please
12768 try to figure out how <CODE>configure</CODE> could check whether or not
12769 to do them, and mail diffs or instructions to
12770 <A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be
12771 considered for the next release.
12774 The file <TT>`configure.in'</TT> is used to create <CODE>configure</CODE>
12775 by a program called Autoconf. You only need
12776 <TT>`configure.in'</TT> if you want to change it or regenerate
12777 <CODE>configure</CODE> using a newer version of Autoconf. If
12778 you do this, make sure you are using Autoconf version 2.50 or
12782 You can remove the program binaries and object files from the
12783 source code directory by typing <SAMP>`make clean'</SAMP>. To also remove the
12784 files that <CODE>configure</CODE> created (so you can compile Bash for
12785 a different kind of computer), type <SAMP>`make distclean'</SAMP>.
12788 <A NAME="Compilers and Options"></A>
12790 <A NAME="SEC129"></A>
12791 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12792 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> < </A>]</TD>
12793 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> > </A>]</TD>
12794 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> << </A>]</TD>
12795 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
12796 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12797 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12798 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12799 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12800 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12802 <H2> 10.2 Compilers and Options </H2>
12803 <!--docid::SEC129::-->
12806 Some systems require unusual options for compilation or linking
12807 that the <CODE>configure</CODE> script does not know about. You can
12808 give <CODE>configure</CODE> initial values for variables by setting
12809 them in the environment. Using a Bourne-compatible shell, you
12810 can do that on the command line like this:
12813 <TABLE><tr><td> </td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
12814 </pre></td></tr></table></P><P>
12816 On systems that have the <CODE>env</CODE> program, you can do it like this:
12819 <TABLE><tr><td> </td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
12820 </pre></td></tr></table></P><P>
12822 The configuration process uses GCC to build Bash if it
12826 <A NAME="Compiling For Multiple Architectures"></A>
12828 <A NAME="SEC130"></A>
12829 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12830 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> < </A>]</TD>
12831 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> > </A>]</TD>
12832 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> << </A>]</TD>
12833 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
12834 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12835 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12836 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12837 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12838 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12840 <H2> 10.3 Compiling For Multiple Architectures </H2>
12841 <!--docid::SEC130::-->
12844 You can compile Bash for more than one kind of computer at the
12845 same time, by placing the object files for each architecture in their
12846 own directory. To do this, you must use a version of <CODE>make</CODE> that
12847 supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>.
12848 <CODE>cd</CODE> to the
12849 directory where you want the object files and executables to go and run
12850 the <CODE>configure</CODE> script from the source directory. You may need to
12851 supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the
12852 source files are. <CODE>configure</CODE> automatically checks for the
12853 source code in the directory that <CODE>configure</CODE> is in and in `..'.
12856 If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE>
12857 variable, you can compile Bash for one architecture at a
12858 time in the source code directory. After you have installed
12859 Bash for one architecture, use <SAMP>`make distclean'</SAMP> before
12860 reconfiguring for another architecture.
12863 Alternatively, if your system supports symbolic links, you can use the
12864 <TT>`support/mkclone'</TT> script to create a build tree which has
12865 symbolic links back to each file in the source directory. Here's an
12866 example that creates a build directory in the current directory from a
12867 source directory <TT>`/usr/gnu/src/bash-2.0'</TT>:
12870 <TABLE><tr><td> </td><td class=example><pre>bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
12871 </pre></td></tr></table></P><P>
12873 The <CODE>mkclone</CODE> script requires Bash, so you must have already built
12874 Bash for at least one architecture before you can create build
12875 directories for other architectures.
12878 <A NAME="Installation Names"></A>
12880 <A NAME="SEC131"></A>
12881 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12882 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> < </A>]</TD>
12883 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> > </A>]</TD>
12884 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> << </A>]</TD>
12885 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
12886 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12887 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12888 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12889 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12890 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12892 <H2> 10.4 Installation Names </H2>
12893 <!--docid::SEC131::-->
12896 By default, <SAMP>`make install'</SAMP> will install into
12897 <TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc. You can
12898 specify an installation prefix other than <TT>`/usr/local'</TT> by
12899 giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>,
12900 or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP>
12901 variable when running <SAMP>`make install'</SAMP>.
12904 You can specify separate installation prefixes for
12905 architecture-specific files and architecture-independent files.
12906 If you give <CODE>configure</CODE> the option
12907 <SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use
12908 <VAR>PATH</VAR> as the prefix for installing programs and libraries.
12909 Documentation and other data files will still use the regular prefix.
12912 <A NAME="Specifying the System Type"></A>
12914 <A NAME="SEC132"></A>
12915 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12916 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> < </A>]</TD>
12917 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> > </A>]</TD>
12918 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> << </A>]</TD>
12919 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
12920 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12921 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12922 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12923 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12924 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12926 <H2> 10.5 Specifying the System Type </H2>
12927 <!--docid::SEC132::-->
12930 There may be some features <CODE>configure</CODE> can not figure out
12931 automatically, but need to determine by the type of host Bash
12932 will run on. Usually <CODE>configure</CODE> can figure that
12933 out, but if it prints a message saying it can not guess the host
12934 type, give it the <SAMP>`--host=TYPE'</SAMP> option. <SAMP>`TYPE'</SAMP> can
12935 either be a short name for the system type, such as <SAMP>`sun4'</SAMP>,
12936 or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP>
12937 (e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>).
12940 See the file <TT>`support/config.sub'</TT> for the possible
12941 values of each field.
12944 <A NAME="Sharing Defaults"></A>
12946 <A NAME="SEC133"></A>
12947 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12948 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> < </A>]</TD>
12949 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> > </A>]</TD>
12950 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> << </A>]</TD>
12951 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
12952 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12953 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12954 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12955 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12956 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12958 <H2> 10.6 Sharing Defaults </H2>
12959 <!--docid::SEC133::-->
12962 If you want to set default values for <CODE>configure</CODE> scripts to
12963 share, you can create a site shell script called
12964 <CODE>config.site</CODE> that gives default values for variables like
12965 <CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>. <CODE>configure</CODE>
12966 looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then
12967 <TT>`PREFIX/etc/config.site'</TT> if it exists. Or, you can set the
12968 <CODE>CONFIG_SITE</CODE> environment variable to the location of the site
12969 script. A warning: the Bash <CODE>configure</CODE> looks for a site script,
12970 but not all <CODE>configure</CODE> scripts do.
12973 <A NAME="Operation Controls"></A>
12975 <A NAME="SEC134"></A>
12976 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12977 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> < </A>]</TD>
12978 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> > </A>]</TD>
12979 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> << </A>]</TD>
12980 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
12981 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
12982 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12983 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12984 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
12985 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12987 <H2> 10.7 Operation Controls </H2>
12988 <!--docid::SEC134::-->
12991 <CODE>configure</CODE> recognizes the following options to control how it
12997 <DT><CODE>--cache-file=<VAR>file</VAR></CODE>
12998 <DD>Use and save the results of the tests in
12999 <VAR>file</VAR> instead of <TT>`./config.cache'</TT>. Set <VAR>file</VAR> to
13000 <TT>`/dev/null'</TT> to disable caching, for debugging
13001 <CODE>configure</CODE>.
13004 <DT><CODE>--help</CODE>
13005 <DD>Print a summary of the options to <CODE>configure</CODE>, and exit.
13008 <DT><CODE>--quiet</CODE>
13009 <DD><DT><CODE>--silent</CODE>
13010 <DD><DT><CODE>-q</CODE>
13011 <DD>Do not print messages saying which checks are being made.
13014 <DT><CODE>--srcdir=<VAR>dir</VAR></CODE>
13015 <DD>Look for the Bash source code in directory <VAR>dir</VAR>. Usually
13016 <CODE>configure</CODE> can determine that directory automatically.
13019 <DT><CODE>--version</CODE>
13020 <DD>Print the version of Autoconf used to generate the <CODE>configure</CODE>
13025 <CODE>configure</CODE> also accepts some other, not widely used, boilerplate
13026 options. <SAMP>`configure --help'</SAMP> prints the complete list.
13029 <A NAME="Optional Features"></A>
13031 <A NAME="SEC135"></A>
13032 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13033 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> < </A>]</TD>
13034 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> > </A>]</TD>
13035 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> << </A>]</TD>
13036 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> Up </A>]</TD>
13037 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
13038 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13039 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13040 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
13041 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13043 <H2> 10.8 Optional Features </H2>
13044 <!--docid::SEC135::-->
13047 The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP>
13048 options, where <VAR>feature</VAR> indicates an optional part of Bash.
13049 There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options,
13050 where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>.
13051 To turn off the default use of a package, use
13052 <SAMP>`--without-<VAR>package</VAR>'</SAMP>. To configure Bash without a feature
13053 that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>.
13056 Here is a complete list of the <SAMP>`--enable-'</SAMP> and
13057 <SAMP>`--with-'</SAMP> options that the Bash <CODE>configure</CODE> recognizes.
13061 <DT><CODE>--with-afs</CODE>
13062 <DD>Define if you are using the Andrew File System from Transarc.
13065 <DT><CODE>--with-bash-malloc</CODE>
13066 <DD>Use the Bash version of
13067 <CODE>malloc</CODE> in the directory <TT>`lib/malloc'</TT>. This is not the same
13068 <CODE>malloc</CODE> that appears in GNU libc, but an older version
13069 originally derived from the 4.2 BSD <CODE>malloc</CODE>. This <CODE>malloc</CODE>
13070 is very fast, but wastes some space on each allocation.
13071 This option is enabled by default.
13072 The <TT>`NOTES'</TT> file contains a list of systems for
13073 which this should be turned off, and <CODE>configure</CODE> disables this
13074 option automatically for a number of systems.
13077 <DT><CODE>--with-curses</CODE>
13078 <DD>Use the curses library instead of the termcap library. This should
13079 be supplied if your system has an inadequate or incomplete termcap
13083 <DT><CODE>--with-gnu-malloc</CODE>
13084 <DD>A synonym for <CODE>--with-bash-malloc</CODE>.
13087 <DT><CODE>--with-installed-readline[=<VAR>PREFIX</VAR>]</CODE>
13088 <DD>Define this to make Bash link with a locally-installed version of Readline
13089 rather than the version in <TT>`lib/readline'</TT>. This works only with
13090 Readline 5.0 and later versions. If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not
13091 supplied, <CODE>configure</CODE> uses the values of the make variables
13092 <CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE>
13093 by default, to find the installed version of Readline if it is not in
13094 the standard system include and library directories.
13095 If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in
13096 <TT>`lib/readline'</TT>.
13097 If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as
13098 a directory pathname and looks for
13099 the installed version of Readline in subdirectories of that directory
13100 (include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in
13101 <VAR>PREFIX</VAR>/<CODE>lib</CODE>).
13104 <DT><CODE>--with-purify</CODE>
13105 <DD>Define this to use the Purify memory allocation checker from Rational
13109 <DT><CODE>--enable-minimal-config</CODE>
13110 <DD>This produces a shell with minimal features, close to the historical
13115 There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is
13116 compiled and linked, rather than changing run-time features.
13120 <DT><CODE>--enable-largefile</CODE>
13121 <DD>Enable support for <A HREF="http://www.sas.com/standards/large_file/x_open.20Mar96.html">large files</A> if the operating system requires special compiler options
13122 to build programs which can access large files. This is enabled by
13123 default, if the operating system provides large file support.
13126 <DT><CODE>--enable-profiling</CODE>
13127 <DD>This builds a Bash binary that produces profiling information to be
13128 processed by <CODE>gprof</CODE> each time it is executed.
13131 <DT><CODE>--enable-static-link</CODE>
13132 <DD>This causes Bash to be linked statically, if <CODE>gcc</CODE> is being used.
13133 This could be used to build a version to use as root's shell.
13137 The <SAMP>`minimal-config'</SAMP> option can be used to disable all of
13138 the following options, but it is processed first, so individual
13139 options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>.
13142 All of the following options except for <SAMP>`disabled-builtins'</SAMP> and
13143 <SAMP>`xpg-echo-default'</SAMP> are
13144 enabled by default, unless the operating system does not provide the
13149 <DT><CODE>--enable-alias</CODE>
13150 <DD>Allow alias expansion and include the <CODE>alias</CODE> and <CODE>unalias</CODE>
13151 builtins (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
13154 <DT><CODE>--enable-arith-for-command</CODE>
13155 <DD>Include support for the alternate form of the <CODE>for</CODE> command
13156 that behaves like the C language <CODE>for</CODE> statement
13157 (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
13160 <DT><CODE>--enable-array-variables</CODE>
13161 <DD>Include support for one-dimensional array shell variables
13162 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
13165 <DT><CODE>--enable-bang-history</CODE>
13166 <DD>Include support for <CODE>csh</CODE>-like history substitution
13167 (see section <A HREF="bashref.html#SEC123">9.3 History Expansion</A>).
13170 <DT><CODE>--enable-brace-expansion</CODE>
13171 <DD>Include <CODE>csh</CODE>-like brace expansion
13172 ( <CODE>b{a,b}c</CODE> ==> <CODE>bac bbc</CODE> ).
13173 See <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>, for a complete description.
13176 <DT><CODE>--enable-casemod-attributes</CODE>
13177 <DD>Include support for case-modifying attributes in the <CODE>declare</CODE> builtin
13178 and assignment statements. Variables with the <VAR>uppercase</VAR> attribute,
13179 for example, will have their values converted to uppercase upon assignment.
13182 <DT><CODE>--enable-casemod-expansion</CODE>
13183 <DD>Include support for case-modifying word expansions.
13186 <DT><CODE>--enable-command-timing</CODE>
13187 <DD>Include support for recognizing <CODE>time</CODE> as a reserved word and for
13188 displaying timing statistics for the pipeline following <CODE>time</CODE>
13189 (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13190 This allows pipelines as well as shell builtins and functions to be timed.
13193 <DT><CODE>--enable-cond-command</CODE>
13194 <DD>Include support for the <CODE>[[</CODE> conditional command.
13195 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13198 <DT><CODE>--enable-cond-regexp</CODE>
13199 <DD>Include support for matching POSIX regular expressions using the
13200 <SAMP>`=~'</SAMP> binary operator in the <CODE>[[</CODE> conditional command.
13201 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13204 <DT><CODE>--enable-coprocesses</CODE>
13205 <DD>Include support for coprocesses and the <CODE>coproc</CODE> reserved word
13206 (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13209 <DT><CODE>--enable-debugger</CODE>
13210 <DD>Include support for the bash debugger (distributed separately).
13213 <DT><CODE>--enable-directory-stack</CODE>
13214 <DD>Include support for a <CODE>csh</CODE>-like directory stack and the
13215 <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins
13216 (see section <A HREF="bashref.html#SEC87">6.8 The Directory Stack</A>).
13219 <DT><CODE>--enable-disabled-builtins</CODE>
13220 <DD>Allow builtin commands to be invoked via <SAMP>`builtin xxx'</SAMP>
13221 even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>.
13222 See <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and
13223 <CODE>enable</CODE> builtin commands.
13226 <DT><CODE>--enable-dparen-arithmetic</CODE>
13227 <DD>Include support for the <CODE>((<small>...</small>))</CODE> command
13228 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13231 <DT><CODE>--enable-extended-glob</CODE>
13232 <DD>Include support for the extended pattern matching features described
13233 above under <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>.
13236 <DT><CODE>--enable-extended-glob-default</CODE>
13237 <DD>Set the default value of the <VAR>extglob</VAR> shell option described
13238 above under <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A> to be enabled.
13241 <DT><CODE>--enable-help-builtin</CODE>
13242 <DD>Include the <CODE>help</CODE> builtin, which displays help on shell builtins and
13243 variables (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13246 <DT><CODE>--enable-history</CODE>
13247 <DD>Include command history and the <CODE>fc</CODE> and <CODE>history</CODE>
13248 builtin commands (see section <A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>).
13251 <DT><CODE>--enable-job-control</CODE>
13252 <DD>This enables the job control features (see section <A HREF="bashref.html#SEC92">7. Job Control</A>),
13253 if the operating system supports them.
13256 <DT><CODE>--enable-multibyte</CODE>
13257 <DD>This enables support for multibyte characters if the operating
13258 system provides the necessary support.
13261 <DT><CODE>--enable-net-redirections</CODE>
13262 <DD>This enables the special handling of filenames of the form
13263 <CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> and
13264 <CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
13265 when used in redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
13268 <DT><CODE>--enable-process-substitution</CODE>
13269 <DD>This enables process substitution (see section <A HREF="bashref.html#SEC35">3.5.6 Process Substitution</A>) if
13270 the operating system provides the necessary support.
13273 <DT><CODE>--enable-progcomp</CODE>
13274 <DD>Enable the programmable completion facilities
13275 (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
13276 If Readline is not enabled, this option has no effect.
13279 <DT><CODE>--enable-prompt-string-decoding</CODE>
13280 <DD>Turn on the interpretation of a number of backslash-escaped characters
13281 in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt
13282 strings. See <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>, for a complete list of prompt
13283 string escape sequences.
13286 <DT><CODE>--enable-readline</CODE>
13287 <DD>Include support for command-line editing and history with the Bash
13288 version of the Readline library (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>).
13291 <DT><CODE>--enable-restricted</CODE>
13292 <DD>Include support for a <EM>restricted shell</EM>. If this is enabled, Bash,
13293 when called as <CODE>rbash</CODE>, enters a restricted mode. See
13294 <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>, for a description of restricted mode.
13297 <DT><CODE>--enable-select</CODE>
13298 <DD>Include the <CODE>select</CODE> compound command, which allows the generation of
13299 simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13302 <DT><CODE>--enable-separate-helpfiles</CODE>
13303 <DD>Use external files for the documentation displayed by the <CODE>help</CODE> builtin
13304 instead of storing the text internally.
13307 <DT><CODE>--enable-single-help-strings</CODE>
13308 <DD>Store the text displayed by the <CODE>help</CODE> builtin as a single string for
13309 each help topic. This aids in translating the text to different languages.
13310 You may need to disable this if your compiler cannot handle very long string
13314 <DT><CODE>--enable-strict-posix-default</CODE>
13315 <DD>Make Bash POSIX-conformant by default (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
13318 <DT><CODE>--enable-usg-echo-default</CODE>
13319 <DD>A synonym for <CODE>--enable-xpg-echo-default</CODE>.
13322 <DT><CODE>--enable-xpg-echo-default</CODE>
13323 <DD>Make the <CODE>echo</CODE> builtin expand backslash-escaped characters by default,
13324 without requiring the <SAMP>`-e'</SAMP> option.
13325 This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>,
13326 which makes the Bash <CODE>echo</CODE> behave more like the version specified in
13327 the Single Unix Specification, version 3.
13328 See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that
13329 <CODE>echo</CODE> recognizes.
13335 The file <TT>`config-top.h'</TT> contains C Preprocessor
13336 <SAMP>`#define'</SAMP> statements for options which are not settable from
13337 <CODE>configure</CODE>.
13338 Some of these are not meant to be changed; beware of the consequences if
13340 Read the comments associated with each definition for more
13341 information about its effect.
13344 <A NAME="Reporting Bugs"></A>
13346 <A NAME="SEC136"></A>
13347 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13348 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> < </A>]</TD>
13349 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> > </A>]</TD>
13350 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> << </A>]</TD>
13351 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13352 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> >> </A>]</TD>
13353 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13354 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13355 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
13356 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13358 <H1> A. Reporting Bugs </H1>
13359 <!--docid::SEC136::-->
13362 Please report all bugs you find in Bash.
13363 But first, you should
13364 make sure that it really is a bug, and that it appears in the latest
13366 The latest version of Bash is always available for FTP from
13367 <A HREF="ftp://ftp.gnu.org/pub/gnu/bash/">ftp://ftp.gnu.org/pub/gnu/bash/</A>.
13370 Once you have determined that a bug actually exists, use the
13371 <CODE>bashbug</CODE> command to submit a bug report.
13372 If you have a fix, you are encouraged to mail that as well!
13373 Suggestions and `philosophical' bug reports may be mailed
13374 to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet
13375 newsgroup <CODE>gnu.bash.bug</CODE>.
13378 All bug reports should include:
13381 The version number of Bash.
13383 The hardware and operating system.
13385 The compiler used to compile Bash.
13387 A description of the bug behaviour.
13389 A short script or `recipe' which exercises the bug and may be used
13394 <CODE>bashbug</CODE> inserts the first three items automatically into
13395 the template it provides for filing a bug report.
13398 Please send all reports concerning this manual to
13399 <A HREF="mailto:chet.ramey@case.edu">chet.ramey@case.edu</A>.
13402 <A NAME="Major Differences From The Bourne Shell"></A>
13404 <A NAME="SEC137"></A>
13405 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13406 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> < </A>]</TD>
13407 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> > </A>]</TD>
13408 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> << </A>]</TD>
13409 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13410 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> >> </A>]</TD>
13411 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13412 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13413 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
13414 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13416 <H1> B. Major Differences From The Bourne Shell </H1>
13417 <!--docid::SEC137::-->
13420 Bash implements essentially the same grammar, parameter and
13421 variable expansion, redirection, and quoting as the Bourne Shell.
13422 Bash uses the POSIX standard as the specification of
13423 how these features are to be implemented. There are some
13424 differences between the traditional Bourne shell and Bash; this
13425 section quickly details the differences of significance. A
13426 number of these differences are explained in greater depth in
13428 This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the
13429 last version of the historical Bourne shell) as the baseline reference.
13435 Bash is POSIX-conformant, even where the POSIX specification
13436 differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
13440 Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>).
13444 Bash has command-line editing (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>) and
13445 the <CODE>bind</CODE> builtin.
13449 Bash provides a programmable word completion mechanism
13450 (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>), and builtin commands
13451 <CODE>complete</CODE>, <CODE>compgen</CODE>, and <CODE>compopt</CODE>, to
13456 Bash has command history (see section <A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>) and the
13457 <CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it.
13458 The Bash history list maintains timestamp information and uses the
13459 value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it.
13463 Bash implements <CODE>csh</CODE>-like history expansion
13464 (see section <A HREF="bashref.html#SEC123">9.3 History Expansion</A>).
13468 Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>), and the
13469 appropriate variable expansions and assignment syntax to use them.
13470 Several of the Bash builtins take options to act on arrays.
13471 Bash provides a number of built-in array variables.
13475 The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C
13476 backslash-escaped characters in the text between the single quotes,
13477 is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>).
13481 Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do
13482 locale-specific translation of the characters between the double
13483 quotes. The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP>
13484 invocation options list the translatable strings found in a script
13485 (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
13489 Bash implements the <CODE>!</CODE> keyword to negate the return value of
13490 a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13491 Very useful when an <CODE>if</CODE> statement needs to act only if a test fails.
13492 The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to
13493 return a failure status if any command fails.
13497 Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13498 The display of the timing statistics may be controlled with the
13499 <CODE>TIMEFORMAT</CODE> variable.
13503 Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE>
13504 arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
13508 Bash includes the <CODE>select</CODE> compound command, which allows the
13509 generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13513 Bash includes the <CODE>[[</CODE> compound command, which makes conditional
13514 testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including
13515 optional regular expression matching.
13519 Bash provides optional case-insensitive matching for the <CODE>case</CODE> and
13520 <CODE>[[</CODE> constructs.
13524 Bash includes brace expansion (see section <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>) and tilde
13525 expansion (see section <A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>).
13529 Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE>
13530 builtins (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
13534 Bash provides shell arithmetic, the <CODE>((</CODE> compound command
13535 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>),
13536 and arithmetic expansion (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
13540 Variables present in the shell's initial environment are automatically
13541 exported to child processes. The Bourne shell does not normally do
13542 this unless the variables are explicitly marked using the <CODE>export</CODE>
13547 Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value
13548 of the variable named on the left hand side.
13552 Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP>
13553 and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from
13554 variable values (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
13558 The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>,
13559 is supported (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
13563 The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>,
13564 which expands to the substring of <CODE>var</CODE>'s value of length
13565 <VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present
13566 (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
13571 <CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>,
13572 which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in
13573 the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
13577 The expansion <CODE>${!<VAR>prefix}*</VAR></CODE> expansion, which expands to
13578 the names of all shell variables whose names begin with <VAR>prefix</VAR>,
13579 is available (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
13583 Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE>
13584 (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
13588 Bash can expand positional parameters beyond <CODE>$9</CODE> using
13589 <CODE>${<VAR>num</VAR>}</CODE>.
13593 The POSIX <CODE>$()</CODE> form of command substitution
13594 is implemented (see section <A HREF="bashref.html#SEC33">3.5.4 Command Substitution</A>),
13595 and preferred to the Bourne shell's <CODE>"</CODE> (which
13596 is also implemented for backwards compatibility).
13600 Bash has process substitution (see section <A HREF="bashref.html#SEC35">3.5.6 Process Substitution</A>).
13604 Bash automatically assigns variables that provide information about the
13605 current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host
13606 (<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>),
13607 and the instance of Bash that is running (<CODE>BASH</CODE>,
13608 <CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>). See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>,
13613 The <CODE>IFS</CODE> variable is used to split only the results of expansion,
13614 not all words (see section <A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A>).
13615 This closes a longstanding shell security hole.
13619 Bash implements the full set of POSIX filename expansion operators,
13620 including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and
13621 <VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>).
13625 Bash implements extended pattern matching features when the <CODE>extglob</CODE>
13626 shell option is enabled (see section <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>).
13630 It is possible to have a variable and a function with the same name;
13631 <CODE>sh</CODE> does not separate the two name spaces.
13635 Bash functions are permitted to have local variables using the
13636 <CODE>local</CODE> builtin, and thus useful recursive functions may be written
13637 (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13641 Variable assignments preceding commands affect only that command, even
13642 builtins and functions (see section <A HREF="bashref.html#SEC55">3.7.4 Environment</A>).
13643 In <CODE>sh</CODE>, all variable assignments
13644 preceding commands are global unless the command is executed from the
13649 Bash performs filename expansion on filenames specified as operands
13650 to input and output redirection operators (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
13654 Bash contains the <SAMP>`<>'</SAMP> redirection operator, allowing a file to be
13655 opened for both reading and writing, and the <SAMP>`&>'</SAMP> redirection
13656 operator, for directing standard output and standard error to the same
13657 file (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
13661 Bash includes the <SAMP>`<<<'</SAMP> redirection operator, allowing a string to
13662 be used as the standard input to a command.
13666 Bash implements the <SAMP>`[n]<&<VAR>word</VAR>'</SAMP> and <SAMP>`[n]>&<VAR>word</VAR>'</SAMP>
13667 redirection operators, which move one file descriptor to another.
13671 Bash treats a number of filenames specially when they are
13672 used in redirection operators (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
13676 Bash can open network connections to arbitrary machines and services
13677 with the redirection operators (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
13681 The <CODE>noclobber</CODE> option is available to avoid overwriting existing
13682 files with output redirection (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
13683 The <SAMP>`>|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>.
13687 The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
13688 each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and
13693 Bash allows a function to override a builtin with the same name, and provides
13694 access to that builtin's functionality within the function via the
13695 <CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13699 The <CODE>command</CODE> builtin allows selective disabling of functions
13700 when command lookup is performed (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13704 Individual builtins may be enabled or disabled using the <CODE>enable</CODE>
13705 builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13709 The Bash <CODE>exec</CODE> builtin takes additional options that allow users
13710 to control the contents of the environment passed to the executed
13711 command, and what the zeroth argument to the command is to be
13712 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
13716 Shell functions may be exported to children via the environment
13717 using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>).
13721 The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can
13722 take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to
13723 display variables with various attributes set in a format that can be
13724 used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable
13725 attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes
13726 and values simultaneously.
13730 The Bash <CODE>hash</CODE> builtin allows a name to be associated with
13731 an arbitrary filename, even when that filename cannot be found by
13732 searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP>
13733 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
13737 Bash includes a <CODE>help</CODE> builtin for quick reference to shell
13738 facilities (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13742 The <CODE>printf</CODE> builtin is available to display formatted output
13743 (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13747 The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>)
13748 will read a line ending in <SAMP>`\'</SAMP> with
13749 the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a
13750 default if no non-option arguments are supplied.
13751 The Bash <CODE>read</CODE> builtin
13752 also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use
13753 Readline to obtain the line when given the <SAMP>`-e'</SAMP> option.
13754 The <CODE>read</CODE> builtin also has additional options to control input:
13755 the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as
13756 they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out
13757 if input does not arrive within a specified number of seconds, the
13758 <SAMP>`-n'</SAMP> option will allow reading only a specified number of
13759 characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read
13760 until a particular character rather than newline.
13764 The <CODE>return</CODE> builtin may be used to abort execution of scripts
13765 executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins
13766 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
13770 Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell
13771 optional capabilities (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), and allows these options
13772 to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>).
13776 Bash has much more optional behavior controllable with the <CODE>set</CODE>
13777 builtin (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
13781 The <SAMP>`-x'</SAMP> (<CODE>xtrace</CODE>) option displays commands other than
13782 simple commands when performing an execution trace
13783 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
13787 The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
13788 is slightly different, as it implements the POSIX algorithm,
13789 which specifies the behavior based on the number of arguments.
13793 Bash includes the <CODE>caller</CODE> builtin, which displays the context of
13794 any active subroutine call (a shell function or a script executed with
13795 the <CODE>.</CODE> or <CODE>source</CODE> builtins). This supports the bash
13800 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>) allows a
13801 <CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>.
13802 Commands specified with a <CODE>DEBUG</CODE> trap are executed before every
13803 simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
13804 <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
13805 the first command executes in a shell function.
13806 The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the
13807 function has been given the <CODE>trace</CODE> attribute or the
13808 <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13809 The <CODE>extdebug</CODE> shell option has additional effects on the
13810 <CODE>DEBUG</CODE> trap.
13813 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>) allows an
13814 <CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13815 Commands specified with an <CODE>ERR</CODE> trap are executed after a simple
13816 command fails, with a few exceptions.
13817 The <CODE>ERR</CODE> trap is not inherited by shell functions unless the
13818 <CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled.
13821 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>) allows a
13822 <CODE>RETURN</CODE> pseudo-signal specification, similar to
13823 <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13824 Commands specified with an <CODE>RETURN</CODE> trap are executed before
13825 execution resumes after a shell function or a shell script executed with
13826 <CODE>.</CODE> or <CODE>source</CODE> returns.
13827 The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the
13828 function has been given the <CODE>trace</CODE> attribute or the
13829 <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13833 The Bash <CODE>type</CODE> builtin is more extensive and gives more information
13834 about the names it finds (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
13838 The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause
13839 the output to be displayed in the form of a <CODE>umask</CODE> command
13840 that may be reused as input (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
13844 Bash implements a <CODE>csh</CODE>-like directory stack, and provides the
13845 <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it
13846 (see section <A HREF="bashref.html#SEC87">6.8 The Directory Stack</A>).
13847 Bash also makes the directory stack visible as the value of the
13848 <CODE>DIRSTACK</CODE> shell variable.
13852 Bash interprets special backslash-escaped characters in the prompt
13853 strings when interactive (see section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>).
13857 The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>);
13858 the SVR4.2 shell restricted mode is too limited.
13862 The <CODE>disown</CODE> builtin can remove a job from the internal shell
13863 job table (see section <A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>) or suppress the sending
13864 of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a
13865 <CODE>SIGHUP</CODE>.
13869 Bash includes a number of features to support a separate debugger for
13874 The SVR4.2 shell has two privilege-related builtins
13875 (<CODE>mldmode</CODE> and <CODE>priv</CODE>) not present in Bash.
13879 Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins.
13883 Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting.
13887 The SVR4.2 <CODE>sh</CODE> uses a <CODE>TIMEOUT</CODE> variable like Bash uses
13888 <CODE>TMOUT</CODE>.
13894 More features unique to Bash may be found in <A HREF="bashref.html#SEC69">6. Bash Features</A>.
13898 <A NAME="SEC138"></A>
13899 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13900 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> < </A>]</TD>
13901 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> > </A>]</TD>
13902 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> << </A>]</TD>
13903 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> Up </A>]</TD>
13904 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> >> </A>]</TD>
13905 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13906 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13907 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
13908 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13910 <H2> B.1 Implementation Differences From The SVR4.2 Shell </H2>
13911 <!--docid::SEC138::-->
13914 Since Bash is a completely new implementation, it does not suffer from
13915 many of the limitations of the SVR4.2 shell. For instance:
13921 Bash does not fork a subshell when redirecting into or out of
13922 a shell control structure such as an <CODE>if</CODE> or <CODE>while</CODE>
13927 Bash does not allow unbalanced quotes. The SVR4.2 shell will silently
13928 insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances.
13929 This can be the cause of some hard-to-find errors.
13933 The SVR4.2 shell uses a baroque memory management scheme based on
13934 trapping <CODE>SIGSEGV</CODE>. If the shell is started from a process with
13935 <CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library
13936 function call), it misbehaves badly.
13940 In a questionable attempt at security, the SVR4.2 shell,
13941 when invoked without the <SAMP>`-p'</SAMP> option, will alter its real
13942 and effective UID and GID if they are less than some
13943 magic threshold value, commonly 100.
13944 This can lead to unexpected results.
13948 The SVR4.2 shell does not allow users to trap <CODE>SIGSEGV</CODE>,
13949 <CODE>SIGALRM</CODE>, or <CODE>SIGCHLD</CODE>.
13953 The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>,
13954 <CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset.
13958 The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of
13963 Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>);
13964 the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>). In
13965 fact, some versions of the shell dump core if the second argument begins
13966 with a <SAMP>`-'</SAMP>.
13970 The SVR4.2 shell exits a script if any builtin fails; Bash exits
13971 a script only if one of the POSIX special builtins fails, and
13972 only for certain failures, as enumerated in the POSIX standard.
13976 The SVR4.2 shell behaves differently when invoked as <CODE>jsh</CODE>
13977 (it turns on job control).
13981 <A NAME="GNU Free Documentation License"></A>
13983 <A NAME="SEC139"></A>
13984 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13985 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> < </A>]</TD>
13986 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> > </A>]</TD>
13987 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> << </A>]</TD>
13988 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13989 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> >> </A>]</TD>
13990 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13991 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
13993 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13995 <H1> C. GNU Free Documentation License </H1>
13996 <!--docid::SEC139::-->
14000 Version 1.3, 3 November 2008
14004 <TABLE><tr><td> </td><td class=display><pre style="font-family: serif">Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
14005 <A HREF="http://fsf.org/">http://fsf.org/</A>
14007 Everyone is permitted to copy and distribute verbatim copies
14008 of this license document, but changing it is not allowed.
14009 </pre></td></tr></table></P><P>
14016 The purpose of this License is to make a manual, textbook, or other
14017 functional and useful document <EM>free</EM> in the sense of freedom: to
14018 assure everyone the effective freedom to copy and redistribute it,
14019 with or without modifying it, either commercially or noncommercially.
14020 Secondarily, this License preserves for the author and publisher a way
14021 to get credit for their work, while not being considered responsible
14022 for modifications made by others.
14025 This License is a kind of "copyleft", which means that derivative
14026 works of the document must themselves be free in the same sense. It
14027 complements the GNU General Public License, which is a copyleft
14028 license designed for free software.
14031 We have designed this License in order to use it for manuals for free
14032 software, because free software needs free documentation: a free
14033 program should come with manuals providing the same freedoms that the
14034 software does. But this License is not limited to software manuals;
14035 it can be used for any textual work, regardless of subject matter or
14036 whether it is published as a printed book. We recommend this License
14037 principally for works whose purpose is instruction or reference.
14041 APPLICABILITY AND DEFINITIONS
14044 This License applies to any manual or other work, in any medium, that
14045 contains a notice placed by the copyright holder saying it can be
14046 distributed under the terms of this License. Such a notice grants a
14047 world-wide, royalty-free license, unlimited in duration, to use that
14048 work under the conditions stated herein. The "Document", below,
14049 refers to any such manual or work. Any member of the public is a
14050 licensee, and is addressed as "you". You accept the license if you
14051 copy, modify or distribute the work in a way requiring permission
14052 under copyright law.
14055 A "Modified Version" of the Document means any work containing the
14056 Document or a portion of it, either copied verbatim, or with
14057 modifications and/or translated into another language.
14060 A "Secondary Section" is a named appendix or a front-matter section
14061 of the Document that deals exclusively with the relationship of the
14062 publishers or authors of the Document to the Document's overall
14063 subject (or to related matters) and contains nothing that could fall
14064 directly within that overall subject. (Thus, if the Document is in
14065 part a textbook of mathematics, a Secondary Section may not explain
14066 any mathematics.) The relationship could be a matter of historical
14067 connection with the subject or with related matters, or of legal,
14068 commercial, philosophical, ethical or political position regarding
14072 The "Invariant Sections" are certain Secondary Sections whose titles
14073 are designated, as being those of Invariant Sections, in the notice
14074 that says that the Document is released under this License. If a
14075 section does not fit the above definition of Secondary then it is not
14076 allowed to be designated as Invariant. The Document may contain zero
14077 Invariant Sections. If the Document does not identify any Invariant
14078 Sections then there are none.
14081 The "Cover Texts" are certain short passages of text that are listed,
14082 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
14083 the Document is released under this License. A Front-Cover Text may
14084 be at most 5 words, and a Back-Cover Text may be at most 25 words.
14087 A "Transparent" copy of the Document means a machine-readable copy,
14088 represented in a format whose specification is available to the
14089 general public, that is suitable for revising the document
14090 straightforwardly with generic text editors or (for images composed of
14091 pixels) generic paint programs or (for drawings) some widely available
14092 drawing editor, and that is suitable for input to text formatters or
14093 for automatic translation to a variety of formats suitable for input
14094 to text formatters. A copy made in an otherwise Transparent file
14095 format whose markup, or absence of markup, has been arranged to thwart
14096 or discourage subsequent modification by readers is not Transparent.
14097 An image format is not Transparent if used for any substantial amount
14098 of text. A copy that is not "Transparent" is called "Opaque".
14101 Examples of suitable formats for Transparent copies include plain
14102 ASCII without markup, Texinfo input format, LaTeX input
14103 format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available
14104 <FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>,
14105 PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification. Examples
14106 of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and
14107 <FONT SIZE="-1">JPG</FONT>. Opaque formats include proprietary formats that can be
14108 read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or
14109 <FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are
14110 not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>,
14111 PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for
14112 output purposes only.
14115 The "Title Page" means, for a printed book, the title page itself,
14116 plus such following pages as are needed to hold, legibly, the material
14117 this License requires to appear in the title page. For works in
14118 formats which do not have any title page as such, "Title Page" means
14119 the text near the most prominent appearance of the work's title,
14120 preceding the beginning of the body of the text.
14123 The "publisher" means any person or entity that distributes copies
14124 of the Document to the public.
14127 A section "Entitled XYZ" means a named subunit of the Document whose
14128 title either is precisely XYZ or contains XYZ in parentheses following
14129 text that translates XYZ in another language. (Here XYZ stands for a
14130 specific section name mentioned below, such as "Acknowledgements",
14131 "Dedications", "Endorsements", or "History".) To "Preserve the Title"
14132 of such a section when you modify the Document means that it remains a
14133 section "Entitled XYZ" according to this definition.
14136 The Document may include Warranty Disclaimers next to the notice which
14137 states that this License applies to the Document. These Warranty
14138 Disclaimers are considered to be included by reference in this
14139 License, but only as regards disclaiming warranties: any other
14140 implication that these Warranty Disclaimers may have is void and has
14141 no effect on the meaning of this License.
14148 You may copy and distribute the Document in any medium, either
14149 commercially or noncommercially, provided that this License, the
14150 copyright notices, and the license notice saying this License applies
14151 to the Document are reproduced in all copies, and that you add no other
14152 conditions whatsoever to those of this License. You may not use
14153 technical measures to obstruct or control the reading or further
14154 copying of the copies you make or distribute. However, you may accept
14155 compensation in exchange for copies. If you distribute a large enough
14156 number of copies you must also follow the conditions in section 3.
14159 You may also lend copies, under the same conditions stated above, and
14160 you may publicly display copies.
14164 COPYING IN QUANTITY
14167 If you publish printed copies (or copies in media that commonly have
14168 printed covers) of the Document, numbering more than 100, and the
14169 Document's license notice requires Cover Texts, you must enclose the
14170 copies in covers that carry, clearly and legibly, all these Cover
14171 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
14172 the back cover. Both covers must also clearly and legibly identify
14173 you as the publisher of these copies. The front cover must present
14174 the full title with all words of the title equally prominent and
14175 visible. You may add other material on the covers in addition.
14176 Copying with changes limited to the covers, as long as they preserve
14177 the title of the Document and satisfy these conditions, can be treated
14178 as verbatim copying in other respects.
14181 If the required texts for either cover are too voluminous to fit
14182 legibly, you should put the first ones listed (as many as fit
14183 reasonably) on the actual cover, and continue the rest onto adjacent
14187 If you publish or distribute Opaque copies of the Document numbering
14188 more than 100, you must either include a machine-readable Transparent
14189 copy along with each Opaque copy, or state in or with each Opaque copy
14190 a computer-network location from which the general network-using
14191 public has access to download using public-standard network protocols
14192 a complete Transparent copy of the Document, free of added material.
14193 If you use the latter option, you must take reasonably prudent steps,
14194 when you begin distribution of Opaque copies in quantity, to ensure
14195 that this Transparent copy will remain thus accessible at the stated
14196 location until at least one year after the last time you distribute an
14197 Opaque copy (directly or through your agents or retailers) of that
14198 edition to the public.
14201 It is requested, but not required, that you contact the authors of the
14202 Document well before redistributing any large number of copies, to give
14203 them a chance to provide you with an updated version of the Document.
14210 You may copy and distribute a Modified Version of the Document under
14211 the conditions of sections 2 and 3 above, provided that you release
14212 the Modified Version under precisely this License, with the Modified
14213 Version filling the role of the Document, thus licensing distribution
14214 and modification of the Modified Version to whoever possesses a copy
14215 of it. In addition, you must do these things in the Modified Version:
14220 Use in the Title Page (and on the covers, if any) a title distinct
14221 from that of the Document, and from those of previous versions
14222 (which should, if there were any, be listed in the History section
14223 of the Document). You may use the same title as a previous version
14224 if the original publisher of that version gives permission.
14228 List on the Title Page, as authors, one or more persons or entities
14229 responsible for authorship of the modifications in the Modified
14230 Version, together with at least five of the principal authors of the
14231 Document (all of its principal authors, if it has fewer than five),
14232 unless they release you from this requirement.
14236 State on the Title page the name of the publisher of the
14237 Modified Version, as the publisher.
14241 Preserve all the copyright notices of the Document.
14245 Add an appropriate copyright notice for your modifications
14246 adjacent to the other copyright notices.
14250 Include, immediately after the copyright notices, a license notice
14251 giving the public permission to use the Modified Version under the
14252 terms of this License, in the form shown in the Addendum below.
14256 Preserve in that license notice the full lists of Invariant Sections
14257 and required Cover Texts given in the Document's license notice.
14261 Include an unaltered copy of this License.
14265 Preserve the section Entitled "History", Preserve its Title, and add
14266 to it an item stating at least the title, year, new authors, and
14267 publisher of the Modified Version as given on the Title Page. If
14268 there is no section Entitled "History" in the Document, create one
14269 stating the title, year, authors, and publisher of the Document as
14270 given on its Title Page, then add an item describing the Modified
14271 Version as stated in the previous sentence.
14275 Preserve the network location, if any, given in the Document for
14276 public access to a Transparent copy of the Document, and likewise
14277 the network locations given in the Document for previous versions
14278 it was based on. These may be placed in the "History" section.
14279 You may omit a network location for a work that was published at
14280 least four years before the Document itself, or if the original
14281 publisher of the version it refers to gives permission.
14285 For any section Entitled "Acknowledgements" or "Dedications", Preserve
14286 the Title of the section, and preserve in the section all the
14287 substance and tone of each of the contributor acknowledgements and/or
14288 dedications given therein.
14292 Preserve all the Invariant Sections of the Document,
14293 unaltered in their text and in their titles. Section numbers
14294 or the equivalent are not considered part of the section titles.
14298 Delete any section Entitled "Endorsements". Such a section
14299 may not be included in the Modified Version.
14303 Do not retitle any existing section to be Entitled "Endorsements" or
14304 to conflict in title with any Invariant Section.
14308 Preserve any Warranty Disclaimers.
14312 If the Modified Version includes new front-matter sections or
14313 appendices that qualify as Secondary Sections and contain no material
14314 copied from the Document, you may at your option designate some or all
14315 of these sections as invariant. To do this, add their titles to the
14316 list of Invariant Sections in the Modified Version's license notice.
14317 These titles must be distinct from any other section titles.
14320 You may add a section Entitled "Endorsements", provided it contains
14321 nothing but endorsements of your Modified Version by various
14322 parties--for example, statements of peer review or that the text has
14323 been approved by an organization as the authoritative definition of a
14327 You may add a passage of up to five words as a Front-Cover Text, and a
14328 passage of up to 25 words as a Back-Cover Text, to the end of the list
14329 of Cover Texts in the Modified Version. Only one passage of
14330 Front-Cover Text and one of Back-Cover Text may be added by (or
14331 through arrangements made by) any one entity. If the Document already
14332 includes a cover text for the same cover, previously added by you or
14333 by arrangement made by the same entity you are acting on behalf of,
14334 you may not add another; but you may replace the old one, on explicit
14335 permission from the previous publisher that added the old one.
14338 The author(s) and publisher(s) of the Document do not by this License
14339 give permission to use their names for publicity for or to assert or
14340 imply endorsement of any Modified Version.
14344 COMBINING DOCUMENTS
14347 You may combine the Document with other documents released under this
14348 License, under the terms defined in section 4 above for modified
14349 versions, provided that you include in the combination all of the
14350 Invariant Sections of all of the original documents, unmodified, and
14351 list them all as Invariant Sections of your combined work in its
14352 license notice, and that you preserve all their Warranty Disclaimers.
14355 The combined work need only contain one copy of this License, and
14356 multiple identical Invariant Sections may be replaced with a single
14357 copy. If there are multiple Invariant Sections with the same name but
14358 different contents, make the title of each such section unique by
14359 adding at the end of it, in parentheses, the name of the original
14360 author or publisher of that section if known, or else a unique number.
14361 Make the same adjustment to the section titles in the list of
14362 Invariant Sections in the license notice of the combined work.
14365 In the combination, you must combine any sections Entitled "History"
14366 in the various original documents, forming one section Entitled
14367 "History"; likewise combine any sections Entitled "Acknowledgements",
14368 and any sections Entitled "Dedications". You must delete all
14369 sections Entitled "Endorsements."
14373 COLLECTIONS OF DOCUMENTS
14376 You may make a collection consisting of the Document and other documents
14377 released under this License, and replace the individual copies of this
14378 License in the various documents with a single copy that is included in
14379 the collection, provided that you follow the rules of this License for
14380 verbatim copying of each of the documents in all other respects.
14383 You may extract a single document from such a collection, and distribute
14384 it individually under this License, provided you insert a copy of this
14385 License into the extracted document, and follow this License in all
14386 other respects regarding verbatim copying of that document.
14390 AGGREGATION WITH INDEPENDENT WORKS
14393 A compilation of the Document or its derivatives with other separate
14394 and independent documents or works, in or on a volume of a storage or
14395 distribution medium, is called an "aggregate" if the copyright
14396 resulting from the compilation is not used to limit the legal rights
14397 of the compilation's users beyond what the individual works permit.
14398 When the Document is included in an aggregate, this License does not
14399 apply to the other works in the aggregate which are not themselves
14400 derivative works of the Document.
14403 If the Cover Text requirement of section 3 is applicable to these
14404 copies of the Document, then if the Document is less than one half of
14405 the entire aggregate, the Document's Cover Texts may be placed on
14406 covers that bracket the Document within the aggregate, or the
14407 electronic equivalent of covers if the Document is in electronic form.
14408 Otherwise they must appear on printed covers that bracket the whole
14416 Translation is considered a kind of modification, so you may
14417 distribute translations of the Document under the terms of section 4.
14418 Replacing Invariant Sections with translations requires special
14419 permission from their copyright holders, but you may include
14420 translations of some or all Invariant Sections in addition to the
14421 original versions of these Invariant Sections. You may include a
14422 translation of this License, and all the license notices in the
14423 Document, and any Warranty Disclaimers, provided that you also include
14424 the original English version of this License and the original versions
14425 of those notices and disclaimers. In case of a disagreement between
14426 the translation and the original version of this License or a notice
14427 or disclaimer, the original version will prevail.
14430 If a section in the Document is Entitled "Acknowledgements",
14431 "Dedications", or "History", the requirement (section 4) to Preserve
14432 its Title (section 1) will typically require changing the actual
14440 You may not copy, modify, sublicense, or distribute the Document
14441 except as expressly provided under this License. Any attempt
14442 otherwise to copy, modify, sublicense, or distribute it is void, and
14443 will automatically terminate your rights under this License.
14446 However, if you cease all violation of this License, then your license
14447 from a particular copyright holder is reinstated (a) provisionally,
14448 unless and until the copyright holder explicitly and finally
14449 terminates your license, and (b) permanently, if the copyright holder
14450 fails to notify you of the violation by some reasonable means prior to
14451 60 days after the cessation.
14454 Moreover, your license from a particular copyright holder is
14455 reinstated permanently if the copyright holder notifies you of the
14456 violation by some reasonable means, this is the first time you have
14457 received notice of violation of this License (for any work) from that
14458 copyright holder, and you cure the violation prior to 30 days after
14459 your receipt of the notice.
14462 Termination of your rights under this section does not terminate the
14463 licenses of parties who have received copies or rights from you under
14464 this License. If your rights have been terminated and not permanently
14465 reinstated, receipt of a copy of some or all of the same material does
14466 not give you any rights to use it.
14470 FUTURE REVISIONS OF THIS LICENSE
14473 The Free Software Foundation may publish new, revised versions
14474 of the GNU Free Documentation License from time to time. Such new
14475 versions will be similar in spirit to the present version, but may
14476 differ in detail to address new problems or concerns. See
14477 <A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>.
14480 Each version of the License is given a distinguishing version number.
14481 If the Document specifies that a particular numbered version of this
14482 License "or any later version" applies to it, you have the option of
14483 following the terms and conditions either of that specified version or
14484 of any later version that has been published (not as a draft) by the
14485 Free Software Foundation. If the Document does not specify a version
14486 number of this License, you may choose any version ever published (not
14487 as a draft) by the Free Software Foundation. If the Document
14488 specifies that a proxy can decide which future versions of this
14489 License can be used, that proxy's public statement of acceptance of a
14490 version permanently authorizes you to choose that version for the
14498 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
14499 World Wide Web server that publishes copyrightable works and also
14500 provides prominent facilities for anybody to edit those works. A
14501 public wiki that anybody can edit is an example of such a server. A
14502 "Massive Multiauthor Collaboration" (or "MMC") contained in the
14503 site means any set of copyrightable works thus published on the MMC
14507 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
14508 license published by Creative Commons Corporation, a not-for-profit
14509 corporation with a principal place of business in San Francisco,
14510 California, as well as future copyleft versions of that license
14511 published by that same organization.
14514 "Incorporate" means to publish or republish a Document, in whole or
14515 in part, as part of another Document.
14518 An MMC is "eligible for relicensing" if it is licensed under this
14519 License, and if all works that were first published under this License
14520 somewhere other than this MMC, and subsequently incorporated in whole
14521 or in part into the MMC, (1) had no cover texts or invariant sections,
14522 and (2) were thus incorporated prior to November 1, 2008.
14525 The operator of an MMC Site may republish an MMC contained in the site
14526 under CC-BY-SA on the same site at any time before August 1, 2009,
14527 provided the MMC is eligible for relicensing.
14533 <A NAME="SEC140"></A>
14534 <H2> ADDENDUM: How to use this License for your documents </H2>
14535 <!--docid::SEC140::-->
14538 To use this License in a document you have written, include a copy of
14539 the License in the document and put the following copyright and
14540 license notices just after the title page:
14543 <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> Copyright (C) <VAR>year</VAR> <VAR>your name</VAR>.
14544 Permission is granted to copy, distribute and/or modify this document
14545 under the terms of the GNU Free Documentation License, Version 1.3
14546 or any later version published by the Free Software Foundation;
14547 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
14548 Texts. A copy of the license is included in the section entitled ``GNU
14549 Free Documentation License''.
14550 </FONT></pre></td></tr></table></P><P>
14552 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
14553 replace the "with<small>...</small>Texts." line with this:
14556 <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> with the Invariant Sections being <VAR>list their titles</VAR>, with
14557 the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts
14558 being <VAR>list</VAR>.
14559 </FONT></pre></td></tr></table></P><P>
14561 If you have Invariant Sections without Cover Texts, or some other
14562 combination of the three, merge those two alternatives to suit the
14566 If your document contains nontrivial examples of program code, we
14567 recommend releasing these examples in parallel under your choice of
14568 free software license, such as the GNU General Public License,
14569 to permit their use in free software.
14572 <A NAME="Indexes"></A>
14574 <A NAME="SEC141"></A>
14575 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14576 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> < </A>]</TD>
14577 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> > </A>]</TD>
14578 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
14579 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
14580 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14581 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14582 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14583 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
14584 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14586 <H1> D. Indexes </H1>
14587 <!--docid::SEC141::-->
14590 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
14591 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC142">D.1 Index of Shell Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR>
14592 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC143">D.2 Index of Shell Reserved Words</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR>
14593 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC144">D.3 Parameter and Variable Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the
14594 variable you want.</TD></TR>
14595 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC145">D.4 Function Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR>
14596 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC146">D.5 Concept Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in
14597 this manual.</TD></TR>
14598 </TABLE></BLOCKQUOTE>
14601 <A NAME="Builtin Index"></A>
14603 <A NAME="SEC142"></A>
14604 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14605 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> < </A>]</TD>
14606 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> > </A>]</TD>
14607 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
14608 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> Up </A>]</TD>
14609 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14610 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14611 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14612 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
14613 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14615 <H2> D.1 Index of Shell Builtin Commands </H2>
14616 <!--docid::SEC142::-->
14617 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
14619 <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14621 <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14624 <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14626 <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14628 <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14630 <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14632 <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14634 <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14636 <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14638 <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14640 <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14642 <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14644 <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14646 <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14648 <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14650 <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14652 <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14654 <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14656 <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14658 <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14660 </td></tr></table><br><P></P>
14662 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14663 <TR><TD COLSPAN=3> <HR></TD></TR>
14664 <TR><TH><A NAME="bt_."></A>.</TH><TD></TD><TD></TD></TR>
14665 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX69"><CODE>.</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14666 <TR><TD COLSPAN=3> <HR></TD></TR>
14667 <TR><TH><A NAME="bt_:"></A>:</TH><TD></TD><TD></TD></TR>
14668 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX68"><CODE>:</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14669 <TR><TD COLSPAN=3> <HR></TD></TR>
14670 <TR><TH><A NAME="bt_["></A>[</TH><TD></TD><TD></TD></TR>
14671 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX84"><CODE>[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14672 <TR><TD COLSPAN=3> <HR></TD></TR>
14673 <TR><TH><A NAME="bt_A"></A>A</TH><TD></TD><TD></TD></TR>
14674 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX89"><CODE>alias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14675 <TR><TD COLSPAN=3> <HR></TD></TR>
14676 <TR><TH><A NAME="bt_B"></A>B</TH><TD></TD><TD></TD></TR>
14677 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX305"><CODE>bg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
14678 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX90"><CODE>bind</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14679 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX70"><CODE>break</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14680 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX91"><CODE>builtin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14681 <TR><TD COLSPAN=3> <HR></TD></TR>
14682 <TR><TH><A NAME="bt_C"></A>C</TH><TD></TD><TD></TD></TR>
14683 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX92"><CODE>caller</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14684 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX71"><CODE>cd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14685 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX93"><CODE>command</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14686 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX556"><CODE>compgen</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
14687 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX557"><CODE>complete</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
14688 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX558"><CODE>compopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
14689 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX72"><CODE>continue</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14690 <TR><TD COLSPAN=3> <HR></TD></TR>
14691 <TR><TH><A NAME="bt_D"></A>D</TH><TD></TD><TD></TD></TR>
14692 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX94"><CODE>declare</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14693 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX302"><CODE>dirs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD></TR>
14694 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX310"><CODE>disown</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
14695 <TR><TD COLSPAN=3> <HR></TD></TR>
14696 <TR><TH><A NAME="bt_E"></A>E</TH><TD></TD><TD></TD></TR>
14697 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX95"><CODE>echo</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14698 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX96"><CODE>enable</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14699 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX73"><CODE>eval</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14700 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX74"><CODE>exec</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14701 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX75"><CODE>exit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14702 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX76"><CODE>export</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14703 <TR><TD COLSPAN=3> <HR></TD></TR>
14704 <TR><TH><A NAME="bt_F"></A>F</TH><TD></TD><TD></TD></TR>
14705 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX560"><CODE>fc</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.2 Bash History Builtins</A></TD></TR>
14706 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX306"><CODE>fg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
14707 <TR><TD COLSPAN=3> <HR></TD></TR>
14708 <TR><TH><A NAME="bt_G"></A>G</TH><TD></TD><TD></TD></TR>
14709 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX77"><CODE>getopts</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14710 <TR><TD COLSPAN=3> <HR></TD></TR>
14711 <TR><TH><A NAME="bt_H"></A>H</TH><TD></TD><TD></TD></TR>
14712 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX78"><CODE>hash</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14713 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX97"><CODE>help</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14714 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX561"><CODE>history</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.2 Bash History Builtins</A></TD></TR>
14715 <TR><TD COLSPAN=3> <HR></TD></TR>
14716 <TR><TH><A NAME="bt_J"></A>J</TH><TD></TD><TD></TD></TR>
14717 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX307"><CODE>jobs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
14718 <TR><TD COLSPAN=3> <HR></TD></TR>
14719 <TR><TH><A NAME="bt_K"></A>K</TH><TD></TD><TD></TD></TR>
14720 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX308"><CODE>kill</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
14721 <TR><TD COLSPAN=3> <HR></TD></TR>
14722 <TR><TH><A NAME="bt_L"></A>L</TH><TD></TD><TD></TD></TR>
14723 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX98"><CODE>let</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14724 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX99"><CODE>local</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14725 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX100"><CODE>logout</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14726 <TR><TD COLSPAN=3> <HR></TD></TR>
14727 <TR><TH><A NAME="bt_M"></A>M</TH><TD></TD><TD></TD></TR>
14728 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX101"><CODE>mapfile</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14729 <TR><TD COLSPAN=3> <HR></TD></TR>
14730 <TR><TH><A NAME="bt_P"></A>P</TH><TD></TD><TD></TD></TR>
14731 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX303"><CODE>popd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD></TR>
14732 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX102"><CODE>printf</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14733 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX304"><CODE>pushd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD></TR>
14734 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX79"><CODE>pwd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14735 <TR><TD COLSPAN=3> <HR></TD></TR>
14736 <TR><TH><A NAME="bt_R"></A>R</TH><TD></TD><TD></TD></TR>
14737 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX103"><CODE>read</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14738 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX104"><CODE>readarray</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14739 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX80"><CODE>readonly</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14740 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX81"><CODE>return</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14741 <TR><TD COLSPAN=3> <HR></TD></TR>
14742 <TR><TH><A NAME="bt_S"></A>S</TH><TD></TD><TD></TD></TR>
14743 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX110"><CODE>set</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A></TD></TR>
14744 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX82"><CODE>shift</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14745 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX111"><CODE>shopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A></TD></TR>
14746 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX105"><CODE>source</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14747 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX311"><CODE>suspend</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
14748 <TR><TD COLSPAN=3> <HR></TD></TR>
14749 <TR><TH><A NAME="bt_T"></A>T</TH><TD></TD><TD></TD></TR>
14750 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX83"><CODE>test</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14751 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX85"><CODE>times</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14752 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX86"><CODE>trap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14753 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX106"><CODE>type</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14754 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX107"><CODE>typeset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14755 <TR><TD COLSPAN=3> <HR></TD></TR>
14756 <TR><TH><A NAME="bt_U"></A>U</TH><TD></TD><TD></TD></TR>
14757 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX108"><CODE>ulimit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14758 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX87"><CODE>umask</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14759 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX109"><CODE>unalias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
14760 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX88"><CODE>unset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
14761 <TR><TD COLSPAN=3> <HR></TD></TR>
14762 <TR><TH><A NAME="bt_W"></A>W</TH><TD></TD><TD></TD></TR>
14763 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX309"><CODE>wait</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
14764 <TR><TD COLSPAN=3> <HR></TD></TR>
14765 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
14767 <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14769 <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14772 <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14774 <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14776 <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14778 <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14780 <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14782 <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14784 <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14786 <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14788 <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14790 <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14792 <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14794 <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14796 <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14798 <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14800 <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14802 <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14804 <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14806 <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14808 </td></tr></table><br><P>
14810 <A NAME="Reserved Word Index"></A>
14812 <A NAME="SEC143"></A>
14813 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14814 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> < </A>]</TD>
14815 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> > </A>]</TD>
14816 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> << </A>]</TD>
14817 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> Up </A>]</TD>
14818 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14819 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14820 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14821 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
14822 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14824 <H2> D.2 Index of Shell Reserved Words </H2>
14825 <!--docid::SEC143::-->
14826 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14828 <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14830 <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14832 <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14834 <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14837 <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14839 <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14841 <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14843 <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14845 <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14847 <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14849 <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14851 <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14853 <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14855 </td></tr></table><br><P></P>
14857 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14858 <TR><TD COLSPAN=3> <HR></TD></TR>
14859 <TR><TH><A NAME="rw_!"></A>!</TH><TD></TD><TD></TD></TR>
14860 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX25"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
14861 <TR><TD COLSPAN=3> <HR></TD></TR>
14862 <TR><TH><A NAME="rw_["></A>[</TH><TD></TD><TD></TD></TR>
14863 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX41"><CODE>[[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14864 <TR><TD COLSPAN=3> <HR></TD></TR>
14865 <TR><TH><A NAME="rw_]"></A>]</TH><TD></TD><TD></TD></TR>
14866 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX42"><CODE>]]</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14867 <TR><TD COLSPAN=3> <HR></TD></TR>
14868 <TR><TH><A NAME="rw_{"></A>{</TH><TD></TD><TD></TD></TR>
14869 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX43"><CODE>{</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR>
14870 <TR><TD COLSPAN=3> <HR></TD></TR>
14871 <TR><TH><A NAME="rw_}"></A>}</TH><TD></TD><TD></TD></TR>
14872 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX44"><CODE>}</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR>
14873 <TR><TD COLSPAN=3> <HR></TD></TR>
14874 <TR><TH><A NAME="rw_C"></A>C</TH><TD></TD><TD></TD></TR>
14875 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX37"><CODE>case</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14876 <TR><TD COLSPAN=3> <HR></TD></TR>
14877 <TR><TH><A NAME="rw_D"></A>D</TH><TD></TD><TD></TD></TR>
14878 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX28"><CODE>do</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14879 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX29"><CODE>done</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14880 <TR><TD COLSPAN=3> <HR></TD></TR>
14881 <TR><TH><A NAME="rw_E"></A>E</TH><TD></TD><TD></TD></TR>
14882 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX35"><CODE>elif</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14883 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX34"><CODE>else</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14884 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX39"><CODE>esac</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14885 <TR><TD COLSPAN=3> <HR></TD></TR>
14886 <TR><TH><A NAME="rw_F"></A>F</TH><TD></TD><TD></TD></TR>
14887 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX36"><CODE>fi</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14888 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX31"><CODE>for</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14889 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX45"><CODE>function</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.3 Shell Functions</A></TD></TR>
14890 <TR><TD COLSPAN=3> <HR></TD></TR>
14891 <TR><TH><A NAME="rw_I"></A>I</TH><TD></TD><TD></TD></TR>
14892 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX32"><CODE>if</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14893 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX38"><CODE>in</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14894 <TR><TD COLSPAN=3> <HR></TD></TR>
14895 <TR><TH><A NAME="rw_S"></A>S</TH><TD></TD><TD></TD></TR>
14896 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX40"><CODE>select</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14897 <TR><TD COLSPAN=3> <HR></TD></TR>
14898 <TR><TH><A NAME="rw_T"></A>T</TH><TD></TD><TD></TD></TR>
14899 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX33"><CODE>then</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14900 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX24"><CODE>time</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
14901 <TR><TD COLSPAN=3> <HR></TD></TR>
14902 <TR><TH><A NAME="rw_U"></A>U</TH><TD></TD><TD></TD></TR>
14903 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX27"><CODE>until</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14904 <TR><TD COLSPAN=3> <HR></TD></TR>
14905 <TR><TH><A NAME="rw_W"></A>W</TH><TD></TD><TD></TD></TR>
14906 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX30"><CODE>while</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14907 <TR><TD COLSPAN=3> <HR></TD></TR>
14908 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14910 <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14912 <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14914 <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14916 <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14919 <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14921 <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14923 <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14925 <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14927 <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14929 <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14931 <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14933 <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14935 <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14937 </td></tr></table><br><P>
14939 <A NAME="Variable Index"></A>
14941 <A NAME="SEC144"></A>
14942 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14943 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> < </A>]</TD>
14944 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> > </A>]</TD>
14945 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> << </A>]</TD>
14946 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> Up </A>]</TD>
14947 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14948 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14949 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14950 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
14951 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14953 <H2> D.3 Parameter and Variable Index </H2>
14954 <!--docid::SEC144::-->
14955 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
14957 <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
14959 <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
14961 <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
14963 <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
14965 <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
14967 <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
14969 <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
14971 <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
14974 <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
14976 <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
14978 <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
14980 <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
14982 <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
14984 <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
14986 <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
14988 <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
14990 <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
14992 <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
14994 <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
14996 <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
14998 <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
15000 <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
15002 <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
15004 <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
15006 <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
15008 <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
15010 <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
15012 </td></tr></table><br><P></P>
15014 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15015 <TR><TD COLSPAN=3> <HR></TD></TR>
15016 <TR><TH><A NAME="vr_!"></A>!</TH><TD></TD><TD></TD></TR>
15017 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX58"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15018 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX59"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15019 <TR><TD COLSPAN=3> <HR></TD></TR>
15020 <TR><TH><A NAME="vr_#"></A>#</TH><TD></TD><TD></TD></TR>
15021 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX50"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15022 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX51"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15023 <TR><TD COLSPAN=3> <HR></TD></TR>
15024 <TR><TH><A NAME="vr_$"></A>$</TH><TD></TD><TD></TD></TR>
15025 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX56"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15026 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX57"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15027 <TR><TD COLSPAN=3> <HR></TD></TR>
15028 <TR><TH><A NAME="vr_*"></A>*</TH><TD></TD><TD></TD></TR>
15029 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX46"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15030 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX47"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15031 <TR><TD COLSPAN=3> <HR></TD></TR>
15032 <TR><TH><A NAME="vr_-"></A>-</TH><TD></TD><TD></TD></TR>
15033 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX54"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15034 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX55"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15035 <TR><TD COLSPAN=3> <HR></TD></TR>
15036 <TR><TH><A NAME="vr_0"></A>0</TH><TD></TD><TD></TD></TR>
15037 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX60"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15038 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX61"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15039 <TR><TD COLSPAN=3> <HR></TD></TR>
15040 <TR><TH><A NAME="vr_?"></A>?</TH><TD></TD><TD></TD></TR>
15041 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX52"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15042 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX53"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15043 <TR><TD COLSPAN=3> <HR></TD></TR>
15044 <TR><TH><A NAME="vr_@"></A>@</TH><TD></TD><TD></TD></TR>
15045 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX48"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15046 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX49"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15047 <TR><TD COLSPAN=3> <HR></TD></TR>
15048 <TR><TH><A NAME="vr__"></A>_</TH><TD></TD><TD></TD></TR>
15049 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX62"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15050 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX63"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15051 <TR><TD COLSPAN=3> <HR></TD></TR>
15052 <TR><TH><A NAME="vr_A"></A>A</TH><TD></TD><TD></TD></TR>
15053 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX312"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD></TR>
15054 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX313"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD></TR>
15055 <TR><TD COLSPAN=3> <HR></TD></TR>
15056 <TR><TH><A NAME="vr_B"></A>B</TH><TD></TD><TD></TD></TR>
15057 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX132"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15058 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX133"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15059 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX138"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15060 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX139"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15061 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX140"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15062 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX141"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15063 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX142"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15064 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX143"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15065 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX144"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15066 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX145"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15067 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX146"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15068 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX147"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15069 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX148"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15070 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX149"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15071 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX150"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15072 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX151"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15073 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX152"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15074 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX153"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15075 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX154"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15076 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX155"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15077 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX156"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15078 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX157"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15079 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX158"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15080 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX159"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15081 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX160"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15082 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX161"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15083 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX162"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15084 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX163"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15085 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX164"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15086 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX165"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15087 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX134"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15088 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX135"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15089 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX136"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15090 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX137"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15091 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX319"><CODE>bell-style</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15092 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX320"><CODE>bind-tty-special-chars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15093 <TR><TD COLSPAN=3> <HR></TD></TR>
15094 <TR><TH><A NAME="vr_C"></A>C</TH><TD></TD><TD></TD></TR>
15095 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX112"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15096 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX113"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15097 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX166"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15098 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX167"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15099 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX321"><CODE>comment-begin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15100 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX168"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15101 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX169"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15102 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX176"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15103 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX177"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15104 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX170"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15105 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX171"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15106 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX172"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15107 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX173"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15108 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX174"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15109 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX175"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15110 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX178"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15111 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX179"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15112 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX180"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15113 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX181"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15114 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX322"><CODE>completion-display-width</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15115 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX323"><CODE>completion-ignore-case</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15116 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX324"><CODE>completion-map-case</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15117 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX325"><CODE>completion-prefix-display-length</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15118 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX326"><CODE>completion-query-items</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15119 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX182"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15120 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX183"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15121 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX327"><CODE>convert-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15122 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX184"><CODE>COPROC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15123 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX185"><CODE>COPROC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15124 <TR><TD COLSPAN=3> <HR></TD></TR>
15125 <TR><TH><A NAME="vr_D"></A>D</TH><TD></TD><TD></TD></TR>
15126 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX186"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15127 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX187"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15128 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX328"><CODE>disable-completion</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15129 <TR><TD COLSPAN=3> <HR></TD></TR>
15130 <TR><TH><A NAME="vr_E"></A>E</TH><TD></TD><TD></TD></TR>
15131 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX329"><CODE>editing-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15132 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX188"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15133 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX189"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15134 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX330"><CODE>enable-keypad</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15135 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX190"><CODE>ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15136 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX191"><CODE>ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15137 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX192"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15138 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX193"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15139 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX331"><CODE>expand-tilde</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15140 <TR><TD COLSPAN=3> <HR></TD></TR>
15141 <TR><TH><A NAME="vr_F"></A>F</TH><TD></TD><TD></TD></TR>
15142 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX194"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15143 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX195"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15144 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX196"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15145 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX197"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15146 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX198"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15147 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX199"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15148 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX200"><CODE>FUNCNEST</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15149 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX201"><CODE>FUNCNEST</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15150 <TR><TD COLSPAN=3> <HR></TD></TR>
15151 <TR><TH><A NAME="vr_G"></A>G</TH><TD></TD><TD></TD></TR>
15152 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX202"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15153 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX203"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15154 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX204"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15155 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX205"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15156 <TR><TD COLSPAN=3> <HR></TD></TR>
15157 <TR><TH><A NAME="vr_H"></A>H</TH><TD></TD><TD></TD></TR>
15158 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX206"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15159 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX207"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15160 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX208"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15161 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX209"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15162 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX210"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15163 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX211"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15164 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX212"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15165 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX213"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15166 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX214"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15167 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX215"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15168 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX216"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15169 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX217"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15170 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX332"><CODE>history-preserve-point</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15171 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX333"><CODE>history-size</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15172 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX218"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15173 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX219"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15174 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX220"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15175 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX221"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15176 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX114"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15177 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX115"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15178 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><CODE>horizontal-scroll-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15179 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX222"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15180 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX223"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15181 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX224"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15182 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX225"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15183 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX226"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15184 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX227"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15185 <TR><TD COLSPAN=3> <HR></TD></TR>
15186 <TR><TH><A NAME="vr_I"></A>I</TH><TD></TD><TD></TD></TR>
15187 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX116"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15188 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX117"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15189 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX228"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15190 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX229"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15191 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><CODE>input-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15192 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX230"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15193 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX231"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15194 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><CODE>isearch-terminators</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15195 <TR><TD COLSPAN=3> <HR></TD></TR>
15196 <TR><TH><A NAME="vr_K"></A>K</TH><TD></TD><TD></TD></TR>
15197 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX338"><CODE>keymap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15198 <TR><TD COLSPAN=3> <HR></TD></TR>
15199 <TR><TH><A NAME="vr_L"></A>L</TH><TD></TD><TD></TD></TR>
15200 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX232"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15201 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX233"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15202 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX234"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15203 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX235"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15204 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX236"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15205 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX237"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15206 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX238"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15207 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX239"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15208 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX21"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15209 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX240"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15210 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX241"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15211 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX242"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15212 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX243"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15213 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX244"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15214 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX245"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15215 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX246"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15216 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX247"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15217 <TR><TD COLSPAN=3> <HR></TD></TR>
15218 <TR><TH><A NAME="vr_M"></A>M</TH><TD></TD><TD></TD></TR>
15219 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX248"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15220 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX249"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15221 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX118"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15222 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX119"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15223 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX250"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15224 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX251"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15225 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX120"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15226 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX121"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15227 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX252"><CODE>MAPFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15228 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX253"><CODE>MAPFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15229 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX339"><CODE>mark-modified-lines</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15230 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX340"><CODE>mark-symlinked-directories</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15231 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX341"><CODE>match-hidden-files</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15232 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX342"><CODE>menu-complete-display-prefix</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15233 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><CODE>meta-flag</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15234 <TR><TD COLSPAN=3> <HR></TD></TR>
15235 <TR><TH><A NAME="vr_O"></A>O</TH><TD></TD><TD></TD></TR>
15236 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX254"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15237 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX255"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15238 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX122"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15239 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX123"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15240 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX256"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15241 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX257"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15242 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX124"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15243 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX125"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15244 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX258"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15245 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX259"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15246 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX343"><CODE>output-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15247 <TR><TD COLSPAN=3> <HR></TD></TR>
15248 <TR><TH><A NAME="vr_P"></A>P</TH><TD></TD><TD></TD></TR>
15249 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX344"><CODE>page-completions</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15250 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX126"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15251 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX127"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15252 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX260"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15253 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX261"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15254 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX262"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15255 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX263"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15256 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX264"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15257 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX265"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15258 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX266"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15259 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX267"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15260 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX268"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15261 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX269"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15262 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX128"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15263 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX129"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15264 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX130"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15265 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX131"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
15266 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX270"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15267 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX271"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15268 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX272"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15269 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX273"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15270 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX274"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15271 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX275"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15272 <TR><TD COLSPAN=3> <HR></TD></TR>
15273 <TR><TH><A NAME="vr_R"></A>R</TH><TD></TD><TD></TD></TR>
15274 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX276"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15275 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX277"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15276 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX278"><CODE>READLINE_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15277 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX279"><CODE>READLINE_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15278 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX280"><CODE>READLINE_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15279 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX281"><CODE>READLINE_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15280 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX282"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15281 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX283"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15282 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX345"><CODE>revert-all-at-newline</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15283 <TR><TD COLSPAN=3> <HR></TD></TR>
15284 <TR><TH><A NAME="vr_S"></A>S</TH><TD></TD><TD></TD></TR>
15285 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX284"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15286 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX285"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15287 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX286"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15288 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX287"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15289 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX288"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15290 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX289"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15291 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX290"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15292 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX291"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15293 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><CODE>show-all-if-ambiguous</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15294 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>show-all-if-unmodified</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15295 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><CODE>skip-completed-text</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15296 <TR><TD COLSPAN=3> <HR></TD></TR>
15297 <TR><TH><A NAME="vr_T"></A>T</TH><TD></TD><TD></TD></TR>
15298 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX22"><CODE>TEXTDOMAIN</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15299 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX23"><CODE>TEXTDOMAINDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15300 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX292"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15301 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX293"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15302 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX294"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15303 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX295"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15304 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX296"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15305 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX297"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15306 <TR><TD COLSPAN=3> <HR></TD></TR>
15307 <TR><TH><A NAME="vr_U"></A>U</TH><TD></TD><TD></TD></TR>
15308 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX298"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15309 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX299"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15310 <TR><TD COLSPAN=3> <HR></TD></TR>
15311 <TR><TH><A NAME="vr_V"></A>V</TH><TD></TD><TD></TD></TR>
15312 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><CODE>visible-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15313 <TR><TD COLSPAN=3> <HR></TD></TR>
15314 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
15316 <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
15318 <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
15320 <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
15322 <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
15324 <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
15326 <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
15328 <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
15330 <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
15333 <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
15335 <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
15337 <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
15339 <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
15341 <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
15343 <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
15345 <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
15347 <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
15349 <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
15351 <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
15353 <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
15355 <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
15357 <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
15359 <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
15361 <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
15363 <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
15365 <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
15367 <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
15369 <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
15371 </td></tr></table><br><P>
15373 <A NAME="Function Index"></A>
15375 <A NAME="SEC145"></A>
15376 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15377 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> < </A>]</TD>
15378 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC146"> > </A>]</TD>
15379 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC146"> << </A>]</TD>
15380 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> Up </A>]</TD>
15381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
15382 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15383 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
15385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15387 <H2> D.4 Function Index </H2>
15388 <!--docid::SEC145::-->
15389 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
15391 <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
15393 <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
15395 <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
15397 <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
15399 <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
15401 <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
15403 <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
15405 <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
15407 <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
15409 <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
15411 <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
15413 <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
15415 <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
15417 <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
15419 <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
15421 <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
15423 <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
15425 <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
15427 <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
15429 </td></tr></table><br><P></P>
15431 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15432 <TR><TD COLSPAN=3> <HR></TD></TR>
15433 <TR><TH><A NAME="fn_A"></A>A</TH><TD></TD><TD></TD></TR>
15434 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX502"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15435 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX503"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15436 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX370"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15437 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX371"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15438 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX546"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15439 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX547"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15440 <TR><TD COLSPAN=3> <HR></TD></TR>
15441 <TR><TH><A NAME="fn_B"></A>B</TH><TD></TD><TD></TD></TR>
15442 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX356"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15443 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX357"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15444 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX398"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15445 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX399"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15446 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX420"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15447 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX421"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15448 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX428"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15449 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX429"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15450 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX360"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15451 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15452 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX376"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15453 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX377"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15454 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX350"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15455 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX351"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15456 <TR><TD COLSPAN=3> <HR></TD></TR>
15457 <TR><TH><A NAME="fn_C"></A>C</TH><TD></TD><TD></TD></TR>
15458 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
15459 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
15460 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15461 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15462 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX518"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15463 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX519"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15464 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX520"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15465 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX521"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15466 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX366"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15467 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX367"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15468 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX456"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15469 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX457"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15470 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX484"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15471 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX485"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15472 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX468"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15473 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX469"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15474 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX480"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15475 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX481"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15476 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX492"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15477 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX493"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15478 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15479 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15480 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX476"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15481 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX477"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15482 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX444"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15483 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX445"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15484 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX446"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15485 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX447"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15486 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX442"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15487 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX443"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15488 <TR><TD COLSPAN=3> <HR></TD></TR>
15489 <TR><TH><A NAME="fn_D"></A>D</TH><TD></TD><TD></TD></TR>
15490 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX490"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15491 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX491"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15492 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15493 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15494 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX466"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15495 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX467"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15496 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX438"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15497 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX439"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15498 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX452"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15499 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX453"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15500 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX538"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15501 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX539"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15502 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX504"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15503 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX505"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15504 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX412"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15505 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX413"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15506 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX526"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15507 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX527"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15508 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX530"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15509 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX531"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15510 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX528"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15511 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX529"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15512 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15513 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15514 <TR><TD COLSPAN=3> <HR></TD></TR>
15515 <TR><TH><A NAME="fn_E"></A>E</TH><TD></TD><TD></TD></TR>
15516 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX554"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15517 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX555"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15518 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX496"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
15519 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
15520 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX378"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15521 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX379"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15522 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX352"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15523 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX353"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15524 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX516"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15525 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX517"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15526 <TR><TD COLSPAN=3> <HR></TD></TR>
15527 <TR><TH><A NAME="fn_F"></A>F</TH><TD></TD><TD></TD></TR>
15528 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX400"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15529 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX401"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15530 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX354"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15531 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX355"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15532 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX382"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15533 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX383"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15534 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX358"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15535 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX359"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15536 <TR><TD COLSPAN=3> <HR></TD></TR>
15537 <TR><TH><A NAME="fn_G"></A>G</TH><TD></TD><TD></TD></TR>
15538 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX532"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15539 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX533"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15540 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX534"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15541 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX535"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15542 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX536"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15543 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX537"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15544 <TR><TD COLSPAN=3> <HR></TD></TR>
15545 <TR><TH><A NAME="fn_H"></A>H</TH><TD></TD><TD></TD></TR>
15546 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX548"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15547 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX549"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15548 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX542"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15549 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX543"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15550 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15551 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15552 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX388"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15553 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15554 <TR><TD COLSPAN=3> <HR></TD></TR>
15555 <TR><TH><A NAME="fn_I"></A>I</TH><TD></TD><TD></TD></TR>
15556 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX524"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15557 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX525"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15558 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX460"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15559 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX461"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15560 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX550"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15561 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX551"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15562 <TR><TD COLSPAN=3> <HR></TD></TR>
15563 <TR><TH><A NAME="fn_K"></A>K</TH><TD></TD><TD></TD></TR>
15564 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX418"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15565 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX419"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15566 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX440"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15567 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX441"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15568 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX424"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15569 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX425"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15570 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX426"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15571 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX427"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15572 <TR><TD COLSPAN=3> <HR></TD></TR>
15573 <TR><TH><A NAME="fn_M"></A>M</TH><TD></TD><TD></TD></TR>
15574 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX544"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15575 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX545"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15576 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX462"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15577 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX463"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15578 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX464"><CODE>menu-complete-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15579 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX465"><CODE>menu-complete-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15580 <TR><TD COLSPAN=3> <HR></TD></TR>
15581 <TR><TH><A NAME="fn_N"></A>N</TH><TD></TD><TD></TD></TR>
15582 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX374"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15583 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX375"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15584 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX386"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15585 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX387"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15586 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX384"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15587 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX385"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15588 <TR><TD COLSPAN=3> <HR></TD></TR>
15589 <TR><TH><A NAME="fn_O"></A>O</TH><TD></TD><TD></TD></TR>
15590 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX552"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15591 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX553"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15592 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX416"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15593 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX417"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15594 <TR><TD COLSPAN=3> <HR></TD></TR>
15595 <TR><TH><A NAME="fn_P"></A>P</TH><TD></TD><TD></TD></TR>
15596 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX486"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15597 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX487"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15598 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX458"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15599 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX459"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15600 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX470"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15601 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX471"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15602 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX482"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15603 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX483"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15604 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX474"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15605 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX475"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15606 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15607 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD></TR>
15608 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15609 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15610 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX372"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15611 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX373"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15612 <TR><TD COLSPAN=3> <HR></TD></TR>
15613 <TR><TH><A NAME="fn_Q"></A>Q</TH><TD></TD><TD></TD></TR>
15614 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX402"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15615 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX403"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15616 <TR><TD COLSPAN=3> <HR></TD></TR>
15617 <TR><TH><A NAME="fn_R"></A>R</TH><TD></TD><TD></TD></TR>
15618 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15619 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15620 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX368"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15621 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX369"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15622 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX380"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15623 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX381"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15624 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15625 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX511"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15626 <TR><TD COLSPAN=3> <HR></TD></TR>
15627 <TR><TH><A NAME="fn_S"></A>S</TH><TD></TD><TD></TD></TR>
15628 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX404"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15629 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX405"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15630 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX514"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15631 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX515"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15632 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX432"><CODE>shell-backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15633 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX433"><CODE>shell-backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15634 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX364"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15635 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX365"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15636 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX540"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15637 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX541"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15638 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX362"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15639 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
15640 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX430"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15641 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX431"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15642 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX522"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15643 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX523"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15644 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX494"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
15645 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX495"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
15646 <TR><TD COLSPAN=3> <HR></TD></TR>
15647 <TR><TH><A NAME="fn_T"></A>T</TH><TD></TD><TD></TD></TR>
15648 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX512"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15649 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX513"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15650 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX406"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15651 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX407"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15652 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX408"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15653 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX409"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15654 <TR><TD COLSPAN=3> <HR></TD></TR>
15655 <TR><TH><A NAME="fn_U"></A>U</TH><TD></TD><TD></TD></TR>
15656 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX508"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15657 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX509"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15658 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX454"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15659 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX455"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15660 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX436"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15661 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15662 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX422"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15663 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX423"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15664 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX434"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15665 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX435"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15666 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX410"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15667 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX411"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
15668 <TR><TD COLSPAN=3> <HR></TD></TR>
15669 <TR><TH><A NAME="fn_Y"></A>Y</TH><TD></TD><TD></TD></TR>
15670 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX448"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15671 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX449"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15672 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX394"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15673 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX395"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15674 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15675 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
15676 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX450"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15677 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX451"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
15678 <TR><TD COLSPAN=3> <HR></TD></TR>
15679 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
15681 <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
15683 <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
15685 <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
15687 <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
15689 <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
15691 <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
15693 <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
15695 <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
15697 <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
15699 <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
15701 <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
15703 <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
15705 <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
15707 <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
15709 <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
15711 <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
15713 <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
15715 <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
15717 <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
15719 </td></tr></table><br><P>
15721 <A NAME="Concept Index"></A>
15723 <A NAME="SEC146"></A>
15724 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15725 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> < </A>]</TD>
15726 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ > ]</TD>
15727 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
15728 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> Up </A>]</TD>
15729 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
15730 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15731 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15732 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
15733 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15735 <H2> D.5 Concept Index </H2>
15736 <!--docid::SEC146::-->
15737 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
15739 <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15741 <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15743 <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15745 <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15747 <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15749 <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15751 <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15753 <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15755 <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15757 <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15759 <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15761 <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15763 <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15765 <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15767 <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15769 <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15771 <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15773 <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15775 <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15777 <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15779 <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15781 </td></tr></table><br><P></P>
15783 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15784 <TR><TD COLSPAN=3> <HR></TD></TR>
15785 <TR><TH><A NAME="cp_A"></A>A</TH><TD></TD><TD></TD></TR>
15786 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC85">alias expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC85">6.6 Aliases</A></TD></TR>
15787 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">arithmetic evaluation</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A></TD></TR>
15788 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC34">arithmetic expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A></TD></TR>
15789 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">arithmetic, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A></TD></TR>
15790 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC86">arrays</A></TD><TD valign=top><A HREF="bashref.html#SEC86">6.7 Arrays</A></TD></TR>
15791 <TR><TD COLSPAN=3> <HR></TD></TR>
15792 <TR><TH><A NAME="cp_B"></A>B</TH><TD></TD><TD></TD></TR>
15793 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC93">background</A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.1 Job Control Basics</A></TD></TR>
15794 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC128">Bash configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC128">10.1 Basic Installation</A></TD></TR>
15795 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC128">Bash installation</A></TD><TD valign=top><A HREF="bashref.html#SEC128">10.1 Basic Installation</A></TD></TR>
15796 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC5">Bourne shell</A></TD><TD valign=top><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD></TR>
15797 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">brace expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A></TD></TR>
15798 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX2">builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15799 <TR><TD COLSPAN=3> <HR></TD></TR>
15800 <TR><TH><A NAME="cp_C"></A>C</TH><TD></TD><TD></TD></TR>
15801 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC99">command editing</A></TD><TD valign=top><A HREF="bashref.html#SEC99">8.2.1 Readline Bare Essentials</A></TD></TR>
15802 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC53">command execution</A></TD><TD valign=top><A HREF="bashref.html#SEC53">3.7.2 Command Search and Execution</A></TD></TR>
15803 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">command expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.1 Simple Command Expansion</A></TD></TR>
15804 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC121">command history</A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A></TD></TR>
15805 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC53">command search</A></TD><TD valign=top><A HREF="bashref.html#SEC53">3.7.2 Command Search and Execution</A></TD></TR>
15806 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">command substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.4 Command Substitution</A></TD></TR>
15807 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX26">command timing</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
15808 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC19">commands, compound</A></TD><TD valign=top><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD></TR>
15809 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC21">commands, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
15810 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC22">commands, grouping</A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR>
15811 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC18">commands, lists</A></TD><TD valign=top><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD></TR>
15812 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC20">commands, looping</A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
15813 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC17">commands, pipelines</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
15814 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC15">commands, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC15">3.2 Shell Commands</A></TD></TR>
15815 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC16">commands, simple</A></TD><TD valign=top><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD></TR>
15816 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC14">comments, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC14">3.1.3 Comments</A></TD></TR>
15817 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC119">completion builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
15818 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC128">configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC128">10.1 Basic Installation</A></TD></TR>
15819 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX3">control operator</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15820 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC23">coprocess</A></TD><TD valign=top><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD></TR>
15821 <TR><TD COLSPAN=3> <HR></TD></TR>
15822 <TR><TH><A NAME="cp_D"></A>D</TH><TD></TD><TD></TD></TR>
15823 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC87">directory stack</A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8 The Directory Stack</A></TD></TR>
15824 <TR><TD COLSPAN=3> <HR></TD></TR>
15825 <TR><TH><A NAME="cp_E"></A>E</TH><TD></TD><TD></TD></TR>
15826 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC99">editing command lines</A></TD><TD valign=top><A HREF="bashref.html#SEC99">8.2.1 Readline Bare Essentials</A></TD></TR>
15827 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC55">environment</A></TD><TD valign=top><A HREF="bashref.html#SEC55">3.7.4 Environment</A></TD></TR>
15828 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">evaluation, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A></TD></TR>
15829 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC124">event designators</A></TD><TD valign=top><A HREF="bashref.html#SEC124">9.3.1 Event Designators</A></TD></TR>
15830 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC54">execution environment</A></TD><TD valign=top><A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A></TD></TR>
15831 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX4">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15832 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC56">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC56">3.7.5 Exit Status</A></TD></TR>
15833 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5 Shell Expansions</A></TD></TR>
15834 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC34">expansion, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A></TD></TR>
15835 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">expansion, brace</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A></TD></TR>
15836 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX64">expansion, filename</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
15837 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC32">expansion, parameter</A></TD><TD valign=top><A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A></TD></TR>
15838 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX65">expansion, pathname</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
15839 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">expansion, tilde</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A></TD></TR>
15840 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">expressions, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A></TD></TR>
15841 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">expressions, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A></TD></TR>
15842 <TR><TD COLSPAN=3> <HR></TD></TR>
15843 <TR><TH><A NAME="cp_F"></A>F</TH><TD></TD><TD></TD></TR>
15844 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX5">field</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15845 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX6">filename</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15846 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX66">filename expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
15847 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC93">foreground</A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.1 Job Control Basics</A></TD></TR>
15848 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">functions, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.3 Shell Functions</A></TD></TR>
15849 <TR><TD COLSPAN=3> <HR></TD></TR>
15850 <TR><TH><A NAME="cp_H"></A>H</TH><TD></TD><TD></TD></TR>
15851 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC122">history builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.2 Bash History Builtins</A></TD></TR>
15852 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX562">history events</A></TD><TD valign=top><A HREF="bashref.html#SEC124">9.3.1 Event Designators</A></TD></TR>
15853 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">history expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3 History Expansion</A></TD></TR>
15854 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC121">history list</A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.1 Bash History Facilities</A></TD></TR>
15855 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX559">History, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
15856 <TR><TD COLSPAN=3> <HR></TD></TR>
15857 <TR><TH><A NAME="cp_I"></A>I</TH><TD></TD><TD></TD></TR>
15858 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX11">identifier</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15859 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC104">initialization file, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3 Readline Init File</A></TD></TR>
15860 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC128">installation</A></TD><TD valign=top><A HREF="bashref.html#SEC128">10.1 Basic Installation</A></TD></TR>
15861 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">interaction, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2 Readline Interaction</A></TD></TR>
15862 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX301">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC70">6.1 Invoking Bash</A></TD></TR>
15863 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC79">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC79">6.3 Interactive Shells</A></TD></TR>
15864 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">internationalization</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15865 <TR><TD COLSPAN=3> <HR></TD></TR>
15866 <TR><TH><A NAME="cp_J"></A>J</TH><TD></TD><TD></TD></TR>
15867 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX7">job</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15868 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX8">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15869 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC93">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.1 Job Control Basics</A></TD></TR>
15870 <TR><TD COLSPAN=3> <HR></TD></TR>
15871 <TR><TH><A NAME="cp_K"></A>K</TH><TD></TD><TD></TD></TR>
15872 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX317">kill ring</A></TD><TD valign=top><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD></TR>
15873 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX315">killing text</A></TD><TD valign=top><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD></TR>
15874 <TR><TD COLSPAN=3> <HR></TD></TR>
15875 <TR><TH><A NAME="cp_L"></A>L</TH><TD></TD><TD></TD></TR>
15876 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">localization</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15877 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX300">login shell</A></TD><TD valign=top><A HREF="bashref.html#SEC70">6.1 Invoking Bash</A></TD></TR>
15878 <TR><TD COLSPAN=3> <HR></TD></TR>
15879 <TR><TH><A NAME="cp_M"></A>M</TH><TD></TD><TD></TD></TR>
15880 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC38">matching, pattern</A></TD><TD valign=top><A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A></TD></TR>
15881 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX9">metacharacter</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15882 <TR><TD COLSPAN=3> <HR></TD></TR>
15883 <TR><TH><A NAME="cp_N"></A>N</TH><TD></TD><TD></TD></TR>
15884 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX10">name</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15885 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">native languages</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15886 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC99">notation, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC99">8.2.1 Readline Bare Essentials</A></TD></TR>
15887 <TR><TD COLSPAN=3> <HR></TD></TR>
15888 <TR><TH><A NAME="cp_O"></A>O</TH><TD></TD><TD></TD></TR>
15889 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX12">operator, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15890 <TR><TD COLSPAN=3> <HR></TD></TR>
15891 <TR><TH><A NAME="cp_P"></A>P</TH><TD></TD><TD></TD></TR>
15892 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC32">parameter expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A></TD></TR>
15893 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC26">parameters</A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4 Shell Parameters</A></TD></TR>
15894 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC27">parameters, positional</A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.1 Positional Parameters</A></TD></TR>
15895 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC28">parameters, special</A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15896 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX67">pathname expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
15897 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC38">pattern matching</A></TD><TD valign=top><A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A></TD></TR>
15898 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC17">pipeline</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
15899 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX1">POSIX</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15900 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC91">POSIX Mode</A></TD><TD valign=top><A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A></TD></TR>
15901 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX13">process group</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15902 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX14">process group ID</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15903 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC35">process substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.6 Process Substitution</A></TD></TR>
15904 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC118">programmable completion</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.6 Programmable Completion</A></TD></TR>
15905 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC89">prompting</A></TD><TD valign=top><A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A></TD></TR>
15906 <TR><TD COLSPAN=3> <HR></TD></TR>
15907 <TR><TH><A NAME="cp_Q"></A>Q</TH><TD></TD><TD></TD></TR>
15908 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC8">quoting</A></TD><TD valign=top><A HREF="bashref.html#SEC8">3.1.2 Quoting</A></TD></TR>
15909 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC12">quoting, ANSI</A></TD><TD valign=top><A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A></TD></TR>
15910 <TR><TD COLSPAN=3> <HR></TD></TR>
15911 <TR><TH><A NAME="cp_R"></A>R</TH><TD></TD><TD></TD></TR>
15912 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX314">Readline, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD></TR>
15913 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC40">redirection</A></TD><TD valign=top><A HREF="bashref.html#SEC40">3.6 Redirections</A></TD></TR>
15914 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX15">reserved word</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15915 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC90">restricted shell</A></TD><TD valign=top><A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A></TD></TR>
15916 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX16">return status</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15917 <TR><TD COLSPAN=3> <HR></TD></TR>
15918 <TR><TH><A NAME="cp_S"></A>S</TH><TD></TD><TD></TD></TR>
15919 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">shell arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A></TD></TR>
15920 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">shell function</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.3 Shell Functions</A></TD></TR>
15921 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC58">shell script</A></TD><TD valign=top><A HREF="bashref.html#SEC58">3.8 Shell Scripts</A></TD></TR>
15922 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC26">shell variable</A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4 Shell Parameters</A></TD></TR>
15923 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC79">shell, interactive</A></TD><TD valign=top><A HREF="bashref.html#SEC79">6.3 Interactive Shells</A></TD></TR>
15924 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX17">signal</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15925 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC57">signal handling</A></TD><TD valign=top><A HREF="bashref.html#SEC57">3.7.6 Signals</A></TD></TR>
15926 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX18">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15927 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC65">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC65">4.4 Special Builtins</A></TD></TR>
15928 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC71">startup files</A></TD><TD valign=top><A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A></TD></TR>
15929 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC93">suspending jobs</A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.1 Job Control Basics</A></TD></TR>
15930 <TR><TD COLSPAN=3> <HR></TD></TR>
15931 <TR><TH><A NAME="cp_T"></A>T</TH><TD></TD><TD></TD></TR>
15932 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">tilde expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A></TD></TR>
15933 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX19">token</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15934 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">translation, native languages</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15935 <TR><TD COLSPAN=3> <HR></TD></TR>
15936 <TR><TH><A NAME="cp_V"></A>V</TH><TD></TD><TD></TD></TR>
15937 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC26">variable, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4 Shell Parameters</A></TD></TR>
15938 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX318">variables, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
15939 <TR><TD COLSPAN=3> <HR></TD></TR>
15940 <TR><TH><A NAME="cp_W"></A>W</TH><TD></TD><TD></TD></TR>
15941 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX20">word</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15942 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC36">word splitting</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A></TD></TR>
15943 <TR><TD COLSPAN=3> <HR></TD></TR>
15944 <TR><TH><A NAME="cp_Y"></A>Y</TH><TD></TD><TD></TD></TR>
15945 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX316">yanking text</A></TD><TD valign=top><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD></TR>
15946 <TR><TD COLSPAN=3> <HR></TD></TR>
15947 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
15949 <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15951 <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15953 <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15955 <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15957 <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15959 <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15961 <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15963 <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15965 <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15967 <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15969 <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15971 <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15973 <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15975 <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15977 <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15979 <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15981 <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15983 <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15985 <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15987 <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15989 <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15991 </td></tr></table><br><P>
15994 <A NAME="SEC_Contents"></A>
15995 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15996 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15997 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15998 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
15999 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16001 <H1>Table of Contents</H1>
16003 <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
16006 <A NAME="TOC2" HREF="bashref.html#SEC2">1.1 What is Bash?</A>
16008 <A NAME="TOC3" HREF="bashref.html#SEC3">1.2 What is a shell?</A>
16011 <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
16013 <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
16016 <A NAME="TOC6" HREF="bashref.html#SEC6">3.1 Shell Syntax</A>
16019 <A NAME="TOC7" HREF="bashref.html#SEC7">3.1.1 Shell Operation</A>
16021 <A NAME="TOC8" HREF="bashref.html#SEC8">3.1.2 Quoting</A>
16024 <A NAME="TOC9" HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A>
16026 <A NAME="TOC10" HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A>
16028 <A NAME="TOC11" HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A>
16030 <A NAME="TOC12" HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>
16032 <A NAME="TOC13" HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>
16035 <A NAME="TOC14" HREF="bashref.html#SEC14">3.1.3 Comments</A>
16038 <A NAME="TOC15" HREF="bashref.html#SEC15">3.2 Shell Commands</A>
16041 <A NAME="TOC16" HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>
16043 <A NAME="TOC17" HREF="bashref.html#SEC17">3.2.2 Pipelines</A>
16045 <A NAME="TOC18" HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>
16047 <A NAME="TOC19" HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>
16050 <A NAME="TOC20" HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>
16052 <A NAME="TOC21" HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>
16054 <A NAME="TOC22" HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>
16057 <A NAME="TOC23" HREF="bashref.html#SEC23">3.2.5 Coprocesses</A>
16059 <A NAME="TOC24" HREF="bashref.html#SEC24">3.2.6 GNU Parallel</A>
16062 <A NAME="TOC25" HREF="bashref.html#SEC25">3.3 Shell Functions</A>
16064 <A NAME="TOC26" HREF="bashref.html#SEC26">3.4 Shell Parameters</A>
16067 <A NAME="TOC27" HREF="bashref.html#SEC27">3.4.1 Positional Parameters</A>
16069 <A NAME="TOC28" HREF="bashref.html#SEC28">3.4.2 Special Parameters</A>
16072 <A NAME="TOC29" HREF="bashref.html#SEC29">3.5 Shell Expansions</A>
16075 <A NAME="TOC30" HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>
16077 <A NAME="TOC31" HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>
16079 <A NAME="TOC32" HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>
16081 <A NAME="TOC33" HREF="bashref.html#SEC33">3.5.4 Command Substitution</A>
16083 <A NAME="TOC34" HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A>
16085 <A NAME="TOC35" HREF="bashref.html#SEC35">3.5.6 Process Substitution</A>
16087 <A NAME="TOC36" HREF="bashref.html#SEC36">3.5.7 Word Splitting</A>
16089 <A NAME="TOC37" HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>
16092 <A NAME="TOC38" HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>
16095 <A NAME="TOC39" HREF="bashref.html#SEC39">3.5.9 Quote Removal</A>
16098 <A NAME="TOC40" HREF="bashref.html#SEC40">3.6 Redirections</A>
16101 <A NAME="TOC41" HREF="bashref.html#SEC41">3.6.1 Redirecting Input</A>
16103 <A NAME="TOC42" HREF="bashref.html#SEC42">3.6.2 Redirecting Output</A>
16105 <A NAME="TOC43" HREF="bashref.html#SEC43">3.6.3 Appending Redirected Output</A>
16107 <A NAME="TOC44" HREF="bashref.html#SEC44">3.6.4 Redirecting Standard Output and Standard Error</A>
16109 <A NAME="TOC45" HREF="bashref.html#SEC45">3.6.5 Appending Standard Output and Standard Error</A>
16111 <A NAME="TOC46" HREF="bashref.html#SEC46">3.6.6 Here Documents</A>
16113 <A NAME="TOC47" HREF="bashref.html#SEC47">3.6.7 Here Strings</A>
16115 <A NAME="TOC48" HREF="bashref.html#SEC48">3.6.8 Duplicating File Descriptors</A>
16117 <A NAME="TOC49" HREF="bashref.html#SEC49">3.6.9 Moving File Descriptors</A>
16119 <A NAME="TOC50" HREF="bashref.html#SEC50">3.6.10 Opening File Descriptors for Reading and Writing</A>
16122 <A NAME="TOC51" HREF="bashref.html#SEC51">3.7 Executing Commands</A>
16125 <A NAME="TOC52" HREF="bashref.html#SEC52">3.7.1 Simple Command Expansion</A>
16127 <A NAME="TOC53" HREF="bashref.html#SEC53">3.7.2 Command Search and Execution</A>
16129 <A NAME="TOC54" HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>
16131 <A NAME="TOC55" HREF="bashref.html#SEC55">3.7.4 Environment</A>
16133 <A NAME="TOC56" HREF="bashref.html#SEC56">3.7.5 Exit Status</A>
16135 <A NAME="TOC57" HREF="bashref.html#SEC57">3.7.6 Signals</A>
16138 <A NAME="TOC58" HREF="bashref.html#SEC58">3.8 Shell Scripts</A>
16141 <A NAME="TOC59" HREF="bashref.html#SEC59">4. Shell Builtin Commands</A>
16144 <A NAME="TOC60" HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>
16146 <A NAME="TOC61" HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>
16148 <A NAME="TOC62" HREF="bashref.html#SEC62">4.3 Modifying Shell Behavior</A>
16151 <A NAME="TOC63" HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>
16153 <A NAME="TOC64" HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
16156 <A NAME="TOC65" HREF="bashref.html#SEC65">4.4 Special Builtins</A>
16159 <A NAME="TOC66" HREF="bashref.html#SEC66">5. Shell Variables</A>
16162 <A NAME="TOC67" HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A>
16164 <A NAME="TOC68" HREF="bashref.html#SEC68">5.2 Bash Variables</A>
16167 <A NAME="TOC69" HREF="bashref.html#SEC69">6. Bash Features</A>
16170 <A NAME="TOC70" HREF="bashref.html#SEC70">6.1 Invoking Bash</A>
16172 <A NAME="TOC71" HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>
16174 <A NAME="TOC79" HREF="bashref.html#SEC79">6.3 Interactive Shells</A>
16177 <A NAME="TOC80" HREF="bashref.html#SEC80">6.3.1 What is an Interactive Shell?</A>
16179 <A NAME="TOC81" HREF="bashref.html#SEC81">6.3.2 Is this Shell Interactive?</A>
16181 <A NAME="TOC82" HREF="bashref.html#SEC82">6.3.3 Interactive Shell Behavior</A>
16184 <A NAME="TOC83" HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>
16186 <A NAME="TOC84" HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>
16188 <A NAME="TOC85" HREF="bashref.html#SEC85">6.6 Aliases</A>
16190 <A NAME="TOC86" HREF="bashref.html#SEC86">6.7 Arrays</A>
16192 <A NAME="TOC87" HREF="bashref.html#SEC87">6.8 The Directory Stack</A>
16195 <A NAME="TOC88" HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A>
16198 <A NAME="TOC89" HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>
16200 <A NAME="TOC90" HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>
16202 <A NAME="TOC91" HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>
16205 <A NAME="TOC92" HREF="bashref.html#SEC92">7. Job Control</A>
16208 <A NAME="TOC93" HREF="bashref.html#SEC93">7.1 Job Control Basics</A>
16210 <A NAME="TOC94" HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>
16212 <A NAME="TOC95" HREF="bashref.html#SEC95">7.3 Job Control Variables</A>
16215 <A NAME="TOC96" HREF="bashref.html#SEC96">8. Command Line Editing</A>
16218 <A NAME="TOC97" HREF="bashref.html#SEC97">8.1 Introduction to Line Editing</A>
16220 <A NAME="TOC98" HREF="bashref.html#SEC98">8.2 Readline Interaction</A>
16223 <A NAME="TOC99" HREF="bashref.html#SEC99">8.2.1 Readline Bare Essentials</A>
16225 <A NAME="TOC100" HREF="bashref.html#SEC100">8.2.2 Readline Movement Commands</A>
16227 <A NAME="TOC101" HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A>
16229 <A NAME="TOC102" HREF="bashref.html#SEC102">8.2.4 Readline Arguments</A>
16231 <A NAME="TOC103" HREF="bashref.html#SEC103">8.2.5 Searching for Commands in the History</A>
16234 <A NAME="TOC104" HREF="bashref.html#SEC104">8.3 Readline Init File</A>
16237 <A NAME="TOC105" HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A>
16239 <A NAME="TOC106" HREF="bashref.html#SEC106">8.3.2 Conditional Init Constructs</A>
16241 <A NAME="TOC107" HREF="bashref.html#SEC107">8.3.3 Sample Init File</A>
16244 <A NAME="TOC108" HREF="bashref.html#SEC108">8.4 Bindable Readline Commands</A>
16247 <A NAME="TOC109" HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A>
16249 <A NAME="TOC110" HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A>
16251 <A NAME="TOC111" HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A>
16253 <A NAME="TOC112" HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A>
16255 <A NAME="TOC113" HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A>
16257 <A NAME="TOC114" HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A>
16259 <A NAME="TOC115" HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A>
16261 <A NAME="TOC116" HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A>
16264 <A NAME="TOC117" HREF="bashref.html#SEC117">8.5 Readline vi Mode</A>
16266 <A NAME="TOC118" HREF="bashref.html#SEC118">8.6 Programmable Completion</A>
16268 <A NAME="TOC119" HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>
16271 <A NAME="TOC120" HREF="bashref.html#SEC120">9. Using History Interactively</A>
16274 <A NAME="TOC121" HREF="bashref.html#SEC121">9.1 Bash History Facilities</A>
16276 <A NAME="TOC122" HREF="bashref.html#SEC122">9.2 Bash History Builtins</A>
16278 <A NAME="TOC123" HREF="bashref.html#SEC123">9.3 History Expansion</A>
16281 <A NAME="TOC124" HREF="bashref.html#SEC124">9.3.1 Event Designators</A>
16283 <A NAME="TOC125" HREF="bashref.html#SEC125">9.3.2 Word Designators</A>
16285 <A NAME="TOC126" HREF="bashref.html#SEC126">9.3.3 Modifiers</A>
16289 <A NAME="TOC127" HREF="bashref.html#SEC127">10. Installing Bash</A>
16292 <A NAME="TOC128" HREF="bashref.html#SEC128">10.1 Basic Installation</A>
16294 <A NAME="TOC129" HREF="bashref.html#SEC129">10.2 Compilers and Options</A>
16296 <A NAME="TOC130" HREF="bashref.html#SEC130">10.3 Compiling For Multiple Architectures</A>
16298 <A NAME="TOC131" HREF="bashref.html#SEC131">10.4 Installation Names</A>
16300 <A NAME="TOC132" HREF="bashref.html#SEC132">10.5 Specifying the System Type</A>
16302 <A NAME="TOC133" HREF="bashref.html#SEC133">10.6 Sharing Defaults</A>
16304 <A NAME="TOC134" HREF="bashref.html#SEC134">10.7 Operation Controls</A>
16306 <A NAME="TOC135" HREF="bashref.html#SEC135">10.8 Optional Features</A>
16309 <A NAME="TOC136" HREF="bashref.html#SEC136">A. Reporting Bugs</A>
16311 <A NAME="TOC137" HREF="bashref.html#SEC137">B. Major Differences From The Bourne Shell</A>
16314 <A NAME="TOC138" HREF="bashref.html#SEC138">B.1 Implementation Differences From The SVR4.2 Shell</A>
16317 <A NAME="TOC139" HREF="bashref.html#SEC139">C. GNU Free Documentation License</A>
16319 <A NAME="TOC141" HREF="bashref.html#SEC141">D. Indexes</A>
16322 <A NAME="TOC142" HREF="bashref.html#SEC142">D.1 Index of Shell Builtin Commands</A>
16324 <A NAME="TOC143" HREF="bashref.html#SEC143">D.2 Index of Shell Reserved Words</A>
16326 <A NAME="TOC144" HREF="bashref.html#SEC144">D.3 Parameter and Variable Index</A>
16328 <A NAME="TOC145" HREF="bashref.html#SEC145">D.4 Function Index</A>
16330 <A NAME="TOC146" HREF="bashref.html#SEC146">D.5 Concept Index</A>
16335 <A NAME="SEC_OVERVIEW"></A>
16336 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16337 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16338 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16339 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
16340 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16342 <H1>Short Table of Contents</H1>
16344 <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
16346 <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
16348 <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
16350 <A NAME="TOC59" HREF="bashref.html#SEC59">4. Shell Builtin Commands</A>
16352 <A NAME="TOC66" HREF="bashref.html#SEC66">5. Shell Variables</A>
16354 <A NAME="TOC69" HREF="bashref.html#SEC69">6. Bash Features</A>
16356 <A NAME="TOC92" HREF="bashref.html#SEC92">7. Job Control</A>
16358 <A NAME="TOC96" HREF="bashref.html#SEC96">8. Command Line Editing</A>
16360 <A NAME="TOC120" HREF="bashref.html#SEC120">9. Using History Interactively</A>
16362 <A NAME="TOC127" HREF="bashref.html#SEC127">10. Installing Bash</A>
16364 <A NAME="TOC136" HREF="bashref.html#SEC136">A. Reporting Bugs</A>
16366 <A NAME="TOC137" HREF="bashref.html#SEC137">B. Major Differences From The Bourne Shell</A>
16368 <A NAME="TOC139" HREF="bashref.html#SEC139">C. GNU Free Documentation License</A>
16370 <A NAME="TOC141" HREF="bashref.html#SEC141">D. Indexes</A>
16375 <A NAME="SEC_About"></A>
16376 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16377 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16378 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16379 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141">Index</A>]</TD>
16380 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16382 <H1>About this document</H1>
16383 This document was generated by <I>Chet Ramey</I> on <I>December, 28 2010</I>
16384 using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
16385 "><I>texi2html</I></A>
16387 The buttons in the navigation panels have the following meaning:
16389 <table border = "1">
16394 <TH> From 1.2.3 go to</TH>
16397 <TD ALIGN="CENTER">
16399 <TD ALIGN="CENTER">
16403 previous section in reading order
16410 <TD ALIGN="CENTER">
16412 <TD ALIGN="CENTER">
16416 next section in reading order
16423 <TD ALIGN="CENTER">
16425 <TD ALIGN="CENTER">
16429 previous or up-and-previous section
16436 <TD ALIGN="CENTER">
16438 <TD ALIGN="CENTER">
16449 <TD ALIGN="CENTER">
16451 <TD ALIGN="CENTER">
16455 next or up-and-next section
16462 <TD ALIGN="CENTER">
16464 <TD ALIGN="CENTER">
16468 cover (top) of document
16475 <TD ALIGN="CENTER">
16477 <TD ALIGN="CENTER">
16488 <TD ALIGN="CENTER">
16490 <TD ALIGN="CENTER">
16501 <TD ALIGN="CENTER">
16503 <TD ALIGN="CENTER">
16515 where the <STRONG> Example </STRONG> assumes that the current position
16516 is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
16517 the following structure:
16519 <LI> 1. Section One </LI>
16521 <LI>1.1 Subsection One-One</LI>
16525 <LI>1.2 Subsection One-Two</LI>
16527 <LI>1.2.1 Subsubsection One-Two-One
16528 </LI><LI>1.2.2 Subsubsection One-Two-Two
16529 </LI><LI>1.2.3 Subsubsection One-Two-Three <STRONG>
16530 <== Current Position </STRONG>
16531 </LI><LI>1.2.4 Subsubsection One-Two-Four
16533 <LI>1.3 Subsection One-Three</LI>
16537 <LI>1.4 Subsection One-Four</LI>
16544 This document was generated
16545 by <I>Chet Ramey</I> on <I>December, 28 2010</I>
16546 using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
16547 "><I>texi2html</I></A>