No specific user configuration
[platform/upstream/bash.git] / doc / bashref.html
1 <HTML>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <!-- Created on February, 24  2014 by texi2html 1.64 -->
4 <!-- 
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>
8             and many others.
9 Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10 Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
11  
12 -->
13 <HEAD>
14 <TITLE>Bash Reference Manual: </TITLE>
15
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">
21
22 </HEAD>
23
24 <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
25
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#SEC142">Index</A>]</TD>
31 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
32 </TR></TABLE>
33 <H1>Bash Reference Manual</H1></P><P>
34
35 This text is a brief description of the features that are present in
36 the Bash shell (version 4.3, 2 February 2014).
37 The Bash home page is <A HREF="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</A>.
38 </P><P>
39
40 This is Edition 4.3, last updated 2 February 2014,
41 of <CITE>The GNU Bash Reference Manual</CITE>,
42 for <CODE>Bash</CODE>, Version 4.3.
43 </P><P>
44
45 Bash contains features that appear in other popular shells, and some
46 features that only appear in Bash.  Some of the shells that Bash has
47 borrowed concepts from are the Bourne Shell (<TT>`sh'</TT>), the Korn Shell
48 (<TT>`ksh'</TT>), and the C-shell (<TT>`csh'</TT> and its successor,
49 <TT>`tcsh'</TT>).  The following menu breaks the features up into
50 categories, noting which features were inspired by other shells and
51 which are specific to Bash.
52 </P><P>
53
54 This manual is meant as a brief introduction to features found in
55 Bash.  The Bash manual page should be used as the definitive
56 reference on shell behavior.
57 </P><P>
58
59 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
60 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC1">1. Introduction</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">An introduction to the shell.</TD></TR>
61 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC4">2. Definitions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Some definitions used in the rest of this
62                                 manual.</TD></TR>
63 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The shell "building blocks".</TD></TR>
64 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC59">4. Shell Builtin Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands that are a part of the shell.</TD></TR>
65 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC66">5. Shell Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Variables used or set by Bash.</TD></TR>
66 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC69">6. Bash Features</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Features found only in Bash.</TD></TR>
67 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC92">7. Job Control</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What job control is and how Bash allows you
68                                 to use it.</TD></TR>
69 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC96">8. Command Line Editing</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Chapter describing the command line
70                                 editing features.</TD></TR>
71 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC121">9. Using History Interactively</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Command History Expansion</TD></TR>
72 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10. Installing Bash</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to build and install Bash on your system.</TD></TR>
73 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC137">A. Reporting Bugs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to report bugs in Bash.</TD></TR>
74 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC138">B. Major Differences From The Bourne Shell</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A terse list of the differences
75                                                 between Bash and historical
76                                                 versions of /bin/sh.</TD></TR>
77 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC140">C. GNU Free Documentation License</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Copying and sharing this documentation.</TD></TR>
78 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC142">D. Indexes</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Various indexes for this manual.</TD></TR>
79 </TABLE></BLOCKQUOTE>
80 <P>
81
82 <HR SIZE=1>
83 <A NAME="SEC1"></A>
84 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
85 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> &lt; </A>]</TD>
86 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> &gt; </A>]</TD>
87 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
88 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
89 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &gt;&gt; </A>]</TD>
90 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
91 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
92 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
93 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
94 </TR></TABLE>
95 <A NAME="Introduction"></A>
96 <H1> 1. Introduction </H1>
97 <!--docid::SEC1::-->
98 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
99 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC2">1.1 What is Bash?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A short description of Bash.</TD></TR>
100 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC3">1.2 What is a shell?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A brief introduction to shells.</TD></TR>
101 </TABLE></BLOCKQUOTE>
102 <P>
103
104 <A NAME="What is Bash?"></A>
105 <HR SIZE="6">
106 <A NAME="SEC2"></A>
107 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
108 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> &lt; </A>]</TD>
109 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> &gt; </A>]</TD>
110 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
111 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD>
112 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &gt;&gt; </A>]</TD>
113 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
114 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
115 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
116 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
117 </TR></TABLE>
118 <H2> 1.1 What is Bash? </H2>
119 <!--docid::SEC2::-->
120 <P>
121
122 Bash is the shell, or command language interpreter,
123 for the GNU operating system.
124 The name is an acronym for the <SAMP>`Bourne-Again SHell'</SAMP>,
125 a pun on Stephen Bourne, the author of the direct ancestor of
126 the current Unix shell <CODE>sh</CODE>, 
127 which appeared in the Seventh Edition Bell Labs Research version
128 of Unix.
129 </P><P>
130
131 Bash is largely compatible with <CODE>sh</CODE> and incorporates useful
132 features from the Korn shell <CODE>ksh</CODE> and the C shell <CODE>csh</CODE>.
133 It is intended to be a conformant implementation of the IEEE
134 POSIX Shell and Tools portion of the IEEE POSIX
135 specification (IEEE Standard 1003.1).
136 It offers functional improvements over <CODE>sh</CODE> for both interactive and
137 programming use.
138 </P><P>
139
140 While the GNU operating system provides other shells, including
141 a version of <CODE>csh</CODE>, Bash is the default shell.
142 Like other GNU software, Bash is quite portable.  It currently runs
143 on nearly every version of Unix and a few other operating systems -
144 independently-supported ports exist for MS-DOS, OS/2,
145 and Windows platforms.
146 </P><P>
147
148 <A NAME="What is a shell?"></A>
149 <HR SIZE="6">
150 <A NAME="SEC3"></A>
151 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
152 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> &lt; </A>]</TD>
153 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &gt; </A>]</TD>
154 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
155 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD>
156 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &gt;&gt; </A>]</TD>
157 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
158 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
159 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
160 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
161 </TR></TABLE>
162 <H2> 1.2 What is a shell? </H2>
163 <!--docid::SEC3::-->
164 <P>
165
166 At its base, a shell is simply a macro processor that executes
167 commands.  The term macro processor means functionality where text
168 and symbols are expanded to create larger expressions.
169 </P><P>
170
171 A Unix shell is both a command interpreter and a programming
172 language.  As a command interpreter, the shell provides the user
173 interface to the rich set of GNU utilities.  The programming
174 language features allow these utilities to be combined.
175 Files containing commands can be created, and become
176 commands themselves.  These new commands have the same status as
177 system commands in directories such as <TT>`/bin'</TT>, allowing users
178 or groups to establish custom environments to automate their common
179 tasks.
180 </P><P>
181
182 Shells may be used interactively or non-interactively.  In
183 interactive mode, they accept input typed from the keyboard.
184 When executing non-interactively, shells execute commands read
185 from a file.
186 </P><P>
187
188 A shell allows execution of GNU commands, both synchronously and
189 asynchronously.
190 The shell waits for synchronous commands to complete before accepting
191 more input; asynchronous commands continue to execute in parallel
192 with the shell while it reads and executes additional commands.
193 The <EM>redirection</EM> constructs permit
194 fine-grained control of the input and output of those commands.
195 Moreover, the shell allows control over the contents of commands'
196 environments.
197 </P><P>
198
199 Shells also provide a small set of built-in
200 commands (<EM>builtins</EM>) implementing functionality impossible
201 or inconvenient to obtain via separate utilities.
202 For example, <CODE>cd</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, and
203 <CODE>exec</CODE> cannot be implemented outside of the shell because
204 they directly manipulate the shell itself.
205 The <CODE>history</CODE>, <CODE>getopts</CODE>, <CODE>kill</CODE>, or <CODE>pwd</CODE>
206 builtins, among others, could be implemented in separate utilities,
207 but they are more convenient to use as builtin commands.
208 All of the shell builtins are described in
209 subsequent sections.
210 </P><P>
211
212 While executing commands is essential, most of the power (and
213 complexity) of shells is due to their embedded programming
214 languages.  Like any high-level language, the shell provides
215 variables, flow control constructs, quoting, and functions. 
216 </P><P>
217
218 Shells offer features geared specifically for
219 interactive use rather than to augment the programming language. 
220 These interactive features include job control, command line
221 editing, command history and aliases.  Each of these features is
222 described in this manual.
223 </P><P>
224
225 <A NAME="Definitions"></A>
226 <HR SIZE="6">
227 <A NAME="SEC4"></A>
228 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
229 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> &lt; </A>]</TD>
230 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &gt; </A>]</TD>
231 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
232 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
233 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &gt;&gt; </A>]</TD>
234 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
235 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
236 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
237 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
238 </TR></TABLE>
239 <H1> 2. Definitions </H1>
240 <!--docid::SEC4::-->
241 These definitions are used throughout the remainder of this manual.
242 <P>
243
244 <DL COMPACT>
245
246 <DT><CODE>POSIX</CODE>
247 <DD><A NAME="IDX1"></A>
248 A family of open system standards based on Unix.  Bash
249 is primarily concerned with the Shell and Utilities portion of the
250 POSIX 1003.1 standard. 
251 <P>
252
253 <DT><CODE>blank</CODE>
254 <DD>A space or tab character.
255 <P>
256
257 <DT><CODE>builtin</CODE>
258 <DD><A NAME="IDX2"></A>
259 A command that is implemented internally by the shell itself, rather
260 than by an executable program somewhere in the file system.
261 <P>
262
263 <DT><CODE>control operator</CODE>
264 <DD><A NAME="IDX3"></A>
265 A <CODE>token</CODE> that performs a control function.  It is a <CODE>newline</CODE>
266 or one of the following:
267 <SAMP>`||'</SAMP>, <SAMP>`&#38;&#38;'</SAMP>, <SAMP>`&#38;'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`;;'</SAMP>,
268 <SAMP>`|'</SAMP>, <SAMP>`|&#38;'</SAMP>, <SAMP>`('</SAMP>, or <SAMP>`)'</SAMP>.
269 <P>
270
271 <DT><CODE>exit status</CODE>
272 <DD><A NAME="IDX4"></A>
273 The value returned by a command to its caller.  The value is restricted
274 to eight bits, so the maximum value is 255.
275 <P>
276
277 <DT><CODE>field</CODE>
278 <DD><A NAME="IDX5"></A>
279 A unit of text that is the result of one of the shell expansions.  After
280 expansion, when executing a command, the resulting fields are used as
281 the command name and arguments.
282 <P>
283
284 <DT><CODE>filename</CODE>
285 <DD><A NAME="IDX6"></A>
286 A string of characters used to identify a file.
287 <P>
288
289 <DT><CODE>job</CODE>
290 <DD><A NAME="IDX7"></A>
291 A set of processes comprising a pipeline, and any processes descended
292 from it, that are all in the same process group.
293 <P>
294
295 <DT><CODE>job control</CODE>
296 <DD><A NAME="IDX8"></A>
297 A mechanism by which users can selectively stop (suspend) and restart
298 (resume) execution of processes.
299 <P>
300
301 <DT><CODE>metacharacter</CODE>
302 <DD><A NAME="IDX9"></A>
303 A character that, when unquoted, separates words.  A metacharacter is
304 a <CODE>blank</CODE> or one of the following characters:
305 <SAMP>`|'</SAMP>, <SAMP>`&#38;'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`('</SAMP>, <SAMP>`)'</SAMP>, <SAMP>`&#60;'</SAMP>, or
306 <SAMP>`&#62;'</SAMP>.
307 <P>
308
309 <DT><CODE>name</CODE>
310 <DD><A NAME="IDX10"></A>
311 <A NAME="IDX11"></A>
312 A <CODE>word</CODE> consisting solely of letters, numbers, and underscores,
313 and beginning with a letter or underscore.  <CODE>Name</CODE>s are used as
314 shell variable and function names.
315 Also referred to as an <CODE>identifier</CODE>.
316 <P>
317
318 <DT><CODE>operator</CODE>
319 <DD><A NAME="IDX12"></A>
320 A <CODE>control operator</CODE> or a <CODE>redirection operator</CODE>.
321 See section <A HREF="bashref.html#SEC40">3.6 Redirections</A>, for a list of redirection operators.
322 Operators contain at least one unquoted <CODE>metacharacter</CODE>.
323 <P>
324
325 <DT><CODE>process group</CODE>
326 <DD><A NAME="IDX13"></A>
327 A collection of related processes each having the same process
328 group ID.
329 <P>
330
331 <DT><CODE>process group ID</CODE>
332 <DD><A NAME="IDX14"></A>
333 A unique identifier that represents a <CODE>process group</CODE>
334 during its lifetime.
335 <P>
336
337 <DT><CODE>reserved word</CODE>
338 <DD><A NAME="IDX15"></A>
339 A <CODE>word</CODE> that has a special meaning to the shell.  Most reserved
340 words introduce shell flow control constructs, such as <CODE>for</CODE> and
341 <CODE>while</CODE>.
342 <P>
343
344 <DT><CODE>return status</CODE>
345 <DD><A NAME="IDX16"></A>
346 A synonym for <CODE>exit status</CODE>.
347 <P>
348
349 <DT><CODE>signal</CODE>
350 <DD><A NAME="IDX17"></A>
351 A mechanism by which a process may be notified by the kernel
352 of an event occurring in the system.
353 <P>
354
355 <DT><CODE>special builtin</CODE>
356 <DD><A NAME="IDX18"></A>
357 A shell builtin command that has been classified as special by the
358 POSIX standard.
359 <P>
360
361 <DT><CODE>token</CODE>
362 <DD><A NAME="IDX19"></A>
363 A sequence of characters considered a single unit by the shell.
364 It is either a <CODE>word</CODE> or an <CODE>operator</CODE>.
365 <P>
366
367 <DT><CODE>word</CODE>
368 <DD><A NAME="IDX20"></A>
369 A sequence of characters treated as a unit by the shell.
370 Words may not include unquoted <CODE>metacharacters</CODE>.
371 </DL>
372 <P>
373
374 <A NAME="Basic Shell Features"></A>
375 <HR SIZE="6">
376 <A NAME="SEC5"></A>
377 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
378 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &lt; </A>]</TD>
379 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> &gt; </A>]</TD>
380 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &lt;&lt; </A>]</TD>
381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
382 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &gt;&gt; </A>]</TD>
383 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
386 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
387 </TR></TABLE>
388 <H1> 3. Basic Shell Features </H1>
389 <!--docid::SEC5::-->
390 <P>
391
392 Bash is an acronym for <SAMP>`Bourne-Again SHell'</SAMP>.
393 The Bourne shell is
394 the traditional Unix shell originally written by Stephen Bourne.
395 All of the Bourne shell builtin commands are available in Bash,
396 The rules for evaluation and quoting are taken from the POSIX
397 specification for the `standard' Unix shell.
398 </P><P>
399
400 This chapter briefly summarizes the shell's `building blocks':
401 commands, control structures, shell functions, shell <I>parameters</I>,
402 shell expansions,
403 <I>redirections</I>, which are a way to direct input and output from
404 and to named files, and how the shell executes commands.
405 </P><P>
406
407 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
408 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC6">3.1 Shell Syntax</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What your input means to the shell.</TD></TR>
409 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC15">3.2 Shell Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The types of commands you can use.</TD></TR>
410 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC25">3.3 Shell Functions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Grouping commands by name.</TD></TR>
411 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC26">3.4 Shell Parameters</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How the shell stores values.</TD></TR>
412 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC29">3.5 Shell Expansions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash expands parameters and the various
413                                 expansions available.</TD></TR>
414 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC40">3.6 Redirections</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A way to control where input and output go.</TD></TR>
415 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC51">3.7 Executing Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What happens when you run a command.</TD></TR>
416 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC58">3.8 Shell Scripts</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Executing files of shell commands.</TD></TR>
417 </TABLE></BLOCKQUOTE>
418 <P>
419
420 <A NAME="Shell Syntax"></A>
421 <HR SIZE="6">
422 <A NAME="SEC6"></A>
423 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
424 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt; </A>]</TD>
425 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> &gt; </A>]</TD>
426 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
427 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
428 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt;&gt; </A>]</TD>
429 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
430 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
431 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
432 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
433 </TR></TABLE>
434 <H2> 3.1 Shell Syntax </H2>
435 <!--docid::SEC6::-->
436 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
437 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC7">3.1.1 Shell Operation</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The basic operation of the shell.</TD></TR>
438 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC8">3.1.2 Quoting</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from characters.</TD></TR>
439 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC14">3.1.3 Comments</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify comments.</TD></TR>
440 </TABLE></BLOCKQUOTE>
441 <P>
442
443 When the shell reads input, it proceeds through a
444 sequence of operations.  If the input indicates the beginning of a
445 comment, the shell ignores the comment symbol (<SAMP>`#'</SAMP>), and the rest
446 of that line.
447                                 
448 Otherwise, roughly speaking,  the shell reads its input and
449 divides the input into words and operators, employing the quoting rules
450 to select which meanings to assign various words and characters.
451 </P><P>
452
453 The shell then parses these tokens into commands and other constructs,
454 removes the special meaning of certain words or characters, expands
455 others, redirects input and output as needed, executes the specified
456 command, waits for the command's exit status, and makes that exit status
457 available for further inspection or processing.
458 </P><P>
459
460 <A NAME="Shell Operation"></A>
461 <HR SIZE="6">
462 <A NAME="SEC7"></A>
463 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
464 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> &lt; </A>]</TD>
465 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> &gt; </A>]</TD>
466 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
467 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
468 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt;&gt; </A>]</TD>
469 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
470 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
471 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
472 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
473 </TR></TABLE>
474 <H3> 3.1.1 Shell Operation </H3>
475 <!--docid::SEC7::-->
476 <P>
477
478 The following is a brief description of the shell's operation when it
479 reads and executes a command.  Basically, the shell does the
480 following:
481 </P><P>
482
483 <OL>
484 <LI>
485 Reads its input from a file (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>), from a string
486 supplied as an argument to the <SAMP>`-c'</SAMP> invocation option
487 (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>), or from the user's terminal.
488 <P>
489
490 <LI>
491 Breaks the input into words and operators, obeying the quoting rules
492 described in <A HREF="bashref.html#SEC8">3.1.2 Quoting</A>.  These tokens are separated by
493 <CODE>metacharacters</CODE>.  Alias expansion is performed by this step
494 (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
495 <P>
496
497 <LI>
498 Parses the tokens into simple and compound commands
499 (see section <A HREF="bashref.html#SEC15">3.2 Shell Commands</A>).
500 <P>
501
502 <LI>
503 Performs the various shell expansions (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>), breaking
504 the expanded tokens into lists of filenames (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>)
505 and commands and arguments.
506 <P>
507
508 <LI>
509 Performs any necessary redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>) and removes
510 the redirection operators and their operands from the argument list.
511 <P>
512
513 <LI>
514 Executes the command (see section <A HREF="bashref.html#SEC51">3.7 Executing Commands</A>).
515 <P>
516
517 <LI>
518 Optionally waits for the command to complete and collects its exit
519 status (see section <A HREF="bashref.html#SEC56">3.7.5 Exit Status</A>).
520 <P>
521
522 </OL>
523 <P>
524
525 <A NAME="Quoting"></A>
526 <HR SIZE="6">
527 <A NAME="SEC8"></A>
528 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
529 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> &lt; </A>]</TD>
530 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> &gt; </A>]</TD>
531 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt;&lt; </A>]</TD>
532 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
533 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
534 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
536 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
537 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
538 </TR></TABLE>
539 <H3> 3.1.2 Quoting </H3>
540 <!--docid::SEC8::-->
541 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
542 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from a single
543                         character.</TD></TR>
544 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to inhibit all interpretation of a sequence
545                         of characters.</TD></TR>
546 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to suppress most of the interpretation of a
547                         sequence of characters.</TD></TR>
548 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to expand ANSI-C sequences in quoted strings.</TD></TR>
549 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to translate strings into different languages.</TD></TR>
550 </TABLE></BLOCKQUOTE>
551 <P>
552
553 Quoting is used to remove the special meaning of certain
554 characters or words to the shell.  Quoting can be used to
555 disable special treatment for special characters, to prevent
556 reserved words from being recognized as such, and to prevent
557 parameter expansion.
558 </P><P>
559
560 Each of the shell metacharacters (see section <A HREF="bashref.html#SEC4">2. Definitions</A>)
561 has special meaning to the shell and must be quoted if it is to
562 represent itself.
563 When the command history expansion facilities are being used
564 (see section <A HREF="bashref.html#SEC124">9.3 History Expansion</A>), the
565 <VAR>history expansion</VAR> character, usually <SAMP>`!'</SAMP>, must be quoted
566 to prevent history expansion.  See section <A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>, for
567 more details concerning history expansion.
568 </P><P>
569
570 There are three quoting mechanisms: the
571 <VAR>escape character</VAR>, single quotes, and double quotes.
572 </P><P>
573
574 <A NAME="Escape Character"></A>
575 <HR SIZE="6">
576 <A NAME="SEC9"></A>
577 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
578 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> &lt; </A>]</TD>
579 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> &gt; </A>]</TD>
580 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt;&lt; </A>]</TD>
581 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
582 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
583 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
584 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
585 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
586 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
587 </TR></TABLE>
588 <H4> 3.1.2.1 Escape Character </H4>
589 <!--docid::SEC9::-->
590 A non-quoted backslash <SAMP>`\'</SAMP> is the Bash escape character.
591 It preserves the literal value of the next character that follows,
592 with the exception of <CODE>newline</CODE>.  If a <CODE>\newline</CODE> pair
593 appears, and the backslash itself is not quoted, the <CODE>\newline</CODE>
594 is treated as a line continuation (that is, it is removed from
595 the input stream and effectively ignored).
596 <P>
597
598 <A NAME="Single Quotes"></A>
599 <HR SIZE="6">
600 <A NAME="SEC10"></A>
601 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
602 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> &lt; </A>]</TD>
603 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> &gt; </A>]</TD>
604 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> &lt;&lt; </A>]</TD>
605 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
606 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
607 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
608 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
609 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
610 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
611 </TR></TABLE>
612 <H4> 3.1.2.2 Single Quotes </H4>
613 <!--docid::SEC10::-->
614 <P>
615
616 Enclosing characters in single quotes (<SAMP>`''</SAMP>) preserves the literal value
617 of each character within the quotes.  A single quote may not occur
618 between single quotes, even when preceded by a backslash.
619 </P><P>
620
621 <A NAME="Double Quotes"></A>
622 <HR SIZE="6">
623 <A NAME="SEC11"></A>
624 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
625 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> &lt; </A>]</TD>
626 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> &gt; </A>]</TD>
627 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> &lt;&lt; </A>]</TD>
628 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
629 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
630 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
631 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
632 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
633 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
634 </TR></TABLE>
635 <H4> 3.1.2.3 Double Quotes </H4>
636 <!--docid::SEC11::-->
637 <P>
638
639 Enclosing characters in double quotes (<SAMP>`"'</SAMP>) preserves the literal value
640 of all characters within the quotes, with the exception of
641 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`\'</SAMP>,
642 and, when history expansion is enabled, <SAMP>`!'</SAMP>.
643 The characters <SAMP>`$'</SAMP> and <SAMP>``'</SAMP>
644 retain their special meaning within double quotes (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
645 The backslash retains its special meaning only when followed by one of
646 the following characters:
647 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`"'</SAMP>, <SAMP>`\'</SAMP>, or <CODE>newline</CODE>.
648 Within double quotes, backslashes that are followed by one of these
649 characters are removed.  Backslashes preceding characters without a
650 special meaning are left unmodified.
651 A double quote may be quoted within double quotes by preceding it with
652 a backslash.
653 If enabled, history expansion will be performed unless an <SAMP>`!'</SAMP>
654 appearing in double quotes is escaped using a backslash.
655 The backslash preceding the <SAMP>`!'</SAMP> is not removed.
656 </P><P>
657
658 The special parameters <SAMP>`*'</SAMP> and <SAMP>`@'</SAMP> have special meaning
659 when in double quotes (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
660 </P><P>
661
662 <A NAME="ANSI-C Quoting"></A>
663 <HR SIZE="6">
664 <A NAME="SEC12"></A>
665 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
666 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> &lt; </A>]</TD>
667 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> &gt; </A>]</TD>
668 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> &lt;&lt; </A>]</TD>
669 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
670 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
671 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
672 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
673 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
674 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
675 </TR></TABLE>
676 <H4> 3.1.2.4 ANSI-C Quoting </H4>
677 <!--docid::SEC12::-->
678 <P>
679
680 Words of the form <CODE>$'<VAR>string</VAR>'</CODE> are treated specially.  The
681 word expands to <VAR>string</VAR>, with backslash-escaped characters replaced
682 as specified by the ANSI C standard.  Backslash escape sequences, if
683 present, are decoded as follows:
684 </P><P>
685
686 <DL COMPACT>
687 <DT><CODE>\a</CODE>
688 <DD>alert (bell)
689 <DT><CODE>\b</CODE>
690 <DD>backspace
691 <DT><CODE>\e</CODE>
692 <DD><DT><CODE>\E</CODE>
693 <DD>an escape character (not ANSI C)
694 <DT><CODE>\f</CODE>
695 <DD>form feed
696 <DT><CODE>\n</CODE>
697 <DD>newline
698 <DT><CODE>\r</CODE>
699 <DD>carriage return
700 <DT><CODE>\t</CODE>
701 <DD>horizontal tab
702 <DT><CODE>\v</CODE>
703 <DD>vertical tab
704 <DT><CODE>\\</CODE>
705 <DD>backslash
706 <DT><CODE>\'</CODE>
707 <DD>single quote
708 <DT><CODE>\"</CODE>
709 <DD>double quote
710 <DT><CODE>\<VAR>nnn</VAR></CODE>
711 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
712 (one to three digits)
713 <DT><CODE>\x<VAR>HH</VAR></CODE>
714 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
715 (one or two hex digits)
716 <DT><CODE>\u<VAR>HHHH</VAR></CODE>
717 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
718 <VAR>HHHH</VAR> (one to four hex digits)
719 <DT><CODE>\U<VAR>HHHHHHHH</VAR></CODE>
720 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
721 <VAR>HHHHHHHH</VAR> (one to eight hex digits)
722 <DT><CODE>\c<VAR>x</VAR></CODE>
723 <DD>a control-<VAR>x</VAR> character
724 </DL>
725 <P>
726
727 The expanded result is single-quoted, as if the dollar sign had not
728 been present.
729 </P><P>
730
731 <A NAME="Locale Translation"></A>
732 <HR SIZE="6">
733 <A NAME="SEC13"></A>
734 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
735 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> &lt; </A>]</TD>
736 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt; </A>]</TD>
737 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt;&lt; </A>]</TD>
738 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
739 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
740 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
741 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
742 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
743 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
744 </TR></TABLE>
745 <H4> 3.1.2.5 Locale-Specific Translation </H4>
746 <!--docid::SEC13::-->
747 <P>
748
749 A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause
750 the string to be translated according to the current locale.
751 If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign
752 is ignored.
753 If the string is translated and replaced, the replacement is
754 double-quoted.
755 </P><P>
756
757 <A NAME="IDX21"></A>
758 <A NAME="IDX22"></A>
759 <A NAME="IDX23"></A>
760 Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE>
761 shell variable.  Others create the name of the message catalog from the
762 value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a
763 suffix of <SAMP>`.mo'</SAMP>.  If you use the <CODE>TEXTDOMAIN</CODE> variable, you
764 may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of
765 the message catalog files.  Still others use both variables in this
766 fashion:
767 <CODE>TEXTDOMAINDIR</CODE>/<CODE>LC_MESSAGES</CODE>/LC_MESSAGES/<CODE>TEXTDOMAIN</CODE>.mo.
768 </P><P>
769
770 <A NAME="Comments"></A>
771 <HR SIZE="6">
772 <A NAME="SEC14"></A>
773 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
774 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> &lt; </A>]</TD>
775 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt; </A>]</TD>
776 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
777 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
778 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt;&gt; </A>]</TD>
779 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
780 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
781 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
782 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
783 </TR></TABLE>
784 <H3> 3.1.3 Comments </H3>
785 <!--docid::SEC14::-->
786 <P>
787
788 In a non-interactive shell, or an interactive shell in which the
789 <CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE>
790 builtin is enabled (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>),
791 a word beginning with <SAMP>`#'</SAMP>
792 causes that word and all remaining characters on that line to
793 be ignored.  An interactive shell without the <CODE>interactive_comments</CODE>
794 option enabled does not allow comments.  The <CODE>interactive_comments</CODE>
795 option is on by default in interactive shells.
796 See section <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>, for a description of what makes
797 a shell interactive.
798 </P><P>
799
800 <A NAME="Shell Commands"></A>
801 <HR SIZE="6">
802 <A NAME="SEC15"></A>
803 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
804 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt; </A>]</TD>
805 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> &gt; </A>]</TD>
806 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt;&lt; </A>]</TD>
807 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
808 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt;&gt; </A>]</TD>
809 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
810 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
811 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
812 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
813 </TR></TABLE>
814 <H2> 3.2 Shell Commands </H2>
815 <!--docid::SEC15::-->
816 <P>
817
818 A simple shell command such as <CODE>echo a b c</CODE> consists of the command
819 itself followed by arguments, separated by spaces.
820 </P><P>
821
822 More complex shell commands are composed of simple commands arranged together
823 in a variety of ways: in a pipeline in which the output of one command
824 becomes the input of a second, in a loop or conditional construct, or in
825 some other grouping.
826 </P><P>
827
828 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
829 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The most common type of command.</TD></TR>
830 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Connecting the input and output of several
831                                 commands.</TD></TR>
832 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to execute commands sequentially.</TD></TR>
833 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for control flow.</TD></TR>
834 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Two-way communication between commands.</TD></TR>
835 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC24">3.2.6 GNU Parallel</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Running commands in parallel.</TD></TR>
836 </TABLE></BLOCKQUOTE>
837 <P>
838
839 <A NAME="Simple Commands"></A>
840 <HR SIZE="6">
841 <A NAME="SEC16"></A>
842 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
843 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &lt; </A>]</TD>
844 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> &gt; </A>]</TD>
845 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt;&lt; </A>]</TD>
846 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
847 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt;&gt; </A>]</TD>
848 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
849 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
850 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
851 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
852 </TR></TABLE>
853 <H3> 3.2.1 Simple Commands </H3>
854 <!--docid::SEC16::-->
855 <P>
856
857 A simple command is the kind of command encountered most often.
858 It's just a sequence of words separated by <CODE>blank</CODE>s, terminated
859 by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>).  The
860 first word generally specifies a command to be executed, with the
861 rest of the words being that command's arguments.
862 </P><P>
863
864 The return status (see section <A HREF="bashref.html#SEC56">3.7.5 Exit Status</A>) of a simple command is
865 its exit status as provided
866 by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if
867 the command was terminated by signal <VAR>n</VAR>.
868 </P><P>
869
870 <A NAME="Pipelines"></A>
871 <HR SIZE="6">
872 <A NAME="SEC17"></A>
873 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
874 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> &lt; </A>]</TD>
875 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &gt; </A>]</TD>
876 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &lt;&lt; </A>]</TD>
877 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
878 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt;&gt; </A>]</TD>
879 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
880 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
881 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
882 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
883 </TR></TABLE>
884 <H3> 3.2.2 Pipelines </H3>
885 <!--docid::SEC17::-->
886 <P>
887
888 A <CODE>pipeline</CODE> is a sequence of simple commands separated by one of
889 the control operators <SAMP>`|'</SAMP> or <SAMP>`|&#38;'</SAMP>.
890 </P><P>
891
892 <A NAME="IDX24"></A>
893 <A NAME="IDX25"></A>
894 <A NAME="IDX26"></A>
895 The format for a pipeline is
896 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[time [-p]] [!] <VAR>command1</VAR> [ | or |&#38; <VAR>command2</VAR> ] <small>...</small>
897 </pre></td></tr></table></P><P>
898
899 The output of each command in the pipeline is connected via a pipe
900 to the input of the next command.
901 That is, each command reads the previous command's output.  This
902 connection is performed before any redirections specified by the
903 command.
904 </P><P>
905
906 If <SAMP>`|&#38;'</SAMP> is used, <VAR>command1</VAR>'s standard error, in addition to
907 its standard output, is connected to
908 <VAR>command2</VAR>'s standard input through the pipe;
909 it is shorthand for <CODE>2&#62;&#38;1 |</CODE>.
910 This implicit redirection of the standard error to the standard output is
911 performed after any redirections specified by the command.
912 </P><P>
913
914 The reserved word <CODE>time</CODE> causes timing statistics
915 to be printed for the pipeline once it finishes.
916 The statistics currently consist of elapsed (wall-clock) time and
917 user and system time consumed by the command's execution.
918 The <SAMP>`-p'</SAMP> option changes the output format to that specified
919 by POSIX.
920 When the shell is in POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>),
921 it does not recognize <CODE>time</CODE> as a reserved word if the next
922 token begins with a <SAMP>`-'</SAMP>.
923 The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that
924 specifies how the timing information should be displayed.
925 See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>, for a description of the available formats.
926 The use of <CODE>time</CODE> as a reserved word permits the timing of
927 shell builtins, shell functions, and pipelines.  An external
928 <CODE>time</CODE> command cannot time these easily.
929 </P><P>
930
931 When the shell is in POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>), <CODE>time</CODE>
932 may be followed by a newline.  In this case, the shell displays the
933 total user and system time consumed by the shell and its children.
934 The <CODE>TIMEFORMAT</CODE> variable may be used to specify the format of
935 the time information.
936 </P><P>
937
938 If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the
939 shell waits for all commands in the pipeline to complete.
940 </P><P>
941
942 Each command in a pipeline is executed in its own subshell
943 (see section <A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>).  The exit
944 status of a pipeline is the exit status of the last command in the
945 pipeline, unless the <CODE>pipefail</CODE> option is enabled
946 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
947 If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the
948 value of the last (rightmost) command to exit with a non-zero status,
949 or zero if all commands exit successfully.
950 If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the
951 exit status is the logical negation of the exit status as described
952 above.
953 The shell waits for all commands in the pipeline to terminate before
954 returning a value.
955 </P><P>
956
957 <A NAME="Lists"></A>
958 <HR SIZE="6">
959 <A NAME="SEC18"></A>
960 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
961 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> &lt; </A>]</TD>
962 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &gt; </A>]</TD>
963 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &lt;&lt; </A>]</TD>
964 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
965 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt;&gt; </A>]</TD>
966 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
967 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
968 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
969 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
970 </TR></TABLE>
971 <H3> 3.2.3 Lists of Commands </H3>
972 <!--docid::SEC18::-->
973 <P>
974
975 A <CODE>list</CODE> is a sequence of one or more pipelines separated by one
976 of the operators <SAMP>`;'</SAMP>, <SAMP>`&#38;'</SAMP>, <SAMP>`&#38;&#38;'</SAMP>, or <SAMP>`||'</SAMP>,
977 and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&#38;'</SAMP>, or a
978 <CODE>newline</CODE>.
979 </P><P>
980
981 Of these list operators, <SAMP>`&#38;&#38;'</SAMP> and <SAMP>`||'</SAMP>
982 have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&#38;'</SAMP>,
983 which have equal precedence.
984 </P><P>
985
986 A sequence of one or more newlines may appear in a <CODE>list</CODE>
987 to delimit commands, equivalent to a semicolon.
988 </P><P>
989
990 If a command is terminated by the control operator <SAMP>`&#38;'</SAMP>,
991 the shell executes the command asynchronously in a subshell.
992 This is known as executing the command in the <VAR>background</VAR>.
993 The shell does not wait for the command to finish, and the return
994 status is 0 (true).
995 When job control is not active (see section <A HREF="bashref.html#SEC92">7. Job Control</A>),
996 the standard input for asynchronous commands, in the absence of any
997 explicit redirections, is redirected from <CODE>/dev/null</CODE>.
998 </P><P>
999
1000 Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell
1001 waits for each command to terminate in turn.  The return status is the
1002 exit status of the last command executed.
1003 </P><P>
1004
1005 AND and OR lists are sequences of one or more pipelines
1006 separated by the control operators <SAMP>`&#38;&#38;'</SAMP> and <SAMP>`||'</SAMP>,
1007 respectively.  AND and OR lists are executed with left
1008 associativity.
1009 </P><P>
1010
1011 An AND list has the form
1012 <TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>command1</VAR> &#38;&#38; <VAR>command2</VAR>
1013 </pre></td></tr></table></P><P>
1014
1015 <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
1016 returns an exit status of zero.
1017 </P><P>
1018
1019 An OR list has the form
1020 <TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR>
1021 </pre></td></tr></table></P><P>
1022
1023 <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
1024 returns a non-zero exit status.
1025 </P><P>
1026
1027 The return status of
1028 AND and OR lists is the exit status of the last command
1029 executed in the list.
1030 </P><P>
1031
1032 <A NAME="Compound Commands"></A>
1033 <HR SIZE="6">
1034 <A NAME="SEC19"></A>
1035 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1036 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &lt; </A>]</TD>
1037 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> &gt; </A>]</TD>
1038 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1039 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1040 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1041 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1042 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1043 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1044 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1045 </TR></TABLE>
1046 <H3> 3.2.4 Compound Commands </H3>
1047 <!--docid::SEC19::-->
1048 <P>
1049
1050 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
1051 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for iterative action.</TD></TR>
1052 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for conditional execution.</TD></TR>
1053 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Ways to group commands.</TD></TR>
1054 </TABLE></BLOCKQUOTE>
1055 <P>
1056
1057 Compound commands are the shell programming constructs.
1058 Each construct begins with a reserved word or control operator and is
1059 terminated by a corresponding reserved word or operator.
1060 Any redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>) associated with a compound command
1061 apply to all commands within that compound command unless explicitly overridden.
1062 </P><P>
1063
1064 In most cases a list of commands in a compound command's description may be
1065 separated from the rest of the command by one or more newlines, and may be
1066 followed by a newline in place of a semicolon.
1067 </P><P>
1068
1069 Bash provides looping constructs, conditional commands, and mechanisms
1070 to group commands and execute them as a unit.
1071 </P><P>
1072
1073 <A NAME="Looping Constructs"></A>
1074 <HR SIZE="6">
1075 <A NAME="SEC20"></A>
1076 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1077 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &lt; </A>]</TD>
1078 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> &gt; </A>]</TD>
1079 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1080 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1081 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1082 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1083 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1084 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1085 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1086 </TR></TABLE>
1087 <H4> 3.2.4.1 Looping Constructs </H4>
1088 <!--docid::SEC20::-->
1089 <P>
1090
1091 Bash supports the following looping constructs.
1092 </P><P>
1093
1094 Note that wherever a <SAMP>`;'</SAMP> appears in the description of a
1095 command's syntax, it may be replaced with one or more newlines.
1096 </P><P>
1097
1098 <DL COMPACT>
1099 <DT><CODE>until</CODE>
1100 <DD><A NAME="IDX27"></A>
1101 <A NAME="IDX28"></A>
1102 <A NAME="IDX29"></A>
1103 The syntax of the <CODE>until</CODE> command is:
1104 <P>
1105
1106 <TABLE><tr><td>&nbsp;</td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1107 </pre></td></tr></table></P><P>
1108
1109 Execute <VAR>consequent-commands</VAR> as long as
1110 <VAR>test-commands</VAR> has an exit status which is not 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.
1113 </P><P>
1114
1115 <DT><CODE>while</CODE>
1116 <DD><A NAME="IDX30"></A>
1117 The syntax of the <CODE>while</CODE> command is:
1118 <P>
1119
1120 <TABLE><tr><td>&nbsp;</td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1121 </pre></td></tr></table></P><P>
1122
1123 Execute <VAR>consequent-commands</VAR> as long as
1124 <VAR>test-commands</VAR> has an exit status of zero.
1125 The return status is the exit status of the last command executed
1126 in <VAR>consequent-commands</VAR>, or zero if none was executed.
1127 </P><P>
1128
1129 <DT><CODE>for</CODE>
1130 <DD><A NAME="IDX31"></A>
1131 The syntax of the <CODE>for</CODE> command is:
1132 <P>
1133
1134 <TABLE><tr><td>&nbsp;</td><td class=example><pre>for <VAR>name</VAR> [ [in [<VAR>words</VAR> <small>...</small>] ] ; ] do <VAR>commands</VAR>; done
1135 </pre></td></tr></table></P><P>
1136
1137 Expand <VAR>words</VAR>, and execute <VAR>commands</VAR> once for each member
1138 in the resultant list, with <VAR>name</VAR> bound to the current member.
1139 If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command
1140 executes the <VAR>commands</VAR> once for each positional parameter that is
1141 set, as if <SAMP>`in "$@"'</SAMP> had been specified
1142 (see section <A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A>).
1143 The return status is the exit status of the last command that executes.
1144 If there are no items in the expansion of <VAR>words</VAR>, no commands are
1145 executed, and the return status is zero.
1146 </P><P>
1147
1148 An alternate form of the <CODE>for</CODE> command is also supported:
1149 </P><P>
1150
1151 <TABLE><tr><td>&nbsp;</td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done
1152 </pre></td></tr></table></P><P>
1153
1154 First, the arithmetic expression <VAR>expr1</VAR> is evaluated according
1155 to the rules described below (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
1156 The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly
1157 until it evaluates to zero.   
1158 Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are
1159 executed and the arithmetic expression <VAR>expr3</VAR> is evaluated.       
1160 If any expression is omitted, it behaves as if it evaluates to 1.
1161 The return value is the exit status of the last command in <VAR>commands</VAR>
1162 that is executed, or false if any of the expressions is invalid.
1163 </DL>
1164 <P>
1165
1166 The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
1167 may be used to control loop execution.
1168 </P><P>
1169
1170 <A NAME="Conditional Constructs"></A>
1171 <HR SIZE="6">
1172 <A NAME="SEC21"></A>
1173 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1174 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> &lt; </A>]</TD>
1175 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &gt; </A>]</TD>
1176 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &lt;&lt; </A>]</TD>
1177 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1178 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1179 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1180 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1181 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1182 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1183 </TR></TABLE>
1184 <H4> 3.2.4.2 Conditional Constructs </H4>
1185 <!--docid::SEC21::-->
1186 <P>
1187
1188 <DL COMPACT>
1189 <DT><CODE>if</CODE>
1190 <DD><A NAME="IDX32"></A>
1191 <A NAME="IDX33"></A>
1192 <A NAME="IDX34"></A>
1193 <A NAME="IDX35"></A>
1194 <A NAME="IDX36"></A>
1195 The syntax of the <CODE>if</CODE> command is:
1196 <P>
1197
1198 <TABLE><tr><td>&nbsp;</td><td class=example><pre>if <VAR>test-commands</VAR>; then
1199   <VAR>consequent-commands</VAR>;
1200 [elif <VAR>more-test-commands</VAR>; then
1201   <VAR>more-consequents</VAR>;]
1202 [else <VAR>alternate-consequents</VAR>;]
1203 fi
1204 </pre></td></tr></table></P><P>
1205
1206 The <VAR>test-commands</VAR> list is executed, and if its return status is zero,
1207 the <VAR>consequent-commands</VAR> list is executed.
1208 If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list
1209 is executed in turn, and if its exit status is zero,
1210 the corresponding <VAR>more-consequents</VAR> is executed and the   
1211 command completes.
1212 If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and
1213 the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause
1214 has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed.
1215 The return status is the exit status of the last command executed, or
1216 zero if no condition tested true.
1217 </P><P>
1218
1219 <DT><CODE>case</CODE>
1220 <DD><A NAME="IDX37"></A>
1221 <A NAME="IDX38"></A>
1222 <A NAME="IDX39"></A>
1223 The syntax of the <CODE>case</CODE> command is:
1224 <P>
1225
1226 <TABLE><tr><td>&nbsp;</td><td class=example><pre>case <VAR>word</VAR> in [ [(] <VAR>pattern</VAR> [| <VAR>pattern</VAR>]<small>...</small>) <VAR>command-list</VAR> ;;]<small>...</small> esac
1227 </pre></td></tr></table></P><P>
1228
1229 <CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to
1230 the first <VAR>pattern</VAR> that matches <VAR>word</VAR>.
1231 If the shell option <CODE>nocasematch</CODE>
1232 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
1233 is enabled, the match is performed without regard to the case
1234 of alphabetic characters.
1235 The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP>
1236 operator terminates a pattern list.
1237 A list of patterns and an associated command-list is known
1238 as a <VAR>clause</VAR>.
1239 </P><P>
1240
1241 Each clause must be terminated with <SAMP>`;;'</SAMP>, <SAMP>`;&#38;'</SAMP>, or <SAMP>`;;&#38;'</SAMP>.
1242 The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command
1243 substitution, arithmetic expansion, and quote removal before matching is
1244 attempted.  Each <VAR>pattern</VAR> undergoes tilde expansion, parameter
1245 expansion, command substitution, and arithmetic expansion.
1246 </P><P>
1247
1248 There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated
1249 by a <SAMP>`;;'</SAMP>, <SAMP>`;&#38;'</SAMP>, or <SAMP>`;;&#38;'</SAMP>.
1250 The first pattern that matches determines the
1251 command-list that is executed.
1252 It's a common idiom to use <SAMP>`*'</SAMP> as the final pattern to define the
1253 default case, since that pattern will always match.
1254 </P><P>
1255
1256 Here is an example using <CODE>case</CODE> in a script that could be used to
1257 describe one interesting feature of an animal:
1258 </P><P>
1259
1260 <TABLE><tr><td>&nbsp;</td><td class=example><pre>echo -n "Enter the name of an animal: "
1261 read ANIMAL
1262 echo -n "The $ANIMAL has "
1263 case $ANIMAL in
1264   horse | dog | cat) echo -n "four";;
1265   man | kangaroo ) echo -n "two";;
1266   *) echo -n "an unknown number of";;
1267 esac
1268 echo " legs."
1269 </pre></td></tr></table></P><P>
1270
1271 </P><P>
1272
1273 If the <SAMP>`;;'</SAMP> operator is used, no subsequent matches are attempted after
1274 the first pattern match.
1275 Using <SAMP>`;&#38;'</SAMP>  in place of <SAMP>`;;'</SAMP> causes execution to continue with
1276 the <VAR>command-list</VAR> associated with the next clause, if any.
1277 Using <SAMP>`;;&#38;'</SAMP> in place of <SAMP>`;;'</SAMP> causes the shell to test the patterns
1278 in the next clause, if any, and execute any associated <VAR>command-list</VAR>
1279 on a successful match.
1280 </P><P>
1281
1282 The return status is zero if no <VAR>pattern</VAR> is matched.  Otherwise, the
1283 return status is the exit status of the <VAR>command-list</VAR> executed.
1284 </P><P>
1285
1286 <DT><CODE>select</CODE>
1287 <DD><A NAME="IDX40"></A>
1288 <P>
1289
1290 The <CODE>select</CODE> construct allows the easy generation of menus.
1291 It has almost the same syntax as the <CODE>for</CODE> command:
1292 </P><P>
1293
1294 <TABLE><tr><td>&nbsp;</td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done
1295 </pre></td></tr></table></P><P>
1296
1297 The list of words following <CODE>in</CODE> is expanded, generating a list
1298 of items.  The set of expanded words is printed on the standard
1299 error output stream, each preceded by a number.  If the
1300 <SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed,
1301 as if <SAMP>`in "$@"'</SAMP> had been specified.
1302 The <CODE>PS3</CODE> prompt is then displayed and a line is read from the
1303 standard input.
1304 If the line consists of a number corresponding to one of the displayed
1305 words, then the value of <VAR>name</VAR> is set to that word.
1306 If the line is empty, the words and prompt are displayed again.
1307 If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes.
1308 Any other value read causes <VAR>name</VAR> to be set to null.
1309 The line read is saved in the variable <CODE>REPLY</CODE>.
1310 </P><P>
1311
1312 The <VAR>commands</VAR> are executed after each selection until a
1313 <CODE>break</CODE> command is executed, at which
1314 point the <CODE>select</CODE> command completes.
1315 </P><P>
1316
1317 Here is an example that allows the user to pick a filename from the
1318 current directory, and displays the name and index of the file
1319 selected.
1320 </P><P>
1321
1322 <TABLE><tr><td>&nbsp;</td><td class=example><pre>select fname in *;
1323 do
1324         echo you picked $fname \($REPLY\)
1325         break;
1326 done
1327 </pre></td></tr></table></P><P>
1328
1329 <DT><CODE>((<small>...</small>))</CODE>
1330 <DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>(( <VAR>expression</VAR> ))
1331 </pre></td></tr></table><P>
1332
1333 The arithmetic <VAR>expression</VAR> is evaluated according to the rules
1334 described below (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
1335 If the value of the expression is non-zero, the return status is 0;
1336 otherwise the return status is 1.  This is exactly equivalent to
1337 <TABLE><tr><td>&nbsp;</td><td class=example><pre>let "<VAR>expression</VAR>"
1338 </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.
1339 </P><P>
1340
1341 <DT><CODE>[[<small>...</small>]]</CODE>
1342 <DD><A NAME="IDX41"></A>
1343 <A NAME="IDX42"></A>
1344 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[[ <VAR>expression</VAR> ]]
1345 </pre></td></tr></table><P>
1346
1347 Return a status of 0 or 1 depending on the evaluation of
1348 the conditional expression <VAR>expression</VAR>.
1349 Expressions are composed of the primaries described below in
1350 <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>.
1351 Word splitting and filename expansion are not performed on the words
1352 between the <CODE>[[</CODE> and <CODE>]]</CODE>; tilde expansion, parameter and
1353 variable expansion, arithmetic expansion, command substitution, process
1354 substitution, and quote removal are performed.
1355 Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized
1356 as primaries.
1357 </P><P>
1358
1359 When used with <CODE>[[</CODE>, the <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
1360 lexicographically using the current locale.
1361 </P><P>
1362
1363 When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the
1364 right of the operator is considered a pattern and matched according
1365 to the rules described below in <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>,
1366 as if the <CODE>extglob</CODE> shell option were enabled.
1367 The <SAMP>`='</SAMP> operator is identical to <SAMP>`=='</SAMP>.
1368 If the shell option <CODE>nocasematch</CODE>
1369 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
1370 is enabled, the match is performed without regard to the case
1371 of alphabetic characters.
1372 The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not
1373 match (<SAMP>`!='</SAMP>)the pattern, and 1 otherwise.
1374 Any part of the pattern may be quoted to force the quoted portion
1375 to be matched as a string.
1376 </P><P>
1377
1378 An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same
1379 precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>.
1380 When it is used, the string to the right of the operator is considered
1381 an extended regular expression and matched accordingly (as in <I>regex</I>3)).  
1382 The return value is 0 if the string matches
1383 the pattern, and 1 otherwise.
1384 If the regular expression is syntactically incorrect, the conditional
1385 expression's return value is 2.
1386 If the shell option <CODE>nocasematch</CODE>
1387 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
1388 is enabled, the match is performed without regard to the case
1389 of alphabetic characters.
1390 Any part of the pattern may be quoted to force the quoted portion
1391 to be matched as a string.
1392 Bracket expressions in regular expressions must be treated carefully,
1393 since normal quoting characters lose their meanings between brackets.
1394 If the pattern is stored in a shell variable, quoting the variable
1395 expansion forces the entire pattern to be matched as a string.
1396 Substrings matched by parenthesized subexpressions within the regular
1397 expression are saved in the array variable <CODE>BASH_REMATCH</CODE>.
1398 The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string
1399 matching the entire regular expression.
1400 The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the
1401 string matching the <VAR>n</VAR>th parenthesized subexpression.
1402 </P><P>
1403
1404 For example, the following will match a line
1405 (stored in the shell variable <VAR>line</VAR>)
1406 if there is a sequence of characters in the value consisting of
1407 any number, including zero, of 
1408 space characters, zero or one instances of <SAMP>`a'</SAMP>, then a <SAMP>`b'</SAMP>:
1409 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[[ $line =~ [[:space:]]*(a)?b ]]
1410 </pre></td></tr></table></P><P>
1411
1412 That means values like <SAMP>`aab'</SAMP> and <SAMP>`  aaaaaab'</SAMP> will match, as
1413 will a line containing a <SAMP>`b'</SAMP> anywhere in its value.
1414 </P><P>
1415
1416 Storing the regular expression in a shell variable is often a useful
1417 way to avoid problems with quoting characters that are special to the
1418 shell.
1419 It is sometimes difficult to specify a regular expression literally
1420 without using quotes, or to keep track of the quoting used by regular
1421 expressions while paying attention to the shell's quote removal.
1422 Using a shell variable to store the pattern decreases these problems.
1423 For example, the following is equivalent to the above:
1424 <TABLE><tr><td>&nbsp;</td><td class=example><pre>pattern='[[:space:]]*(a)?b'
1425 [[ $line =~ $pattern ]]
1426 </pre></td></tr></table></P><P>
1427
1428 If you want to match a character that's special to the regular expression
1429 grammar, it has to be quoted to remove its special meaning.
1430 This means that in the pattern <SAMP>`xxx.txt'</SAMP>, the <SAMP>`.'</SAMP> matches any
1431 character in the string (its usual regular expression meaning), but in the
1432 pattern <SAMP>`"xxx.txt"'</SAMP> it can only match a literal <SAMP>`.'</SAMP>.
1433 Shell programmers should take special care with backslashes, since backslashes
1434 are used both by the shell and regular expressions to remove the special
1435 meaning from the following character.
1436 The following two sets of commands are <EM>not</EM> equivalent:
1437 <TABLE><tr><td>&nbsp;</td><td class=example><pre>pattern='\.'
1438
1439 [[ . =~ $pattern ]]
1440 [[ . =~ \. ]]
1441
1442 [[ . =~ "$pattern" ]]
1443 [[ . =~ '\.' ]]
1444 </pre></td></tr></table></P><P>
1445
1446 The first two matches will succeed, but the second two will not, because
1447 in the second two the backslash will be part of the pattern to be matched.
1448 In the first two examples, the backslash removes the special meaning from
1449 <SAMP>`.'</SAMP>, so the literal <SAMP>`.'</SAMP> matches.
1450 If the string in the first examples were anything other than <SAMP>`.'</SAMP>, say
1451 <SAMP>`a'</SAMP>, the pattern would not match, because the quoted <SAMP>`.'</SAMP> in the
1452 pattern loses its special meaning of matching any single character.
1453 </P><P>
1454
1455 Expressions may be combined using the following operators, listed
1456 in decreasing order of precedence:
1457 </P><P>
1458
1459 <DL COMPACT>
1460 <DT><CODE>( <VAR>expression</VAR> )</CODE>
1461 <DD>Returns the value of <VAR>expression</VAR>.
1462 This may be used to override the normal precedence of operators.
1463 <P>
1464
1465 <DT><CODE>! <VAR>expression</VAR></CODE>
1466 <DD>True if <VAR>expression</VAR> is false.
1467 <P>
1468
1469 <DT><CODE><VAR>expression1</VAR> &#38;&#38; <VAR>expression2</VAR></CODE>
1470 <DD>True if both <VAR>expression1</VAR> and <VAR>expression2</VAR> are true.
1471 <P>
1472
1473 <DT><CODE><VAR>expression1</VAR> || <VAR>expression2</VAR></CODE>
1474 <DD>True if either <VAR>expression1</VAR> or <VAR>expression2</VAR> is true.
1475 </DL>
1476 <P>
1477
1478 The <CODE>&#38;&#38;</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the
1479 value of <VAR>expression1</VAR> is sufficient to determine the return
1480 value of the entire conditional expression.
1481 </DL>
1482 <P>
1483
1484 <A NAME="Command Grouping"></A>
1485 <HR SIZE="6">
1486 <A NAME="SEC22"></A>
1487 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1488 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> &lt; </A>]</TD>
1489 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt; </A>]</TD>
1490 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1491 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1492 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1493 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1494 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1495 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1496 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1497 </TR></TABLE>
1498 <H4> 3.2.4.3 Grouping Commands </H4>
1499 <!--docid::SEC22::-->
1500 <P>
1501
1502 Bash provides two ways to group a list of commands to be executed
1503 as a unit.  When commands are grouped, redirections may be applied
1504 to the entire command list.  For example, the output of all the
1505 commands in the list may be redirected to a single stream.
1506 </P><P>
1507
1508 <DL COMPACT>
1509 <DT><CODE>()</CODE>
1510 <DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>( <VAR>list</VAR> )
1511 </pre></td></tr></table><P>
1512
1513 Placing a list of commands between parentheses causes a subshell
1514 environment to be created (see section <A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>), and each
1515 of the commands in <VAR>list</VAR> to be executed in that subshell.  Since the
1516 <VAR>list</VAR> is executed in a subshell, variable assignments do not remain in
1517 effect after the subshell completes. 
1518 </P><P>
1519
1520 <DT><CODE>{}</CODE>
1521 <DD><A NAME="IDX43"></A>
1522 <A NAME="IDX44"></A>
1523 <TABLE><tr><td>&nbsp;</td><td class=example><pre>{ <VAR>list</VAR>; }
1524 </pre></td></tr></table><P>
1525
1526 Placing a list of commands between curly braces causes the list to
1527 be executed in the current shell context.  No subshell is created.
1528 The semicolon (or newline) following <VAR>list</VAR> is required.
1529 </DL>
1530 <P>
1531
1532 In addition to the creation of a subshell, there is a subtle difference
1533 between these two constructs due to historical reasons.  The braces
1534 are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR>
1535 by <CODE>blank</CODE>s or other shell metacharacters.
1536 The parentheses are <CODE>operators</CODE>, and are
1537 recognized as separate tokens by the shell even if they are not separated
1538 from the <VAR>list</VAR> by whitespace.
1539 </P><P>
1540
1541 The exit status of both of these constructs is the exit status of
1542 <VAR>list</VAR>.
1543 </P><P>
1544
1545 <A NAME="Coprocesses"></A>
1546 <HR SIZE="6">
1547 <A NAME="SEC23"></A>
1548 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1549 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &lt; </A>]</TD>
1550 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt; </A>]</TD>
1551 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt;&lt; </A>]</TD>
1552 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1553 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt;&gt; </A>]</TD>
1554 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1555 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1556 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1557 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1558 </TR></TABLE>
1559 <H3> 3.2.5 Coprocesses </H3>
1560 <!--docid::SEC23::-->
1561 <P>
1562
1563 A <CODE>coprocess</CODE> is a shell command preceded by the <CODE>coproc</CODE>
1564 reserved word.
1565 A coprocess is executed asynchronously in a subshell, as if the command
1566 had been terminated with the <SAMP>`&#38;'</SAMP> control operator, with a two-way pipe
1567 established between the executing shell and the coprocess.
1568 </P><P>
1569
1570 The format for a coprocess is:
1571 <TABLE><tr><td>&nbsp;</td><td class=example><pre>coproc [<VAR>NAME</VAR>] <VAR>command</VAR> [<VAR>redirections</VAR>]
1572 </pre></td></tr></table></P><P>
1573
1574 This creates a coprocess named <VAR>NAME</VAR>.
1575 If <VAR>NAME</VAR> is not supplied, the default name is <VAR>COPROC</VAR>.
1576 <VAR>NAME</VAR> must not be supplied if <VAR>command</VAR> is a simple
1577 command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>); otherwise, it is interpreted as
1578 the first word of the simple command.
1579 </P><P>
1580
1581 When the coprocess is executed, the shell creates an array variable
1582 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>)
1583 named <CODE>NAME</CODE> in the context of the executing shell.
1584 The standard output of <VAR>command</VAR>
1585 is connected via a pipe to a file descriptor in the executing shell,
1586 and that file descriptor is assigned to <CODE>NAME</CODE>[0].
1587 The standard input of <VAR>command</VAR>
1588 is connected via a pipe to a file descriptor in the executing shell,
1589 and that file descriptor is assigned to <CODE>NAME</CODE>[1].
1590 This pipe is established before any redirections specified by the
1591 command (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
1592 The file descriptors can be utilized as arguments to shell commands
1593 and redirections using standard word expansions.
1594 The file descriptors are not available in subshells.
1595 </P><P>
1596
1597 The process ID of the shell spawned to execute the coprocess is
1598 available as the value of the variable <CODE>NAME</CODE>_PID.
1599 The <CODE>wait</CODE>
1600 builtin command may be used to wait for the coprocess to terminate.
1601 </P><P>
1602
1603 Since the coprocess is created as an asynchronous command,
1604 the <CODE>coproc</CODE> command always returns success.
1605 The return status of a coprocess is the exit status of <VAR>command</VAR>.
1606 </P><P>
1607
1608 <A NAME="GNU Parallel"></A>
1609 <HR SIZE="6">
1610 <A NAME="SEC24"></A>
1611 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1612 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt; </A>]</TD>
1613 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt; </A>]</TD>
1614 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt;&lt; </A>]</TD>
1615 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1616 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt;&gt; </A>]</TD>
1617 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1618 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1619 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1620 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1621 </TR></TABLE>
1622 <H3> 3.2.6 GNU Parallel </H3>
1623 <!--docid::SEC24::-->
1624 <P>
1625
1626 There are ways to run commands in parallel that are not built into Bash.
1627 GNU Parallel is a tool to do just that.
1628 </P><P>
1629
1630 GNU Parallel, as its name suggests, can be used to build and run commands
1631 in parallel.  You may run the same command with different arguments, whether
1632 they are filenames, usernames, hostnames, or lines read from files.  GNU
1633 Parallel provides shorthand references to many of the most common operations
1634 (input lines, various portions of the input line, different ways to specify
1635 the input source, and so on).  Parallel can replace <CODE>xargs</CODE> or feed
1636 commands from its input sources to several different instances of Bash.
1637 </P><P>
1638
1639 For a complete description, refer to the GNU Parallel documentation.  A few
1640 examples should provide a brief introduction to its use.
1641 </P><P>
1642
1643 For example, it is easy to replace <CODE>xargs</CODE> to gzip all html files in the
1644 current directory and its subdirectories:
1645 <TABLE><tr><td>&nbsp;</td><td class=example><pre>find . -type f -name '*.html' -print | parallel gzip
1646 </pre></td></tr></table>If you need to protect special characters such as newlines in file names,
1647 use find's <SAMP>`-print0'</SAMP> option and parallel's <SAMP>`-0'</SAMP> option.
1648 </P><P>
1649
1650 You can use Parallel to move files from the current directory when the
1651 number of files is too large to process with one <CODE>mv</CODE> invocation:
1652 <TABLE><tr><td>&nbsp;</td><td class=example><pre>ls | parallel mv {} destdir
1653 </pre></td></tr></table></P><P>
1654
1655 As you can see, the {} is replaced with each line read from standard input.
1656 While using <CODE>ls</CODE> will work in most instances, it is not sufficient to
1657 deal with all filenames.
1658 If you need to accommodate special characters in filenames, you can use
1659 </P><P>
1660
1661 <TABLE><tr><td>&nbsp;</td><td class=example><pre>find . -depth 1 \! -name '.*' -print0 | parallel -0 mv {} destdir
1662 </pre></td></tr></table></P><P>
1663
1664 as alluded to above.
1665 </P><P>
1666
1667 This will run as many <CODE>mv</CODE> commands as there are files in the current
1668 directory.
1669 You can emulate a parallel <CODE>xargs</CODE> by adding the <SAMP>`-X'</SAMP> option:
1670 <TABLE><tr><td>&nbsp;</td><td class=example><pre>find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv {} destdir
1671 </pre></td></tr></table></P><P>
1672
1673 GNU Parallel can replace certain common idioms that operate on lines read
1674 from a file (in this case, filenames listed one per line):
1675 <TABLE><tr><td>&nbsp;</td><td class=example><pre>       while IFS= read -r x; do
1676                 do-something1 "$x" "config-$x"
1677                 do-something2 &#60; "$x"
1678         done &#60; file | process-output
1679 </pre></td></tr></table></P><P>
1680
1681 with a more compact syntax reminiscent of lambdas:
1682 <TABLE><tr><td>&nbsp;</td><td class=example><pre>cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" | process-output
1683 </pre></td></tr></table></P><P>
1684
1685 Parallel provides a built-in mechanism to remove filename extensions, which
1686 lends itself to batch file transformations or renaming:
1687 <TABLE><tr><td>&nbsp;</td><td class=example><pre>ls *.gz | parallel -j+0 "zcat {} | bzip2 >{.}.bz2 &&#38; rm {}"
1688 </pre></td></tr></table>This will recompress all files in the current directory with names ending
1689 in .gz using bzip2, running one job per CPU (-j+0) in parallel.
1690 (We use <CODE>ls</CODE> for brevity here; using <CODE>find</CODE> as above is more
1691 robust in the face of filenames containing unexpected characters.)
1692 Parallel can take arguments from the command line; the above can also be
1693 written as
1694 </P><P>
1695
1696 <TABLE><tr><td>&nbsp;</td><td class=example><pre>parallel "zcat {} | bzip2 >{.}.bz2 &&#38; rm {}" ::: *.gz
1697 </pre></td></tr></table></P><P>
1698
1699 If a command generates output, you may want to preserve the input order in
1700 the output.  For instance, the following command
1701 <TABLE><tr><td>&nbsp;</td><td class=example><pre>{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute
1702 </pre></td></tr></table>will display as output the traceroute invocation that finishes first.
1703 Adding the <SAMP>`-k'</SAMP> option 
1704 <TABLE><tr><td>&nbsp;</td><td class=example><pre>{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute
1705 </pre></td></tr></table>will ensure that the output of <CODE>traceroute foss.org.my</CODE> is displayed first.
1706 </P><P>
1707
1708 Finally, Parallel can be used to run a sequence of shell commands in parallel,
1709 similar to <SAMP>`cat file | bash'</SAMP>.
1710 It is not uncommon to take a list of filenames, create a series of shell
1711 commands to operate on them, and feed that list of commnds to a shell.
1712 Parallel can speed this up.  Assuming that <TT>`file'</TT> contains a list of
1713 shell commands, one per line,
1714 </P><P>
1715
1716 <TABLE><tr><td>&nbsp;</td><td class=example><pre>parallel -j 10 &#60; file
1717 </pre></td></tr></table></P><P>
1718
1719 will evaluate the commands using the shell (since no explicit command is
1720 supplied as an argument), in blocks of ten shell jobs at a time.
1721 </P><P>
1722
1723 <A NAME="Shell Functions"></A>
1724 <HR SIZE="6">
1725 <A NAME="SEC25"></A>
1726 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1727 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt; </A>]</TD>
1728 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> &gt; </A>]</TD>
1729 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> &lt;&lt; </A>]</TD>
1730 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1731 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &gt;&gt; </A>]</TD>
1732 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1733 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1734 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1735 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1736 </TR></TABLE>
1737 <H2> 3.3 Shell Functions </H2>
1738 <!--docid::SEC25::-->
1739 <P>
1740
1741 Shell functions are a way to group commands for later execution
1742 using a single name for the group.  They are executed just like
1743 a "regular" command.
1744 When the name of a shell function is used as a simple command name,
1745 the list of commands associated with that function name is executed.
1746 Shell functions are executed in the current
1747 shell context; no new process is created to interpret them.
1748 </P><P>
1749
1750 Functions are declared using this syntax:
1751 <A NAME="IDX45"></A>
1752 <TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ]
1753 </pre></td></tr></table></P><P>
1754
1755 or
1756 </P><P>
1757
1758 <TABLE><tr><td>&nbsp;</td><td class=example><pre>function <VAR>name</VAR> [()] <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ]
1759 </pre></td></tr></table></P><P>
1760
1761 This defines a shell function named <VAR>name</VAR>.  The reserved
1762 word <CODE>function</CODE> is optional.
1763 If the <CODE>function</CODE> reserved
1764 word is supplied, the parentheses are optional.
1765 The <VAR>body</VAR> of the function is the compound command
1766 <VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>).
1767 That command is usually a <VAR>list</VAR> enclosed between { and }, but
1768 may be any compound command listed above.
1769 <VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the
1770 name of a command.
1771 When the shell is in POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>),
1772 <VAR>name</VAR> may not be the same as one of the special builtins
1773 (see section <A HREF="bashref.html#SEC65">4.4 Special Builtins</A>).
1774 Any redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>) associated with the shell function
1775 are performed when the function is executed.
1776 </P><P>
1777
1778 A function definition may be deleted using the <SAMP>`-f'</SAMP> option to the
1779 <CODE>unset</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
1780 </P><P>
1781
1782 The exit status of a function definition is zero unless a syntax error
1783 occurs or a readonly function with the same name already exists.
1784 When executed, the exit status of a function is the exit status of the
1785 last command executed in the body.
1786 </P><P>
1787
1788 Note that for historical reasons, in the most common usage the curly braces
1789 that surround the body of the function must be separated from the body by
1790 <CODE>blank</CODE>s or newlines.
1791 This is because the braces are reserved words and are only recognized
1792 as such when they are separated from the command list
1793 by whitespace or another shell metacharacter.
1794 Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon,
1795 a <SAMP>`&#38;'</SAMP>, or a newline.
1796 </P><P>
1797
1798 When a function is executed, the arguments to the
1799 function become the positional parameters
1800 during its execution (see section <A HREF="bashref.html#SEC27">3.4.1 Positional Parameters</A>).
1801 The special parameter <SAMP>`#'</SAMP> that expands to the number of
1802 positional parameters is updated to reflect the change.
1803 Special parameter <CODE>0</CODE> is unchanged.
1804 The first element of the <CODE>FUNCNAME</CODE> variable is set to the
1805 name of the function while the function is executing.
1806 </P><P>
1807
1808 All other aspects of the shell execution
1809 environment are identical between a function and its caller
1810 with these exceptions:
1811 the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps
1812 are not inherited unless the function has been given the
1813 <CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or
1814 the <CODE>-o functrace</CODE> option has been enabled with
1815 the <CODE>set</CODE> builtin,
1816 (in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps),
1817 and the <CODE>ERR</CODE> trap is not inherited unless the <CODE>-o errtrace</CODE>
1818 shell option has been enabled.
1819 See section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>, for the description of the
1820 <CODE>trap</CODE> builtin.
1821 </P><P>
1822
1823 The <CODE>FUNCNEST</CODE> variable, if set to a numeric value greater
1824 than 0, defines a maximum function nesting level.  Function
1825 invocations that exceed the limit cause the entire command to
1826 abort.
1827 </P><P>
1828
1829 If the builtin command <CODE>return</CODE>
1830 is executed in a function, the function completes and
1831 execution resumes with the next command after the function
1832 call.
1833 Any command associated with the <CODE>RETURN</CODE> trap is executed
1834 before execution resumes.
1835 When a function completes, the values of the
1836 positional parameters and the special parameter <SAMP>`#'</SAMP>
1837 are restored to the values they had prior to the function's
1838 execution.  If a numeric argument is given to <CODE>return</CODE>,
1839 that is the function's return status; otherwise the function's
1840 return status is the exit status of the last command executed
1841 before the <CODE>return</CODE>.
1842 </P><P>
1843
1844 Variables local to the function may be declared with the
1845 <CODE>local</CODE> builtin.  These variables are visible only to
1846 the function and the commands it invokes.
1847 </P><P>
1848
1849 Function names and definitions may be listed with the
1850 <SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> (<CODE>typeset</CODE>)
1851 builtin command (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
1852 The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE>
1853 will list the function names only
1854 (and optionally the source file and line number, if the <CODE>extdebug</CODE>
1855 shell option is enabled).
1856 Functions may be exported so that subshells
1857 automatically have them defined with the
1858 <SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin
1859 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
1860 Note that shell functions and variables with the same name may result
1861 in multiple identically-named entries in the environment passed to the
1862 shell's children.
1863 Care should be taken in cases where this may cause a problem.
1864 </P><P>
1865
1866 Functions may be recursive.
1867 The <CODE>FUNCNEST</CODE> variable may be used to limit the depth of the
1868 function call stack and restrict the number of function invocations.
1869 By default, no limit is placed on the number of recursive  calls.
1870 </P><P>
1871
1872 <A NAME="Shell Parameters"></A>
1873 <HR SIZE="6">
1874 <A NAME="SEC26"></A>
1875 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1876 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt; </A>]</TD>
1877 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> &gt; </A>]</TD>
1878 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &lt;&lt; </A>]</TD>
1879 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1880 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &gt;&gt; </A>]</TD>
1881 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1882 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1883 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1884 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1885 </TR></TABLE>
1886 <H2> 3.4 Shell Parameters </H2>
1887 <!--docid::SEC26::-->
1888 <P>
1889
1890 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
1891 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.4.1 Positional Parameters</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR>
1892 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR>
1893 </TABLE></BLOCKQUOTE>
1894 <P>
1895
1896 A <VAR>parameter</VAR> is an entity that stores values.
1897 It can be a <CODE>name</CODE>, a number, or one of the special characters
1898 listed below.
1899 A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>.
1900 A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>.
1901 Attributes are assigned using the <CODE>declare</CODE> builtin command
1902 (see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
1903 </P><P>
1904
1905 A parameter is set if it has been assigned a value.  The null string is
1906 a valid value.  Once a variable is set, it may be unset only by using
1907 the <CODE>unset</CODE> builtin command.
1908 </P><P>
1909
1910 A variable may be assigned to by a statement of the form
1911 <TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>]
1912 </pre></td></tr></table>If <VAR>value</VAR>
1913 is not given, the variable is assigned the null string.  All
1914 <VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion,
1915 command substitution, arithmetic expansion, and quote
1916 removal (detailed below).  If the variable has its <CODE>integer</CODE>
1917 attribute set, then <VAR>value</VAR> 
1918 is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE>
1919 expansion is not used (see section <A HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A>).
1920 Word splitting is not performed, with the exception
1921 of <CODE>"$@"</CODE> as explained below.
1922 Filename expansion is not performed.
1923 Assignment statements may also appear as arguments to the
1924 <CODE>alias</CODE>, 
1925 <CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>,
1926 and <CODE>local</CODE> builtin commands.
1927 When in POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>), these builtins may appear
1928 in a command after one or more instances of the <CODE>command</CODE> builtin
1929 and retain these assignment statement properties.
1930 </P><P>
1931
1932 In the context where an assignment statement is assigning a value  
1933 to a shell variable or array index (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>), the <SAMP>`+='</SAMP>
1934 operator can be used to   
1935 append to or add to the variable's previous value.
1936 When <SAMP>`+='</SAMP> is applied to a variable for which the <VAR>integer</VAR> attribute
1937 has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and
1938 added to the variable's current value, which is also evaluated.
1939 When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment
1940 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>), the
1941 variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new
1942 values are appended to the array beginning at one greater than the array's
1943 maximum index (for indexed arrays),  or added as additional key-value pairs
1944 in an associative array.
1945 When applied to a string-valued variable, <VAR>value</VAR> is expanded and
1946 appended to the variable's value.
1947 </P><P>
1948
1949 A variable can be assigned the <VAR>nameref</VAR> attribute using the
1950 <SAMP>`-n'</SAMP> option to the \fBdeclare\fP or \fBlocal\fP builtin commands
1951 (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>)
1952 to create a <VAR>nameref</VAR>, or a reference to another variable.
1953 This allows variables to be manipulated indirectly.
1954 Whenever the nameref variable is referenced or assigned to, the operation
1955 is actually performed on the variable specified by the nameref variable's
1956 value.
1957 A nameref is commonly used within shell functions to refer to a variable
1958 whose name is passed as an argument to the function.
1959 For instance, if a variable name is passed to a shell function as its first
1960 argument, running
1961 <TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -n ref=$1
1962 </pre></td></tr></table>inside the function creates a nameref variable <VAR>ref</VAR> whose value is
1963 the variable name passed as the first argument.
1964 References and assignments to <VAR>ref</VAR> are treated as references and
1965 assignments to the variable whose name was passed as <CODE>$1</CODE>.
1966 </P><P>
1967
1968 If the control variable in a <CODE>for</CODE> loop has the nameref attribute,
1969 the list of words can be a list of shell variables, and a name reference
1970 will be established for each word in the list, in turn, when the loop is
1971 executed.
1972 Array variables cannot be given the <SAMP>`-n'</SAMP> attribute.
1973 However, nameref variables can reference array variables and subscripted
1974 array variables.
1975 Namerefs can be unset using the <SAMP>`-n'</SAMP> option to the <CODE>unset</CODE> builtin
1976 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
1977 Otherwise, if <CODE>unset</CODE> is executed with the name of a nameref variable
1978 as an argument, the variable referenced by the nameref variable will be unset.
1979 </P><P>
1980
1981 <A NAME="Positional Parameters"></A>
1982 <HR SIZE="6">
1983 <A NAME="SEC27"></A>
1984 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1985 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> &lt; </A>]</TD>
1986 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt; </A>]</TD>
1987 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &lt;&lt; </A>]</TD>
1988 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> Up </A>]</TD>
1989 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &gt;&gt; </A>]</TD>
1990 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1991 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
1993 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1994 </TR></TABLE>
1995 <H3> 3.4.1 Positional Parameters </H3>
1996 <!--docid::SEC27::-->
1997 <P>
1998
1999 A <VAR>positional parameter</VAR> is a parameter denoted by one or more
2000 digits, other than the single digit <CODE>0</CODE>.  Positional parameters are
2001 assigned from the shell's arguments when it is invoked,
2002 and may be reassigned using the <CODE>set</CODE> builtin command.
2003 Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or
2004 as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit.
2005 Positional parameters may not be assigned to with assignment statements.
2006 The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and
2007 unset them (see section <A HREF="bashref.html#SEC59">4. Shell Builtin Commands</A>).
2008 The positional parameters are
2009 temporarily replaced when a shell function is executed
2010 (see section <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>).
2011 </P><P>
2012
2013 When a positional parameter consisting of more than a single
2014 digit is expanded, it must be enclosed in braces.
2015 </P><P>
2016
2017 <A NAME="Special Parameters"></A>
2018 <HR SIZE="6">
2019 <A NAME="SEC28"></A>
2020 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2021 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> &lt; </A>]</TD>
2022 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &gt; </A>]</TD>
2023 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &lt;&lt; </A>]</TD>
2024 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> Up </A>]</TD>
2025 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &gt;&gt; </A>]</TD>
2026 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2027 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2028 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2029 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2030 </TR></TABLE>
2031 <H3> 3.4.2 Special Parameters </H3>
2032 <!--docid::SEC28::-->
2033 <P>
2034
2035 The shell treats several parameters specially.  These parameters may
2036 only be referenced; assignment to them is not allowed.
2037 </P><P>
2038
2039 <DL COMPACT>
2040
2041 <A NAME="IDX46"></A>
2042 <DT><CODE>*</CODE>
2043 <DD><A NAME="IDX47"></A>
2044 <A NAME="IDX48"></A>
2045 ($*) Expands to the positional parameters, starting from one.
2046 When the expansion is not within double quotes, each positional parameter
2047 expands to a separate word.
2048 In contexts where it is performed, those words
2049 are subject to further word splitting and pathname expansion.
2050 When the expansion occurs within double quotes, it expands to a single word
2051 with the value of each parameter separated by the first character
2052 of the <CODE>IFS</CODE>
2053 special variable.  That is, <CODE>"$*"</CODE> is equivalent
2054 to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR>
2055 is the first character of the value of the <CODE>IFS</CODE>
2056 variable.
2057 If <CODE>IFS</CODE> is unset, the parameters are separated by spaces.
2058 If <CODE>IFS</CODE> is null, the parameters are joined without intervening
2059 separators.
2060 <P>
2061
2062 <A NAME="IDX49"></A>
2063 <DT><CODE>@</CODE>
2064 <DD><A NAME="IDX50"></A>
2065 <A NAME="IDX51"></A>
2066 ($@) Expands to the positional parameters, starting from one.  When the
2067 expansion occurs within double quotes, each parameter expands to a
2068 separate word.  That is, <CODE>"$@"</CODE> is equivalent to
2069 <CODE>"$1" "$2" <small>...</small></CODE>.
2070 If the double-quoted expansion occurs within a word, the expansion of
2071 the first parameter is joined with the beginning part of the original
2072 word, and the expansion of the last parameter is joined with the last
2073 part of the original word.
2074 When there are no positional parameters, <CODE>"$@"</CODE> and
2075 <CODE>$@</CODE>
2076 expand to nothing (i.e., they are removed).
2077 <P>
2078
2079 <A NAME="IDX52"></A>
2080 <DT><CODE>#</CODE>
2081 <DD><A NAME="IDX53"></A>
2082 <A NAME="IDX54"></A>
2083 ($#) Expands to the number of positional parameters in decimal.
2084 <P>
2085
2086 <A NAME="IDX55"></A>
2087 <DT><CODE>?</CODE>
2088 <DD><A NAME="IDX56"></A>
2089 <A NAME="IDX57"></A>
2090 ($?) Expands to the exit status of the most recently executed foreground
2091 pipeline.
2092 <P>
2093
2094 <A NAME="IDX58"></A>
2095 <DT><CODE>-</CODE>
2096 <DD><A NAME="IDX59"></A>
2097 <A NAME="IDX60"></A>
2098 ($-, a hyphen.)  Expands to the current option flags as specified upon
2099 invocation, by the <CODE>set</CODE>
2100 builtin command, or those set by the shell itself
2101 (such as the <SAMP>`-i'</SAMP> option).
2102 <P>
2103
2104 <A NAME="IDX61"></A>
2105 <DT><CODE>$</CODE>
2106 <DD><A NAME="IDX62"></A>
2107 <A NAME="IDX63"></A>
2108 ($$) Expands to the process ID of the shell.  In a <CODE>()</CODE> subshell, it
2109 expands to the process ID of the invoking shell, not the subshell.
2110 <P>
2111
2112 <A NAME="IDX64"></A>
2113 <DT><CODE>!</CODE>
2114 <DD><A NAME="IDX65"></A>
2115 <A NAME="IDX66"></A>
2116 ($!) Expands to the process ID of the job most recently placed into the
2117 background, whether executed as an asynchronous command or using
2118 the <CODE>bg</CODE> builtin (see section <A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>).
2119 <P>
2120
2121 <A NAME="IDX67"></A>
2122 <DT><CODE>0</CODE>
2123 <DD><A NAME="IDX68"></A>
2124 <A NAME="IDX69"></A>
2125 ($0) Expands to the name of the shell or shell script.  This is set at
2126 shell initialization.  If Bash is invoked with a file of commands
2127 (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file.
2128 If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>),
2129 then <CODE>$0</CODE> is set to the first argument after the string to be
2130 executed, if one is present.  Otherwise, it is set
2131 to the filename used to invoke Bash, as given by argument zero.
2132 <P>
2133
2134 <A NAME="IDX70"></A>
2135 <DT><CODE>_</CODE>
2136 <DD><A NAME="IDX71"></A>
2137 <A NAME="IDX72"></A>
2138 ($_, an underscore.)
2139 At shell startup, set to the absolute pathname used to invoke the
2140 shell or shell script being executed as passed in the environment
2141 or argument list.
2142 Subsequently, expands to the last argument to the previous command,
2143 after expansion.   
2144 Also set to the full pathname used to invoke each command executed
2145 and placed in the environment exported to that command.
2146 When checking mail, this parameter holds the name of the mail file.
2147 </DL>
2148 <P>
2149
2150 <A NAME="Shell Expansions"></A>
2151 <HR SIZE="6">
2152 <A NAME="SEC29"></A>
2153 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2154 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt; </A>]</TD>
2155 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> &gt; </A>]</TD>
2156 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &lt;&lt; </A>]</TD>
2157 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
2158 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2159 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2160 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2161 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2162 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2163 </TR></TABLE>
2164 <H2> 3.5 Shell Expansions </H2>
2165 <!--docid::SEC29::-->
2166 <P>
2167
2168 Expansion is performed on the command line after it has been split into
2169 <CODE>token</CODE>s.  There are seven kinds of expansion performed:
2170 </P><P>
2171
2172 <UL>
2173 <LI>brace expansion
2174 <LI>tilde expansion
2175 <LI>parameter and variable expansion
2176 <LI>command substitution
2177 <LI>arithmetic expansion
2178 <LI>word splitting
2179 <LI>filename expansion
2180 </UL>
2181 <P>
2182
2183 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
2184 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR>
2185 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR>
2186 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR>
2187 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.4 Command Substitution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Using the output of a command as an argument.</TD></TR>
2188 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR>
2189 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC35">3.5.6 Process Substitution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a
2190                                 command.</TD></TR>
2191 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How the results of expansion are split into separate
2192                         arguments.</TD></TR>
2193 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A shorthand for specifying filenames matching patterns.</TD></TR>
2194 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC39">3.5.9 Quote Removal</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How and when quote characters are removed from
2195                         words.</TD></TR>
2196 </TABLE></BLOCKQUOTE>
2197 <P>
2198
2199 The order of expansions is:
2200 brace expansion;
2201 tilde expansion, parameter and variable expansion, arithmetic expansion,
2202 and command substitution (done in a left-to-right fashion);
2203 word splitting;
2204 and filename expansion.
2205 </P><P>
2206
2207 On systems that can support it, there is an additional expansion
2208 available: <VAR>process substitution</VAR>.
2209 This is performed at the
2210 same time as tilde, parameter, variable, and arithmetic expansion and
2211 command substitution.
2212 </P><P>
2213
2214 Only brace expansion, word splitting, and filename expansion
2215 can change the number of words of the expansion; other expansions
2216 expand a single word to a single word.
2217 The only exceptions to this are the expansions of
2218 <CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE>
2219 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
2220 </P><P>
2221
2222 After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC39">3.5.9 Quote Removal</A>)
2223 is performed.
2224 </P><P>
2225
2226 <A NAME="Brace Expansion"></A>
2227 <HR SIZE="6">
2228 <A NAME="SEC30"></A>
2229 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2230 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &lt; </A>]</TD>
2231 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &gt; </A>]</TD>
2232 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &lt;&lt; </A>]</TD>
2233 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2234 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2235 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2236 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2237 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2238 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2239 </TR></TABLE>
2240 <H3> 3.5.1 Brace Expansion </H3>
2241 <!--docid::SEC30::-->
2242 <P>
2243
2244 Brace expansion is a mechanism by which arbitrary strings may be generated.
2245 This mechanism is similar to
2246 <VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>),
2247 but the filenames generated need not exist.
2248 Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>,
2249 followed by either a series of comma-separated strings or a sequence expression
2250 between a pair of braces,
2251 followed by an optional <VAR>postscript</VAR>.
2252 The preamble is prefixed to each string contained within the braces, and
2253 the postscript is then appended to each resulting string, expanding left
2254 to right.
2255 </P><P>
2256
2257 Brace expansions may be nested.
2258 The results of each expanded string are not sorted; left to right order
2259 is preserved.
2260 For example,
2261 <TABLE><tr><td>&nbsp;</td><td class=example><pre>bash$ echo a{d,c,b}e
2262 ade ace abe
2263 </pre></td></tr></table></P><P>
2264
2265 A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>[..<VAR>incr</VAR>]}</CODE>,
2266 where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters,
2267 and <VAR>incr</VAR>, an optional increment, is an integer.
2268 When integers are supplied, the expression expands to each number between
2269 <VAR>x</VAR> and <VAR>y</VAR>, inclusive.
2270 Supplied integers may be prefixed with <SAMP>`0'</SAMP> to force each term to have the
2271 same width.
2272 When either <VAR>x</VAR> or <VAR>y</VAR> begins with a zero, the shell
2273 attempts to force all generated terms to contain the same number of digits,
2274 zero-padding where necessary.
2275 When characters are supplied, the expression expands to each character
2276 lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive,
2277 using the default C locale.
2278 Note that both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type.
2279 When the increment is supplied, it is used as the difference between
2280 each term.  The default increment is 1 or -1 as appropriate.
2281 </P><P>
2282
2283 Brace expansion is performed before any other expansions,
2284 and any characters special to other expansions are preserved
2285 in the result.  It is strictly textual.  Bash
2286 does not apply any syntactic interpretation to the context of the
2287 expansion or the text between the braces.
2288 To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2289 is not considered eligible for brace expansion.
2290 </P><P>
2291
2292 A correctly-formed brace expansion must contain unquoted opening
2293 and closing braces, and at least one unquoted comma or a valid
2294 sequence expression.
2295 Any incorrectly formed brace expansion is left unchanged.
2296 </P><P>
2297
2298 A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its
2299 being considered part of a brace expression.
2300 To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2301 is not considered eligible for brace expansion.
2302 </P><P>
2303
2304 This construct is typically used as shorthand when the common
2305 prefix of the strings to be generated is longer than in the
2306 above example:
2307 <TABLE><tr><td>&nbsp;</td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs}
2308 </pre></td></tr></table>or
2309 <TABLE><tr><td>&nbsp;</td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
2310 </pre></td></tr></table></P><P>
2311
2312 <A NAME="Tilde Expansion"></A>
2313 <HR SIZE="6">
2314 <A NAME="SEC31"></A>
2315 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2316 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> &lt; </A>]</TD>
2317 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &gt; </A>]</TD>
2318 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &lt;&lt; </A>]</TD>
2319 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2320 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2321 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2322 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2323 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2324 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2325 </TR></TABLE>
2326 <H3> 3.5.2 Tilde Expansion </H3>
2327 <!--docid::SEC31::-->
2328 <P>
2329
2330 If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the
2331 characters up to the first unquoted slash (or all characters,
2332 if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>.
2333 If none of the characters in the tilde-prefix are quoted, the
2334 characters in the tilde-prefix following the tilde are treated as a
2335 possible <VAR>login name</VAR>.
2336 If this login name is the null string, the tilde is replaced with the
2337 value of the <CODE>HOME</CODE> shell variable.
2338 If <CODE>HOME</CODE> is unset, the home directory of the user executing the
2339 shell is substituted instead.
2340 Otherwise, the tilde-prefix is replaced with the home directory
2341 associated with the specified login name.
2342 </P><P>
2343
2344 If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of
2345 the shell variable <CODE>PWD</CODE> replaces the tilde-prefix.
2346 If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable
2347 <CODE>OLDPWD</CODE>, if it is set, is substituted.
2348 </P><P>
2349
2350 If the characters following the tilde in the tilde-prefix consist of a
2351 number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>,
2352 the tilde-prefix is replaced with the
2353 corresponding element from the directory stack, as it would be displayed
2354 by the <CODE>dirs</CODE> builtin invoked with the characters following tilde
2355 in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC87">6.8 The Directory Stack</A>).
2356 If the tilde-prefix, sans the tilde, consists of a number without a
2357 leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed.
2358 </P><P>
2359
2360 If the login name is invalid, or the tilde expansion fails, the word is
2361 left unchanged.
2362 </P><P>
2363
2364 Each variable assignment is checked for unquoted tilde-prefixes immediately
2365 following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>.
2366 In these cases, tilde expansion is also performed.
2367 Consequently, one may use filenames with tildes in assignments to
2368 <CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>,
2369 and the shell assigns the expanded value.
2370 </P><P>
2371
2372 The following table shows how Bash treats unquoted tilde-prefixes:
2373 </P><P>
2374
2375 <DL COMPACT>
2376 <DT><CODE>~</CODE>
2377 <DD>The value of <CODE>$HOME</CODE>
2378 <DT><CODE>~/foo</CODE>
2379 <DD><TT>`$HOME/foo'</TT>
2380 <P>
2381
2382 <DT><CODE>~fred/foo</CODE>
2383 <DD>The subdirectory <CODE>foo</CODE> of the home directory of the user
2384 <CODE>fred</CODE>
2385 <P>
2386
2387 <DT><CODE>~+/foo</CODE>
2388 <DD><TT>`$PWD/foo'</TT>
2389 <P>
2390
2391 <DT><CODE>~-/foo</CODE>
2392 <DD><TT>`${OLDPWD-'~-'}/foo'</TT>
2393 <P>
2394
2395 <DT><CODE>~<VAR>N</VAR></CODE>
2396 <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2397 <P>
2398
2399 <DT><CODE>~+<VAR>N</VAR></CODE>
2400 <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2401 <P>
2402
2403 <DT><CODE>~-<VAR>N</VAR></CODE>
2404 <DD>The string that would be displayed by <SAMP>`dirs -<VAR>N</VAR>'</SAMP>
2405 </DL>
2406 <P>
2407
2408 <A NAME="Shell Parameter Expansion"></A>
2409 <HR SIZE="6">
2410 <A NAME="SEC32"></A>
2411 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2412 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &lt; </A>]</TD>
2413 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &gt; </A>]</TD>
2414 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &lt;&lt; </A>]</TD>
2415 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2416 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2417 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2418 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2419 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2420 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2421 </TR></TABLE>
2422 <H3> 3.5.3 Shell Parameter Expansion </H3>
2423 <!--docid::SEC32::-->
2424 <P>
2425
2426 The <SAMP>`$'</SAMP> character introduces parameter expansion,
2427 command substitution, or arithmetic expansion.  The parameter name
2428 or symbol to be expanded may be enclosed in braces, which
2429 are optional but serve to protect the variable to be expanded from
2430 characters immediately following it which could be
2431 interpreted as part of the name.
2432 </P><P>
2433
2434 When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP>
2435 not escaped by a backslash or within a quoted string, and not within an
2436 embedded arithmetic expansion, command substitution, or parameter
2437 expansion.
2438 </P><P>
2439
2440 The basic form of parameter expansion is ${<VAR>parameter</VAR>}.
2441 The value of <VAR>parameter</VAR> is substituted.
2442 The <VAR>parameter</VAR> is a shell parameter as described above
2443 (see section <A HREF="bashref.html#SEC26">3.4 Shell Parameters</A>) or an array reference (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
2444 The braces are required when <VAR>parameter</VAR>
2445 is a positional parameter with more than one digit,
2446 or when <VAR>parameter</VAR> is followed by a character that is not to be
2447 interpreted as part of its name.
2448 </P><P>
2449
2450 If the first character of <VAR>parameter</VAR> is an exclamation point (!),
2451 it introduces a level of variable indirection.
2452 Bash uses the value of the variable formed from the rest of
2453 <VAR>parameter</VAR> as the name of the variable; this variable is then
2454 expanded and that value is used in the rest of the substitution, rather
2455 than the value of <VAR>parameter</VAR> itself.
2456 This is known as <CODE>indirect expansion</CODE>.
2457 The exceptions to this are the expansions of ${!<VAR>prefix</VAR>*}
2458 and ${!<VAR>name</VAR>[@]}
2459 described below.
2460 The exclamation point must immediately follow the left brace in order to
2461 introduce indirection.
2462 </P><P>
2463
2464 In each of the cases below, <VAR>word</VAR> is subject to tilde expansion,
2465 parameter expansion, command substitution, and arithmetic expansion.
2466 </P><P>
2467
2468 When not performing substring expansion, using the form described
2469 below (e.g., <SAMP>`:-'</SAMP>), Bash tests for a parameter that is unset or null.
2470 Omitting the colon results in a test only for a parameter that is unset.
2471 Put another way, if the colon is included,
2472 the operator tests for both <VAR>parameter</VAR>'s existence and that its value
2473 is not null; if the colon is omitted, the operator tests only for existence.
2474 </P><P>
2475
2476 <DL COMPACT>
2477
2478 <DT><CODE>${<VAR>parameter</VAR>:-<VAR>word</VAR>}</CODE>
2479 <DD>If <VAR>parameter</VAR> is unset or null, the expansion of
2480 <VAR>word</VAR> is substituted.  Otherwise, the value of
2481 <VAR>parameter</VAR> is substituted.
2482 <P>
2483
2484 <DT><CODE>${<VAR>parameter</VAR>:=<VAR>word</VAR>}</CODE>
2485 <DD>If <VAR>parameter</VAR>
2486 is unset or null, the expansion of <VAR>word</VAR>
2487 is assigned to <VAR>parameter</VAR>.
2488 The value of <VAR>parameter</VAR> is then substituted. 
2489 Positional parameters and special parameters may not be assigned to
2490 in this way.
2491 <P>
2492
2493 <DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE>
2494 <DD>If <VAR>parameter</VAR>
2495 is null or unset, the expansion of <VAR>word</VAR> (or a message
2496 to that effect if <VAR>word</VAR>
2497 is not present) is written to the standard error and the shell, if it
2498 is not interactive, exits.  Otherwise, the value of <VAR>parameter</VAR> is
2499 substituted.
2500 <P>
2501
2502 <DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE>
2503 <DD>If <VAR>parameter</VAR>
2504 is null or unset, nothing is substituted, otherwise the expansion of
2505 <VAR>word</VAR> is substituted.
2506 <P>
2507
2508 <DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>}</CODE>
2509 <DD><DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>:<VAR>length</VAR>}</CODE>
2510 <DD>This is referred to as Substring Expansion.
2511 It expands to up to <VAR>length</VAR> characters of the value of <VAR>parameter</VAR>
2512 starting at the character specified by <VAR>offset</VAR>.
2513 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, an indexed array subscripted by
2514 <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, or an associative array name, the results differ as
2515 described below.
2516 If <VAR>length</VAR> is omitted, it expands to the substring of the value of
2517 <VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>
2518 and extending to the end of the value.
2519 <VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions
2520 (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
2521 <P>
2522
2523 If <VAR>offset</VAR> evaluates to a number less than zero, the value
2524 is used as an offset in characters
2525 from the end of the value of <VAR>parameter</VAR>.
2526 If <VAR>length</VAR> evaluates to a number less than zero,
2527 it is interpreted as an offset in characters
2528 from the end of the value of <VAR>parameter</VAR> rather than
2529 a number of characters, and the expansion is the characters between
2530 <VAR>offset</VAR> and that result.
2531 Note that a negative offset must be separated from the colon by at least
2532 one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion.
2533 </P><P>
2534
2535 Here are some examples illustrating substring expansion on parameters and
2536 subscripted arrays:
2537 </P><P>
2538
2539 @verbatim
2540 $ string=01234567890abcdefgh
2541 $ echo ${string:7}
2542 7890abcdefgh
2543 $ echo ${string:7:0}
2544 </P><P>
2545
2546 $ echo ${string:7:2}
2547 78
2548 $ echo ${string:7:-2}
2549 7890abcdef
2550 $ echo ${string: -7}
2551 bcdefgh
2552 $ echo ${string: -7:0}
2553 </P><P>
2554
2555 $ echo ${string: -7:2}
2556 bc
2557 $ echo ${string: -7:-2}
2558 bcdef
2559 $ set -- 01234567890abcdefgh
2560 $ echo ${1:7}
2561 7890abcdefgh
2562 $ echo ${1:7:0}
2563 </P><P>
2564
2565 $ echo ${1:7:2}
2566 78
2567 $ echo ${1:7:-2}
2568 7890abcdef
2569 $ echo ${1: -7}
2570 bcdefgh
2571 $ echo ${1: -7:0}
2572 </P><P>
2573
2574 $ echo ${1: -7:2}
2575 bc
2576 $ echo ${1: -7:-2}
2577 bcdef
2578 $ array[0]=01234567890abcdefgh
2579 $ echo ${array[0]:7}
2580 7890abcdefgh
2581 $ echo ${array[0]:7:0}
2582 </P><P>
2583
2584 $ echo ${array[0]:7:2}
2585 78
2586 $ echo ${array[0]:7:-2}
2587 7890abcdef
2588 $ echo ${array[0]: -7}
2589 bcdefgh
2590 $ echo ${array[0]: -7:0}
2591 </P><P>
2592
2593 $ echo ${array[0]: -7:2}
2594 bc
2595 $ echo ${array[0]: -7:-2}
2596 bcdef
2597 </P><P>
2598
2599 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional
2600 parameters beginning at <VAR>offset</VAR>.
2601 A negative <VAR>offset</VAR> is taken relative to one greater than the greatest
2602 positional parameter, so an offset of -1 evaluates to the last positional
2603 parameter.
2604 It is an expansion error if <VAR>length</VAR> evaluates to a number less than zero.
2605 </P><P>
2606
2607 The following examples illustrate substring expansion using positional
2608 parameters:
2609 </P><P>
2610
2611 @verbatim
2612 $ set -- 1 2 3 4 5 6 7 8 9 0 a b c d e f g h
2613 $ echo ${7}
2614 7 8 9 0 a b c d e f g h
2615 $ echo ${7:0}
2616 </P><P>
2617
2618 $ echo ${7:2}
2619 7 8
2620 $ echo ${7:-2}
2621 bash: -2: substring expression &#60; 0
2622 $ echo ${ -7:2}
2623 b c
2624 $ echo ${0}
2625 ./bash 1 2 3 4 5 6 7 8 9 0 a b c d e f g h
2626 $ echo ${0:2}
2627 ./bash 1
2628 $ echo ${ -7:0}
2629 </P><P>
2630
2631 If <VAR>parameter</VAR> is an indexed array name subscripted
2632 by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the result is the <VAR>length</VAR>
2633 members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>.
2634 A negative <VAR>offset</VAR> is taken relative to one greater than the maximum
2635 index of the specified array.
2636 It is an expansion error if <VAR>length</VAR> evaluates to a number less than zero.
2637 </P><P>
2638
2639 These examples show how you can use substring expansion with indexed
2640 arrays:
2641 </P><P>
2642
2643 @verbatim
2644 $ array=(0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h)
2645 $ echo ${array[@]:7}
2646 7 8 9 0 a b c d e f g h
2647 $ echo ${array[@]:7:2}
2648 7 8
2649 $ echo ${array[@]: -7:2}
2650 b c
2651 $ echo ${array[@]: -7:-2}
2652 bash: -2: substring expression &#60; 0
2653 $ echo ${array[@]:0}
2654 0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h
2655 $ echo ${array[@]:0:2}
2656 0 1
2657 $ echo ${array[@]: -7:0}
2658 </P><P>
2659
2660 Substring expansion applied to an associative array produces undefined
2661 results.
2662 </P><P>
2663
2664 Substring indexing is zero-based unless the positional parameters
2665 are used, in which case the indexing starts at 1 by default.
2666 If <VAR>offset</VAR> is 0, and the positional parameters are used, <CODE>$@</CODE> is
2667 prefixed to the list.
2668 </P><P>
2669
2670 <DT><CODE>${!<VAR>prefix</VAR>*}</CODE>
2671 <DD><DT><CODE>${!<VAR>prefix</VAR>@}</CODE>
2672 <DD>Expands to the names of variables whose names begin with <VAR>prefix</VAR>,
2673 separated by the first character of the <CODE>IFS</CODE> special variable.
2674 When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2675 variable name expands to a separate word.
2676 <P>
2677
2678 <DT><CODE>${!<VAR>name</VAR>[@]}</CODE>
2679 <DD><DT><CODE>${!<VAR>name</VAR>[*]}</CODE>
2680 <DD>If <VAR>name</VAR> is an array variable, expands to the list of array indices
2681 (keys) assigned in <VAR>name</VAR>.
2682 If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null
2683 otherwise.
2684 When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2685 key expands to a separate word.
2686 <P>
2687
2688 <DT><CODE>${#<VAR>parameter</VAR>}</CODE>
2689 <DD>The length in characters of the expanded value of <VAR>parameter</VAR> is
2690 substituted.
2691 If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted
2692 is the number of positional parameters.
2693 If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, 
2694 the value substituted is the number of elements in the array.
2695 If <VAR>parameter</VAR>
2696 is an indexed array name subscripted by a negative number, that number is
2697 interpreted as relative to one greater than the maximum index of
2698 <VAR>parameter</VAR>, so negative indices count back from the end of the
2699 array, and an index of -1 references the last element.
2700 <P>
2701
2702 <DT><CODE>${<VAR>parameter</VAR>#<VAR>word</VAR>}</CODE>
2703 <DD><DT><CODE>${<VAR>parameter</VAR>##<VAR>word</VAR>}</CODE>
2704 <DD>The <VAR>word</VAR>
2705 is expanded to produce a pattern just as in filename
2706 expansion (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>).  If the pattern matches
2707 the beginning of the expanded value of <VAR>parameter</VAR>,
2708 then the result of the expansion is the expanded value of <VAR>parameter</VAR>
2709 with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the
2710 longest matching pattern (the <SAMP>`##'</SAMP> case) deleted.
2711 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2712 the pattern removal operation is applied to each positional
2713 parameter in turn, and the expansion is the resultant list.
2714 If <VAR>parameter</VAR> is an array variable subscripted with
2715 <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2716 the pattern removal operation is applied to each member of the
2717 array in turn, and the expansion is the resultant list.
2718 <P>
2719
2720 <DT><CODE>${<VAR>parameter</VAR>%<VAR>word</VAR>}</CODE>
2721 <DD><DT><CODE>${<VAR>parameter</VAR>%%<VAR>word</VAR>}</CODE>
2722 <DD>The <VAR>word</VAR> is expanded to produce a pattern just as in
2723 filename expansion.
2724 If the pattern matches a trailing portion of the expanded value of
2725 <VAR>parameter</VAR>, then the result of the expansion is the value of
2726 <VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case)
2727 or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted.
2728 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2729 the pattern removal operation is applied to each positional
2730 parameter in turn, and the expansion is the resultant list.
2731 If <VAR>parameter</VAR>
2732 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2733 the pattern removal operation is applied to each member of the
2734 array in turn, and the expansion is the resultant list.
2735 <P>
2736
2737 <DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE>
2738 <DD><P>
2739
2740 The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2741 filename expansion.
2742 <VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR>
2743 against its value is replaced with <VAR>string</VAR>.
2744 If <VAR>pattern</VAR> begins with <SAMP>`/'</SAMP>, all matches of <VAR>pattern</VAR> are
2745 replaced with <VAR>string</VAR>.  Normally only the first match is replaced.
2746 If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning
2747 of the expanded value of <VAR>parameter</VAR>.
2748 If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end
2749 of the expanded value of <VAR>parameter</VAR>.
2750 If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted
2751 and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted.
2752 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2753 the substitution operation is applied to each positional
2754 parameter in turn, and the expansion is the resultant list.
2755 If <VAR>parameter</VAR>
2756 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2757 the substitution operation is applied to each member of the
2758 array in turn, and the expansion is the resultant list.
2759 </P><P>
2760
2761 <DT><CODE>${<VAR>parameter</VAR>^<VAR>pattern</VAR>}</CODE>
2762 <DD><DT><CODE>${<VAR>parameter</VAR>^^<VAR>pattern</VAR>}</CODE>
2763 <DD><DT><CODE>${<VAR>parameter</VAR>,<VAR>pattern</VAR>}</CODE>
2764 <DD><DT><CODE>${<VAR>parameter</VAR>,,<VAR>pattern</VAR>}</CODE>
2765 <DD>This expansion modifies the case of alphabetic characters in <VAR>parameter</VAR>.
2766 The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2767 filename expansion.
2768 Each character in the expanded value of <VAR>parameter</VAR> is tested against
2769 <VAR>pattern</VAR>, and, if it matches the pattern, its case is converted.
2770 The pattern should not attempt to match more than one character.
2771 The <SAMP>`^'</SAMP> operator converts lowercase letters matching <VAR>pattern</VAR>
2772 to uppercase; the <SAMP>`,'</SAMP> operator converts matching uppercase letters
2773 to lowercase.
2774 The <SAMP>`^^'</SAMP> and <SAMP>`,,'</SAMP> expansions convert each matched character in the
2775 expanded value; the <SAMP>`^'</SAMP> and <SAMP>`,'</SAMP> expansions match and convert only
2776 the first character in the expanded value.
2777 If <VAR>pattern</VAR> is omitted, it is treated like a <SAMP>`?'</SAMP>, which matches
2778 every character.
2779 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2780 the case modification operation is applied to each positional
2781 parameter in turn, and the expansion is the resultant list.
2782 If <VAR>parameter</VAR>
2783 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2784 the case modification operation is applied to each member of the
2785 array in turn, and the expansion is the resultant list.
2786 </DL>
2787 <P>
2788
2789 <A NAME="Command Substitution"></A>
2790 <HR SIZE="6">
2791 <A NAME="SEC33"></A>
2792 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2793 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &lt; </A>]</TD>
2794 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &gt; </A>]</TD>
2795 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &lt;&lt; </A>]</TD>
2796 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2797 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2798 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2799 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2800 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2801 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2802 </TR></TABLE>
2803 <H3> 3.5.4 Command Substitution </H3>
2804 <!--docid::SEC33::-->
2805 <P>
2806
2807 Command substitution allows the output of a command to replace
2808 the command itself.
2809 Command substitution occurs when a command is enclosed as follows:
2810 <TABLE><tr><td>&nbsp;</td><td class=example><pre>$(<VAR>command</VAR>)
2811 </pre></td></tr></table>or
2812 <TABLE><tr><td>&nbsp;</td><td class=example><pre>`<VAR>command</VAR>`
2813 </pre></td></tr></table></P><P>
2814
2815 Bash performs the expansion by executing <VAR>command</VAR> and
2816 replacing the command substitution with the standard output of the
2817 command, with any trailing newlines deleted.
2818 Embedded newlines are not deleted, but they may be removed during
2819 word splitting.
2820 The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be
2821 replaced by the equivalent but faster <CODE>$(&#60; <VAR>file</VAR>)</CODE>.
2822 </P><P>
2823
2824 When the old-style backquote form of substitution is used,
2825 backslash retains its literal meaning except when followed by
2826 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>. 
2827 The first backquote not preceded by a backslash terminates the
2828 command substitution.
2829 When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between
2830 the parentheses make up the command; none are treated specially.
2831 </P><P>
2832
2833 Command substitutions may be nested.  To nest when using the backquoted
2834 form, escape the inner backquotes with backslashes.
2835 </P><P>
2836
2837 If the substitution appears within double quotes, word splitting and
2838 filename expansion are not performed on the results.
2839 </P><P>
2840
2841 <A NAME="Arithmetic Expansion"></A>
2842 <HR SIZE="6">
2843 <A NAME="SEC34"></A>
2844 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2845 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &lt; </A>]</TD>
2846 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &gt; </A>]</TD>
2847 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &lt;&lt; </A>]</TD>
2848 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2849 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2850 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2851 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2852 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2853 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2854 </TR></TABLE>
2855 <H3> 3.5.5 Arithmetic Expansion </H3>
2856 <!--docid::SEC34::-->
2857 <P>
2858
2859 Arithmetic expansion allows the evaluation of an arithmetic expression
2860 and the substitution of the result.  The format for arithmetic expansion is:
2861 </P><P>
2862
2863 <TABLE><tr><td>&nbsp;</td><td class=example><pre>$(( <VAR>expression</VAR> ))
2864 </pre></td></tr></table></P><P>
2865
2866 The expression is treated as if it were within double quotes, but
2867 a double quote inside the parentheses is not treated specially.
2868 All tokens in the expression undergo parameter and variable expansion,
2869 command substitution, and quote removal.
2870 The result is treated as the arithmetic expression to be evaluated.
2871 Arithmetic expansions may be nested. 
2872 </P><P>
2873
2874 The evaluation is performed according to the rules listed below
2875 (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
2876 If the expression is invalid, Bash prints a message indicating
2877 failure to the standard error and no substitution occurs.
2878 </P><P>
2879
2880 <A NAME="Process Substitution"></A>
2881 <HR SIZE="6">
2882 <A NAME="SEC35"></A>
2883 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2884 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &lt; </A>]</TD>
2885 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &gt; </A>]</TD>
2886 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &lt;&lt; </A>]</TD>
2887 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2888 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2889 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2890 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2891 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2892 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2893 </TR></TABLE>
2894 <H3> 3.5.6 Process Substitution </H3>
2895 <!--docid::SEC35::-->
2896 <P>
2897
2898 Process substitution is supported on systems that support named
2899 pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files.
2900 It takes the form of 
2901 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;(<VAR>list</VAR>)
2902 </pre></td></tr></table>or
2903 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;(<VAR>list</VAR>)
2904 </pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a
2905 FIFO or some file in <TT>`/dev/fd'</TT>.  The name of this file is
2906 passed as an argument to the current command as the result of the
2907 expansion.  If the <CODE>&#62;(<VAR>list</VAR>)</CODE> form is used, writing to
2908 the file will provide input for <VAR>list</VAR>.  If the
2909 <CODE>&#60;(<VAR>list</VAR>)</CODE> form is used, the file passed as an
2910 argument should be read to obtain the output of <VAR>list</VAR>.
2911 Note that no space may appear between the <CODE>&#60;</CODE> or <CODE>&#62;</CODE>
2912 and the left parenthesis, otherwise the construct would be interpreted
2913 as a redirection.
2914 </P><P>
2915
2916 When available, process substitution is performed simultaneously with
2917 parameter and variable expansion, command substitution, and arithmetic
2918 expansion.
2919 </P><P>
2920
2921 <A NAME="Word Splitting"></A>
2922 <HR SIZE="6">
2923 <A NAME="SEC36"></A>
2924 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2925 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &lt; </A>]</TD>
2926 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> &gt; </A>]</TD>
2927 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> &lt;&lt; </A>]</TD>
2928 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2929 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
2930 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2931 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2932 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2933 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2934 </TR></TABLE>
2935 <H3> 3.5.7 Word Splitting </H3>
2936 <!--docid::SEC36::-->
2937 <P>
2938
2939 The shell scans the results of parameter expansion, command substitution,
2940 and arithmetic expansion that did not occur within double quotes for
2941 word splitting.
2942 </P><P>
2943
2944 The shell treats each character of <CODE>$IFS</CODE> as a delimiter, and splits
2945 the results of the other expansions into words using these characters
2946 as field terminators.
2947 If <CODE>IFS</CODE> is unset, or its value is exactly <CODE>&#60;space&#62;&#60;tab&#62;&#60;newline&#62;</CODE>,
2948 the default, then sequences of
2949 <CODE> &#60;space&#62;</CODE>, <CODE>&#60;tab&#62;</CODE>, and <CODE>&#60;newline&#62;</CODE>
2950 at the beginning and end of the results of the previous
2951 expansions are ignored, and any sequence of <CODE>IFS</CODE>
2952 characters not at the beginning or end serves to delimit words.
2953 If <CODE>IFS</CODE> has a value other than the default, then sequences of
2954 the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE>
2955 are ignored at the beginning and end of the
2956 word, as long as the whitespace character is in the
2957 value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character).
2958 Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE>
2959 whitespace, along with any adjacent <CODE>IFS</CODE>
2960 whitespace characters, delimits a field.  A sequence of <CODE>IFS</CODE>
2961 whitespace characters is also treated as a delimiter.
2962 If the value of <CODE>IFS</CODE> is null, no word splitting occurs.
2963 </P><P>
2964
2965 Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained.
2966 Unquoted implicit null arguments, resulting from the expansion of
2967 parameters that have no values, are removed.
2968 If a parameter with no value is expanded within double quotes, a
2969 null argument results and is retained.
2970 </P><P>
2971
2972 Note that if no expansion occurs, no splitting
2973 is performed.
2974 </P><P>
2975
2976 <A NAME="Filename Expansion"></A>
2977 <HR SIZE="6">
2978 <A NAME="SEC37"></A>
2979 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2980 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &lt; </A>]</TD>
2981 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &gt; </A>]</TD>
2982 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
2983 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
2984 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2985 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2986 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2987 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
2988 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2989 </TR></TABLE>
2990 <H3> 3.5.8 Filename Expansion </H3>
2991 <!--docid::SEC37::-->
2992 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
2993 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How the shell matches patterns.</TD></TR>
2994 </TABLE></BLOCKQUOTE>
2995 <A NAME="IDX73"></A>
2996 <A NAME="IDX74"></A>
2997 <A NAME="IDX75"></A>
2998 <A NAME="IDX76"></A>
2999 <P>
3000
3001 After word splitting, unless the <SAMP>`-f'</SAMP> option has been set
3002 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>), Bash scans each word for the characters
3003 <SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>.
3004 If one of these characters appears, then the word is
3005 regarded as a <VAR>pattern</VAR>,
3006 and replaced with an alphabetically sorted list of
3007 filenames matching the pattern (see section <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>).
3008 If no matching filenames are found,
3009 and the shell option <CODE>nullglob</CODE> is disabled, the word is left
3010 unchanged.
3011 If the <CODE>nullglob</CODE> option is set, and no matches are found, the word
3012 is removed.
3013 If the <CODE>failglob</CODE> shell option is set, and no matches are found,
3014 an error message is printed and the command is not executed.
3015 If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed
3016 without regard to the case of alphabetic characters.
3017 </P><P>
3018
3019 When a pattern is used for filename expansion, the character <SAMP>`.'</SAMP>
3020 at the start of a filename or immediately following a slash
3021 must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set.
3022 When matching a filename, the slash character must always be
3023 matched explicitly.
3024 In other cases, the <SAMP>`.'</SAMP> character is not treated specially.
3025 </P><P>
3026
3027 See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>,
3028 for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>,
3029 <CODE>failglob</CODE>, and <CODE>dotglob</CODE> options.
3030 </P><P>
3031
3032 The <CODE>GLOBIGNORE</CODE>
3033 shell variable may be used to restrict the set of filenames matching a
3034 pattern.  If <CODE>GLOBIGNORE</CODE>
3035 is set, each matching filename that also matches one of the patterns in
3036 <CODE>GLOBIGNORE</CODE> is removed from the list of matches.  The filenames
3037 <TT>`.'</TT> and <TT>`..'</TT>
3038 are always ignored when <CODE>GLOBIGNORE</CODE>
3039 is set and not null.
3040 However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of
3041 enabling the <CODE>dotglob</CODE>
3042 shell option, so all other filenames beginning with a
3043 <SAMP>`.'</SAMP> will match.
3044 To get the old behavior of ignoring filenames beginning with a
3045 <SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>.
3046 The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE>
3047 is unset.
3048 </P><P>
3049
3050 <A NAME="Pattern Matching"></A>
3051 <HR SIZE="6">
3052 <A NAME="SEC38"></A>
3053 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3054 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> &lt; </A>]</TD>
3055 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt; </A>]</TD>
3056 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
3057 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> Up </A>]</TD>
3058 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
3059 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3060 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3061 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3062 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3063 </TR></TABLE>
3064 <H4> 3.5.8.1 Pattern Matching </H4>
3065 <!--docid::SEC38::-->
3066 <P>
3067
3068 Any character that appears in a pattern, other than the special pattern
3069 characters described below, matches itself.
3070 The NUL character may not occur in a pattern.
3071 A backslash escapes the following character; the
3072 escaping backslash is discarded when matching.
3073 The special pattern characters must be quoted if they are to be matched
3074 literally.
3075 </P><P>
3076
3077 The special pattern characters have the following meanings:
3078 <DL COMPACT>
3079 <DT><CODE>*</CODE>
3080 <DD>Matches any string, including the null string.
3081 When the <CODE>globstar</CODE> shell option is enabled, and <SAMP>`*'</SAMP> is used in
3082 a filename expansion context, two adjacent <SAMP>`*'</SAMP>s used as a single
3083 pattern will match all files and zero or more directories and
3084 subdirectories.
3085 If followed by a <SAMP>`/'</SAMP>, two adjacent <SAMP>`*'</SAMP>s will match only
3086 directories and subdirectories.
3087 <DT><CODE>?</CODE>
3088 <DD>Matches any single character.
3089 <DT><CODE>[<small>...</small>]</CODE>
3090 <DD>Matches any one of the enclosed characters.  A pair of characters
3091 separated by a hyphen denotes a <VAR>range expression</VAR>;
3092 any character that falls between those two characters, inclusive,
3093 using the current locale's collating sequence and character set,
3094 is matched.  If the first character following the
3095 <SAMP>`['</SAMP> is a <SAMP>`!'</SAMP>  or a <SAMP>`^'</SAMP>
3096 then any character not enclosed is matched.  A <SAMP>`-'</SAMP>
3097 may be matched by including it as the first or last character
3098 in the set.  A <SAMP>`]'</SAMP> may be matched by including it as the first
3099 character in the set.
3100 The sorting order of characters in range expressions is determined by
3101 the current locale and the values of the
3102 <CODE>LC_COLLATE</CODE> and <CODE>LC_ALL</CODE> shell variables, if set.
3103 <P>
3104
3105 For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to
3106 <SAMP>`[abcdxyz]'</SAMP>.  Many locales sort characters in dictionary order, and in
3107 these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>;
3108 it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example.  To obtain
3109 the traditional interpretation of ranges in bracket expressions, you can
3110 force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or
3111 <CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>, or enable the
3112 <CODE>globasciiranges</CODE> shell option.
3113 </P><P>
3114
3115 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified
3116 using the syntax
3117 <CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the
3118 following classes defined in the POSIX standard:
3119 <TABLE><tr><td>&nbsp;</td><td class=example><pre>alnum   alpha   ascii   blank   cntrl   digit   graph   lower
3120 print   punct   space   upper   word    xdigit
3121 </pre></td></tr></table>A character class matches any character belonging to that class.
3122 The <CODE>word</CODE> character class matches letters, digits, and the character
3123 <SAMP>`_'</SAMP>.
3124 </P><P>
3125
3126 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be
3127 specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which
3128 matches all characters with the same collation weight (as defined
3129 by the current locale) as the character <VAR>c</VAR>.
3130 </P><P>
3131
3132 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE>
3133 matches the collating symbol <VAR>symbol</VAR>.
3134 </DL>
3135 <P>
3136
3137 If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE>
3138 builtin, several extended pattern matching operators are recognized.
3139 In the following description, a <VAR>pattern-list</VAR> is a list of one
3140 or more patterns separated by a <SAMP>`|'</SAMP>.
3141 Composite patterns may be formed using one or more of the following
3142 sub-patterns:
3143 </P><P>
3144
3145 <DL COMPACT>
3146 <DT><CODE>?(<VAR>pattern-list</VAR>)</CODE>
3147 <DD>Matches zero or one occurrence of the given patterns.
3148 <P>
3149
3150 <DT><CODE>*(<VAR>pattern-list</VAR>)</CODE>
3151 <DD>Matches zero or more occurrences of the given patterns.
3152 <P>
3153
3154 <DT><CODE>+(<VAR>pattern-list</VAR>)</CODE>
3155 <DD>Matches one or more occurrences of the given patterns.
3156 <P>
3157
3158 <DT><CODE>@(<VAR>pattern-list</VAR>)</CODE>
3159 <DD>Matches one of the given patterns.
3160 <P>
3161
3162 <DT><CODE>!(<VAR>pattern-list</VAR>)</CODE>
3163 <DD>Matches anything except one of the given patterns.
3164 </DL>
3165 <P>
3166
3167 <A NAME="Quote Removal"></A>
3168 <HR SIZE="6">
3169 <A NAME="SEC39"></A>
3170 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3171 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &lt; </A>]</TD>
3172 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt; </A>]</TD>
3173 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &lt;&lt; </A>]</TD>
3174 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> Up </A>]</TD>
3175 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt;&gt; </A>]</TD>
3176 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3177 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3178 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3179 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3180 </TR></TABLE>
3181 <H3> 3.5.9 Quote Removal </H3>
3182 <!--docid::SEC39::-->
3183 <P>
3184
3185 After the preceding expansions, all unquoted occurrences of the
3186 characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not
3187 result from one of the above expansions are removed.
3188 </P><P>
3189
3190 <A NAME="Redirections"></A>
3191 <HR SIZE="6">
3192 <A NAME="SEC40"></A>
3193 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3194 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt; </A>]</TD>
3195 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &gt; </A>]</TD>
3196 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &lt;&lt; </A>]</TD>
3197 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3198 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3199 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3200 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3201 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3202 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3203 </TR></TABLE>
3204 <H2> 3.6 Redirections </H2>
3205 <!--docid::SEC40::-->
3206 <P>
3207
3208 Before a command is executed, its input and output
3209 may be <VAR>redirected</VAR>
3210 using a special notation interpreted by the shell.
3211 Redirection allows commands' file handles to be
3212 duplicated, opened, closed,
3213 made to refer to different files,
3214 and can change the files the command reads from and writes to.
3215 Redirection may also be used to modify file handles in the
3216 current shell execution environment.  The following redirection
3217 operators may precede or appear anywhere within a
3218 simple command or may follow a command.
3219 Redirections are processed in the order they appear, from
3220 left to right.
3221 </P><P>
3222
3223 Each redirection that may be preceded by a file descriptor number
3224 may instead be preceded by a word of the form {<VAR>varname</VAR>}.
3225 In this case, for each redirection operator except
3226 &#62;&#38;- and &#60;&#38;-, the shell will allocate a file descriptor greater
3227 than 10 and assign it to {<VAR>varname</VAR>}.  If &#62;&#38;- or &#60;&#38;- is preceded
3228 by {<VAR>varname</VAR>}, the value of <VAR>varname</VAR> defines the file
3229 descriptor to close.
3230 </P><P>
3231
3232 In the following descriptions, if the file descriptor number is
3233 omitted, and the first character of the redirection operator is
3234 <SAMP>`&#60;'</SAMP>, the redirection refers to the standard input (file
3235 descriptor 0).  If the first character of the redirection operator
3236 is <SAMP>`&#62;'</SAMP>, the redirection refers to the standard output (file
3237 descriptor 1).
3238 </P><P>
3239
3240 The word following the redirection operator in the following
3241 descriptions, unless otherwise noted, is subjected to brace expansion,
3242 tilde expansion, parameter expansion, command substitution, arithmetic
3243 expansion, quote removal, filename expansion, and word splitting.
3244 If it expands to more than one word, Bash reports an error.
3245 </P><P>
3246
3247 Note that the order of redirections is significant.  For example,
3248 the command
3249 <TABLE><tr><td>&nbsp;</td><td class=example><pre>ls &#62; <VAR>dirlist</VAR> 2&#62;&#38;1
3250 </pre></td></tr></table>directs both standard output (file descriptor 1) and standard error
3251 (file descriptor 2) to the file <VAR>dirlist</VAR>, while the command
3252 <TABLE><tr><td>&nbsp;</td><td class=example><pre>ls 2&#62;&#38;1 &#62; <VAR>dirlist</VAR>
3253 </pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>,
3254 because the standard error was made a copy of the standard output
3255 before the standard output was redirected to <VAR>dirlist</VAR>.
3256 </P><P>
3257
3258 Bash handles several filenames specially when they are used in
3259 redirections, as described in the following table:
3260 </P><P>
3261
3262 <DL COMPACT>
3263 <DT><CODE>/dev/fd/<VAR>fd</VAR></CODE>
3264 <DD>If <VAR>fd</VAR> is a valid integer, file descriptor <VAR>fd</VAR> is duplicated.
3265 <P>
3266
3267 <DT><CODE>/dev/stdin</CODE>
3268 <DD>File descriptor 0 is duplicated.
3269 <P>
3270
3271 <DT><CODE>/dev/stdout</CODE>
3272 <DD>File descriptor 1 is duplicated.
3273 <P>
3274
3275 <DT><CODE>/dev/stderr</CODE>
3276 <DD>File descriptor 2 is duplicated.
3277 <P>
3278
3279 <DT><CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
3280 <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
3281 is an integer port number or service name, Bash attempts to open
3282 the corresponding TCP socket.
3283 <P>
3284
3285 <DT><CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
3286 <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
3287 is an integer port number or service name, Bash attempts to open 
3288 the corresponding UDP socket.
3289 </DL>
3290 <P>
3291
3292 A failure to open or create a file causes the redirection to fail.
3293 </P><P>
3294
3295 Redirections using file descriptors greater than 9 should be used with
3296 care, as they may conflict with file descriptors the shell uses
3297 internally.
3298 </P><P>
3299
3300 <HR SIZE="6">
3301 <A NAME="SEC41"></A>
3302 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3303 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &lt; </A>]</TD>
3304 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &gt; </A>]</TD>
3305 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &lt;&lt; </A>]</TD>
3306 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3307 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3308 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3309 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3311 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3312 </TR></TABLE>
3313 <H3> 3.6.1 Redirecting Input </H3>
3314 <!--docid::SEC41::-->
3315 Redirection of input causes the file whose name results from
3316 the expansion of <VAR>word</VAR>
3317 to be opened for reading on file descriptor <CODE>n</CODE>,
3318 or the standard input (file descriptor 0) if <CODE>n</CODE>
3319 is not specified.
3320 <P>
3321
3322 The general format for redirecting input is:
3323 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;<VAR>word</VAR>
3324 </pre></td></tr></table></P><P>
3325
3326 <HR SIZE="6">
3327 <A NAME="SEC42"></A>
3328 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3329 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &lt; </A>]</TD>
3330 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &gt; </A>]</TD>
3331 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &lt;&lt; </A>]</TD>
3332 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3333 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3334 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3335 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3336 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3337 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3338 </TR></TABLE>
3339 <H3> 3.6.2 Redirecting Output </H3>
3340 <!--docid::SEC42::-->
3341 Redirection of output causes the file whose name results from
3342 the expansion of <VAR>word</VAR>
3343 to be opened for writing on file descriptor <VAR>n</VAR>,
3344 or the standard output (file descriptor 1) if <VAR>n</VAR>
3345 is not specified.  If the file does not exist it is created;
3346 if it does exist it is truncated to zero size.
3347 <P>
3348
3349 The general format for redirecting output is:
3350 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;[|]<VAR>word</VAR>
3351 </pre></td></tr></table></P><P>
3352
3353 If the redirection operator is <SAMP>`&#62;'</SAMP>, and the <CODE>noclobber</CODE>
3354 option to the <CODE>set</CODE> builtin has been enabled, the redirection
3355 will fail if the file whose name results from the expansion of
3356 <VAR>word</VAR> exists and is a regular file.
3357 If the redirection operator is <SAMP>`&#62;|'</SAMP>, or the redirection operator is
3358 <SAMP>`&#62;'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection
3359 is attempted even if the file named by <VAR>word</VAR> exists.
3360 </P><P>
3361
3362 <HR SIZE="6">
3363 <A NAME="SEC43"></A>
3364 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3365 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &lt; </A>]</TD>
3366 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &gt; </A>]</TD>
3367 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &lt;&lt; </A>]</TD>
3368 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3369 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3370 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3371 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3372 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3373 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3374 </TR></TABLE>
3375 <H3> 3.6.3 Appending Redirected Output </H3>
3376 <!--docid::SEC43::-->
3377 Redirection of output in this fashion
3378 causes the file whose name results from
3379 the expansion of <VAR>word</VAR>
3380 to be opened for appending on file descriptor <VAR>n</VAR>,
3381 or the standard output (file descriptor 1) if <VAR>n</VAR>
3382 is not specified.  If the file does not exist it is created.
3383 <P>
3384
3385 The general format for appending output is:
3386 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#62;<VAR>word</VAR>
3387 </pre></td></tr></table></P><P>
3388
3389 <HR SIZE="6">
3390 <A NAME="SEC44"></A>
3391 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3392 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &lt; </A>]</TD>
3393 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &gt; </A>]</TD>
3394 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &lt;&lt; </A>]</TD>
3395 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3396 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3397 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3398 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3399 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3400 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3401 </TR></TABLE>
3402 <H3> 3.6.4 Redirecting Standard Output and Standard Error </H3>
3403 <!--docid::SEC44::-->
3404 This construct allows both the
3405 standard output (file descriptor 1) and
3406 the standard error output (file descriptor 2)
3407 to be redirected to the file whose name is the
3408 expansion of <VAR>word</VAR>.
3409 <P>
3410
3411 There are two formats for redirecting standard output and
3412 standard error:
3413 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#38;&#62;<VAR>word</VAR>
3414 </pre></td></tr></table>and
3415 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;&#38;<VAR>word</VAR>
3416 </pre></td></tr></table>Of the two forms, the first is preferred.
3417 This is semantically equivalent to
3418 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;<VAR>word</VAR> 2&#62;&#38;1
3419 </pre></td></tr></table>When using the second form, <VAR>word</VAR> may not expand to a number or
3420 <SAMP>`-'</SAMP>.  If it does, other redirection operators apply
3421 (see Duplicating File Descriptors below) for compatibility reasons.
3422 </P><P>
3423
3424 <HR SIZE="6">
3425 <A NAME="SEC45"></A>
3426 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3427 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &lt; </A>]</TD>
3428 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &gt; </A>]</TD>
3429 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &lt;&lt; </A>]</TD>
3430 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3431 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3432 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3433 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3434 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3435 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3436 </TR></TABLE>
3437 <H3> 3.6.5 Appending Standard Output and Standard Error </H3>
3438 <!--docid::SEC45::-->
3439 This construct allows both the
3440 standard output (file descriptor 1) and
3441 the standard error output (file descriptor 2)
3442 to be appended to the file whose name is the
3443 expansion of <VAR>word</VAR>.
3444 <P>
3445
3446 The format for appending standard output and standard error is:
3447 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#38;&#62;&#62;<VAR>word</VAR>
3448 </pre></td></tr></table>This is semantically equivalent to
3449 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;&#62;<VAR>word</VAR> 2&#62;&#38;1
3450 </pre></td></tr></table>(see Duplicating File Descriptors below).
3451 </P><P>
3452
3453 <HR SIZE="6">
3454 <A NAME="SEC46"></A>
3455 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3456 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &lt; </A>]</TD>
3457 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &gt; </A>]</TD>
3458 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &lt;&lt; </A>]</TD>
3459 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3460 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3461 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3462 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3463 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3464 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3465 </TR></TABLE>
3466 <H3> 3.6.6 Here Documents </H3>
3467 <!--docid::SEC46::-->
3468 This type of redirection instructs the shell to read input from the
3469 current source until a line containing only <VAR>word</VAR>
3470 (with no trailing blanks) is seen.  All of
3471 the lines read up to that point are then used as the standard
3472 input for a command.
3473 <P>
3474
3475 The format of here-documents is:
3476 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;&#60;[-]<VAR>word</VAR>
3477         <VAR>here-document</VAR>
3478 <VAR>delimiter</VAR>
3479 </pre></td></tr></table></P><P>
3480
3481 No parameter and variable expansion, command substitution,
3482 arithmetic expansion, or filename expansion is performed on
3483 <VAR>word</VAR>.  If any characters in <VAR>word</VAR> are quoted, the
3484 <VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>,
3485 and the lines in the here-document are not expanded.
3486 If <VAR>word</VAR> is unquoted,
3487 all lines of the here-document are subjected to
3488 parameter expansion, command substitution, and arithmetic expansion,
3489 the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP>
3490 must be used to quote the characters
3491 <SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>.
3492 </P><P>
3493
3494 If the redirection operator is <SAMP>`&#60;&#60;-'</SAMP>,
3495 then all leading tab characters are stripped from input lines and the
3496 line containing <VAR>delimiter</VAR>.
3497 This allows here-documents within shell scripts to be indented in a
3498 natural fashion.
3499 </P><P>
3500
3501 <HR SIZE="6">
3502 <A NAME="SEC47"></A>
3503 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3504 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &lt; </A>]</TD>
3505 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &gt; </A>]</TD>
3506 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &lt;&lt; </A>]</TD>
3507 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3508 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3509 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3510 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3511 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3512 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3513 </TR></TABLE>
3514 <H3> 3.6.7 Here Strings </H3>
3515 <!--docid::SEC47::-->
3516 A variant of here documents, the format is:
3517 <TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;&#60;&#60; <VAR>word</VAR>
3518 </pre></td></tr></table><P>
3519
3520 The <VAR>word</VAR> undergoes
3521 brace expansion, tilde expansion, parameter and variable expansion,
3522 command substitution, arithmetic expansion, and quote removal.
3523 Pathname expansion and word splitting are not performed.
3524 The result is supplied as a single string to the command on its
3525 standard input.
3526 </P><P>
3527
3528 <HR SIZE="6">
3529 <A NAME="SEC48"></A>
3530 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3531 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &lt; </A>]</TD>
3532 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> &gt; </A>]</TD>
3533 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> &lt;&lt; </A>]</TD>
3534 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3536 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3537 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3538 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3539 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3540 </TR></TABLE>
3541 <H3> 3.6.8 Duplicating File Descriptors </H3>
3542 <!--docid::SEC48::-->
3543 The redirection operator
3544 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#38;<VAR>word</VAR>
3545 </pre></td></tr></table>is used to duplicate input file descriptors.
3546 If <VAR>word</VAR>
3547 expands to one or more digits, the file descriptor denoted by <VAR>n</VAR>
3548 is made to be a copy of that file descriptor.
3549 If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3550 input, a redirection error occurs.
3551 If <VAR>word</VAR>
3552 evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed.
3553 If <VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used.
3554 <P>
3555
3556 The operator
3557 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#38;<VAR>word</VAR>
3558 </pre></td></tr></table>is used similarly to duplicate output file descriptors.  If
3559 <VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used.
3560 If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3561 output, a redirection error occurs.
3562 If <VAR>word</VAR>
3563 evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed.
3564 As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not
3565 expand to one or more digits or <SAMP>`-'</SAMP>, the standard output and standard
3566 error are redirected as described previously.
3567 </P><P>
3568
3569 <HR SIZE="6">
3570 <A NAME="SEC49"></A>
3571 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3572 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &lt; </A>]</TD>
3573 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt; </A>]</TD>
3574 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &lt;&lt; </A>]</TD>
3575 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3576 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3577 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3578 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3579 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3580 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3581 </TR></TABLE>
3582 <H3> 3.6.9 Moving File Descriptors </H3>
3583 <!--docid::SEC49::-->
3584 The redirection operator
3585 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#38;<VAR>digit</VAR>-
3586 </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3587 or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified.
3588 <VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>.
3589 <P>
3590
3591 Similarly, the redirection operator
3592 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#38;<VAR>digit</VAR>-
3593 </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3594 or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified.
3595 </P><P>
3596
3597 <HR SIZE="6">
3598 <A NAME="SEC50"></A>
3599 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3600 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> &lt; </A>]</TD>
3601 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt; </A>]</TD>
3602 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &lt;&lt; </A>]</TD>
3603 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> Up </A>]</TD>
3604 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt;&gt; </A>]</TD>
3605 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3606 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3607 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3608 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3609 </TR></TABLE>
3610 <H3> 3.6.10 Opening File Descriptors for Reading and Writing </H3>
3611 <!--docid::SEC50::-->
3612 The redirection operator
3613 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#62;<VAR>word</VAR>
3614 </pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR>
3615 to be opened for both reading and writing on file descriptor
3616 <VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR>
3617 is not specified.  If the file does not exist, it is created.
3618 <P>
3619
3620 <A NAME="Executing Commands"></A>
3621 <HR SIZE="6">
3622 <A NAME="SEC51"></A>
3623 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3624 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt; </A>]</TD>
3625 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> &gt; </A>]</TD>
3626 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </A>]</TD>
3627 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3628 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3629 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3630 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3631 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3632 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3633 </TR></TABLE>
3634 <H2> 3.7 Executing Commands </H2>
3635 <!--docid::SEC51::-->
3636 <P>
3637
3638 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
3639 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.1 Simple Command Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before
3640                                 executing them.</TD></TR>
3641 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.2 Command Search and Execution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash finds commands and runs them.</TD></TR>
3642 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash
3643                                         executes commands that are not
3644                                         shell builtins.</TD></TR>
3645 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.7.4 Environment</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR>
3646 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC56">3.7.5 Exit Status</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash
3647                         interprets it.</TD></TR>
3648 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC57">3.7.6 Signals</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs
3649                         receives a signal.</TD></TR>
3650 </TABLE></BLOCKQUOTE>
3651 <P>
3652
3653 <A NAME="Simple Command Expansion"></A>
3654 <HR SIZE="6">
3655 <A NAME="SEC52"></A>
3656 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3657 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &lt; </A>]</TD>
3658 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &gt; </A>]</TD>
3659 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </A>]</TD>
3660 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3661 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3662 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3663 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3664 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3665 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3666 </TR></TABLE>
3667 <H3> 3.7.1 Simple Command Expansion </H3>
3668 <!--docid::SEC52::-->
3669 <P>
3670
3671 When a simple command is executed, the shell performs the following
3672 expansions, assignments, and redirections, from left to right.
3673 </P><P>
3674
3675 <OL>
3676 <LI>
3677 The words that the parser has marked as variable assignments (those
3678 preceding the command name) and redirections are saved for later
3679 processing.
3680 <P>
3681
3682 <LI>
3683 The words that are not variable assignments or redirections are
3684 expanded (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
3685 If any words remain after expansion, the first word
3686 is taken to be the name of the command and the remaining words are
3687 the arguments.
3688 <P>
3689
3690 <LI>
3691 Redirections are performed as described above (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
3692 <P>
3693
3694 <LI>
3695 The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde
3696 expansion, parameter expansion, command substitution, arithmetic expansion,
3697 and quote removal before being assigned to the variable.
3698 </OL>
3699 <P>
3700
3701 If no command name results, the variable assignments affect the current
3702 shell environment.  Otherwise, the variables are added to the environment
3703 of the executed command and do not affect the current shell environment.
3704 If any of the assignments attempts to assign a value to a readonly variable,
3705 an error occurs, and the command exits with a non-zero status.
3706 </P><P>
3707
3708 If no command name results, redirections are performed, but do not
3709 affect the current shell environment.  A redirection error causes the
3710 command to exit with a non-zero status.
3711 </P><P>
3712
3713 If there is a command name left after expansion, execution proceeds as
3714 described below.  Otherwise, the command exits.  If one of the expansions
3715 contained a command substitution, the exit status of the command is
3716 the exit status of the last command substitution performed.  If there
3717 were no command substitutions, the command exits with a status of zero.
3718 </P><P>
3719
3720 <A NAME="Command Search and Execution"></A>
3721 <HR SIZE="6">
3722 <A NAME="SEC53"></A>
3723 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3724 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> &lt; </A>]</TD>
3725 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &gt; </A>]</TD>
3726 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &lt;&lt; </A>]</TD>
3727 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3728 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3729 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3730 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3731 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3732 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3733 </TR></TABLE>
3734 <H3> 3.7.2 Command Search and Execution </H3>
3735 <!--docid::SEC53::-->
3736 <P>
3737
3738 After a command has been split into words, if it results in a
3739 simple command and an optional list of arguments, the following
3740 actions are taken.
3741 </P><P>
3742
3743 <OL>
3744 <LI>
3745 If the command name contains no slashes, the shell attempts to
3746 locate it.  If there exists a shell function by that name, that
3747 function is invoked as described in <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>.
3748 <P>
3749
3750 <LI>
3751 If the name does not match a function, the shell searches for
3752 it in the list of shell builtins.  If a match is found, that
3753 builtin is invoked.
3754 <P>
3755
3756 <LI>
3757 If the name is neither a shell function nor a builtin,
3758 and contains no slashes, Bash searches each element of
3759 <CODE>$PATH</CODE> for a directory containing an executable file
3760 by that name.  Bash uses a hash table to remember the full
3761 pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches
3762 (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
3763 A full search of the directories in <CODE>$PATH</CODE>
3764 is performed only if the command is not found in the hash table.
3765 If the search is unsuccessful, the shell searches for a defined shell
3766 function named <CODE>command_not_found_handle</CODE>.
3767 If that function exists, it is invoked with the original command and
3768 the original command's arguments as its arguments, and the function's
3769 exit status becomes the exit status of the shell.
3770 If that function is not defined, the shell prints an error
3771 message and returns an exit status of 127.
3772 <P>
3773
3774 <LI>
3775 If the search is successful, or if the command name contains
3776 one or more slashes, the shell executes the named program in
3777 a separate execution environment.
3778 Argument 0 is set to the name given, and the remaining arguments
3779 to the command are set to the arguments supplied, if any.
3780 <P>
3781
3782 <LI>
3783 If this execution fails because the file is not in executable
3784 format, and the file is not a directory, it is assumed to be a
3785 <VAR>shell script</VAR> and the shell executes it as described in
3786 <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>.
3787 <P>
3788
3789 <LI>
3790 If the command was not begun asynchronously, the shell waits for
3791 the command to complete and collects its exit status.
3792 <P>
3793
3794 </OL>
3795 <P>
3796
3797 <A NAME="Command Execution Environment"></A>
3798 <HR SIZE="6">
3799 <A NAME="SEC54"></A>
3800 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3801 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &lt; </A>]</TD>
3802 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &gt; </A>]</TD>
3803 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &lt;&lt; </A>]</TD>
3804 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3805 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3806 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3807 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3808 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3809 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3810 </TR></TABLE>
3811 <H3> 3.7.3 Command Execution Environment </H3>
3812 <!--docid::SEC54::-->
3813 <P>
3814
3815 The shell has an <VAR>execution environment</VAR>, which consists of the
3816 following:
3817 </P><P>
3818
3819 <UL>
3820 <LI>
3821 open files inherited by the shell at invocation, as modified by
3822 redirections supplied to the <CODE>exec</CODE> builtin
3823 <P>
3824
3825 <LI>
3826 the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or
3827 <CODE>popd</CODE>, or inherited by the shell at invocation
3828 <P>
3829
3830 <LI>
3831 the file creation mode mask as set by <CODE>umask</CODE> or inherited from
3832 the shell's parent
3833 <P>
3834
3835 <LI>
3836 current traps set by <CODE>trap</CODE>
3837 <P>
3838
3839 <LI>
3840 shell parameters that are set by variable assignment or with <CODE>set</CODE>
3841 or inherited from the shell's parent in the environment
3842 <P>
3843
3844 <LI>
3845 shell functions defined during execution or inherited from the shell's
3846 parent in the environment
3847 <P>
3848
3849 <LI>
3850 options enabled at invocation (either by default or with command-line
3851 arguments) or by <CODE>set</CODE>
3852 <P>
3853
3854 <LI>
3855 options enabled by <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
3856 <P>
3857
3858 <LI>
3859 shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>)
3860 <P>
3861
3862 <LI>
3863 various process IDs, including those of background jobs
3864 (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of
3865 <CODE>$PPID</CODE>
3866 <P>
3867
3868 </UL>
3869 <P>
3870
3871 When a simple command other than a builtin or shell function
3872 is to be executed, it
3873 is invoked in a separate execution environment that consists of
3874 the following.  Unless otherwise noted, the values are inherited
3875 from the shell.
3876 </P><P>
3877
3878 <UL>
3879 <LI>
3880 the shell's open files, plus any modifications and additions specified
3881 by redirections to the command
3882 <P>
3883
3884 <LI>
3885 the current working directory
3886 <P>
3887
3888 <LI>
3889 the file creation mode mask
3890 <P>
3891
3892 <LI>
3893 shell variables and functions marked for export, along with variables
3894 exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC55">3.7.4 Environment</A>)
3895 <P>
3896
3897 <LI>
3898 traps caught by the shell are reset to the values inherited from the
3899 shell's parent, and traps ignored by the shell are ignored
3900 <P>
3901
3902 </UL>
3903 <P>
3904
3905 A command invoked in this separate environment cannot affect the
3906 shell's execution environment. 
3907 </P><P>
3908
3909 Command substitution, commands grouped with parentheses,
3910 and asynchronous commands are invoked in a
3911 subshell environment that is a duplicate of the shell environment,
3912 except that traps caught by the shell are reset to the values
3913 that the shell inherited from its parent at invocation.  Builtin
3914 commands that are invoked as part of a pipeline are also executed
3915 in a subshell environment.  Changes made to the subshell environment
3916 cannot affect the shell's execution environment.
3917 </P><P>
3918
3919 Subshells spawned to execute command substitutions inherit the value of
3920 the <SAMP>`-e'</SAMP> option from the parent shell.  When not in POSIX mode,
3921 Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
3922 </P><P>
3923
3924 If a command is followed by a <SAMP>`&#38;'</SAMP> and job control is not active, the
3925 default standard input for the command is the empty file <TT>`/dev/null'</TT>.
3926 Otherwise, the invoked command inherits the file descriptors of the calling
3927 shell as modified by redirections.
3928 </P><P>
3929
3930 <A NAME="Environment"></A>
3931 <HR SIZE="6">
3932 <A NAME="SEC55"></A>
3933 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3934 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &lt; </A>]</TD>
3935 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &gt; </A>]</TD>
3936 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &lt;&lt; </A>]</TD>
3937 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3938 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3939 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3940 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3941 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3942 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3943 </TR></TABLE>
3944 <H3> 3.7.4 Environment </H3>
3945 <!--docid::SEC55::-->
3946 <P>
3947
3948 When a program is invoked it is given an array of strings
3949 called the <VAR>environment</VAR>.
3950 This is a list of name-value pairs, of the form <CODE>name=value</CODE>.
3951 </P><P>
3952
3953 Bash provides several ways to manipulate the environment.
3954 On invocation, the shell scans its own environment and
3955 creates a parameter for each name found, automatically marking
3956 it for <VAR>export</VAR>
3957 to child processes.  Executed commands inherit the environment.
3958 The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP>
3959 commands allow parameters and functions to be added to and
3960 deleted from the environment.  If the value of a parameter
3961 in the environment is modified, the new value becomes part
3962 of the environment, replacing the old.  The environment
3963 inherited by any executed command consists of the shell's
3964 initial environment, whose values may be modified in the shell,
3965 less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP>
3966 commands, plus any additions via the <CODE>export</CODE> and
3967 <SAMP>`declare -x'</SAMP> commands.
3968 </P><P>
3969
3970 The environment for any simple command
3971 or function may be augmented temporarily by prefixing it with
3972 parameter assignments, as described in <A HREF="bashref.html#SEC26">3.4 Shell Parameters</A>.
3973 These assignment statements affect only the environment seen
3974 by that command.
3975 </P><P>
3976
3977 If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>), then all
3978 parameter assignments are placed in the environment for a command,
3979 not just those that precede the command name.
3980 </P><P>
3981
3982 When Bash invokes an external command, the variable <SAMP>`$_'</SAMP>
3983 is set to the full pathname of the command and passed to that
3984 command in its environment.
3985 </P><P>
3986
3987 <A NAME="Exit Status"></A>
3988 <HR SIZE="6">
3989 <A NAME="SEC56"></A>
3990 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3991 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &lt; </A>]</TD>
3992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt; </A>]</TD>
3993 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt;&lt; </A>]</TD>
3994 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
3995 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3996 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3997 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3998 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
3999 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4000 </TR></TABLE>
4001 <H3> 3.7.5 Exit Status </H3>
4002 <!--docid::SEC56::-->
4003 <P>
4004
4005 The exit status of an executed command is the value returned by the
4006 <VAR>waitpid</VAR> system call or equivalent function.  Exit statuses    
4007 fall between 0 and 255, though, as explained below, the shell may
4008 use values above 125 specially.  Exit statuses from shell builtins and
4009 compound commands are also limited to this range.  Under certain
4010 circumstances, the shell will use special values to indicate specific
4011 failure modes.
4012 </P><P>
4013
4014 For the shell's purposes, a command which exits with a
4015 zero exit status has succeeded.
4016 A non-zero exit status indicates failure.
4017 This seemingly counter-intuitive scheme is used so there
4018 is one well-defined way to indicate success and a variety of
4019 ways to indicate various failure modes.
4020 When a command terminates on a fatal signal whose number is <VAR>N</VAR>,
4021 Bash uses the value 128+<VAR>N</VAR> as the exit status.
4022 </P><P>
4023
4024 If a command is not found, the child process created to
4025 execute it returns a status of 127.  If a command is found  
4026 but is not executable, the return status is 126.
4027 </P><P>
4028
4029 If a command fails because of an error during expansion or redirection,
4030 the exit status is greater than zero.
4031 </P><P>
4032
4033 The exit status is used by the Bash conditional commands
4034 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list
4035 constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>).
4036 </P><P>
4037
4038 All of the Bash builtins return an exit status of zero if they succeed
4039 and a non-zero status on failure, so they may be used by the
4040 conditional and list constructs.
4041 All builtins return an exit status of 2 to indicate incorrect usage.
4042 </P><P>
4043
4044 <A NAME="Signals"></A>
4045 <HR SIZE="6">
4046 <A NAME="SEC57"></A>
4047 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4048 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &lt; </A>]</TD>
4049 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt; </A>]</TD>
4050 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </A>]</TD>
4051 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> Up </A>]</TD>
4052 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
4053 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4054 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4055 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
4056 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4057 </TR></TABLE>
4058 <H3> 3.7.6 Signals </H3>
4059 <!--docid::SEC57::-->
4060 <P>
4061
4062 When Bash is interactive, in the absence of any traps, it ignores
4063 <CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell),
4064 and <CODE>SIGINT</CODE>
4065 is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible).
4066 When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops.
4067 In all cases, Bash ignores <CODE>SIGQUIT</CODE>.
4068 If job control is in effect (see section <A HREF="bashref.html#SEC92">7. Job Control</A>), Bash
4069 ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
4070 </P><P>
4071
4072 Non-builtin commands started by Bash have signal handlers set to the
4073 values inherited by the shell from its parent.
4074 When job control is not in effect, asynchronous commands
4075 ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited
4076 handlers.
4077 Commands run as a result of
4078 command substitution ignore the keyboard-generated job control signals
4079 <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
4080 </P><P>
4081
4082 The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>.
4083 Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to
4084 all jobs, running or stopped.
4085 Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive
4086 the <CODE>SIGHUP</CODE>.
4087 To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a
4088 particular job, it should be removed
4089 from the jobs table with the <CODE>disown</CODE>
4090 builtin (see section <A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>) or marked
4091 to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>.
4092 </P><P>
4093
4094 If the  <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE>
4095 (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when
4096 an interactive login shell exits.
4097 </P><P>
4098
4099 If Bash is waiting for a command to complete and receives a signal
4100 for which a trap has been set, the trap will not be executed until
4101 the command completes. 
4102 When Bash is waiting for an asynchronous
4103 command via the <CODE>wait</CODE> builtin, the reception of a signal for
4104 which a trap has been set will cause the <CODE>wait</CODE> builtin to return
4105 immediately with an exit status greater than 128, immediately after
4106 which the trap is executed.
4107 </P><P>
4108
4109 <A NAME="Shell Scripts"></A>
4110 <HR SIZE="6">
4111 <A NAME="SEC58"></A>
4112 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4113 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt; </A>]</TD>
4114 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &gt; </A>]</TD>
4115 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
4116 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
4117 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &gt;&gt; </A>]</TD>
4118 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4119 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4120 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
4121 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4122 </TR></TABLE>
4123 <H2> 3.8 Shell Scripts </H2>
4124 <!--docid::SEC58::-->
4125 <P>
4126
4127 A shell script is a text file containing shell commands.  When such
4128 a file is used as the first non-option argument when invoking Bash,
4129 and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied
4130 (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>), 
4131 Bash reads and executes commands from the file, then exits.  This
4132 mode of operation creates a non-interactive shell.  The shell first
4133 searches for the file in the current directory, and looks in the
4134 directories in <CODE>$PATH</CODE> if not found there.
4135 </P><P>
4136
4137 When Bash runs
4138 a shell script, it sets the special parameter <CODE>0</CODE> to the name
4139 of the file, rather than the name of the shell, and the positional
4140 parameters are set to the remaining arguments, if any are given.
4141 If no additional arguments are supplied, the positional parameters
4142 are unset.
4143 </P><P>
4144
4145 A shell script may be made executable by using the <CODE>chmod</CODE> command
4146 to turn on the execute bit.  When Bash finds such a file while
4147 searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to
4148 execute it.  In other words, executing
4149 <TABLE><tr><td>&nbsp;</td><td class=example><pre>filename <VAR>arguments</VAR>
4150 </pre></td></tr></table>is equivalent to executing
4151 <TABLE><tr><td>&nbsp;</td><td class=example><pre>bash filename <VAR>arguments</VAR>
4152 </pre></td></tr></table></P><P>
4153
4154 if <CODE>filename</CODE> is an executable shell script.
4155 This subshell reinitializes itself, so that the effect is as if a
4156 new shell had been invoked to interpret the script, with the
4157 exception that the locations of commands remembered by the parent
4158 (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
4159 are retained by the child.
4160 </P><P>
4161
4162 Most versions of Unix make this a part of the operating system's command
4163 execution mechanism.  If the first line of a script begins with
4164 the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies
4165 an interpreter for the program.
4166 Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other
4167 interpreter and write the rest of the script file in that language.
4168 </P><P>
4169
4170 The arguments to the interpreter
4171 consist of a single optional argument following the interpreter
4172 name on the first line of the script file, followed by the name of
4173 the script file, followed by the rest of the arguments.  Bash
4174 will perform this action on operating systems that do not handle it
4175 themselves.  Note that some older versions of Unix limit the interpreter
4176 name and argument to a maximum of 32 characters.
4177 </P><P>
4178
4179 Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that
4180 Bash has been installed in <TT>`/bin'</TT>), since this ensures that
4181 Bash will be used to interpret the script, even if it is executed
4182 under another shell.
4183 </P><P>
4184
4185 <A NAME="Shell Builtin Commands"></A>
4186 <HR SIZE="6">
4187 <A NAME="SEC59"></A>
4188 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4189 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt; </A>]</TD>
4190 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> &gt; </A>]</TD>
4191 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &lt;&lt; </A>]</TD>
4192 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
4193 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &gt;&gt; </A>]</TD>
4194 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4195 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4196 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
4197 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4198 </TR></TABLE>
4199 <H1> 4. Shell Builtin Commands </H1>
4200 <!--docid::SEC59::-->
4201 <P>
4202
4203 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
4204 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands inherited from the Bourne
4205                                 Shell.</TD></TR>
4206 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Table of builtins specific to Bash.</TD></TR>
4207 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC62">4.3 Modifying Shell Behavior</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtins to modify shell attributes and
4208                                 optional behavior.</TD></TR>
4209 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC65">4.4 Special Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands classified specially by
4210                                 POSIX.</TD></TR>
4211 </TABLE></BLOCKQUOTE>
4212 <P>
4213
4214 Builtin commands are contained within the shell itself.
4215 When the name of a builtin command is used as the first word of
4216 a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes
4217 the command directly, without invoking another program.
4218 Builtin commands are necessary to implement functionality impossible
4219 or inconvenient to obtain with separate utilities.
4220 </P><P>
4221
4222 This section briefly describes the builtins which Bash inherits from
4223 the Bourne Shell, as well as the builtin commands which are unique
4224 to or have been extended in Bash.
4225 </P><P>
4226
4227 Several builtin commands are described in other chapters:  builtin
4228 commands which provide the Bash interface to the job control
4229 facilities (see section <A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>), the directory stack
4230 (see section <A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A>), the command history
4231 (see section <A HREF="bashref.html#SEC123">9.2 Bash History Builtins</A>), and the programmable completion
4232 facilities (see section <A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>).
4233 </P><P>
4234
4235 Many of the builtins have been extended by POSIX or Bash.
4236 </P><P>
4237
4238 Unless otherwise noted, each builtin command documented as accepting
4239 options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP>
4240 to signify the end of the options.
4241 The <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE>
4242 builtins do not accept options and do not treat <SAMP>`--'</SAMP> specially.
4243 The <CODE>exit</CODE>, <CODE>logout</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, <CODE>let</CODE>,
4244 and <CODE>shift</CODE> builtins accept and process arguments beginning
4245 with <SAMP>`-'</SAMP> without requiring <SAMP>`--'</SAMP>.
4246 Other builtins that accept arguments but are not specified as accepting
4247 options interpret arguments beginning with <SAMP>`-'</SAMP> as invalid options and
4248 require <SAMP>`--'</SAMP> to prevent this interpretation.
4249 </P><P>
4250
4251 <A NAME="Bourne Shell Builtins"></A>
4252 <HR SIZE="6">
4253 <A NAME="SEC60"></A>
4254 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4255 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &lt; </A>]</TD>
4256 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &gt; </A>]</TD>
4257 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &lt;&lt; </A>]</TD>
4258 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
4259 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &gt;&gt; </A>]</TD>
4260 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4261 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4262 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
4263 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4264 </TR></TABLE>
4265 <H2> 4.1 Bourne Shell Builtins </H2>
4266 <!--docid::SEC60::-->
4267 <P>
4268
4269 The following shell builtin commands are inherited from the Bourne Shell.
4270 These commands are implemented as specified by the POSIX standard.
4271 </P><P>
4272
4273 <DL COMPACT>
4274 <DT><CODE>:    (a colon)</CODE>
4275 <DD><A NAME="IDX77"></A>
4276 <TABLE><tr><td>&nbsp;</td><td class=example><pre>: [<VAR>arguments</VAR>]
4277 </pre></td></tr></table><P>
4278
4279 Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections.
4280 The return status is zero.
4281 </P><P>
4282
4283 <DT><CODE>.    (a period)</CODE>
4284 <DD><A NAME="IDX78"></A>
4285 <TABLE><tr><td>&nbsp;</td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>]
4286 </pre></td></tr></table><P>
4287
4288 Read and execute commands from the <VAR>filename</VAR> argument in the
4289 current shell context.  If <VAR>filename</VAR> does not contain a slash,
4290 the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>.
4291 When Bash is not in POSIX mode, the current directory is searched
4292 if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>.
4293 If any <VAR>arguments</VAR> are supplied, they become the positional
4294 parameters when <VAR>filename</VAR> is executed.  Otherwise the positional
4295 parameters are unchanged.
4296 The return status is the exit status of the last command executed, or
4297 zero if no commands are executed.  If <VAR>filename</VAR> is not found, or
4298 cannot be read, the return status is non-zero.
4299 This builtin is equivalent to <CODE>source</CODE>.
4300 </P><P>
4301
4302 <DT><CODE>break</CODE>
4303 <DD><A NAME="IDX79"></A>
4304 <TABLE><tr><td>&nbsp;</td><td class=example><pre>break [<VAR>n</VAR>]
4305 </pre></td></tr></table><P>
4306
4307 Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop.
4308 If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited.
4309 <VAR>n</VAR> must be greater than or equal to 1.
4310 The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
4311 </P><P>
4312
4313 <DT><CODE>cd</CODE>
4314 <DD><A NAME="IDX80"></A>
4315 <TABLE><tr><td>&nbsp;</td><td class=example><pre>cd [-L|[-P [-e]] [-@] [<VAR>directory</VAR>]
4316 </pre></td></tr></table><P>
4317
4318 Change the current working directory to <VAR>directory</VAR>.
4319 If <VAR>directory</VAR> is not supplied, the value of the <CODE>HOME</CODE>
4320 shell variable is used.
4321 Any additional arguments following <VAR>directory</VAR> are ignored.
4322 If the shell variable
4323 <CODE>CDPATH</CODE> exists, it is used as a search path:
4324 each directory name in <CODE>CDPATH</CODE> is searched for
4325 <VAR>directory</VAR>, with alternative directory names in <CODE>CDPATH</CODE>
4326 separated by a colon (<SAMP>`:'</SAMP>).
4327 If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used.
4328 </P><P>
4329
4330 The <SAMP>`-P'</SAMP> option means to not follow symbolic links: symbolic links
4331 are resolved while <CODE>cd</CODE> is traversing <VAR>directory</VAR> and before
4332 processing an instance of <SAMP>`..'</SAMP> in <VAR>directory</VAR>.
4333 </P><P>
4334
4335 By default, or when the <SAMP>`-L'</SAMP> option is supplied, symbolic links
4336 in <VAR>directory</VAR> are resolved after <CODE>cd</CODE> processes an instance
4337 of <SAMP>`..'</SAMP> in <VAR>directory</VAR>.
4338 </P><P>
4339
4340 If <SAMP>`..'</SAMP> appears in <VAR>directory</VAR>, it is processed by removing the
4341 immediately preceding pathname component, back to a slash or the beginning
4342 of <VAR>directory</VAR>.
4343 </P><P>
4344
4345 If the <SAMP>`-e'</SAMP> option is supplied with <SAMP>`-P'</SAMP>
4346 and the current working directory cannot be successfully determined
4347 after a successful directory change, <CODE>cd</CODE> will return an unsuccessful
4348 status.
4349 </P><P>
4350
4351 On systems that support it, the <SAMP>`-@'</SAMP> option presents the extended
4352 attributes associated with a file as a directory.              
4353 </P><P>
4354
4355 If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is converted to <CODE>$OLDPWD</CODE>
4356 before the directory change is attempted.
4357 </P><P>
4358
4359 If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if
4360 <SAMP>`-'</SAMP> is the first argument, and the directory change is
4361 successful, the absolute pathname of the new working directory is
4362 written to the standard output.
4363 </P><P>
4364
4365 The return status is zero if the directory is successfully changed,
4366 non-zero otherwise.
4367 </P><P>
4368
4369 <DT><CODE>continue</CODE>
4370 <DD><A NAME="IDX81"></A>
4371 <TABLE><tr><td>&nbsp;</td><td class=example><pre>continue [<VAR>n</VAR>]
4372 </pre></td></tr></table><P>
4373
4374 Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>,
4375 <CODE>until</CODE>, or <CODE>select</CODE> loop.
4376 If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop
4377 is resumed.
4378 <VAR>n</VAR> must be greater than or equal to 1.
4379 The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
4380 </P><P>
4381
4382 <DT><CODE>eval</CODE>
4383 <DD><A NAME="IDX82"></A>
4384 <TABLE><tr><td>&nbsp;</td><td class=example><pre>eval [<VAR>arguments</VAR>]
4385 </pre></td></tr></table><P>
4386
4387 The arguments are concatenated together into a single command, which is
4388 then read and executed, and its exit status returned as the exit status
4389 of <CODE>eval</CODE>.
4390 If there are no arguments or only empty arguments, the return status is
4391 zero.
4392 </P><P>
4393
4394 <DT><CODE>exec</CODE>
4395 <DD><A NAME="IDX83"></A>
4396 <TABLE><tr><td>&nbsp;</td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]]
4397 </pre></td></tr></table><P>
4398
4399 If <VAR>command</VAR>
4400 is supplied, it replaces the shell without creating a new process.
4401 If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the
4402 beginning of the zeroth argument passed to <VAR>command</VAR>.
4403 This is what the <CODE>login</CODE> program does.
4404 The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty
4405 environment.
4406 If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth
4407 argument to <VAR>command</VAR>.
4408 If <VAR>command</VAR>
4409 cannot be executed for some reason, a non-interactive shell exits,
4410 unless the <CODE>execfail</CODE> shell option
4411 is enabled.  In that case, it returns failure.
4412 An interactive shell returns failure if the file cannot be executed.
4413 If no <VAR>command</VAR> is specified, redirections may be used to affect
4414 the current shell environment.  If there are no redirection errors, the
4415 return status is zero; otherwise the return status is non-zero.
4416 </P><P>
4417
4418 <DT><CODE>exit</CODE>
4419 <DD><A NAME="IDX84"></A>
4420 <TABLE><tr><td>&nbsp;</td><td class=example><pre>exit [<VAR>n</VAR>]
4421 </pre></td></tr></table><P>
4422
4423 Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent.
4424 If <VAR>n</VAR> is omitted, the exit status is that of the last command executed.
4425 Any trap on <CODE>EXIT</CODE> is executed before the shell terminates.
4426 </P><P>
4427
4428 <DT><CODE>export</CODE>
4429 <DD><A NAME="IDX85"></A>
4430 <TABLE><tr><td>&nbsp;</td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]]
4431 </pre></td></tr></table><P>
4432
4433 Mark each <VAR>name</VAR> to be passed to child processes
4434 in the environment.  If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s
4435 refer to shell functions; otherwise the names refer to shell variables.
4436 The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export.
4437 If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a
4438 list of names of all exported variables is displayed.
4439 The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input.
4440 If a variable name is followed by =<VAR>value</VAR>, the value of
4441 the variable is set to <VAR>value</VAR>.
4442 </P><P>
4443
4444 The return status is zero unless an invalid option is supplied, one of
4445 the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied
4446 with a name that is not a shell function.
4447 </P><P>
4448
4449 <DT><CODE>getopts</CODE>
4450 <DD><A NAME="IDX86"></A>
4451 <TABLE><tr><td>&nbsp;</td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>]
4452 </pre></td></tr></table><P>
4453
4454 <CODE>getopts</CODE> is used by shell scripts to parse positional parameters.
4455 <VAR>optstring</VAR> contains the option characters to be recognized; if a
4456 character is followed by a colon, the option is expected to have an
4457 argument, which should be separated from it by whitespace.
4458 The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be
4459 used as option characters.
4460 Each time it is invoked, <CODE>getopts</CODE>
4461 places the next option in the shell variable <VAR>name</VAR>, initializing
4462 <VAR>name</VAR> if it does not exist,
4463 and the index of the next argument to be processed into the
4464 variable <CODE>OPTIND</CODE>.
4465 <CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script
4466 is invoked.
4467 When an option requires an argument,
4468 <CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>.
4469 The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually
4470 reset between multiple calls to <CODE>getopts</CODE> within the same shell
4471 invocation if a new set of parameters is to be used.
4472 </P><P>
4473
4474 When the end of options is encountered, <CODE>getopts</CODE> exits with a
4475 return value greater than zero.
4476 <CODE>OPTIND</CODE> is set to the index of the first non-option argument,
4477 and <VAR>name</VAR> is set to <SAMP>`?'</SAMP>.
4478 </P><P>
4479
4480 <CODE>getopts</CODE>
4481 normally parses the positional parameters, but if more arguments are
4482 given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead.
4483 </P><P>
4484
4485 <CODE>getopts</CODE> can report errors in two ways.  If the first character of
4486 <VAR>optstring</VAR> is a colon, <VAR>silent</VAR>
4487 error reporting is used.  In normal operation, diagnostic messages
4488 are printed when invalid options or missing option arguments are
4489 encountered.
4490 If the variable <CODE>OPTERR</CODE>
4491 is set to 0, no error messages will be displayed, even if the first
4492 character of <CODE>optstring</CODE> is not a colon.
4493 </P><P>
4494
4495 If an invalid option is seen,
4496 <CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent,
4497 prints an error message and unsets <CODE>OPTARG</CODE>.
4498 If <CODE>getopts</CODE> is silent, the option character found is placed in
4499 <CODE>OPTARG</CODE> and no diagnostic message is printed.
4500 </P><P>
4501
4502 If a required argument is not found, and <CODE>getopts</CODE>
4503 is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>,
4504 <CODE>OPTARG</CODE> is unset, and a diagnostic message is printed.
4505 If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in
4506 <VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found.
4507 </P><P>
4508
4509 <DT><CODE>hash</CODE>
4510 <DD><A NAME="IDX87"></A>
4511 <TABLE><tr><td>&nbsp;</td><td class=example><pre>hash [-r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>]
4512 </pre></td></tr></table><P>
4513
4514 Each time <CODE>hash</CODE> is invoked, it remembers the full pathnames of the
4515 commands specified as <VAR>name</VAR> arguments,
4516 so they need not be searched for on subsequent invocations.
4517 The commands are found by searching through the directories listed in
4518 <CODE>$PATH</CODE>.
4519 Any previously-remembered pathname is discarded.
4520 The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is
4521 used as the location of <VAR>name</VAR>.
4522 The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations.
4523 The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location
4524 of each <VAR>name</VAR>.
4525 If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each
4526 <VAR>name</VAR> corresponds is printed.  If multiple <VAR>name</VAR> arguments are
4527 supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed
4528 full pathname.
4529 The <SAMP>`-l'</SAMP> option causes output to be displayed in a format
4530 that may be reused as input.
4531 If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied,
4532 information about remembered commands is printed.
4533 The return status is zero unless a <VAR>name</VAR> is not found or an invalid
4534 option is supplied.
4535 </P><P>
4536
4537 <DT><CODE>pwd</CODE>
4538 <DD><A NAME="IDX88"></A>
4539 <TABLE><tr><td>&nbsp;</td><td class=example><pre>pwd [-LP]
4540 </pre></td></tr></table><P>
4541
4542 Print the absolute pathname of the current working directory.
4543 If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not
4544 contain symbolic links.
4545 If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain
4546 symbolic links.
4547 The return status is zero unless an error is encountered while
4548 determining the name of the current directory or an invalid option
4549 is supplied.
4550 </P><P>
4551
4552 <DT><CODE>readonly</CODE>
4553 <DD><A NAME="IDX89"></A>
4554 <TABLE><tr><td>&nbsp;</td><td class=example><pre>readonly [-aAf] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small>
4555 </pre></td></tr></table><P>
4556
4557 Mark each <VAR>name</VAR> as readonly.
4558 The values of these names may not be changed by subsequent assignment.
4559 If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell
4560 function.
4561 The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed
4562 array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers
4563 to an associative array variable.
4564 If both options are supplied, <SAMP>`-A'</SAMP> takes precedence.
4565 If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP>
4566 option is supplied, a list of all readonly names is printed.
4567 The other options may be used to restrict the output to a subset of
4568 the set of readonly names.
4569 The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that
4570 may be reused as input.
4571 If a variable name is followed by =<VAR>value</VAR>, the value of
4572 the variable is set to <VAR>value</VAR>.
4573 The return status is zero unless an invalid option is supplied, one of
4574 the <VAR>name</VAR> arguments is not a valid shell variable or function name,
4575 or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function.
4576 </P><P>
4577
4578 <DT><CODE>return</CODE>
4579 <DD><A NAME="IDX90"></A>
4580 <TABLE><tr><td>&nbsp;</td><td class=example><pre>return [<VAR>n</VAR>]
4581 </pre></td></tr></table><P>
4582
4583 Cause a shell function to stop executing and return the value <VAR>n</VAR>
4584 to its caller.
4585 If <VAR>n</VAR> is not supplied, the return value is the exit status of the
4586 last command executed in the function.
4587 <CODE>return</CODE> may also be used to terminate execution of a script
4588 being executed with the <CODE>.</CODE> (<CODE>source</CODE>) builtin,
4589 returning either <VAR>n</VAR> or
4590 the exit status of the last command executed within the script as the exit
4591 status of the script.
4592 If <VAR>n</VAR> is supplied, the return value is its least significant
4593 8 bits.
4594 Any command associated with the <CODE>RETURN</CODE> trap is executed
4595 before execution resumes after the function or script.
4596 The return status is non-zero if <CODE>return</CODE> is supplied a non-numeric
4597 argument or is used outside a function
4598 and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>.
4599 </P><P>
4600
4601 <DT><CODE>shift</CODE>
4602 <DD><A NAME="IDX91"></A>
4603 <TABLE><tr><td>&nbsp;</td><td class=example><pre>shift [<VAR>n</VAR>]
4604 </pre></td></tr></table><P>
4605
4606 Shift the positional parameters to the left by <VAR>n</VAR>.
4607 The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are
4608 renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>.
4609 Parameters represented by the numbers <CODE>$#</CODE> to <CODE>$#</CODE>-<VAR>n</VAR>+1
4610 are unset.
4611 <VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>.
4612 If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters
4613 are not changed.
4614 If <VAR>n</VAR> is not supplied, it is assumed to be 1.
4615 The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or
4616 less than zero, non-zero otherwise.
4617 </P><P>
4618
4619 <DT><CODE>test</CODE>
4620 <DD><DT><CODE>[</CODE>
4621 <DD><A NAME="IDX92"></A>
4622 <A NAME="IDX93"></A>
4623 <TABLE><tr><td>&nbsp;</td><td class=example><pre>test <VAR>expr</VAR>
4624 </pre></td></tr></table><P>
4625
4626 Evaluate a conditional express
4627 ion <VAR>expr</VAR> and return a status of 0
4628 (true) or 1 (false).
4629 Each operator and operand must be a separate argument.
4630 Expressions are composed of the primaries described below in
4631 <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>.
4632 <CODE>test</CODE> does not accept any options, nor does it accept and ignore
4633 an argument of <SAMP>`--'</SAMP> as signifying the end of options.
4634 </P><P>
4635
4636 When the <CODE>[</CODE> form is used, the last argument to the command must
4637 be a <CODE>]</CODE>.
4638 </P><P>
4639
4640 Expressions may be combined using the following operators, listed in
4641 decreasing order of precedence.
4642 The evaluation depends on the number of arguments; see below.
4643 Operator precedence is used when there are five or more arguments.
4644 </P><P>
4645
4646 <DL COMPACT>
4647 <DT><CODE>! <VAR>expr</VAR></CODE>
4648 <DD>True if <VAR>expr</VAR> is false.
4649 <P>
4650
4651 <DT><CODE>( <VAR>expr</VAR> )</CODE>
4652 <DD>Returns the value of <VAR>expr</VAR>.
4653 This may be used to override the normal precedence of operators.
4654 <P>
4655
4656 <DT><CODE><VAR>expr1</VAR> -a <VAR>expr2</VAR></CODE>
4657 <DD>True if both <VAR>expr1</VAR> and <VAR>expr2</VAR> are true.
4658 <P>
4659
4660 <DT><CODE><VAR>expr1</VAR> -o <VAR>expr2</VAR></CODE>
4661 <DD>True if either <VAR>expr1</VAR> or <VAR>expr2</VAR> is true.
4662 </DL>
4663 <P>
4664
4665 The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional
4666 expressions using a set of rules based on the number of arguments.
4667 </P><P>
4668
4669 <DL COMPACT>
4670 <DT>0 arguments
4671 <DD>The expression is false.
4672 <P>
4673
4674 <DT>1 argument
4675 <DD>The expression is true if and only if the argument is not null.
4676 <P>
4677
4678 <DT>2 arguments
4679 <DD>If the first argument is <SAMP>`!'</SAMP>, the expression is true if and
4680 only if the second argument is null.
4681 If the first argument is one of the unary conditional operators
4682 (see section <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>), the expression
4683 is true if the unary test is true.
4684 If the first argument is not a valid unary operator, the expression is
4685 false.
4686 <P>
4687
4688 <DT>3 arguments
4689 <DD>The following conditions are applied in the order listed.
4690 If the second argument is one of the binary conditional
4691 operators (see section <A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>), the
4692 result of the expression is the result of the binary test using the
4693 first and third arguments as operands.
4694 The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators
4695 when there are three arguments.
4696 If the first argument is <SAMP>`!'</SAMP>, the value is the negation of
4697 the two-argument test using the second and third arguments.
4698 If the first argument is exactly <SAMP>`('</SAMP> and the third argument is
4699 exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second
4700 argument.
4701 Otherwise, the expression is false.
4702 <P>
4703
4704 <DT>4 arguments
4705 <DD>If the first argument is <SAMP>`!'</SAMP>, the result is the negation of
4706 the three-argument expression composed of the remaining arguments.
4707 Otherwise, the expression is parsed and evaluated according to 
4708 precedence using the rules listed above.
4709 <P>
4710
4711 <DT>5 or more arguments
4712 <DD>The expression is parsed and evaluated according to precedence
4713 using the rules listed above.
4714 </DL>
4715 <P>
4716
4717 When used with <CODE>test</CODE> or <SAMP>`['</SAMP>, the <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP>
4718 operators sort lexicographically using ASCII ordering.
4719 </P><P>
4720
4721 <DT><CODE>times</CODE>
4722 <DD><A NAME="IDX94"></A>
4723 <TABLE><tr><td>&nbsp;</td><td class=example><pre>times
4724 </pre></td></tr></table><P>
4725
4726 Print out the user and system times used by the shell and its children.
4727 The return status is zero.
4728 </P><P>
4729
4730 <DT><CODE>trap</CODE>
4731 <DD><A NAME="IDX95"></A>
4732 <TABLE><tr><td>&nbsp;</td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>]
4733 </pre></td></tr></table><P>
4734
4735 The commands in <VAR>arg</VAR> are to be read and executed when the
4736 shell receives signal <VAR>sigspec</VAR>.  If <VAR>arg</VAR> is absent (and
4737 there is a single <VAR>sigspec</VAR>) or
4738 equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset
4739 to the value it had when the shell was started.
4740 If <VAR>arg</VAR> is the null string, then the signal specified by
4741 each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes.
4742 If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied,
4743 the shell displays the trap commands associated with each <VAR>sigspec</VAR>.
4744 If no arguments are supplied, or
4745 only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands
4746 associated with each signal number in a form that may be reused as
4747 shell input.
4748 The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names
4749 and their corresponding numbers.
4750 Each <VAR>sigspec</VAR> is either a signal name or a signal number.
4751 Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional.
4752 </P><P>
4753
4754 If a <VAR>sigspec</VAR>
4755 is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits.
4756 If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed
4757 before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
4758 <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
4759 the first command executes in a shell function.
4760 Refer to the description of the <CODE>extdebug</CODE> option to the
4761 <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>) for details of its
4762 effect on the <CODE>DEBUG</CODE> trap.
4763 If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed
4764 each time a shell function or a script executed with the <CODE>.</CODE> or
4765 <CODE>source</CODE> builtins finishes executing.
4766 </P><P>
4767
4768 If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR> 
4769 is executed whenever
4770 a pipeline (which may consist of a single simple
4771 command), a list, or a compound command returns a 
4772 non-zero exit status,
4773 subject to the following conditions.
4774 The <CODE>ERR</CODE> trap is not executed if the failed command is part of the
4775 command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword,
4776 part of the test following the <CODE>if</CODE> or <CODE>elif</CODE> reserved words,
4777 part of a command executed in a <CODE>&#38;&#38;</CODE> or <CODE>||</CODE> list
4778 except the command following the final <CODE>&#38;&#38;</CODE> or <CODE>||</CODE>,
4779 any command in a pipeline but the last,
4780 or if the command's return
4781 status is being inverted using <CODE>!</CODE>.
4782 These are the same conditions obeyed by the <CODE>errexit</CODE> (<SAMP>`-e'</SAMP>)
4783 option.
4784 </P><P>
4785
4786 Signals ignored upon entry to the shell cannot be trapped or reset.
4787 Trapped signals that are not being ignored are reset to their original
4788 values in a subshell or subshell environment when one is created.
4789 </P><P>
4790
4791 The return status is zero unless a <VAR>sigspec</VAR> does not specify a
4792 valid signal.
4793 </P><P>
4794
4795 <DT><CODE>umask</CODE>
4796 <DD><A NAME="IDX96"></A>
4797 <TABLE><tr><td>&nbsp;</td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>]
4798 </pre></td></tr></table><P>
4799
4800 Set the shell process's file creation mask to <VAR>mode</VAR>.  If
4801 <VAR>mode</VAR> begins with a digit, it is interpreted as an octal number;
4802 if not, it is interpreted as a symbolic mode mask similar
4803 to that accepted by the <CODE>chmod</CODE> command.  If <VAR>mode</VAR> is
4804 omitted, the current value of the mask is printed.  If the <SAMP>`-S'</SAMP>
4805 option is supplied without a <VAR>mode</VAR> argument, the mask is printed
4806 in a symbolic format.
4807 If the  <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR>
4808 is omitted, the output is in a form that may be reused as input.
4809 The return status is zero if the mode is successfully changed or if
4810 no <VAR>mode</VAR> argument is supplied, and non-zero otherwise.
4811 </P><P>
4812
4813 Note that when the mode is interpreted as an octal number, each number
4814 of the umask is subtracted from <CODE>7</CODE>.  Thus, a umask of <CODE>022</CODE>
4815 results in permissions of <CODE>755</CODE>.
4816 </P><P>
4817
4818 <DT><CODE>unset</CODE>
4819 <DD><A NAME="IDX97"></A>
4820 <TABLE><tr><td>&nbsp;</td><td class=example><pre>unset [-fnv] [<VAR>name</VAR>]
4821 </pre></td></tr></table><P>
4822
4823 Remove each variable or function <VAR>name</VAR>.
4824 If the <SAMP>`-v'</SAMP> option is given, each
4825 <VAR>name</VAR> refers to a shell variable and that variable is remvoved.
4826 If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell
4827 functions, and the function definition is removed.
4828 If the <SAMP>`-n'</SAMP> option is supplied, and <VAR>name</VAR> is a variable with
4829 the <VAR>nameref</VAR> attribute, <VAR>name</VAR> will be unset rather than the
4830 variable it references.
4831 <SAMP>`-n'</SAMP> has no effect if the <SAMP>`-f'</SAMP> option is supplied.
4832 If no options are supplied, each <VAR>name</VAR> refers to a variable; if
4833 there is no variable by that name, any function with that name is
4834 unset.
4835 Readonly variables and functions may not be unset.
4836 The return status is zero unless a <VAR>name</VAR> is readonly.
4837 </DL>
4838 <P>
4839
4840 <A NAME="Bash Builtins"></A>
4841 <HR SIZE="6">
4842 <A NAME="SEC61"></A>
4843 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4844 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> &lt; </A>]</TD>
4845 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> &gt; </A>]</TD>
4846 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> &lt;&lt; </A>]</TD>
4847 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
4848 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &gt;&gt; </A>]</TD>
4849 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4850 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4851 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
4852 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4853 </TR></TABLE>
4854 <H2> 4.2 Bash Builtin Commands </H2>
4855 <!--docid::SEC61::-->
4856 <P>
4857
4858 This section describes builtin commands which are unique to
4859 or have been extended in Bash.
4860 Some of these commands are specified in the POSIX standard.
4861 </P><P>
4862
4863 <DL COMPACT>
4864
4865 <DT><CODE>alias</CODE>
4866 <DD><A NAME="IDX98"></A>
4867 <TABLE><tr><td>&nbsp;</td><td class=example><pre>alias [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4868 </pre></td></tr></table><P>
4869
4870 Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints
4871 the list of aliases on the standard output in a form that allows
4872 them to be reused as input.
4873 If arguments are supplied, an alias is defined for each <VAR>name</VAR>
4874 whose <VAR>value</VAR> is given.  If no <VAR>value</VAR> is given, the name
4875 and value of the alias is printed.
4876 Aliases are described in <A HREF="bashref.html#SEC85">6.6 Aliases</A>.
4877 </P><P>
4878
4879 <DT><CODE>bind</CODE>
4880 <DD><A NAME="IDX99"></A>
4881 <TABLE><tr><td>&nbsp;</td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSVX]
4882 bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>]
4883 bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR>
4884 bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR>
4885 bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR>
4886 bind <VAR>readline-command</VAR>
4887 </pre></td></tr></table><P>
4888
4889 Display current Readline (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>)
4890 key and function bindings,
4891 bind a key sequence to a Readline function or macro,
4892 or set a Readline variable.
4893 Each non-option argument is a command as it would appear in a
4894 Readline initialization file (see section <A HREF="bashref.html#SEC104">8.3 Readline Init File</A>),
4895 but each binding or command must be passed as a separate argument;  e.g.,
4896 <SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>.
4897 </P><P>
4898
4899 Options, if supplied, have the following meanings:
4900 </P><P>
4901
4902 <DL COMPACT>
4903 <DT><CODE>-m <VAR>keymap</VAR></CODE>
4904 <DD>Use <VAR>keymap</VAR> as the keymap to be affected by
4905 the subsequent bindings.  Acceptable <VAR>keymap</VAR>
4906 names are
4907 <CODE>emacs</CODE>,
4908 <CODE>emacs-standard</CODE>,
4909 <CODE>emacs-meta</CODE>,
4910 <CODE>emacs-ctlx</CODE>,
4911 <CODE>vi</CODE>,
4912 <CODE>vi-move</CODE>,
4913 <CODE>vi-command</CODE>, and
4914 <CODE>vi-insert</CODE>.
4915 <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>;
4916 <CODE>emacs</CODE> is equivalent to <CODE>emacs-standard</CODE>.
4917 <P>
4918
4919 <DT><CODE>-l</CODE>
4920 <DD>List the names of all Readline functions.
4921 <P>
4922
4923 <DT><CODE>-p</CODE>
4924 <DD>Display Readline function names and bindings in such a way that they
4925 can be used as input or in a Readline initialization file.
4926 <P>
4927
4928 <DT><CODE>-P</CODE>
4929 <DD>List current Readline function names and bindings.
4930 <P>
4931
4932 <DT><CODE>-v</CODE>
4933 <DD>Display Readline variable names and values in such a way that they
4934 can be used as input or in a Readline initialization file.
4935 <P>
4936
4937 <DT><CODE>-V</CODE>
4938 <DD>List current Readline variable names and values.
4939 <P>
4940
4941 <DT><CODE>-s</CODE>
4942 <DD>Display Readline key sequences bound to macros and the strings they output
4943 in such a way that they can be used as input or in a Readline
4944 initialization file.
4945 <P>
4946
4947 <DT><CODE>-S</CODE>
4948 <DD>Display Readline key sequences bound to macros and the strings they output.
4949 <P>
4950
4951 <DT><CODE>-f <VAR>filename</VAR></CODE>
4952 <DD>Read key bindings from <VAR>filename</VAR>.
4953 <P>
4954
4955 <DT><CODE>-q <VAR>function</VAR></CODE>
4956 <DD>Query about which keys invoke the named <VAR>function</VAR>.
4957 <P>
4958
4959 <DT><CODE>-u <VAR>function</VAR></CODE>
4960 <DD>Unbind all keys bound to the named <VAR>function</VAR>.
4961 <P>
4962
4963 <DT><CODE>-r <VAR>keyseq</VAR></CODE>
4964 <DD>Remove any current binding for <VAR>keyseq</VAR>.
4965 <P>
4966
4967 <DT><CODE>-x <VAR>keyseq:shell-command</VAR></CODE>
4968 <DD>Cause <VAR>shell-command</VAR> to be executed whenever <VAR>keyseq</VAR> is
4969 entered.
4970 When <VAR>shell-command</VAR> is executed, the shell sets the
4971 <CODE>READLINE_LINE</CODE> variable to the contents of the Readline line
4972 buffer and the <CODE>READLINE_POINT</CODE> variable to the current location
4973 of the insertion point.
4974 If the executed command changes the value of <CODE>READLINE_LINE</CODE> or
4975 <CODE>READLINE_POINT</CODE>, those new values will be reflected in the
4976 editing state.
4977 <P>
4978
4979 <DT><CODE>-X</CODE>
4980 <DD>List all key sequences bound to shell commands and the associated commands
4981 in a format that can be reused as input.
4982 </DL>
4983 <P>
4984
4985 The return status is zero unless an invalid option is supplied or an
4986 error occurs.
4987 </P><P>
4988
4989 <DT><CODE>builtin</CODE>
4990 <DD><A NAME="IDX100"></A>
4991 <TABLE><tr><td>&nbsp;</td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]]
4992 </pre></td></tr></table><P>
4993
4994 Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status.
4995 This is useful when defining a shell function with the same
4996 name as a shell builtin, retaining the functionality of the builtin within
4997 the function.
4998 The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell
4999 builtin command.
5000 </P><P>
5001
5002 <DT><CODE>caller</CODE>
5003 <DD><A NAME="IDX101"></A>
5004 <TABLE><tr><td>&nbsp;</td><td class=example><pre>caller [<VAR>expr</VAR>]
5005 </pre></td></tr></table><P>
5006
5007 Returns the context of any active subroutine call (a shell function or
5008 a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins).
5009 </P><P>
5010
5011 Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source
5012 filename of the current subroutine call.
5013 If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE> 
5014 displays the line number, subroutine name, and source file corresponding
5015 to that position in the current execution call stack.  This extra
5016 information may be used, for example, to print a stack trace.  The
5017 current frame is frame 0.
5018 </P><P>
5019
5020 The return value is 0 unless the shell is not executing a subroutine
5021 call or <VAR>expr</VAR> does not correspond to a valid position in the
5022 call stack.
5023 </P><P>
5024
5025 <DT><CODE>command</CODE>
5026 <DD><A NAME="IDX102"></A>
5027 <TABLE><tr><td>&nbsp;</td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>]
5028 </pre></td></tr></table><P>
5029
5030 Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function
5031 named <VAR>command</VAR>.
5032 Only shell builtin commands or commands found by searching the
5033 <CODE>PATH</CODE> are executed.
5034 If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP>
5035 within the function will execute the external command <CODE>ls</CODE>
5036 instead of calling the function recursively.
5037 The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE>
5038 that is guaranteed to find all of the standard utilities.
5039 The return status in this case is 127 if <VAR>command</VAR> cannot be
5040 found or an error occurred, and the exit status of <VAR>command</VAR>
5041 otherwise.
5042 </P><P>
5043
5044 If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a
5045 description of <VAR>command</VAR> is printed.  The <SAMP>`-v'</SAMP> option
5046 causes a single word indicating the command or file name used to
5047 invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces
5048 a more verbose description.  In this case, the return status is
5049 zero if <VAR>command</VAR> is found, and non-zero if not.
5050 </P><P>
5051
5052 <DT><CODE>declare</CODE>
5053 <DD><A NAME="IDX103"></A>
5054 <TABLE><tr><td>&nbsp;</td><td class=example><pre>declare [-aAfFgilnrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
5055 </pre></td></tr></table><P>
5056
5057 Declare variables and give them attributes.  If no <VAR>name</VAR>s
5058 are given, then display the values of variables instead. 
5059 </P><P>
5060
5061 The <SAMP>`-p'</SAMP> option will display the attributes and values of each
5062 <VAR>name</VAR>.
5063 When <SAMP>`-p'</SAMP> is used with <VAR>name</VAR> arguments, additional options,
5064 other than <SAMP>`-f'</SAMP> and <SAMP>`-F'</SAMP>, are ignored.
5065 </P><P>
5066
5067 When <SAMP>`-p'</SAMP> is supplied without <VAR>name</VAR> arguments, <CODE>declare</CODE>
5068 will display the attributes and values of all variables having the
5069 attributes specified by the additional options.
5070 If no other options are supplied with <SAMP>`-p'</SAMP>, <CODE>declare</CODE> will
5071 display the attributes and values of all shell variables.  The <SAMP>`-f'</SAMP>
5072 option will restrict the display to shell functions.
5073 </P><P>
5074
5075 The <SAMP>`-F'</SAMP> option inhibits the display of function definitions;
5076 only the function name and attributes are printed.
5077 If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE>
5078 (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), the source file name and line number where
5079 the function is defined are displayed as well.
5080 <SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>.
5081 </P><P>
5082
5083 The <SAMP>`-g'</SAMP> option forces variables to be created or modified at
5084 the global scope, even when <CODE>declare</CODE> is executed in a shell function.
5085 It is ignored in all other cases.
5086 </P><P>
5087
5088 The following options can be used to restrict output to variables with
5089 the specified attributes or to give variables attributes:
5090 </P><P>
5091
5092 <DL COMPACT>
5093 <DT><CODE>-a</CODE>
5094 <DD>Each <VAR>name</VAR> is an indexed array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
5095 <P>
5096
5097 <DT><CODE>-A</CODE>
5098 <DD>Each <VAR>name</VAR> is an associative array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
5099 <P>
5100
5101 <DT><CODE>-f</CODE>
5102 <DD>Use function names only.
5103 <P>
5104
5105 <DT><CODE>-i</CODE>
5106 <DD>The variable is to be treated as
5107 an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>) is
5108 performed when the variable is assigned a value.
5109 <P>
5110
5111 <DT><CODE>-l</CODE>
5112 <DD>When the variable is assigned a value, all upper-case characters are
5113 converted to lower-case.
5114 The upper-case attribute is disabled.
5115 <P>
5116
5117 <DT><CODE>-n</CODE>
5118 <DD>Give each <VAR>name</VAR> the <VAR>nameref</VAR> attribute, making
5119 it a name reference to another variable.
5120 That other variable is defined by the value of <VAR>name</VAR>.
5121 All references and assignments to <VAR>name</VAR>, except for changing the
5122 <SAMP>`-n'</SAMP> attribute itself, are performed on the variable referenced by
5123 <VAR>name</VAR>'s value.
5124 The <SAMP>`-n'</SAMP> attribute cannot be applied to array variables.
5125 <P>
5126
5127 <DT><CODE>-r</CODE>
5128 <DD>Make <VAR>name</VAR>s readonly.  These names cannot then be assigned values
5129 by subsequent assignment statements or unset.
5130 <P>
5131
5132 <DT><CODE>-t</CODE>
5133 <DD>Give each <VAR>name</VAR> the <CODE>trace</CODE> attribute.
5134 Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from
5135 the calling shell.
5136 The trace attribute has no special meaning for variables.
5137 <P>
5138
5139 <DT><CODE>-u</CODE>
5140 <DD>When the variable is assigned a value, all lower-case characters are
5141 converted to upper-case.
5142 The lower-case attribute is disabled.
5143 <P>
5144
5145 <DT><CODE>-x</CODE>
5146 <DD>Mark each <VAR>name</VAR> for export to subsequent commands via
5147 the environment.
5148 </DL>
5149 <P>
5150
5151 Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead,
5152 with the exceptions that <SAMP>`+a'</SAMP>
5153 may not be used to destroy an array variable and <SAMP>`+r'</SAMP> will not
5154 remove the readonly attribute.
5155 When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local,
5156 as with the <CODE>local</CODE> command, unless the <SAMP>`-g'</SAMP> option is used.
5157 If a variable name is followed by =<VAR>value</VAR>, the value of the variable
5158 is set to <VAR>value</VAR>.
5159 </P><P>
5160
5161 When using <SAMP>`-a'</SAMP> or <SAMP>`-A'</SAMP> and the compound assignment syntax to 
5162 create array variables, additional attributes do not take effect until
5163 subsequent assignments.
5164 </P><P>
5165
5166 The return status is zero unless an invalid option is encountered,
5167 an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>,
5168 an attempt is made to assign a value to a readonly variable,
5169 an attempt is made to assign a value to an array variable without
5170 using the compound assignment syntax (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>),
5171 one of the <VAR>names</VAR> is not a valid shell variable name,
5172 an attempt is made to turn off readonly status for a readonly variable,
5173 an attempt is made to turn off array status for an array variable,
5174 or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>.
5175 </P><P>
5176
5177 <DT><CODE>echo</CODE>
5178 <DD><A NAME="IDX104"></A>
5179 <TABLE><tr><td>&nbsp;</td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>]
5180 </pre></td></tr></table><P>
5181
5182 Output the <VAR>arg</VAR>s, separated by spaces, terminated with a
5183 newline.
5184 The return status is 0 unless a write error occurs.
5185 If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed.
5186 If the <SAMP>`-e'</SAMP> option is given, interpretation of the following
5187 backslash-escaped characters is enabled.
5188 The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters,
5189 even on systems where they are interpreted by default.
5190 The <CODE>xpg_echo</CODE> shell option may be used to
5191 dynamically determine whether or not <CODE>echo</CODE> expands these
5192 escape characters by default.
5193 <CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options.
5194 </P><P>
5195
5196 <CODE>echo</CODE> interprets the following escape sequences:
5197 <DL COMPACT>
5198 <DT><CODE>\a</CODE>
5199 <DD>alert (bell)
5200 <DT><CODE>\b</CODE>
5201 <DD>backspace
5202 <DT><CODE>\c</CODE>
5203 <DD>suppress further output
5204 <DT><CODE>\e</CODE>
5205 <DD><DT><CODE>\E</CODE>
5206 <DD>escape
5207 <DT><CODE>\f</CODE>
5208 <DD>form feed
5209 <DT><CODE>\n</CODE>
5210 <DD>new line
5211 <DT><CODE>\r</CODE>
5212 <DD>carriage return
5213 <DT><CODE>\t</CODE>
5214 <DD>horizontal tab
5215 <DT><CODE>\v</CODE>
5216 <DD>vertical tab
5217 <DT><CODE>\\</CODE>
5218 <DD>backslash
5219 <DT><CODE>\0<VAR>nnn</VAR></CODE>
5220 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
5221 (zero to three octal digits)
5222 <DT><CODE>\x<VAR>HH</VAR></CODE>
5223 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
5224 (one or two hex digits)
5225 <DT><CODE>\u<VAR>HHHH</VAR></CODE>
5226 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
5227 <VAR>HHHH</VAR> (one to four hex digits)
5228 <DT><CODE>\U<VAR>HHHHHHHH</VAR></CODE>
5229 <DD>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value
5230 <VAR>HHHHHHHH</VAR> (one to eight hex digits)
5231 </DL>
5232 <P>
5233
5234 <DT><CODE>enable</CODE>
5235 <DD><A NAME="IDX105"></A>
5236 <TABLE><tr><td>&nbsp;</td><td class=example><pre>enable [-a] [-dnps] [-f <VAR>filename</VAR>] [<VAR>name</VAR> <small>...</small>]
5237 </pre></td></tr></table><P>
5238
5239 Enable and disable builtin shell commands.
5240 Disabling a builtin allows a disk command which has the same name
5241 as a shell builtin to be executed without specifying a full pathname,
5242 even though the shell normally searches for builtins before disk commands.
5243 If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled.  Otherwise
5244 <VAR>name</VAR>s are enabled.  For example, to use the <CODE>test</CODE> binary
5245 found via <CODE>$PATH</CODE> instead of the shell builtin version, type
5246 <SAMP>`enable -n test'</SAMP>.
5247 </P><P>
5248
5249 If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear,
5250 a list of shell builtins is printed.  With no other arguments, the list
5251 consists of all enabled shell builtins.
5252 The <SAMP>`-a'</SAMP> option means to list
5253 each builtin with an indication of whether or not it is enabled. 
5254 </P><P>
5255
5256 The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR>
5257 from shared object <VAR>filename</VAR>, on systems that support dynamic loading.
5258 The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>.
5259 </P><P>
5260
5261 If there are no options, a list of the shell builtins is displayed.
5262 The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special
5263 builtins.  If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes
5264 a special builtin (see section <A HREF="bashref.html#SEC65">4.4 Special Builtins</A>).
5265 </P><P>
5266
5267 The return status is zero unless a <VAR>name</VAR> is not a shell builtin
5268 or there is an error loading a new builtin from a shared object.
5269 </P><P>
5270
5271 <DT><CODE>help</CODE>
5272 <DD><A NAME="IDX106"></A>
5273 <TABLE><tr><td>&nbsp;</td><td class=example><pre>help [-dms] [<VAR>pattern</VAR>]
5274 </pre></td></tr></table><P>
5275
5276 Display helpful information about builtin commands.
5277 If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help
5278 on all commands matching <VAR>pattern</VAR>, otherwise a list of
5279 the builtins is printed.
5280 </P><P>
5281
5282 Options, if supplied, have the following meanings:
5283 </P><P>
5284
5285 <DL COMPACT>
5286 <DT><CODE>-d</CODE>
5287 <DD>Display a short description of each <VAR>pattern</VAR>
5288 <DT><CODE>-m</CODE>
5289 <DD>Display the description of each <VAR>pattern</VAR> in a manpage-like format
5290 <DT><CODE>-s</CODE>
5291 <DD>Display only a short usage synopsis for each <VAR>pattern</VAR>
5292 </DL>
5293 <P>
5294
5295 The return status is zero unless no command matches <VAR>pattern</VAR>.
5296 </P><P>
5297
5298 <DT><CODE>let</CODE>
5299 <DD><A NAME="IDX107"></A>
5300 <TABLE><tr><td>&nbsp;</td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR> <small>...</small>]
5301 </pre></td></tr></table><P>
5302
5303 The <CODE>let</CODE> builtin allows arithmetic to be performed on shell
5304 variables.  Each <VAR>expression</VAR> is evaluated according to the
5305 rules given below in <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>.  If the
5306 last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1;
5307 otherwise 0 is returned.
5308 </P><P>
5309
5310 <DT><CODE>local</CODE>
5311 <DD><A NAME="IDX108"></A>
5312 <TABLE><tr><td>&nbsp;</td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>
5313 </pre></td></tr></table><P>
5314
5315 For each argument, a local variable named <VAR>name</VAR> is created,
5316 and assigned <VAR>value</VAR>.
5317 The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>.
5318 <CODE>local</CODE> can only be used within a function; it makes the variable
5319 <VAR>name</VAR> have a visible scope restricted to that function and its
5320 children.  The return status is zero unless <CODE>local</CODE> is used outside
5321 a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a
5322 readonly variable.
5323 </P><P>
5324
5325 <DT><CODE>logout</CODE>
5326 <DD><A NAME="IDX109"></A>
5327 <TABLE><tr><td>&nbsp;</td><td class=example><pre>logout [<VAR>n</VAR>]
5328 </pre></td></tr></table><P>
5329
5330 Exit a login shell, returning a status of <VAR>n</VAR> to the shell's
5331 parent.
5332 </P><P>
5333
5334 <DT><CODE>mapfile</CODE>
5335 <DD><A NAME="IDX110"></A>
5336 <TABLE><tr><td>&nbsp;</td><td class=example><pre>mapfile [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>]
5337     [-C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
5338 </pre></td></tr></table><P>
5339
5340 Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
5341 or from file descriptor <VAR>fd</VAR>
5342 if the <SAMP>`-u'</SAMP> option is supplied.
5343 The variable <CODE>MAPFILE</CODE> is the default <VAR>array</VAR>.
5344 Options, if supplied, have the following meanings:
5345 </P><P>
5346
5347 <DL COMPACT>
5348
5349 <DT><CODE>-n</CODE>
5350 <DD>Copy at most <VAR>count</VAR> lines.  If <VAR>count</VAR> is 0, all lines are copied.
5351 <DT><CODE>-O</CODE>
5352 <DD>Begin assigning to <VAR>array</VAR> at index <VAR>origin</VAR>.
5353 The default index is 0.
5354 <DT><CODE>-s</CODE>
5355 <DD>Discard the first <VAR>count</VAR> lines read.
5356 <DT><CODE>-t</CODE>
5357 <DD>Remove a trailing newline from each line read.
5358 <DT><CODE>-u</CODE>
5359 <DD>Read lines from file descriptor <VAR>fd</VAR> instead of the standard input.
5360 <DT><CODE>-C</CODE>
5361 <DD>Evaluate <VAR>callback</VAR> each time <VAR>quantum</VAR>P lines are read.
5362 The <SAMP>`-c'</SAMP> option specifies <VAR>quantum</VAR>.
5363 <DT><CODE>-c</CODE>
5364 <DD>Specify the number of lines read between each call to <VAR>callback</VAR>.
5365 </DL>
5366 <P>
5367
5368 If <SAMP>`-C'</SAMP> is specified without <SAMP>`-c'</SAMP>, 
5369 the default quantum is 5000.
5370 When <VAR>callback</VAR>  is evaluated, it is supplied the index of the next
5371 array element to be assigned and the line to be assigned to that element
5372 as additional arguments.
5373 <VAR>callback</VAR> is evaluated after the line is read but before the 
5374 array element is assigned.
5375 </P><P>
5376
5377 If not supplied with an explicit origin, <CODE>mapfile</CODE> will clear <VAR>array</VAR>
5378 before assigning to it.
5379 </P><P>
5380
5381 <CODE>mapfile</CODE> returns successfully unless an invalid option or option
5382 argument is supplied, <VAR>array</VAR> is invalid or unassignable, or <VAR>array</VAR>
5383 is not an indexed array.
5384 </P><P>
5385
5386 <DT><CODE>printf</CODE>
5387 <DD><A NAME="IDX111"></A>
5388 <TABLE><tr><td>&nbsp;</td><td class=example><pre>printf [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>]
5389 </pre></td></tr></table><P>
5390
5391 Write the formatted <VAR>arguments</VAR> to the standard output under the
5392 control of the <VAR>format</VAR>.
5393 The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable
5394 <VAR>var</VAR> rather than being printed to the standard output.
5395 </P><P>
5396
5397 The <VAR>format</VAR> is a character string which contains three types of objects:
5398 plain characters, which are simply copied to standard output, character
5399 escape sequences, which are converted and copied to the standard output, and
5400 format specifications, each of which causes printing of the next successive
5401 <VAR>argument</VAR>.
5402 In addition to the standard <CODE>printf(1)</CODE> formats, <CODE>printf</CODE>
5403 interprets the following extensions:
5404 </P><P>
5405
5406 <DL COMPACT>
5407 <DT><CODE>%b</CODE>
5408 <DD>Causes <CODE>printf</CODE> to expand backslash escape sequences in the
5409 corresponding <VAR>argument</VAR>,
5410 except that <SAMP>`\c'</SAMP> terminates output, backslashes in
5411 <SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes
5412 beginning with <SAMP>`\0'</SAMP> may contain up to four digits.
5413 <DT><CODE>%q</CODE>
5414 <DD>Causes <CODE>printf</CODE> to output the
5415 corresponding <VAR>argument</VAR> in a format that can be reused as shell input.
5416 <DT><CODE>%(<VAR>datefmt</VAR>)T</CODE>
5417 <DD>Causes <CODE>printf</CODE> to output the date-time string resulting from using
5418 <VAR>datefmt</VAR> as a format string for <CODE>strftime</CODE>(3).
5419 The corresponding <VAR>argument</VAR> is an integer representing the number of
5420 seconds since the epoch.
5421 Two special argument values may be used: -1 represents the current
5422 time, and -2 represents the time the shell was invoked.
5423 If no argument is specified, conversion behaves as if -1 had been given.
5424 This is an exception to the usual <CODE>printf</CODE> behavior.
5425 </DL>
5426 <P>
5427
5428 Arguments to non-string format specifiers are treated as C language constants,
5429 except that a leading plus or minus sign is allowed, and if the leading
5430 character is a single or double quote, the value is the ASCII value of
5431 the following character.
5432 </P><P>
5433
5434 The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>.
5435 If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the
5436 extra format specifications behave as if a zero value or null string, as
5437 appropriate, had been supplied.  The return value is zero on success,
5438 non-zero on failure.
5439 </P><P>
5440
5441 <DT><CODE>read</CODE>
5442 <DD><A NAME="IDX112"></A>
5443 <TABLE><tr><td>&nbsp;</td><td class=example><pre>read [-ers] [-a <VAR>aname</VAR>] [-d <VAR>delim</VAR>] [-i <VAR>text</VAR>] [-n <VAR>nchars</VAR>]
5444     [-N <VAR>nchars</VAR>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>]
5445 </pre></td></tr></table><P>
5446
5447 One line is read from the standard input, or from the file descriptor
5448 <VAR>fd</VAR> supplied as an argument to the <SAMP>`-u'</SAMP> option, and the first word
5449 is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>,
5450 and so on, with leftover words and their intervening separators assigned
5451 to the last <VAR>name</VAR>.
5452 If there are fewer words read from the input stream than names,
5453 the remaining names are assigned empty values.
5454 The characters in the value of the <CODE>IFS</CODE> variable
5455 are used to split the line into words using the same rules the shell
5456 uses for expansion (described above in <A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A>).
5457 The backslash character <SAMP>`\'</SAMP> may be used to remove any special
5458 meaning for the next character read and for line continuation.
5459 If no names are supplied, the line read is assigned to the
5460 variable <CODE>REPLY</CODE>.
5461 The return code is zero, unless end-of-file is encountered, <CODE>read</CODE>
5462 times out (in which case the return code is greater than 128),
5463 a variable assignment error (such as assigning to a readonly variable) occurs,
5464 or an invalid file descriptor is supplied as the argument to <SAMP>`-u'</SAMP>.
5465 </P><P>
5466
5467 Options, if supplied, have the following meanings:
5468 </P><P>
5469
5470 <DL COMPACT>
5471 <DT><CODE>-a <VAR>aname</VAR></CODE>
5472 <DD>The words are assigned to sequential indices of the array variable
5473 <VAR>aname</VAR>, starting at 0.
5474 All elements are removed from <VAR>aname</VAR> before the assignment.
5475 Other <VAR>name</VAR> arguments are ignored.
5476 <P>
5477
5478 <DT><CODE>-d <VAR>delim</VAR></CODE>
5479 <DD>The first character of <VAR>delim</VAR> is used to terminate the input line,
5480 rather than newline.
5481 <P>
5482
5483 <DT><CODE>-e</CODE>
5484 <DD>Readline (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>) is used to obtain the line.
5485 Readline uses the current (or default, if line editing was not previously
5486 active) editing settings.
5487 <P>
5488
5489 <DT><CODE>-i <VAR>text</VAR></CODE>
5490 <DD>If Readline is being used to read the line, <VAR>text</VAR> is placed into
5491 the editing buffer before editing begins.
5492 <P>
5493
5494 <DT><CODE>-n <VAR>nchars</VAR></CODE>
5495 <DD><CODE>read</CODE> returns after reading <VAR>nchars</VAR> characters rather than
5496 waiting for a complete line of input, but honor a delimiter if fewer
5497 than <VAR>nchars</VAR> characters are read before the delimiter.
5498 <P>
5499
5500 <DT><CODE>-N <VAR>nchars</VAR></CODE>
5501 <DD><CODE>read</CODE> returns after reading exactly <VAR>nchars</VAR> characters rather
5502 than waiting for a complete line of input, unless EOF is encountered or
5503 <CODE>read</CODE> times out.
5504 Delimiter characters encountered in the input are
5505 not treated specially and do not cause <CODE>read</CODE> to return until
5506 <VAR>nchars</VAR> characters are read.
5507 <P>
5508
5509 <DT><CODE>-p <VAR>prompt</VAR></CODE>
5510 <DD>Display <VAR>prompt</VAR>, without a trailing newline, before attempting
5511 to read any input.
5512 The prompt is displayed only if input is coming from a terminal.
5513 <P>
5514
5515 <DT><CODE>-r</CODE>
5516 <DD>If this option is given, backslash does not act as an escape character.
5517 The backslash is considered to be part of the line.
5518 In particular, a backslash-newline pair may not be used as a line
5519 continuation.
5520 <P>
5521
5522 <DT><CODE>-s</CODE>
5523 <DD>Silent mode.  If input is coming from a terminal, characters are
5524 not echoed.
5525 <P>
5526
5527 <DT><CODE>-t <VAR>timeout</VAR></CODE>
5528 <DD>Cause <CODE>read</CODE> to time out and return failure if a complete line of
5529 input (or a specified number of characters)
5530 is not read within <VAR>timeout</VAR> seconds.
5531 <VAR>timeout</VAR>  may be a decimal number with a fractional portion following
5532 the decimal point.
5533 This option is only effective if <CODE>read</CODE> is reading input from a
5534 terminal, pipe, or other special file; it has no effect when reading
5535 from regular files.
5536 If <CODE>read</CODE> times out, <CODE>read</CODE> saves any partial input read into
5537 the specified variable <VAR>name</VAR>.
5538 If <VAR>timeout</VAR> is 0, <CODE>read</CODE> returns immediately, without trying to
5539 read and data.  The exit status is 0 if input is available on
5540 the specified file descriptor, non-zero otherwise.
5541 The exit status is greater than 128 if the timeout is exceeded.
5542 <P>
5543
5544 <DT><CODE>-u <VAR>fd</VAR></CODE>
5545 <DD>Read input from file descriptor <VAR>fd</VAR>.
5546 </DL>
5547 <P>
5548
5549 <DT><CODE>readarray</CODE>
5550 <DD><A NAME="IDX113"></A>
5551 <TABLE><tr><td>&nbsp;</td><td class=example><pre>readarray [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>]
5552     [-C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
5553 </pre></td></tr></table><P>
5554
5555 Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
5556 or from file descriptor <VAR>fd</VAR>
5557 if the <SAMP>`-u'</SAMP> option is supplied.
5558 </P><P>
5559
5560 A synonym for <CODE>mapfile</CODE>.
5561 </P><P>
5562
5563 <DT><CODE>source</CODE>
5564 <DD><A NAME="IDX114"></A>
5565 <TABLE><tr><td>&nbsp;</td><td class=example><pre>source <VAR>filename</VAR>
5566 </pre></td></tr></table><P>
5567
5568 A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
5569 </P><P>
5570
5571 <DT><CODE>type</CODE>
5572 <DD><A NAME="IDX115"></A>
5573 <TABLE><tr><td>&nbsp;</td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>]
5574 </pre></td></tr></table><P>
5575
5576 For each <VAR>name</VAR>, indicate how it would be interpreted if used as a
5577 command name.
5578 </P><P>
5579
5580 If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word
5581 which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>,
5582 <SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>,
5583 if <VAR>name</VAR> is an alias, shell function, shell builtin,
5584 disk file, or shell reserved word, respectively.
5585 If the <VAR>name</VAR> is not found, then nothing is printed, and
5586 <CODE>type</CODE> returns a failure status.
5587 </P><P>
5588
5589 If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name
5590 of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP>
5591 would not return <SAMP>`file'</SAMP>.
5592 </P><P>
5593
5594 The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if
5595 <SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>.
5596 </P><P>
5597
5598 If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value,
5599 which is not necessarily the file that appears first in <CODE>$PATH</CODE>.
5600 </P><P>
5601
5602 If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places
5603 that contain an executable named <VAR>file</VAR>.
5604 This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option
5605 is not also used.
5606 </P><P>
5607
5608 If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find
5609 shell functions, as with the <CODE>command</CODE> builtin.
5610 </P><P>
5611
5612 The return status is zero if all of the <VAR>names</VAR> are found, non-zero
5613 if any are not found.
5614 </P><P>
5615
5616 <DT><CODE>typeset</CODE>
5617 <DD><A NAME="IDX116"></A>
5618 <TABLE><tr><td>&nbsp;</td><td class=example><pre>typeset [-afFgrxilnrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
5619 </pre></td></tr></table><P>
5620
5621 The <CODE>typeset</CODE> command is supplied for compatibility with the Korn
5622 shell.
5623 It is a synonym for the <CODE>declare</CODE> builtin command.
5624 </P><P>
5625
5626 <DT><CODE>ulimit</CODE>
5627 <DD><A NAME="IDX117"></A>
5628 <TABLE><tr><td>&nbsp;</td><td class=example><pre>ulimit [-abcdefilmnpqrstuvxHST] [<VAR>limit</VAR>]
5629 </pre></td></tr></table><P>
5630
5631 <CODE>ulimit</CODE> provides control over the resources available to processes
5632 started by the shell, on systems that allow such control.  If an
5633 option is given, it is interpreted as follows:
5634 </P><P>
5635
5636 <DL COMPACT>
5637 <DT><CODE>-S</CODE>
5638 <DD>Change and report the soft limit associated with a resource.
5639 <P>
5640
5641 <DT><CODE>-H</CODE>
5642 <DD>Change and report the hard limit associated with a resource.
5643 <P>
5644
5645 <DT><CODE>-a</CODE>
5646 <DD>All current limits are reported.
5647 <P>
5648
5649 <DT><CODE>-b</CODE>
5650 <DD>The maximum socket buffer size.
5651 <P>
5652
5653 <DT><CODE>-c</CODE>
5654 <DD>The maximum size of core files created.
5655 <P>
5656
5657 <DT><CODE>-d</CODE>
5658 <DD>The maximum size of a process's data segment.
5659 <P>
5660
5661 <DT><CODE>-e</CODE>
5662 <DD>The maximum scheduling priority ("nice").
5663 <P>
5664
5665 <DT><CODE>-f</CODE>
5666 <DD>The maximum size of files written by the shell and its children.
5667 <P>
5668
5669 <DT><CODE>-i</CODE>
5670 <DD>The maximum number of pending signals.
5671 <P>
5672
5673 <DT><CODE>-l</CODE>
5674 <DD>The maximum size that may be locked into memory.
5675 <P>
5676
5677 <DT><CODE>-m</CODE>
5678 <DD>The maximum resident set size (many systems do not honor this limit).
5679 <P>
5680
5681 <DT><CODE>-n</CODE>
5682 <DD>The maximum number of open file descriptors (most systems do not
5683 allow this value to be set).
5684 <P>
5685
5686 <DT><CODE>-p</CODE>
5687 <DD>The pipe buffer size.
5688 <P>
5689
5690 <DT><CODE>-q</CODE>
5691 <DD>The maximum number of bytes in POSIX message queues.
5692 <P>
5693
5694 <DT><CODE>-r</CODE>
5695 <DD>The maximum real-time scheduling priority.
5696 <P>
5697
5698 <DT><CODE>-s</CODE>
5699 <DD>The maximum stack size.
5700 <P>
5701
5702 <DT><CODE>-t</CODE>
5703 <DD>The maximum amount of cpu time in seconds.
5704 <P>
5705
5706 <DT><CODE>-u</CODE>
5707 <DD>The maximum number of processes available to a single user.
5708 <P>
5709
5710 <DT><CODE>-v</CODE>
5711 <DD>The maximum amount of virtual memory available to the shell, and, on
5712 some systems, to its children.
5713 <P>
5714
5715 <DT><CODE>-x</CODE>
5716 <DD>The maximum number of file locks.
5717 <P>
5718
5719 <DT><CODE>-T</CODE>
5720 <DD>The maximum number of threads.
5721 </DL>
5722 <P>
5723
5724 If <VAR>limit</VAR> is given, and the <SAMP>`-a'</SAMP> option is not used,
5725 <VAR>limit</VAR> is the new value of the specified resource.
5726 The special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and
5727 <CODE>unlimited</CODE> stand for the current hard limit, the current soft limit,
5728 and no limit, respectively.
5729 A hard limit cannot be increased by a non-root user once it is set;
5730 a soft limit may be increased up to the value of the hard limit.
5731 Otherwise, the current value of the soft limit for the specified resource
5732 is printed, unless the <SAMP>`-H'</SAMP> option is supplied.
5733 When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied,
5734 both the hard and soft limits are set.
5735 If no option is given, then <SAMP>`-f'</SAMP> is assumed.  Values are in 1024-byte
5736 increments, except for <SAMP>`-t'</SAMP>, which is in seconds; <SAMP>`-p'</SAMP>,
5737 which is in units of 512-byte blocks; and <SAMP>`-T'</SAMP>, <SAMP>`-b'</SAMP>,
5738 <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which are unscaled values.
5739 </P><P>
5740
5741 The return status is zero unless an invalid option or argument is supplied,
5742 or an error occurs while setting a new limit.
5743 </P><P>
5744
5745 <DT><CODE>unalias</CODE>
5746 <DD><A NAME="IDX118"></A>
5747 <TABLE><tr><td>&nbsp;</td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ]
5748 </pre></td></tr></table><P>
5749
5750 Remove each <VAR>name</VAR> from the list of aliases.  If <SAMP>`-a'</SAMP> is
5751 supplied, all aliases are removed.
5752 Aliases are described in <A HREF="bashref.html#SEC85">6.6 Aliases</A>.
5753 </DL>
5754 <P>
5755
5756 <A NAME="Modifying Shell Behavior"></A>
5757 <HR SIZE="6">
5758 <A NAME="SEC62"></A>
5759 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5760 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &lt; </A>]</TD>
5761 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> &gt; </A>]</TD>
5762 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
5763 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
5764 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
5765 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5766 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5767 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
5768 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5769 </TR></TABLE>
5770 <H2> 4.3 Modifying Shell Behavior </H2>
5771 <!--docid::SEC62::-->
5772  
5773 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
5774 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Change the values of shell attributes and
5775                                 positional parameters.</TD></TR>
5776 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Modify shell optional behavior.</TD></TR>
5777 </TABLE></BLOCKQUOTE>
5778 <P>
5779
5780 <A NAME="The Set Builtin"></A>
5781 <HR SIZE="6">
5782 <A NAME="SEC63"></A>
5783 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5784 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> &lt; </A>]</TD>
5785 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt; </A>]</TD>
5786 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
5787 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> Up </A>]</TD>
5788 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
5789 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5790 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5791 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
5792 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5793 </TR></TABLE>
5794 <H3> 4.3.1 The Set Builtin </H3>
5795 <!--docid::SEC63::-->
5796 <P>
5797
5798 This builtin is so complicated that it deserves its own section.  <CODE>set</CODE>
5799 allows you to change the values of shell options and set the positional
5800 parameters, or to display the names and values of shell variables.
5801 </P><P>
5802
5803 <DL COMPACT>
5804 <DT><CODE>set</CODE>
5805 <DD><A NAME="IDX119"></A>
5806 <TABLE><tr><td>&nbsp;</td><td class=example><pre>set [--abefhkmnptuvxBCEHPT] [-o <VAR>option-name</VAR>] [<VAR>argument</VAR> <small>...</small>]
5807 set [+abefhkmnptuvxBCEHPT] [+o <VAR>option-name</VAR>] [<VAR>argument</VAR> <small>...</small>]
5808 </pre></td></tr></table><P>
5809
5810 If no options or arguments are supplied, <CODE>set</CODE> displays the names
5811 and values of all shell variables and functions, sorted according to the
5812 current locale, in a format that may be reused as input
5813 for setting or resetting the currently-set variables.
5814 Read-only variables cannot be reset.
5815 In POSIX mode, only shell variables are listed.
5816 </P><P>
5817
5818 When options are supplied, they set or unset shell attributes.
5819 Options, if specified, have the following meanings:
5820 </P><P>
5821
5822 <DL COMPACT>
5823 <DT><CODE>-a</CODE>
5824 <DD>Mark variables and function which are modified or created for export
5825 to the environment of subsequent commands.
5826 <P>
5827
5828 <DT><CODE>-b</CODE>
5829 <DD>Cause the status of terminated background jobs to be reported
5830 immediately, rather than before printing the next primary prompt.
5831 <P>
5832
5833 <DT><CODE>-e</CODE>
5834 <DD>Exit immediately if
5835 a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>), which may consist of a single simple command
5836 (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>),
5837 a list (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>),
5838 or a compound command (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>)
5839 returns a non-zero status.
5840 The shell does not exit if the command that fails is part of the
5841 command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> keyword,
5842 part of the test in an <CODE>if</CODE> statement,
5843 part of any command executed in a <CODE>&#38;&#38;</CODE> or <CODE>||</CODE> list except
5844 the command following the final <CODE>&#38;&#38;</CODE> or <CODE>||</CODE>,
5845 any command in a pipeline but the last,
5846 or if the command's return status is being inverted with <CODE>!</CODE>.
5847 If a compound command other than a subshell
5848 returns a non-zero status because a command failed
5849 while <SAMP>`-e'</SAMP> was being ignored, the shell does not exit.
5850 A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits.
5851 <P>
5852
5853 This option applies to the shell environment and each subshell environment
5854 separately (see section <A HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>), and may cause
5855 subshells to exit before executing all the commands in the subshell.
5856 </P><P>
5857
5858 If a compound command or shell function executes in a context where
5859 <SAMP>`-e'</SAMP> is being ignored,
5860 none of the commands executed within the compound command or function body
5861 will be affected by the <SAMP>`-e'</SAMP> setting, even if <SAMP>`-e'</SAMP> is set
5862 and a command returns a failure status.
5863 If a compound command or shell function sets <SAMP>`-e'</SAMP> while executing in
5864 a context where <SAMP>`-e'</SAMP> is ignored, that setting will not have any
5865 effect until the compound command or the command containing the function
5866 call completes.
5867 </P><P>
5868
5869 <DT><CODE>-f</CODE>
5870 <DD>Disable filename expansion (globbing).
5871 <P>
5872
5873 <DT><CODE>-h</CODE>
5874 <DD>Locate and remember (hash) commands as they are looked up for execution.
5875 This option is enabled by default.
5876 <P>
5877
5878 <DT><CODE>-k</CODE>
5879 <DD>All arguments in the form of assignment statements are placed
5880 in the environment for a command, not just those that precede
5881 the command name.
5882 <P>
5883
5884 <DT><CODE>-m</CODE>
5885 <DD>Job control is enabled (see section <A HREF="bashref.html#SEC92">7. Job Control</A>).
5886 All processes run in a separate process group.
5887 When a background job completes, the shell prints a line
5888 containing its exit status.
5889 <P>
5890
5891 <DT><CODE>-n</CODE>
5892 <DD>Read commands but do not execute them; this may be used to check a
5893 script for syntax errors.
5894 This option is ignored by interactive shells.
5895 <P>
5896
5897 <DT><CODE>-o <VAR>option-name</VAR></CODE>
5898 <DD><P>
5899
5900 Set the option corresponding to <VAR>option-name</VAR>:
5901 </P><P>
5902
5903 <DL COMPACT>
5904 <DT><CODE>allexport</CODE>
5905 <DD>Same as <CODE>-a</CODE>.
5906 <P>
5907
5908 <DT><CODE>braceexpand</CODE>
5909 <DD>Same as <CODE>-B</CODE>.
5910 <P>
5911
5912 <DT><CODE>emacs</CODE>
5913 <DD>Use an <CODE>emacs</CODE>-style line editing interface (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>).
5914 This also affects the editing interface used for <CODE>read -e</CODE>.
5915 <P>
5916
5917 <DT><CODE>errexit</CODE>
5918 <DD>Same as <CODE>-e</CODE>.
5919 <P>
5920
5921 <DT><CODE>errtrace</CODE>
5922 <DD>Same as <CODE>-E</CODE>.
5923 <P>
5924
5925 <DT><CODE>functrace</CODE>
5926 <DD>Same as <CODE>-T</CODE>.
5927 <P>
5928
5929 <DT><CODE>hashall</CODE>
5930 <DD>Same as <CODE>-h</CODE>.
5931 <P>
5932
5933 <DT><CODE>histexpand</CODE>
5934 <DD>Same as <CODE>-H</CODE>.
5935 <P>
5936
5937 <DT><CODE>history</CODE>
5938 <DD>Enable command history, as described in <A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>.
5939 This option is on by default in interactive shells.
5940 <P>
5941
5942 <DT><CODE>ignoreeof</CODE>
5943 <DD>An interactive shell will not exit upon reading EOF.
5944 <P>
5945
5946 <DT><CODE>keyword</CODE>
5947 <DD>Same as <CODE>-k</CODE>.
5948 <P>
5949
5950 <DT><CODE>monitor</CODE>
5951 <DD>Same as <CODE>-m</CODE>.
5952 <P>
5953
5954 <DT><CODE>noclobber</CODE>
5955 <DD>Same as <CODE>-C</CODE>.
5956 <P>
5957
5958 <DT><CODE>noexec</CODE>
5959 <DD>Same as <CODE>-n</CODE>.
5960 <P>
5961
5962 <DT><CODE>noglob</CODE>
5963 <DD>Same as <CODE>-f</CODE>.
5964 <P>
5965
5966 <DT><CODE>nolog</CODE>
5967 <DD>Currently ignored.
5968 <P>
5969
5970 <DT><CODE>notify</CODE>
5971 <DD>Same as <CODE>-b</CODE>.
5972 <P>
5973
5974 <DT><CODE>nounset</CODE>
5975 <DD>Same as <CODE>-u</CODE>.
5976 <P>
5977
5978 <DT><CODE>onecmd</CODE>
5979 <DD>Same as <CODE>-t</CODE>.
5980 <P>
5981
5982 <DT><CODE>physical</CODE>
5983 <DD>Same as <CODE>-P</CODE>.
5984 <P>
5985
5986 <DT><CODE>pipefail</CODE>
5987 <DD>If set, the return value of a pipeline is the value of the last
5988 (rightmost) command to exit with a non-zero status, or zero if all
5989 commands in the pipeline exit successfully.
5990 This option is disabled by default.
5991 <P>
5992
5993 <DT><CODE>posix</CODE>
5994 <DD>Change the behavior of Bash where the default operation differs
5995 from the POSIX standard to match the standard
5996 (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
5997 This is intended to make Bash behave as a strict superset of that
5998 standard.
5999 <P>
6000
6001 <DT><CODE>privileged</CODE>
6002 <DD>Same as <CODE>-p</CODE>.
6003 <P>
6004
6005 <DT><CODE>verbose</CODE>
6006 <DD>Same as <CODE>-v</CODE>.
6007 <P>
6008
6009 <DT><CODE>vi</CODE>
6010 <DD>Use a <CODE>vi</CODE>-style line editing interface.
6011 This also affects the editing interface used for <CODE>read -e</CODE>.
6012 <P>
6013
6014 <DT><CODE>xtrace</CODE>
6015 <DD>Same as <CODE>-x</CODE>.
6016 </DL>
6017 <P>
6018
6019 <DT><CODE>-p</CODE>
6020 <DD>Turn on privileged mode.
6021 In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not
6022 processed, shell functions are not inherited from the environment,
6023 and the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE> and <CODE>GLOBIGNORE</CODE>
6024 variables, if they appear in the environment, are ignored.
6025 If the shell is started with the effective user (group) id not equal to the
6026 real user (group) id, and the <SAMP>`-p'</SAMP> option is not supplied, these actions
6027 are taken and the effective user id is set to the real user id.
6028 If the <SAMP>`-p'</SAMP> option is supplied at startup, the effective user id is
6029 not reset.
6030 Turning this option off causes the effective user
6031 and group ids to be set to the real user and group ids.
6032 <P>
6033
6034 <DT><CODE>-t</CODE>
6035 <DD>Exit after reading and executing one command.
6036 <P>
6037
6038 <DT><CODE>-u</CODE>
6039 <DD>Treat unset variables and parameters other than the special parameters
6040 <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP> as an error when performing parameter expansion.
6041 An error message will be written to the standard error, and a non-interactive
6042 shell will exit.
6043 <P>
6044
6045 <DT><CODE>-v</CODE>
6046 <DD>Print shell input lines as they are read.
6047 <P>
6048
6049 <DT><CODE>-x</CODE>
6050 <DD>Print a trace of simple commands, <CODE>for</CODE> commands, <CODE>case</CODE>
6051 commands, <CODE>select</CODE> commands, and arithmetic <CODE>for</CODE> commands
6052 and their arguments or associated word lists after they are
6053 expanded and before they are executed.  The value of the <CODE>PS4</CODE>
6054 variable is expanded and the resultant value is printed before
6055 the command and its expanded arguments.
6056 <P>
6057
6058 <DT><CODE>-B</CODE>
6059 <DD>The shell will perform brace expansion (see section <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>).
6060 This option is on by default.
6061 <P>
6062
6063 <DT><CODE>-C</CODE>
6064 <DD>Prevent output redirection using <SAMP>`&#62;'</SAMP>, <SAMP>`&#62;&#38;'</SAMP>, and <SAMP>`&#60;&#62;'</SAMP>
6065 from overwriting existing files.
6066 <P>
6067
6068 <DT><CODE>-E</CODE>
6069 <DD>If set, any trap on <CODE>ERR</CODE> is inherited by shell functions, command
6070 substitutions, and commands executed in a subshell environment.
6071 The <CODE>ERR</CODE> trap is normally not inherited in such cases.
6072 <P>
6073
6074 <DT><CODE>-H</CODE>
6075 <DD>Enable <SAMP>`!'</SAMP> style history substitution (see section <A HREF="bashref.html#SEC124">9.3 History Expansion</A>).
6076 This option is on by default for interactive shells.
6077 <P>
6078
6079 <DT><CODE>-P</CODE>
6080 <DD>If set, do not resolve symbolic links when performing commands such as
6081 <CODE>cd</CODE> which change the current directory.  The physical directory
6082 is used instead.  By default, Bash follows
6083 the logical chain of directories when performing commands
6084 which change the current directory.
6085 <P>
6086
6087 For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT>
6088 then:
6089 <TABLE><tr><td>&nbsp;</td><td class=example><pre>$ cd /usr/sys; echo $PWD
6090 /usr/sys
6091 $ cd ..; pwd
6092 /usr
6093 </pre></td></tr></table></P><P>
6094
6095 If <CODE>set -P</CODE> is on, then:
6096 <TABLE><tr><td>&nbsp;</td><td class=example><pre>$ cd /usr/sys; echo $PWD
6097 /usr/local/sys
6098 $ cd ..; pwd
6099 /usr/local
6100 </pre></td></tr></table></P><P>
6101
6102 <DT><CODE>-T</CODE>
6103 <DD>If set, any trap on <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> are inherited by
6104 shell functions, command substitutions, and commands executed
6105 in a subshell environment.
6106 The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited
6107 in such cases.
6108 <P>
6109
6110 <DT><CODE>--</CODE>
6111 <DD>If no arguments follow this option, then the positional parameters are
6112 unset.  Otherwise, the positional parameters are set to the
6113 <VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>.
6114 <P>
6115
6116 <DT><CODE>-</CODE>
6117 <DD>Signal the end of options, cause all remaining <VAR>arguments</VAR>
6118 to be assigned to the positional parameters.  The <SAMP>`-x'</SAMP>
6119 and <SAMP>`-v'</SAMP>  options are turned off.
6120 If there are no arguments, the positional parameters remain unchanged.
6121 </DL>
6122 <P>
6123
6124 Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be
6125 turned off.  The options can also be used upon invocation of the
6126 shell.  The current set of options may be found in <CODE>$-</CODE>.
6127 </P><P>
6128
6129 The remaining N <VAR>arguments</VAR> are positional parameters and are
6130 assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small>  <CODE>$N</CODE>.
6131 The special parameter <CODE>#</CODE> is set to N.
6132 </P><P>
6133
6134 The return status is always zero unless an invalid option is supplied.
6135 </DL>
6136 <P>
6137
6138 <A NAME="The Shopt Builtin"></A>
6139 <HR SIZE="6">
6140 <A NAME="SEC64"></A>
6141 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6142 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> &lt; </A>]</TD>
6143 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt; </A>]</TD>
6144 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
6145 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> Up </A>]</TD>
6146 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
6147 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6148 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6149 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
6150 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6151 </TR></TABLE>
6152 <H3> 4.3.2 The Shopt Builtin </H3>
6153 <!--docid::SEC64::-->
6154 <P>
6155
6156 This builtin allows you to change additional shell optional behavior.
6157 </P><P>
6158
6159 <DL COMPACT>
6160
6161 <DT><CODE>shopt</CODE>
6162 <DD><A NAME="IDX120"></A>
6163 <TABLE><tr><td>&nbsp;</td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>]
6164 </pre></td></tr></table><P>
6165
6166 Toggle the values of settings controlling optional shell behavior.
6167 The settings can be either those listed below, or, if the
6168 <SAMP>`-o'</SAMP> option is used, those available with the <SAMP>`-o'</SAMP>
6169 option to the <CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
6170 With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable
6171 options is displayed, with an indication of whether or not each is set.
6172 The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that
6173 may be reused as input.
6174 Other options have the following meanings:
6175 </P><P>
6176
6177 <DL COMPACT>
6178 <DT><CODE>-s</CODE>
6179 <DD>Enable (set) each <VAR>optname</VAR>.
6180 <P>
6181
6182 <DT><CODE>-u</CODE>
6183 <DD>Disable (unset) each <VAR>optname</VAR>.
6184 <P>
6185
6186 <DT><CODE>-q</CODE>
6187 <DD>Suppresses normal output; the return status
6188 indicates whether the <VAR>optname</VAR> is set or unset.
6189 If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>,
6190 the return status is zero if all <VAR>optnames</VAR> are enabled;
6191 non-zero otherwise.
6192 <P>
6193
6194 <DT><CODE>-o</CODE>
6195 <DD>Restricts the values of
6196 <VAR>optname</VAR> to be those defined for the <SAMP>`-o'</SAMP> option to the
6197 <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
6198 </DL>
6199 <P>
6200
6201 If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP>
6202 is used with no <VAR>optname</VAR> arguments, <CODE>shopt</CODE> shows only
6203 those options which are set or unset, respectively.
6204 </P><P>
6205
6206 Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off)
6207 by default.
6208 </P><P>
6209
6210 The return status when listing options is zero if all <VAR>optnames</VAR>
6211 are enabled, non-zero otherwise.  When setting or unsetting options,
6212 the return status is zero unless an <VAR>optname</VAR> is not a valid shell
6213 option.
6214 </P><P>
6215
6216 The list of <CODE>shopt</CODE> options is:
6217 <DL COMPACT>
6218
6219 <DT><CODE>autocd</CODE>
6220 <DD>If set, a command name that is the name of a directory is executed as if
6221 it were the argument to the <CODE>cd</CODE> command.
6222 This option is only used by interactive shells.
6223 <P>
6224
6225 <DT><CODE>cdable_vars</CODE>
6226 <DD>If this is set, an argument to the <CODE>cd</CODE> builtin command that
6227 is not a directory is assumed to be the name of a variable whose
6228 value is the directory to change to.
6229 <P>
6230
6231 <DT><CODE>cdspell</CODE>
6232 <DD>If set, minor errors in the spelling of a directory component in a
6233 <CODE>cd</CODE> command will be corrected.
6234 The errors checked for are transposed characters,
6235 a missing character, and a character too many.
6236 If a correction is found, the corrected path is printed,
6237 and the command proceeds.
6238 This option is only used by interactive shells.
6239 <P>
6240
6241 <DT><CODE>checkhash</CODE>
6242 <DD>If this is set, Bash checks that a command found in the hash
6243 table exists before trying to execute it.  If a hashed command no
6244 longer exists, a normal path search is performed.
6245 <P>
6246
6247 <DT><CODE>checkjobs</CODE>
6248 <DD>If set, Bash lists the status of any stopped and running jobs before
6249 exiting an interactive shell.  If any jobs are running, this causes
6250 the exit to be deferred until a second exit is attempted without an
6251 intervening command (see section <A HREF="bashref.html#SEC92">7. Job Control</A>).
6252 The shell always postpones exiting if any jobs are stopped.
6253 <P>
6254
6255 <DT><CODE>checkwinsize</CODE>
6256 <DD>If set, Bash checks the window size after each command
6257  and, if necessary, updates the values of    
6258 <CODE>LINES</CODE> and <CODE>COLUMNS</CODE>.
6259 <P>
6260
6261 <DT><CODE>cmdhist</CODE>
6262 <DD>If set, Bash
6263 attempts to save all lines of a multiple-line
6264 command in the same history entry.  This allows
6265 easy re-editing of multi-line commands.
6266 <P>
6267
6268 <DT><CODE>compat31</CODE>
6269 <DD>If set, Bash
6270 changes its behavior to that of version 3.1 with respect to quoted
6271 arguments to the conditional command's <SAMP>`=~'</SAMP> operator
6272 and with respect to locale-specific
6273 string comparison when using the <CODE>[[</CODE>
6274 conditional command's <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators.
6275 Bash versions prior to bash-4.1 use ASCII collation and strcmp(3);
6276 bash-4.1 and later use the current locale's collation sequence and strcoll(3).
6277 <P>
6278
6279 <DT><CODE>compat32</CODE>
6280 <DD>If set, Bash
6281 changes its behavior to that of version 3.2 with respect to locale-specific
6282 string comparison when using the <CODE>[[</CODE>
6283 conditional command's <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators (see previous item).
6284 <P>
6285
6286 <DT><CODE>compat40</CODE>
6287 <DD>If set, Bash
6288 changes its behavior to that of version 4.0 with respect to locale-specific
6289 string comparison when using the <CODE>[[</CODE>
6290 conditional command's <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators (see description
6291 of <CODE>compat31</CODE>)
6292 and the effect of interrupting a command list.
6293 Bash versions 4.0 and later interrupt the list as if the shell received the
6294 interrupt; previous versions continue with the next command in the list.
6295 <P>
6296
6297 <DT><CODE>compat41</CODE>
6298 <DD>If set, Bash, when in POSIX mode, treats a single quote in a double-quoted
6299 parameter expansion as a special character.  The single quotes must match
6300 (an even number) and the characters between the single quotes are considered
6301 quoted.  This is the behavior of POSIX mode through version 4.1.
6302 The default Bash behavior remains as in previous versions.
6303 <P>
6304
6305 <DT><CODE>compat42</CODE>
6306 <DD>If set, Bash
6307 does not process the replacement string in the pattern substitution word
6308 expansion using quote removal.
6309 <P>
6310
6311 <DT><CODE>complete_fullquote</CODE>
6312 <DD>If set, Bash
6313 quotes all shell metacharacters in filenames and directory names when
6314 performing completion.
6315 If not set, Bash
6316 removes metacharacters such as the dollar sign from the set of
6317 characters that will be quoted in completed filenames
6318 when these metacharacters appear in shell variable references in words to be
6319 completed.
6320 This means that dollar signs in variable names that expand to directories
6321 will not be quoted;
6322 however, any dollar signs appearing in filenames will not be quoted, either.
6323 This is active only when bash is using backslashes to quote completed
6324 filenames.
6325 This variable is set by default, which is the default Bash behavior in
6326 versions through 4.2.
6327 <P>
6328
6329 <DT><CODE>direxpand</CODE>
6330 <DD>If set, Bash
6331 replaces directory names with the results of word expansion when performing
6332 filename completion.  This changes the contents of the readline editing
6333 buffer.
6334 If not set, Bash attempts to preserve what the user typed.
6335 <P>
6336
6337 <DT><CODE>dirspell</CODE>
6338 <DD>If set, Bash
6339 attempts spelling correction on directory names during word completion 
6340 if the directory name initially supplied does not exist.
6341 <P>
6342
6343 <DT><CODE>dotglob</CODE>
6344 <DD>If set, Bash includes filenames beginning with a `.' in
6345 the results of filename expansion.
6346 <P>
6347
6348 <DT><CODE>execfail</CODE>
6349 <DD>If this is set, a non-interactive shell will not exit if
6350 it cannot execute the file specified as an argument to the <CODE>exec</CODE>
6351 builtin command.  An interactive shell does not exit if <CODE>exec</CODE>
6352 fails.
6353 <P>
6354
6355 <DT><CODE>expand_aliases</CODE>
6356 <DD>If set, aliases are expanded as described below under Aliases,
6357 <A HREF="bashref.html#SEC85">6.6 Aliases</A>.
6358 This option is enabled by default for interactive shells.
6359 <P>
6360
6361 <DT><CODE>extdebug</CODE>
6362 <DD>If set, behavior intended for use by debuggers is enabled:
6363 <P>
6364
6365 <OL>
6366 <LI>
6367 The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>)
6368 displays the source file name and line number corresponding to each function
6369 name supplied as an argument.
6370 <P>
6371
6372 <LI>
6373 If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the
6374 next command is skipped and not executed.
6375 <P>
6376
6377 <LI>
6378 If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the
6379 shell is executing in a subroutine (a shell function or a shell script
6380 executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to
6381 <CODE>return</CODE> is simulated.
6382 <P>
6383
6384 <LI>
6385 <CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their
6386 descriptions (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
6387 <P>
6388
6389 <LI>
6390 Function tracing is enabled:  command substitution, shell functions, and
6391 subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
6392 <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps.
6393 <P>
6394
6395 <LI>
6396 Error tracing is enabled:  command substitution, shell functions, and
6397 subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
6398 <CODE>ERR</CODE> trap.
6399 </OL>
6400 <P>
6401
6402 <DT><CODE>extglob</CODE>
6403 <DD>If set, the extended pattern matching features described above
6404 (see section <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>) are enabled.
6405 <P>
6406
6407 <DT><CODE>extquote</CODE>
6408 <DD>If set, <CODE>$'<VAR>string</VAR>'</CODE> and <CODE>$"<VAR>string</VAR>"</CODE> quoting is  
6409 performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions                     
6410 enclosed in double quotes.  This option is enabled by default. 
6411 <P>
6412
6413 <DT><CODE>failglob</CODE>
6414 <DD>If set, patterns which fail to match filenames during filename expansion
6415 result in an expansion error.
6416 <P>
6417
6418 <DT><CODE>force_fignore</CODE>
6419 <DD>If set, the suffixes specified by the <CODE>FIGNORE</CODE> shell variable
6420 cause words to be ignored when performing word completion even if
6421 the ignored words are the only possible completions.
6422 See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
6423 This option is enabled by default.
6424 <P>
6425
6426 <DT><CODE>globasciiranges</CODE>
6427 <DD>If set, range expressions used in pattern matching bracket expressions
6428 (see section <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>)
6429 behave as if in the traditional C locale when performing
6430 comparisons.  That is, the current locale's collating sequence
6431 is not taken into account, so
6432 <SAMP>`b'</SAMP> will not collate between <SAMP>`A'</SAMP> and <SAMP>`B'</SAMP>,
6433 and upper-case and lower-case ASCII characters will collate together.   
6434 <P>
6435
6436 <DT><CODE>globstar</CODE>
6437 <DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename expansion context will
6438 match all files and zero or more directories and subdirectories.
6439 If the pattern is followed by a <SAMP>`/'</SAMP>, only directories and
6440 subdirectories match.
6441 <P>
6442
6443 <DT><CODE>gnu_errfmt</CODE>
6444 <DD>If set, shell error messages are written in the standard GNU error
6445 message format.
6446 <P>
6447
6448 <DT><CODE>histappend</CODE>
6449 <DD>If set, the history list is appended to the file named by the value
6450 of the <CODE>HISTFILE</CODE>
6451 variable when the shell exits, rather than overwriting the file.
6452 <P>
6453
6454 <DT><CODE>histreedit</CODE>
6455 <DD>If set, and Readline
6456 is being used, a user is given the opportunity to re-edit a
6457 failed history substitution.
6458 <P>
6459
6460 <DT><CODE>histverify</CODE>
6461 <DD>If set, and Readline
6462 is being used, the results of history substitution are not immediately
6463 passed to the shell parser.  Instead, the resulting line is loaded into
6464 the Readline editing buffer, allowing further modification.
6465 <P>
6466
6467 <DT><CODE>hostcomplete</CODE>
6468 <DD>If set, and Readline is being used, Bash will attempt to perform
6469 hostname completion when a word containing a <SAMP>`@'</SAMP> is being
6470 completed (see section <A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A>).  This option is enabled
6471 by default.
6472 <P>
6473
6474 <DT><CODE>huponexit</CODE>
6475 <DD>If set, Bash will send <CODE>SIGHUP</CODE> to all jobs when an interactive
6476 login shell exits (see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
6477 <P>
6478
6479 <DT><CODE>interactive_comments</CODE>
6480 <DD>Allow a word beginning with <SAMP>`#'</SAMP>
6481 to cause that word and all remaining characters on that
6482 line to be ignored in an interactive shell.
6483 This option is enabled by default.
6484 <P>
6485
6486 <DT><CODE>lastpipe</CODE>
6487 <DD>If set, and job control is not active, the shell runs the last command of
6488 a pipeline not executed in the background in the current shell environment.
6489 <P>
6490
6491 <DT><CODE>lithist</CODE>
6492 <DD>If enabled, and the <CODE>cmdhist</CODE>
6493 option is enabled, multi-line commands are saved to the history with
6494 embedded newlines rather than using semicolon separators where possible.
6495 <P>
6496
6497 <DT><CODE>login_shell</CODE>
6498 <DD>The shell sets this option if it is started as a login shell
6499 (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>).
6500 The value may not be changed.
6501 <P>
6502
6503 <DT><CODE>mailwarn</CODE>
6504 <DD>If set, and a file that Bash is checking for mail has been  
6505 accessed since the last time it was checked, the message
6506 <CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed.
6507 <P>
6508
6509 <DT><CODE>no_empty_cmd_completion</CODE>
6510 <DD>If set, and Readline is being used, Bash will not attempt to search
6511 the <CODE>PATH</CODE> for possible completions when completion is attempted
6512 on an empty line.
6513 <P>
6514
6515 <DT><CODE>nocaseglob</CODE>
6516 <DD>If set, Bash matches filenames in a case-insensitive fashion when
6517 performing filename expansion.
6518 <P>
6519
6520 <DT><CODE>nocasematch</CODE>
6521 <DD>If set, Bash matches patterns in a case-insensitive fashion when
6522 performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE>
6523 conditional commands.
6524 <P>
6525
6526 <DT><CODE>nullglob</CODE>
6527 <DD>If set, Bash allows filename patterns which match no
6528 files to expand to a null string, rather than themselves.
6529 <P>
6530
6531 <DT><CODE>progcomp</CODE>
6532 <DD>If set, the programmable completion facilities
6533 (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>) are enabled.
6534 This option is enabled by default.
6535 <P>
6536
6537 <DT><CODE>promptvars</CODE>
6538 <DD>If set, prompt strings undergo
6539 parameter expansion, command substitution, arithmetic
6540 expansion, and quote removal after being expanded
6541 as described below (see section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>).
6542 This option is enabled by default.
6543 <P>
6544
6545 <DT><CODE>restricted_shell</CODE>
6546 <DD>The shell sets this option if it is started in restricted mode
6547 (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>).
6548 The value may not be changed.
6549 This is not reset when the startup files are executed, allowing
6550 the startup files to discover whether or not a shell is restricted.
6551 <P>
6552
6553 <DT><CODE>shift_verbose</CODE>
6554 <DD>If this is set, the <CODE>shift</CODE>
6555 builtin prints an error message when the shift count exceeds the
6556 number of positional parameters.
6557 <P>
6558
6559 <DT><CODE>sourcepath</CODE>
6560 <DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE>
6561 to find the directory containing the file supplied as an argument.
6562 This option is enabled by default.
6563 <P>
6564
6565 <DT><CODE>xpg_echo</CODE>
6566 <DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences
6567 by default.
6568 <P>
6569
6570 </DL>
6571 <P>
6572
6573 The return status when listing options is zero if all <VAR>optnames</VAR>
6574 are enabled, non-zero otherwise.
6575 When setting or unsetting options, the return status is zero unless an
6576 <VAR>optname</VAR> is not a valid shell option.
6577 </DL>
6578 <P>
6579
6580 <A NAME="Special Builtins"></A>
6581 <HR SIZE="6">
6582 <A NAME="SEC65"></A>
6583 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6584 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt; </A>]</TD>
6585 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &gt; </A>]</TD>
6586 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &lt;&lt; </A>]</TD>
6587 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> Up </A>]</TD>
6588 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &gt;&gt; </A>]</TD>
6589 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6590 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6591 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
6592 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6593 </TR></TABLE>
6594 <H2> 4.4 Special Builtins </H2>
6595 <!--docid::SEC65::-->
6596 <P>
6597
6598 For historical reasons, the POSIX standard has classified
6599 several builtin commands as <EM>special</EM>.
6600 When Bash is executing in POSIX mode, the special builtins
6601 differ from other builtin commands in three respects:
6602 </P><P>
6603
6604 <OL>
6605 <LI>
6606 Special builtins are found before shell functions during command lookup.
6607 <P>
6608
6609 <LI>
6610 If a special builtin returns an error status, a non-interactive shell exits.
6611 <P>
6612
6613 <LI>
6614 Assignment statements preceding the command stay in effect in the shell
6615 environment after the command completes.
6616 </OL>
6617 <P>
6618
6619 When Bash is not executing in POSIX mode, these builtins behave no
6620 differently than the rest of the Bash builtin commands.
6621 The Bash POSIX mode is described in <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>. 
6622 </P><P>
6623
6624 These are the POSIX special builtins:
6625 <TABLE><tr><td>&nbsp;</td><td class=example><pre>break : . continue eval exec exit export readonly return set
6626 shift trap unset
6627 </pre></td></tr></table></P><P>
6628
6629 <A NAME="Shell Variables"></A>
6630 <HR SIZE="6">
6631 <A NAME="SEC66"></A>
6632 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6633 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt; </A>]</TD>
6634 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> &gt; </A>]</TD>
6635 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &lt;&lt; </A>]</TD>
6636 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
6637 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &gt;&gt; </A>]</TD>
6638 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6639 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6640 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
6641 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6642 </TR></TABLE>
6643 <H1> 5. Shell Variables </H1>
6644 <!--docid::SEC66::-->
6645 <P>
6646
6647 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
6648 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way
6649                                 as the Bourne Shell.</TD></TR>
6650 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR>
6651 </TABLE></BLOCKQUOTE>
6652 <P>
6653
6654 This chapter describes the shell variables that Bash uses.
6655 Bash automatically assigns default values to a number of variables.
6656 </P><P>
6657
6658 <A NAME="Bourne Shell Variables"></A>
6659 <HR SIZE="6">
6660 <A NAME="SEC67"></A>
6661 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6662 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &lt; </A>]</TD>
6663 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt; </A>]</TD>
6664 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &lt;&lt; </A>]</TD>
6665 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> Up </A>]</TD>
6666 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &gt;&gt; </A>]</TD>
6667 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6668 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6669 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
6670 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6671 </TR></TABLE>
6672 <H2> 5.1 Bourne Shell Variables </H2>
6673 <!--docid::SEC67::-->
6674 <P>
6675
6676 Bash uses certain shell variables in the same way as the Bourne shell.
6677 In some cases, Bash assigns a default value to the variable.
6678 </P><P>
6679
6680 <DL COMPACT>
6681
6682 <A NAME="IDX121"></A>
6683 <DT><CODE>CDPATH</CODE>
6684 <DD><A NAME="IDX122"></A>
6685 A colon-separated list of directories used as a search path for
6686 the <CODE>cd</CODE> builtin command.
6687 <P>
6688
6689 <A NAME="IDX123"></A>
6690 <DT><CODE>HOME</CODE>
6691 <DD><A NAME="IDX124"></A>
6692 The current user's home directory; the default for the <CODE>cd</CODE> builtin
6693 command.
6694 The value of this variable is also used by tilde expansion
6695 (see section <A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>).
6696 <P>
6697
6698 <A NAME="IDX125"></A>
6699 <DT><CODE>IFS</CODE>
6700 <DD><A NAME="IDX126"></A>
6701 A list of characters that separate fields; used when the shell splits
6702 words as part of expansion.
6703 <P>
6704
6705 <A NAME="IDX127"></A>
6706 <DT><CODE>MAIL</CODE>
6707 <DD><A NAME="IDX128"></A>
6708 If this parameter is set to a filename or directory name
6709 and the <CODE>MAILPATH</CODE> variable
6710 is not set, Bash informs the user of the arrival of mail in
6711 the specified file or Maildir-format directory.
6712 <P>
6713
6714 <A NAME="IDX129"></A>
6715 <DT><CODE>MAILPATH</CODE>
6716 <DD><A NAME="IDX130"></A>
6717 A colon-separated list of filenames which the shell periodically checks
6718 for new mail.
6719 Each list entry can specify the message that is printed when new mail
6720 arrives in the mail file by separating the filename from the message with
6721 a <SAMP>`?'</SAMP>.
6722 When used in the text of the message, <CODE>$_</CODE> expands to the name of
6723 the current mail file.
6724 <P>
6725
6726 <A NAME="IDX131"></A>
6727 <DT><CODE>OPTARG</CODE>
6728 <DD><A NAME="IDX132"></A>
6729 The value of the last option argument processed by the <CODE>getopts</CODE> builtin.
6730 <P>
6731
6732 <A NAME="IDX133"></A>
6733 <DT><CODE>OPTIND</CODE>
6734 <DD><A NAME="IDX134"></A>
6735 The index of the last option argument processed by the <CODE>getopts</CODE> builtin.
6736 <P>
6737
6738 <A NAME="IDX135"></A>
6739 <DT><CODE>PATH</CODE>
6740 <DD><A NAME="IDX136"></A>
6741 A colon-separated list of directories in which the shell looks for
6742 commands.
6743 A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the
6744 current directory.
6745 A null directory name may appear as two adjacent colons, or as an initial
6746 or trailing colon.
6747 <P>
6748
6749 <A NAME="IDX137"></A>
6750 <DT><CODE>PS1</CODE>
6751 <DD><A NAME="IDX138"></A>
6752 The primary prompt string.  The default value is <SAMP>`\s-\v\$ '</SAMP>.
6753 See section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>, for the complete list of escape
6754 sequences that are expanded before <CODE>PS1</CODE> is displayed.
6755 <P>
6756
6757 <A NAME="IDX139"></A>
6758 <DT><CODE>PS2</CODE>
6759 <DD><A NAME="IDX140"></A>
6760 The secondary prompt string.  The default value is <SAMP>`&#62; '</SAMP>.
6761 <P>
6762
6763 </DL>
6764 <P>
6765
6766 <A NAME="Bash Variables"></A>
6767 <HR SIZE="6">
6768 <A NAME="SEC68"></A>
6769 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6770 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> &lt; </A>]</TD>
6771 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &gt; </A>]</TD>
6772 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &lt;&lt; </A>]</TD>
6773 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> Up </A>]</TD>
6774 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &gt;&gt; </A>]</TD>
6775 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6776 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6777 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
6778 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6779 </TR></TABLE>
6780 <H2> 5.2 Bash Variables </H2>
6781 <!--docid::SEC68::-->
6782 <P>
6783
6784 These variables are set or used by Bash, but other shells
6785 do not normally treat them specially.
6786 </P><P>
6787
6788 A few variables used by Bash are described in different chapters:
6789 variables for controlling the job control facilities
6790 (see section <A HREF="bashref.html#SEC95">7.3 Job Control Variables</A>).
6791 </P><P>
6792
6793 <DL COMPACT>
6794
6795 <A NAME="IDX141"></A>
6796 <DT><CODE>BASH</CODE>
6797 <DD><A NAME="IDX142"></A>
6798 The full pathname used to execute the current instance of Bash.
6799 <P>
6800
6801 <A NAME="IDX143"></A>
6802 <DT><CODE>BASHOPTS</CODE>
6803 <DD><A NAME="IDX144"></A>
6804 A colon-separated list of enabled shell options.  Each word in
6805 the list is a valid argument for the <SAMP>`-s'</SAMP> option to the
6806 <CODE>shopt</CODE> builtin command (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
6807 The options appearing in <CODE>BASHOPTS</CODE> are those reported
6808 as <SAMP>`on'</SAMP> by <SAMP>`shopt'</SAMP>.
6809 If this variable is in the environment when Bash
6810 starts up, each shell option in the list will be enabled before
6811 reading any startup files.  This variable is readonly.
6812 <P>
6813
6814 <A NAME="IDX145"></A>
6815 <DT><CODE>BASHPID</CODE>
6816 <DD><A NAME="IDX146"></A>
6817 Expands to the process ID of the current Bash process.
6818 This differs from <CODE>$$</CODE> under certain circumstances, such as subshells
6819 that do not require Bash to be re-initialized.
6820 <P>
6821
6822 <A NAME="IDX147"></A>
6823 <DT><CODE>BASH_ALIASES</CODE>
6824 <DD><A NAME="IDX148"></A>
6825 An associative array variable whose members correspond to the internal
6826 list of aliases as maintained by the <CODE>alias</CODE> builtin.
6827 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
6828 Elements added to this array appear in the alias list; unsetting array
6829 elements cause aliases to be removed from the alias list.
6830 <P>
6831
6832 <A NAME="IDX149"></A>
6833 <DT><CODE>BASH_ARGC</CODE>
6834 <DD><A NAME="IDX150"></A>
6835 An array variable whose values are the number of parameters in each
6836 frame of the current bash execution call stack.  The number of
6837 parameters to the current subroutine (shell function or script executed
6838 with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack.  When a
6839 subroutine is executed, the number of parameters passed is pushed onto
6840 <CODE>BASH_ARGC</CODE>.
6841 The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode
6842 (see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
6843 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6844 builtin).
6845 <P>
6846
6847 <A NAME="IDX151"></A>
6848 <DT><CODE>BASH_ARGV</CODE>
6849 <DD><A NAME="IDX152"></A>
6850 An array variable containing all of the parameters in the current bash
6851 execution call stack.  The final parameter of the last subroutine call
6852 is at the top of the stack; the first parameter of the initial call is
6853 at the bottom.  When a subroutine is executed, the parameters supplied
6854 are pushed onto <CODE>BASH_ARGV</CODE>.
6855 The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode
6856 (see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
6857 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6858 builtin).
6859 <P>
6860
6861 <A NAME="IDX153"></A>
6862 <DT><CODE>BASH_CMDS</CODE>
6863 <DD><A NAME="IDX154"></A>
6864 An associative array variable whose members correspond to the internal
6865 hash table of commands as maintained by the <CODE>hash</CODE> builtin
6866 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
6867 Elements added to this array appear in the hash table; unsetting array
6868 elements cause commands to be removed from the hash table.
6869 <P>
6870
6871 <A NAME="IDX155"></A>
6872 <DT><CODE>BASH_COMMAND</CODE>
6873 <DD><A NAME="IDX156"></A>
6874 The command currently being executed or about to be executed, unless the
6875 shell is executing a command as the result of a trap,
6876 in which case it is the command executing at the time of the trap.
6877 <P>
6878
6879 <A NAME="IDX157"></A>
6880 <DT><CODE>BASH_COMPAT</CODE>
6881 <DD><A NAME="IDX158"></A>
6882 The value is used to set the shell's compatibility level.
6883 See section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>, for a description of the various compatibility
6884 levels and their effects.
6885 The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42)
6886 corresponding to the desired compatibility level.
6887 If <CODE>BASH_COMPAT</CODE> is unset or set to the empty string, the compatibility
6888 level is set to the default for the current version.
6889 If <CODE>BASH_COMPAT</CODE> is set to a value that is not one of the valid
6890 compatibility levels, the shell prints an error message and sets the
6891 compatibility level to the default for the current version.
6892 The valid compatibility levels correspond to the compatibility options
6893 accepted by the <CODE>shopt</CODE> builtin described above (for example,
6894 <VAR>compat42</VAR> means that 4.2 and 42 are valid values).
6895 The current version is also a valid value.
6896 <P>
6897
6898 <A NAME="IDX159"></A>
6899 <DT><CODE>BASH_ENV</CODE>
6900 <DD><A NAME="IDX160"></A>
6901 If this variable is set when Bash is invoked to execute a shell
6902 script, its value is expanded and used as the name of a startup file
6903 to read before executing the script.  See section <A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>.
6904 <P>
6905
6906 <A NAME="IDX161"></A>
6907 <DT><CODE>BASH_EXECUTION_STRING</CODE>
6908 <DD><A NAME="IDX162"></A>
6909 The command argument to the <SAMP>`-c'</SAMP> invocation option.
6910 <P>
6911
6912 <A NAME="IDX163"></A>
6913 <DT><CODE>BASH_LINENO</CODE>
6914 <DD><A NAME="IDX164"></A>
6915 An array variable whose members are the line numbers in source files
6916 where each corresponding member of <VAR>FUNCNAME</VAR> was invoked.
6917 <CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file
6918 (<CODE>${BASH_SOURCE[$i+1]}</CODE>) where
6919 <CODE>${FUNCNAME[$i]}</CODE> was called (or <CODE>${BASH_LINENO[$i-1]}</CODE> if
6920 referenced within another shell function). 
6921 Use <CODE>LINENO</CODE> to obtain the current line number.
6922 <P>
6923
6924 <A NAME="IDX165"></A>
6925 <DT><CODE>BASH_REMATCH</CODE>
6926 <DD><A NAME="IDX166"></A>
6927 An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary
6928 operator to the <CODE>[[</CODE> conditional command
6929 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
6930 The element with index 0 is the portion of the string
6931 matching the entire regular expression.
6932 The element with index <VAR>n</VAR> is the portion of the
6933 string matching the <VAR>n</VAR>th parenthesized subexpression.
6934 This variable is read-only.
6935 <P>
6936
6937 <A NAME="IDX167"></A>
6938 <DT><CODE>BASH_SOURCE</CODE>
6939 <DD><A NAME="IDX168"></A>
6940 An array variable whose members are the source filenames where the
6941 corresponding shell function names in the <CODE>FUNCNAME</CODE> array
6942 variable are defined.
6943 The shell function <CODE>${FUNCNAME[$i]}</CODE> is defined in the file
6944 <CODE>${BASH_SOURCE[$i]}</CODE> and called from <CODE>${BASH_SOURCE[$i+1]}</CODE>
6945 <P>
6946
6947 <A NAME="IDX169"></A>
6948 <DT><CODE>BASH_SUBSHELL</CODE>
6949 <DD><A NAME="IDX170"></A>
6950 Incremented by one within each subshell or subshell environment when
6951 the shell begins executing in that environment.
6952 The initial value is 0.
6953 <P>
6954
6955 <A NAME="IDX171"></A>
6956 <DT><CODE>BASH_VERSINFO</CODE>
6957 <DD><A NAME="IDX172"></A>
6958 A readonly array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>)
6959 whose members hold version information for this instance of Bash.
6960 The values assigned to the array members are as follows:
6961 <P>
6962
6963 <DL COMPACT>
6964
6965 <DT><CODE>BASH_VERSINFO[0]</CODE>
6966 <DD>The major version number (the <VAR>release</VAR>).
6967 <P>
6968
6969 <DT><CODE>BASH_VERSINFO[1]</CODE>
6970 <DD>The minor version number (the <VAR>version</VAR>).
6971 <P>
6972
6973 <DT><CODE>BASH_VERSINFO[2]</CODE>
6974 <DD>The patch level.
6975 <P>
6976
6977 <DT><CODE>BASH_VERSINFO[3]</CODE>
6978 <DD>The build version.
6979 <P>
6980
6981 <DT><CODE>BASH_VERSINFO[4]</CODE>
6982 <DD>The release status (e.g., <VAR>beta1</VAR>).
6983 <P>
6984
6985 <DT><CODE>BASH_VERSINFO[5]</CODE>
6986 <DD>The value of <CODE>MACHTYPE</CODE>.
6987 </DL>
6988 <P>
6989
6990 <A NAME="IDX173"></A>
6991 <DT><CODE>BASH_VERSION</CODE>
6992 <DD><A NAME="IDX174"></A>
6993 The version number of the current instance of Bash.
6994 <P>
6995
6996 <A NAME="IDX175"></A>
6997 <DT><CODE>BASH_XTRACEFD</CODE>
6998 <DD><A NAME="IDX176"></A>
6999 If set to an integer corresponding to a valid file descriptor, Bash
7000 will write the trace output generated when <SAMP>`set -x'</SAMP>
7001 is enabled to that file descriptor.
7002 This allows tracing output to be separated from diagnostic and error
7003 messages.
7004 The file descriptor is closed when <CODE>BASH_XTRACEFD</CODE> is unset or assigned
7005 a new value.
7006 Unsetting <CODE>BASH_XTRACEFD</CODE> or assigning it the empty string causes the
7007 trace output to be sent to the standard error.
7008 Note that setting <CODE>BASH_XTRACEFD</CODE> to 2 (the standard error file
7009 descriptor) and then unsetting it will result in the standard error
7010 being closed.
7011 <P>
7012
7013 <A NAME="IDX177"></A>
7014 <DT><CODE>CHILD_MAX</CODE>
7015 <DD><A NAME="IDX178"></A>
7016 Set the number of exited child status values for the shell to remember.
7017 Bash will not allow this value to be decreased below a POSIX-mandated
7018 minimum, and there is a maximum value (currently 8192) that this may
7019 not exceed.
7020 The minimum value is system-dependent.
7021 <P>
7022
7023 <A NAME="IDX179"></A>
7024 <DT><CODE>COLUMNS</CODE>
7025 <DD><A NAME="IDX180"></A>
7026 Used by the <CODE>select</CODE> command to determine the terminal width
7027 when printing selection lists.
7028 Automatically set if the <CODE>checkwinsize</CODE> option is enabled
7029 (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), or in an interactive shell upon receipt of a
7030 <CODE>SIGWINCH</CODE>.
7031 <P>
7032
7033 <A NAME="IDX181"></A>
7034 <DT><CODE>COMP_CWORD</CODE>
7035 <DD><A NAME="IDX182"></A>
7036 An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current
7037 cursor position.
7038 This variable is available only in shell functions invoked by the
7039 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
7040 <P>
7041
7042 <A NAME="IDX183"></A>
7043 <DT><CODE>COMP_LINE</CODE>
7044 <DD><A NAME="IDX184"></A>
7045 The current command line.
7046 This variable is available only in shell functions and external
7047 commands invoked by the
7048 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
7049 <P>
7050
7051 <A NAME="IDX185"></A>
7052 <DT><CODE>COMP_POINT</CODE>
7053 <DD><A NAME="IDX186"></A>
7054 The index of the current cursor position relative to the beginning of
7055 the current command.
7056 If the current cursor position is at the end of the current command,
7057 the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>.
7058 This variable is available only in shell functions and external
7059 commands invoked by the
7060 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
7061 <P>
7062
7063 <A NAME="IDX187"></A>
7064 <DT><CODE>COMP_TYPE</CODE>
7065 <DD><A NAME="IDX188"></A>
7066 Set to an integer value corresponding to the type of completion attempted
7067 that caused a completion function to be called:
7068 <VAR>TAB</VAR>, for normal completion,
7069 <SAMP>`?'</SAMP>, for listing completions after successive tabs,
7070 <SAMP>`!'</SAMP>, for listing alternatives on partial word completion,
7071 <SAMP>`@'</SAMP>, to list completions if the word is not unmodified,
7072 or
7073 <SAMP>`%'</SAMP>, for menu completion.
7074 This variable is available only in shell functions and external
7075 commands invoked by the
7076 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
7077 <P>
7078
7079 <A NAME="IDX189"></A>
7080 <DT><CODE>COMP_KEY</CODE>
7081 <DD><A NAME="IDX190"></A>
7082 The key (or final key of a key sequence) used to invoke the current
7083 completion function.
7084 <P>
7085
7086 <A NAME="IDX191"></A>
7087 <DT><CODE>COMP_WORDBREAKS</CODE>
7088 <DD><A NAME="IDX192"></A>
7089 The set of characters that the Readline library treats as word
7090 separators when performing word completion.
7091 If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties,
7092 even if it is subsequently reset.
7093 <P>
7094
7095 <A NAME="IDX193"></A>
7096 <DT><CODE>COMP_WORDS</CODE>
7097 <DD><A NAME="IDX194"></A>
7098 An array variable consisting of the individual
7099 words in the current command line.
7100 The line is split into words as Readline would split it, using
7101 <CODE>COMP_WORDBREAKS</CODE> as described above.
7102 This variable is available only in shell functions invoked by the
7103 programmable completion facilities (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
7104 <P>
7105
7106 <A NAME="IDX195"></A>
7107 <DT><CODE>COMPREPLY</CODE>
7108 <DD><A NAME="IDX196"></A>
7109 An array variable from which Bash reads the possible completions
7110 generated by a shell function invoked by the programmable completion
7111 facility (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
7112 Each array element contains one possible completion.
7113 <P>
7114
7115 <A NAME="IDX197"></A>
7116 <DT><CODE>COPROC</CODE>
7117 <DD><A NAME="IDX198"></A>
7118 An array variable created to hold the file descriptors
7119 for output from and input to an unnamed coprocess (see section <A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A>).
7120 <P>
7121
7122 <A NAME="IDX199"></A>
7123 <DT><CODE>DIRSTACK</CODE>
7124 <DD><A NAME="IDX200"></A>
7125 An array variable containing the current contents of the directory stack.
7126 Directories appear in the stack in the order they are displayed by the
7127 <CODE>dirs</CODE> builtin.
7128 Assigning to members of this array variable may be used to modify
7129 directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE>
7130 builtins must be used to add and remove directories.
7131 Assignment to this variable will not change the current directory.
7132 If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if
7133 it is subsequently reset.
7134 <P>
7135
7136 <A NAME="IDX201"></A>
7137 <DT><CODE>EMACS</CODE>
7138 <DD><A NAME="IDX202"></A>
7139 If Bash finds this variable in the environment when the shell
7140 starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an
7141 Emacs shell buffer and disables line editing.
7142 <P>
7143
7144 <A NAME="IDX203"></A>
7145 <DT><CODE>ENV</CODE>
7146 <DD><A NAME="IDX204"></A>
7147 Similar to <CODE>BASH_ENV</CODE>; used when the shell is invoked in
7148 POSIX Mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
7149 <P>
7150
7151 <A NAME="IDX205"></A>
7152 <DT><CODE>EUID</CODE>
7153 <DD><A NAME="IDX206"></A>
7154 The numeric effective user id of the current user.  This variable
7155 is readonly.
7156 <P>
7157
7158 <A NAME="IDX207"></A>
7159 <DT><CODE>FCEDIT</CODE>
7160 <DD><A NAME="IDX208"></A>
7161 The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE>
7162 builtin command.
7163 <P>
7164
7165 <A NAME="IDX209"></A>
7166 <DT><CODE>FIGNORE</CODE>
7167 <DD><A NAME="IDX210"></A>
7168 A colon-separated list of suffixes to ignore when performing
7169 filename completion.
7170 A filename whose suffix matches one of the entries in 
7171 <CODE>FIGNORE</CODE>
7172 is excluded from the list of matched filenames.  A sample
7173 value is <SAMP>`.o:~'</SAMP>
7174 <P>
7175
7176 <A NAME="IDX211"></A>
7177 <DT><CODE>FUNCNAME</CODE>
7178 <DD><A NAME="IDX212"></A>
7179 An array variable containing the names of all shell functions
7180 currently in the execution call stack.
7181 The element with index 0 is the name of any currently-executing
7182 shell function.
7183 The bottom-most element (the one with the highest index)
7184 is <CODE>"main"</CODE>.
7185 This variable exists only when a shell function is executing.
7186 Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status.
7187 If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if
7188 it is subsequently reset.
7189 <P>
7190
7191 This variable can be used with <CODE>BASH_LINENO</CODE> and <CODE>BASH_SOURCE</CODE>.
7192 Each element of <CODE>FUNCNAME</CODE> has corresponding elements in
7193 <CODE>BASH_LINENO</CODE> and <CODE>BASH_SOURCE</CODE> to describe the call stack.
7194 For instance, <CODE>${FUNCNAME[$i]}</CODE> was called from the file
7195 <CODE>${BASH_SOURCE[$i+1]}</CODE> at line number <CODE>${BASH_LINENO[$i]}</CODE>.
7196 The <CODE>caller</CODE> builtin displays the current call stack using this
7197 information.
7198 </P><P>
7199
7200 <A NAME="IDX213"></A>
7201 <DT><CODE>FUNCNEST</CODE>
7202 <DD><A NAME="IDX214"></A>
7203 If set to a numeric value greater than 0, defines a maximum function
7204 nesting level.  Function invocations that exceed this nesting level
7205 will cause the current command to abort.
7206 <P>
7207
7208 <A NAME="IDX215"></A>
7209 <DT><CODE>GLOBIGNORE</CODE>
7210 <DD><A NAME="IDX216"></A>
7211 A colon-separated list of patterns defining the set of filenames to
7212 be ignored by filename expansion.
7213 If a filename matched by a filename expansion pattern also matches one
7214 of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list
7215 of matches.
7216 <P>
7217
7218 <A NAME="IDX217"></A>
7219 <DT><CODE>GROUPS</CODE>
7220 <DD><A NAME="IDX218"></A>
7221 An array variable containing the list of groups of which the current    
7222 user is a member.
7223 Assignments to <CODE>GROUPS</CODE> have no effect and return an error status.
7224 If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is
7225 subsequently reset.
7226 <P>
7227
7228 <A NAME="IDX219"></A>
7229 <DT><CODE>histchars</CODE>
7230 <DD><A NAME="IDX220"></A>
7231 Up to three characters which control history expansion, quick
7232 substitution, and tokenization (see section <A HREF="bashref.html#SEC124">9.3 History Expansion</A>).
7233 The first character is the
7234 <VAR>history expansion</VAR> character, that is, the character which signifies the
7235 start of a history expansion, normally <SAMP>`!'</SAMP>.  The second character is the
7236 character which signifies `quick substitution' when seen as the first
7237 character on a line, normally <SAMP>`^'</SAMP>.  The optional third character is the
7238 character which indicates that the remainder of the line is a comment when
7239 found as the first character of a word, usually <SAMP>`#'</SAMP>.  The history
7240 comment character causes history substitution to be skipped for the
7241 remaining words on the line.  It does not necessarily cause the shell
7242 parser to treat the rest of the line as a comment.
7243 <P>
7244
7245 <A NAME="IDX221"></A>
7246 <DT><CODE>HISTCMD</CODE>
7247 <DD><A NAME="IDX222"></A>
7248 The history number, or index in the history list, of the current
7249 command.  If <CODE>HISTCMD</CODE> is unset, it loses its special properties,
7250 even if it is subsequently reset.
7251 <P>
7252
7253 <A NAME="IDX223"></A>
7254 <DT><CODE>HISTCONTROL</CODE>
7255 <DD><A NAME="IDX224"></A>
7256 A colon-separated list of values controlling how commands are saved on
7257 the history list.
7258 If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin
7259 with a space character are not saved in the history list.
7260 A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous
7261 history entry to not be saved.
7262 A value of <SAMP>`ignoreboth'</SAMP> is shorthand for
7263 <SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>.
7264 A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the
7265 current line to be removed from the history list before that line
7266 is saved.
7267 Any value not in the above list is ignored.
7268 If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value, 
7269 all lines read by the shell parser are saved on the history list, 
7270 subject to the value of <CODE>HISTIGNORE</CODE>.
7271 The second and subsequent lines of a multi-line compound command are
7272 not tested, and are added to the history regardless of the value of
7273 <CODE>HISTCONTROL</CODE>.
7274 <P>
7275
7276 <A NAME="IDX225"></A>
7277 <DT><CODE>HISTFILE</CODE>
7278 <DD><A NAME="IDX226"></A>
7279 The name of the file to which the command history is saved.  The
7280 default value is <TT>`~/.bash_history'</TT>.
7281 <P>
7282
7283 <A NAME="IDX227"></A>
7284 <DT><CODE>HISTFILESIZE</CODE>
7285 <DD><A NAME="IDX228"></A>
7286 The maximum number of lines contained in the history file.
7287 When this variable is assigned a value, the history file is truncated,
7288 if necessary, to contain no more than that number of lines
7289 by removing the oldest entries.
7290 The history file is also truncated to this size after
7291 writing it when a shell exits.
7292 If the value is 0, the history file is truncated to zero size.
7293 Non-numeric values and numeric values less than zero inhibit truncation.
7294 The shell sets the default value to the value of <CODE>HISTSIZE</CODE>
7295 after reading any startup files.
7296 <P>
7297
7298 <A NAME="IDX229"></A>
7299 <DT><CODE>HISTIGNORE</CODE>
7300 <DD><A NAME="IDX230"></A>
7301 A colon-separated list of patterns used to decide which command
7302 lines should be saved on the history list.  Each pattern is
7303 anchored at the beginning of the line and must match the complete
7304 line (no implicit <SAMP>`*'</SAMP> is appended).  Each pattern is tested
7305 against the line after the checks specified by <CODE>HISTCONTROL</CODE>
7306 are applied.  In addition to the normal shell pattern matching
7307 characters, <SAMP>`&#38;'</SAMP> matches the previous history line.  <SAMP>`&#38;'</SAMP>
7308 may be escaped using a backslash; the backslash is removed
7309 before attempting a match. 
7310 The second and subsequent lines of a multi-line compound command are
7311 not tested, and are added to the history regardless of the value of
7312 <CODE>HISTIGNORE</CODE>.
7313 <P>
7314
7315 <CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>.  A
7316 pattern of <SAMP>`&#38;'</SAMP> is identical to <CODE>ignoredups</CODE>, and a
7317 pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>. 
7318 Combining these two patterns, separating them with a colon,
7319 provides the functionality of <CODE>ignoreboth</CODE>. 
7320 </P><P>
7321
7322 <A NAME="IDX231"></A>
7323 <DT><CODE>HISTSIZE</CODE>
7324 <DD><A NAME="IDX232"></A>
7325 The maximum number of commands to remember on the history list.
7326 If the value is 0, commands are not saved in the history list.
7327 Numeric values less than zero result in every command being saved
7328 on the history list (there is no limit).
7329 The shell sets the default value to 500 after reading any startup files.
7330 <P>
7331
7332 <A NAME="IDX233"></A>
7333 <DT><CODE>HISTTIMEFORMAT</CODE>
7334 <DD><A NAME="IDX234"></A>
7335 If this variable is set and not null, its value is used as a format string
7336 for <VAR>strftime</VAR> to print the time stamp associated with each history
7337 entry displayed by the <CODE>history</CODE> builtin.
7338 If this variable is set, time stamps are written to the history file so
7339 they may be preserved across shell sessions.
7340 This uses the history comment character to distinguish timestamps from
7341 other history lines.
7342 <P>
7343
7344 <A NAME="IDX235"></A>
7345 <DT><CODE>HOSTFILE</CODE>
7346 <DD><A NAME="IDX236"></A>
7347 Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that
7348 should be read when the shell needs to complete a hostname.
7349 The list of possible hostname completions may be changed while the shell
7350 is running;
7351 the next time hostname completion is attempted after the
7352 value is changed, Bash adds the contents of the new file to the
7353 existing list.
7354 If <CODE>HOSTFILE</CODE> is set, but has no value, or does not name a readable file,
7355 Bash attempts to read 
7356 <TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions.
7357 When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared.
7358 <P>
7359
7360 <A NAME="IDX237"></A>
7361 <DT><CODE>HOSTNAME</CODE>
7362 <DD><A NAME="IDX238"></A>
7363 The name of the current host.
7364 <P>
7365
7366 <A NAME="IDX239"></A>
7367 <DT><CODE>HOSTTYPE</CODE>
7368 <DD><A NAME="IDX240"></A>
7369 A string describing the machine Bash is running on.
7370 <P>
7371
7372 <A NAME="IDX241"></A>
7373 <DT><CODE>IGNOREEOF</CODE>
7374 <DD><A NAME="IDX242"></A>
7375 Controls the action of the shell on receipt of an <CODE>EOF</CODE> character
7376 as the sole input.  If set, the value denotes the number
7377 of consecutive <CODE>EOF</CODE> characters that can be read as the
7378 first character on an input line
7379 before the shell will exit.  If the variable exists but does not
7380 have a numeric value (or has no value) then the default is 10.
7381 If the variable does not exist, then <CODE>EOF</CODE> signifies the end of 
7382 input to the shell.  This is only in effect for interactive shells.
7383 <P>
7384
7385 <A NAME="IDX243"></A>
7386 <DT><CODE>INPUTRC</CODE>
7387 <DD><A NAME="IDX244"></A>
7388 The name of the Readline initialization file, overriding the default
7389 of <TT>`~/.inputrc'</TT>.
7390 <P>
7391
7392 <A NAME="IDX245"></A>
7393 <DT><CODE>LANG</CODE>
7394 <DD><A NAME="IDX246"></A>
7395 Used to determine the locale category for any category not specifically
7396 selected with a variable starting with <CODE>LC_</CODE>.
7397 <P>
7398
7399 <A NAME="IDX247"></A>
7400 <DT><CODE>LC_ALL</CODE>
7401 <DD><A NAME="IDX248"></A>
7402 This variable overrides the value of <CODE>LANG</CODE> and any other
7403 <CODE>LC_</CODE> variable specifying a locale category.
7404 <P>
7405
7406 <A NAME="IDX249"></A>
7407 <DT><CODE>LC_COLLATE</CODE>
7408 <DD><A NAME="IDX250"></A>
7409 This variable determines the collation order used when sorting the
7410 results of filename expansion, and
7411 determines the behavior of range expressions, equivalence classes,
7412 and collating sequences within filename expansion and pattern matching
7413 (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>).
7414 <P>
7415
7416 <A NAME="IDX251"></A>
7417 <DT><CODE>LC_CTYPE</CODE>
7418 <DD><A NAME="IDX252"></A>
7419 This variable determines the interpretation of characters and the
7420 behavior of character classes within filename expansion and pattern
7421 matching (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>).
7422 <P>
7423
7424 <A NAME="IDX253"></A>
7425 <DT><CODE>LC_MESSAGES</CODE>
7426 <DD><A NAME="IDX254"></A>
7427 This variable determines the locale used to translate double-quoted
7428 strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
7429 <P>
7430
7431 <A NAME="IDX255"></A>
7432 <DT><CODE>LC_NUMERIC</CODE>
7433 <DD><A NAME="IDX256"></A>
7434 This variable determines the locale category used for number formatting.
7435 <P>
7436
7437 <A NAME="IDX257"></A>
7438 <DT><CODE>LINENO</CODE>
7439 <DD><A NAME="IDX258"></A>
7440 The line number in the script or shell function currently executing.
7441 <P>
7442
7443 <A NAME="IDX259"></A>
7444 <DT><CODE>LINES</CODE>
7445 <DD><A NAME="IDX260"></A>
7446 Used by the <CODE>select</CODE> command to determine the column length
7447 for printing selection lists.
7448 Automatically set if the <CODE>checkwinsize</CODE> option is enabled
7449 (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), or in an interactive shell upon receipt of a
7450 <CODE>SIGWINCH</CODE>.
7451 <P>
7452
7453 <A NAME="IDX261"></A>
7454 <DT><CODE>MACHTYPE</CODE>
7455 <DD><A NAME="IDX262"></A>
7456 A string that fully describes the system type on which Bash
7457 is executing, in the standard GNU <VAR>cpu-company-system</VAR> format.
7458 <P>
7459
7460 <A NAME="IDX263"></A>
7461 <DT><CODE>MAILCHECK</CODE>
7462 <DD><A NAME="IDX264"></A>
7463 How often (in seconds) that the shell should check for mail in the
7464 files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables.
7465 The default is 60 seconds.  When it is time to check
7466 for mail, the shell does so before displaying the primary prompt.
7467 If this variable is unset, or set to a value that is not a number
7468 greater than or equal to zero, the shell disables mail checking.
7469 <P>
7470
7471 <A NAME="IDX265"></A>
7472 <DT><CODE>MAPFILE</CODE>
7473 <DD><A NAME="IDX266"></A>
7474 An array variable created to hold the text read by the
7475 <CODE>mapfile</CODE> builtin when no variable name is supplied.
7476 <P>
7477
7478 <A NAME="IDX267"></A>
7479 <DT><CODE>OLDPWD</CODE>
7480 <DD><A NAME="IDX268"></A>
7481 The previous working directory as set by the <CODE>cd</CODE> builtin.
7482 <P>
7483
7484 <A NAME="IDX269"></A>
7485 <DT><CODE>OPTERR</CODE>
7486 <DD><A NAME="IDX270"></A>
7487 If set to the value 1, Bash displays error messages
7488 generated by the <CODE>getopts</CODE> builtin command.
7489 <P>
7490
7491 <A NAME="IDX271"></A>
7492 <DT><CODE>OSTYPE</CODE>
7493 <DD><A NAME="IDX272"></A>
7494 A string describing the operating system Bash is running on.
7495 <P>
7496
7497 <A NAME="IDX273"></A>
7498 <DT><CODE>PIPESTATUS</CODE>
7499 <DD><A NAME="IDX274"></A>
7500 An array variable (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>)
7501 containing a list of exit status values from the processes
7502 in the most-recently-executed foreground pipeline (which may
7503 contain only a single command).
7504 <P>
7505
7506 <A NAME="IDX275"></A>
7507 <DT><CODE>POSIXLY_CORRECT</CODE>
7508 <DD><A NAME="IDX276"></A>
7509 If this variable is in the environment when Bash starts, the shell
7510 enters POSIX mode (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>) before reading the
7511 startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied.
7512 If it is set while the shell is running, Bash enables POSIX mode,
7513 as if the command
7514 <TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>set -o posix</CODE>
7515 </pre></td></tr></table>had been executed.  
7516 <P>
7517
7518 <A NAME="IDX277"></A>
7519 <DT><CODE>PPID</CODE>
7520 <DD><A NAME="IDX278"></A>
7521 The process ID of the shell's parent process.  This variable
7522 is readonly.
7523 <P>
7524
7525 <A NAME="IDX279"></A>
7526 <DT><CODE>PROMPT_COMMAND</CODE>
7527 <DD><A NAME="IDX280"></A>
7528 If set, the value is interpreted as a command to execute
7529 before the printing of each primary prompt (<CODE>$PS1</CODE>).
7530 <P>
7531
7532 <A NAME="IDX281"></A>
7533 <DT><CODE>PROMPT_DIRTRIM</CODE>
7534 <DD><A NAME="IDX282"></A>
7535 If set to a number greater than zero, the value is used as the number of
7536 trailing directory components to retain when expanding the <CODE>\w</CODE> and
7537 <CODE>\W</CODE> prompt string escapes (see section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>).
7538 Characters removed are replaced with an ellipsis.
7539 <P>
7540
7541 <A NAME="IDX283"></A>
7542 <DT><CODE>PS3</CODE>
7543 <DD><A NAME="IDX284"></A>
7544 The value of this variable is used as the prompt for the
7545 <CODE>select</CODE> command.  If this variable is not set, the
7546 <CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP>
7547 <P>
7548
7549 <A NAME="IDX285"></A>
7550 <DT><CODE>PS4</CODE>
7551 <DD><A NAME="IDX286"></A>
7552 The value is the prompt printed before the command line is echoed
7553 when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
7554 The first character of <CODE>PS4</CODE> is replicated multiple times, as
7555 necessary, to indicate multiple levels of indirection.
7556 The default is <SAMP>`+ '</SAMP>.
7557 <P>
7558
7559 <A NAME="IDX287"></A>
7560 <DT><CODE>PWD</CODE>
7561 <DD><A NAME="IDX288"></A>
7562 The current working directory as set by the <CODE>cd</CODE> builtin.
7563 <P>
7564
7565 <A NAME="IDX289"></A>
7566 <DT><CODE>RANDOM</CODE>
7567 <DD><A NAME="IDX290"></A>
7568 Each time this parameter is referenced, a random integer
7569 between 0 and 32767 is generated.  Assigning a value to this
7570 variable seeds the random number generator.
7571 <P>
7572
7573 <A NAME="IDX291"></A>
7574 <DT><CODE>READLINE_LINE</CODE>
7575 <DD><A NAME="IDX292"></A>
7576 The contents of the Readline line buffer, for use
7577 with <SAMP>`bind -x'</SAMP> (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
7578 <P>
7579
7580 <A NAME="IDX293"></A>
7581 <DT><CODE>READLINE_POINT</CODE>
7582 <DD><A NAME="IDX294"></A>
7583 The position of the insertion point in the Readline line buffer, for use
7584 with <SAMP>`bind -x'</SAMP> (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
7585 <P>
7586
7587 <A NAME="IDX295"></A>
7588 <DT><CODE>REPLY</CODE>
7589 <DD><A NAME="IDX296"></A>
7590 The default variable for the <CODE>read</CODE> builtin.
7591 <P>
7592
7593 <A NAME="IDX297"></A>
7594 <DT><CODE>SECONDS</CODE>
7595 <DD><A NAME="IDX298"></A>
7596 This variable expands to the number of seconds since the
7597 shell was started.  Assignment to this variable resets
7598 the count to the value assigned, and the expanded value
7599 becomes the value assigned plus the number of seconds
7600 since the assignment.
7601 <P>
7602
7603 <A NAME="IDX299"></A>
7604 <DT><CODE>SHELL</CODE>
7605 <DD><A NAME="IDX300"></A>
7606 The full pathname to the shell is kept in this environment variable.
7607 If it is not set when the shell starts,
7608 Bash assigns to it the full pathname of the current user's login shell.
7609 <P>
7610
7611 <A NAME="IDX301"></A>
7612 <DT><CODE>SHELLOPTS</CODE>
7613 <DD><A NAME="IDX302"></A>
7614 A colon-separated list of enabled shell options.  Each word in
7615 the list is a valid argument for the <SAMP>`-o'</SAMP> option to the
7616 <CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
7617 The options appearing in <CODE>SHELLOPTS</CODE> are those reported
7618 as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>.
7619 If this variable is in the environment when Bash
7620 starts up, each shell option in the list will be enabled before
7621 reading any startup files.  This variable is readonly.
7622 <P>
7623
7624 <A NAME="IDX303"></A>
7625 <DT><CODE>SHLVL</CODE>
7626 <DD><A NAME="IDX304"></A>
7627 Incremented by one each time a new instance of Bash is started.  This is
7628 intended to be a count of how deeply your Bash shells are nested.
7629 <P>
7630
7631 <A NAME="IDX305"></A>
7632 <DT><CODE>TIMEFORMAT</CODE>
7633 <DD><A NAME="IDX306"></A>
7634 The value of this parameter is used as a format string specifying
7635 how the timing information for pipelines prefixed with the <CODE>time</CODE>
7636 reserved word should be displayed.
7637 The <SAMP>`%'</SAMP> character introduces an
7638 escape sequence that is expanded to a time value or other
7639 information.
7640 The escape sequences and their meanings are as
7641 follows; the braces denote optional portions. 
7642 <P>
7643
7644 <DL COMPACT>
7645
7646 <DT><CODE>%%</CODE>
7647 <DD>A literal <SAMP>`%'</SAMP>.
7648 <P>
7649
7650 <DT><CODE>%[<VAR>p</VAR>][l]R</CODE>
7651 <DD>The elapsed time in seconds. 
7652 <P>
7653
7654 <DT><CODE>%[<VAR>p</VAR>][l]U</CODE>
7655 <DD>The number of CPU seconds spent in user mode. 
7656 <P>
7657
7658 <DT><CODE>%[<VAR>p</VAR>][l]S</CODE>
7659 <DD>The number of CPU seconds spent in system mode. 
7660 <P>
7661
7662 <DT><CODE>%P</CODE>
7663 <DD>The CPU percentage, computed as (%U + %S) / %R. 
7664 </DL>
7665 <P>
7666
7667 The optional <VAR>p</VAR> is a digit specifying the precision, the number of
7668 fractional digits after a decimal point.
7669 A value of 0 causes no decimal point or fraction to be output.
7670 At most three places after the decimal point may be specified; values
7671 of <VAR>p</VAR> greater than 3 are changed to 3.
7672 If <VAR>p</VAR> is not specified, the value 3 is used. 
7673 </P><P>
7674
7675 The optional <CODE>l</CODE> specifies a longer format, including minutes, of
7676 the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s.
7677 The value of <VAR>p</VAR> determines whether or not the fraction is included. 
7678 </P><P>
7679
7680 If this variable is not set, Bash acts as if it had the value
7681 <TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE>
7682 </pre></td></tr></table>If the value is null, no timing information is displayed.
7683 A trailing newline is added when the format string is displayed.
7684 </P><P>
7685
7686 <A NAME="IDX307"></A>
7687 <DT><CODE>TMOUT</CODE>
7688 <DD><A NAME="IDX308"></A>
7689 If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the
7690 default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
7691 The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates
7692 if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming
7693 from a terminal.
7694 <P>
7695
7696 In an interactive shell, the value is interpreted as
7697 the number of seconds to wait for a line of input after issuing
7698 the primary prompt.
7699 Bash
7700 terminates after waiting for that number of seconds if a complete
7701 line of input does not arrive.
7702 </P><P>
7703
7704 <A NAME="IDX309"></A>
7705 <DT><CODE>TMPDIR</CODE>
7706 <DD><A NAME="IDX310"></A>
7707 If set, Bash uses its value as the name of a directory in which
7708 Bash creates temporary files for the shell's use.
7709 <P>
7710
7711 <A NAME="IDX311"></A>
7712 <DT><CODE>UID</CODE>
7713 <DD><A NAME="IDX312"></A>
7714 The numeric real user id of the current user.  This variable is readonly.
7715 <P>
7716
7717 </DL>
7718 <P>
7719
7720 <A NAME="Bash Features"></A>
7721 <HR SIZE="6">
7722 <A NAME="SEC69"></A>
7723 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7724 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt; </A>]</TD>
7725 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &gt; </A>]</TD>
7726 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &lt;&lt; </A>]</TD>
7727 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
7728 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
7729 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7730 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7731 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
7732 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7733 </TR></TABLE>
7734 <H1> 6. Bash Features </H1>
7735 <!--docid::SEC69::-->
7736 <P>
7737
7738 This chapter describes features unique to Bash.
7739 </P><P>
7740
7741 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
7742 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC70">6.1 Invoking Bash</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Command line options that you can give
7743                                 to Bash.</TD></TR>
7744 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">When and how Bash executes scripts.</TD></TR>
7745 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC79">6.3 Interactive Shells</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What an interactive shell is.</TD></TR>
7746 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Primitives used in composing expressions for
7747                                 the <CODE>test</CODE> builtin.</TD></TR>
7748 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR>
7749 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.6 Aliases</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR>
7750 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.7 Arrays</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR>
7751 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC87">6.8 The Directory Stack</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR>
7752 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Customizing the various prompt strings.</TD></TR>
7753 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR>
7754 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what
7755                                 the POSIX standard specifies.</TD></TR>
7756 </TABLE></BLOCKQUOTE>
7757 <P>
7758
7759 <A NAME="Invoking Bash"></A>
7760 <HR SIZE="6">
7761 <A NAME="SEC70"></A>
7762 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7763 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &lt; </A>]</TD>
7764 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> &gt; </A>]</TD>
7765 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &lt;&lt; </A>]</TD>
7766 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
7767 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
7768 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7769 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7770 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
7771 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7772 </TR></TABLE>
7773 <H2> 6.1 Invoking Bash </H2>
7774 <!--docid::SEC70::-->
7775 <P>
7776
7777 <TABLE><tr><td>&nbsp;</td><td class=example><pre>bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
7778 bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>]
7779 bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
7780 </pre></td></tr></table></P><P>
7781
7782 All of the single-character options used with the <CODE>set</CODE> builtin
7783 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>) can be used as options when the shell is invoked.
7784 In addition, there are several multi-character
7785 options that you can use.  These options must appear on the command
7786 line before the single-character options to be recognized. 
7787 </P><P>
7788
7789 <DL COMPACT>
7790 <DT><CODE>--debugger</CODE>
7791 <DD>Arrange for the debugger profile to be executed before the shell
7792 starts.  Turns on extended debugging mode (see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
7793 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
7794 builtin).
7795 <P>
7796
7797 <DT><CODE>--dump-po-strings</CODE>
7798 <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
7799 is printed on the standard output
7800 in the GNU <CODE>gettext</CODE> PO (portable object) file format.
7801 Equivalent to <SAMP>`-D'</SAMP> except for the output format.
7802 <P>
7803
7804 <DT><CODE>--dump-strings</CODE>
7805 <DD>Equivalent to <SAMP>`-D'</SAMP>.
7806 <P>
7807
7808 <DT><CODE>--help</CODE>
7809 <DD>Display a usage message on standard output and exit successfully.
7810 <P>
7811
7812 <DT><CODE>--init-file <VAR>filename</VAR></CODE>
7813 <DD><DT><CODE>--rcfile <VAR>filename</VAR></CODE>
7814 <DD>Execute commands from <VAR>filename</VAR> (instead of <TT>`~/.bashrc'</TT>)
7815 in an interactive shell.
7816 <P>
7817
7818 <DT><CODE>--login</CODE>
7819 <DD>Equivalent to <SAMP>`-l'</SAMP>.
7820 <P>
7821
7822 <DT><CODE>--noediting</CODE>
7823 <DD>Do not use the GNU Readline library (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>)
7824 to read  command lines when the shell is interactive.
7825 <P>
7826
7827 <DT><CODE>--noprofile</CODE>
7828 <DD>Don't load the system-wide startup file <TT>`/etc/profile'</TT>
7829 or any of the personal initialization files
7830 <TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT>
7831 when Bash is invoked as a login shell.
7832 <P>
7833
7834 <DT><CODE>--norc</CODE>
7835 <DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an
7836 interactive shell.  This is on by default if the shell is
7837 invoked as <CODE>sh</CODE>.
7838 <P>
7839
7840 <DT><CODE>--posix</CODE>
7841 <DD>Change the behavior of Bash where the default operation differs
7842 from the POSIX standard to match the standard.  This
7843 is intended to make Bash behave as a strict superset of that
7844 standard.  See section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>, for a description of the Bash
7845 POSIX mode.
7846 <P>
7847
7848 <DT><CODE>--restricted</CODE>
7849 <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>).
7850 <P>
7851
7852 <DT><CODE>--verbose</CODE>
7853 <DD>Equivalent to <SAMP>`-v'</SAMP>.  Print shell input lines as they're read.
7854 <P>
7855
7856 <DT><CODE>--version</CODE>
7857 <DD>Show version information for this instance of
7858 Bash on the standard output and exit successfully.
7859 </DL>
7860 <P>
7861
7862 There are several single-character options that may be supplied at
7863 invocation which are not available with the <CODE>set</CODE> builtin.
7864 </P><P>
7865
7866 <DL COMPACT>
7867 <DT><CODE>-c</CODE>
7868 <DD>Read and execute commands from the first non-option <VAR>argument</VAR>
7869 after processing the options, then exit. 
7870 Any remaining arguments are assigned to the
7871 positional parameters, starting with <CODE>$0</CODE>.
7872 <P>
7873
7874 <DT><CODE>-i</CODE>
7875 <DD>Force the shell to run interactively.  Interactive shells are
7876 described in <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>.
7877 <P>
7878
7879 <DT><CODE>-l</CODE>
7880 <DD>Make this shell act as if it had been directly invoked by login.
7881 When the shell is interactive, this is equivalent to starting a
7882 login shell with <SAMP>`exec -l bash'</SAMP>.
7883 When the shell is not interactive, the login shell startup files will
7884 be executed.
7885 <SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP>
7886 will replace the current shell with a Bash login shell.
7887 See section <A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>, for a description of the special behavior
7888 of a login shell.
7889 <P>
7890
7891 <DT><CODE>-r</CODE>
7892 <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>).
7893 <P>
7894
7895 <DT><CODE>-s</CODE>
7896 <DD>If this option is present, or if no arguments remain after option
7897 processing, then commands are read from the standard input.
7898 This option allows the positional parameters to be set
7899 when invoking an interactive shell.
7900 <P>
7901
7902 <DT><CODE>-D</CODE>
7903 <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
7904 is printed on the standard output.
7905 These are the strings that
7906 are subject to language translation when the current locale
7907 is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
7908 This implies the <SAMP>`-n'</SAMP> option; no commands will be executed.
7909 <P>
7910
7911 <DT><CODE>[-+]O [<VAR>shopt_option</VAR>]</CODE>
7912 <DD><VAR>shopt_option</VAR> is one of the shell options accepted by the
7913 <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
7914 If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option;
7915 <SAMP>`+O'</SAMP> unsets it.  
7916 If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell
7917 options accepted by <CODE>shopt</CODE> are printed on the standard output.
7918 If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format
7919 that may be reused as input.
7920 <P>
7921
7922 <DT><CODE>--</CODE>
7923 <DD>A <CODE>--</CODE> signals the end of options and disables further option
7924 processing.
7925 Any arguments after the <CODE>--</CODE> are treated as filenames and arguments.
7926 </DL>
7927 <P>
7928
7929 <A NAME="IDX313"></A>
7930 A <EM>login</EM> shell is one whose first character of argument zero is
7931 <SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option.
7932 </P><P>
7933
7934 <A NAME="IDX314"></A>
7935 An <EM>interactive</EM> shell is one started without non-option arguments,
7936 unless <SAMP>`-s'</SAMP> is specified,
7937 without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both
7938 connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one
7939 started with the <SAMP>`-i'</SAMP> option.  See section <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>, for more
7940 information.
7941 </P><P>
7942
7943 If arguments remain after option processing, and neither the
7944 <SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP>
7945 option has been supplied, the first argument is assumed to
7946 be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>).
7947 When Bash is invoked in this fashion, <CODE>$0</CODE>
7948 is set to the name of the file, and the positional parameters
7949 are set to the remaining arguments.
7950 Bash reads and executes commands from this file, then exits.   
7951 Bash's exit status is the exit status of the last command executed
7952 in the script.  If no commands are executed, the exit status is 0.
7953 </P><P>
7954
7955 <A NAME="Bash Startup Files"></A>
7956 <HR SIZE="6">
7957 <A NAME="SEC71"></A>
7958 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7959 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &lt; </A>]</TD>
7960 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> &gt; </A>]</TD>
7961 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> &lt;&lt; </A>]</TD>
7962 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
7963 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
7964 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7965 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7966 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
7967 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7968 </TR></TABLE>
7969 <H2> 6.2 Bash Startup Files </H2>
7970 <!--docid::SEC71::-->
7971 <P>
7972
7973 This section describes how Bash executes its startup files.
7974 If any of the files exist but cannot be read, Bash reports an error.
7975 Tildes are expanded in filenames as described above under
7976 Tilde Expansion (see section <A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>).
7977 </P><P>
7978
7979 Interactive shells are described in <A HREF="bashref.html#SEC79">6.3 Interactive Shells</A>.
7980 </P><P>
7981
7982 <A NAME="SEC72"></A>
7983 <H4> Invoked as an interactive login shell, or with <SAMP>`--login'</SAMP> </H4>
7984 <!--docid::SEC72::-->
7985 <P>
7986
7987 When Bash is invoked as an interactive login shell, or as a
7988 non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and
7989 executes commands from the file <TT>`/etc/profile'</TT>, if that file exists.
7990 After reading that file, it looks for <TT>`~/.bash_profile'</TT>,
7991 <TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads
7992 and executes commands from the first one that exists and is readable.
7993 The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to
7994 inhibit this behavior.
7995 </P><P>
7996
7997 When a login shell exits, Bash reads and executes commands from
7998 the file <TT>`~/.bash_logout'</TT>, if it exists.
7999 </P><P>
8000
8001 <A NAME="SEC73"></A>
8002 <H4> Invoked as an interactive non-login shell </H4>
8003 <!--docid::SEC73::-->
8004 <P>
8005
8006 When an interactive shell that is not a login shell is started, Bash
8007 reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists.
8008 This may be inhibited by using the <SAMP>`--norc'</SAMP> option.
8009 The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and
8010 execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>.
8011 </P><P>
8012
8013 So, typically, your <TT>`~/.bash_profile'</TT> contains the line
8014 <TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE>
8015 </pre></td></tr></table>after (or before) any login-specific initializations.
8016 </P><P>
8017
8018 <A NAME="SEC74"></A>
8019 <H4> Invoked non-interactively </H4>
8020 <!--docid::SEC74::-->
8021 <P>
8022
8023 When Bash is started non-interactively, to run a shell script,
8024 for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment,
8025 expands its value if it appears there, and uses the expanded value as
8026 the name of a file to read and execute.  Bash behaves as if the
8027 following command were executed:
8028 <TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE>
8029 </pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the
8030 filename.
8031 </P><P>
8032
8033 As noted above, if a non-interactive shell is invoked with the
8034 <SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the
8035 login shell startup files. 
8036 </P><P>
8037
8038 <A NAME="SEC75"></A>
8039 <H4> Invoked with name <CODE>sh</CODE> </H4>
8040 <!--docid::SEC75::-->
8041 <P>
8042
8043 If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the
8044 startup behavior of historical versions of <CODE>sh</CODE> as closely as
8045 possible, while conforming to the POSIX standard as well.
8046 </P><P>
8047
8048 When invoked as an interactive login shell, or as a non-interactive
8049 shell with the <SAMP>`--login'</SAMP> option, it first attempts to read
8050 and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in
8051 that order.
8052 The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior.
8053 When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash
8054 looks for the variable <CODE>ENV</CODE>, expands its value if it is defined,
8055 and uses the expanded value as the name of a file to read and execute.
8056 Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute
8057 commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has
8058 no effect.
8059 A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt
8060 to read any other startup files.
8061 </P><P>
8062
8063 When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after
8064 the startup files are read.
8065 </P><P>
8066
8067 <A NAME="SEC76"></A>
8068 <H4> Invoked in POSIX mode </H4>
8069 <!--docid::SEC76::-->
8070 <P>
8071
8072 When Bash is started in POSIX mode, as with the
8073 <SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard
8074 for startup files.
8075 In this mode, interactive shells expand the <CODE>ENV</CODE> variable
8076 and commands are read and executed from the file whose name is the
8077 expanded value.
8078 No other startup files are read.
8079 </P><P>
8080
8081 <A NAME="SEC77"></A>
8082 <H4> Invoked by remote shell daemon </H4>
8083 <!--docid::SEC77::-->
8084 <P>
8085
8086 Bash attempts to determine when it is being run with its standard input
8087 connected to a network connection, as when executed by the remote shell
8088 daemon, usually <CODE>rshd</CODE>, or the secure shell daemon <CODE>sshd</CODE>.
8089 If Bash determines it is being run in
8090 this fashion, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that
8091 file exists and is readable.
8092 It will not do this if invoked as <CODE>sh</CODE>.
8093 The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the
8094 <SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but
8095 neither <CODE>rshd</CODE> nor <CODE>sshd</CODE> generally invoke the shell with those
8096 options or allow them to be specified.
8097 </P><P>
8098
8099 <A NAME="SEC78"></A>
8100 <H4> Invoked with unequal effective and real UID/GIDs </H4>
8101 <!--docid::SEC78::-->
8102 <P>
8103
8104 If Bash is started with the effective user (group) id not equal to the
8105 real user (group) id, and the <SAMP>`-p'</SAMP> option is not supplied, no startup
8106 files are read, shell functions are not inherited from the environment,
8107 the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE>, and <CODE>GLOBIGNORE</CODE>
8108 variables, if they appear in the environment, are ignored, and the effective
8109 user id is set to the real user id.
8110 If the <SAMP>`-p'</SAMP> option is supplied at invocation, the startup behavior is
8111 the same, but the effective user id is not reset.
8112 </P><P>
8113
8114 <A NAME="Interactive Shells"></A>
8115 <HR SIZE="6">
8116 <A NAME="SEC79"></A>
8117 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8118 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> &lt; </A>]</TD>
8119 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> &gt; </A>]</TD>
8120 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt;&lt; </A>]</TD>
8121 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8122 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &gt;&gt; </A>]</TD>
8123 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8124 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8125 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8126 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8127 </TR></TABLE>
8128 <H2> 6.3 Interactive Shells </H2>
8129 <!--docid::SEC79::-->
8130 <P>
8131
8132 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
8133 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.3.1 What is an Interactive Shell?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What determines whether a shell is Interactive.</TD></TR>
8134 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.3.2 Is this Shell Interactive?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to tell if a shell is interactive.</TD></TR>
8135 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC82">6.3.3 Interactive Shell Behavior</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR>
8136 </TABLE></BLOCKQUOTE>
8137 <P>
8138
8139 <A NAME="What is an Interactive Shell?"></A>
8140 <HR SIZE="6">
8141 <A NAME="SEC80"></A>
8142 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8143 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> &lt; </A>]</TD>
8144 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &gt; </A>]</TD>
8145 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt;&lt; </A>]</TD>
8146 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> Up </A>]</TD>
8147 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &gt;&gt; </A>]</TD>
8148 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8149 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8150 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8151 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8152 </TR></TABLE>
8153 <H3> 6.3.1 What is an Interactive Shell? </H3>
8154 <!--docid::SEC80::-->
8155 <P>
8156
8157 An interactive shell
8158 is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is
8159 specified, without specifying the <SAMP>`-c'</SAMP> option, and
8160 whose input and error output are both
8161 connected to terminals (as determined by <CODE>isatty(3)</CODE>),
8162 or one started with the <SAMP>`-i'</SAMP> option.
8163 </P><P>
8164
8165 An interactive shell generally reads from and writes to a user's
8166 terminal.
8167 </P><P>
8168
8169 The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters
8170 when an interactive shell is started.
8171 </P><P>
8172
8173 <A NAME="Is this Shell Interactive?"></A>
8174 <HR SIZE="6">
8175 <A NAME="SEC81"></A>
8176 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8177 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> &lt; </A>]</TD>
8178 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt; </A>]</TD>
8179 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt;&lt; </A>]</TD>
8180 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> Up </A>]</TD>
8181 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &gt;&gt; </A>]</TD>
8182 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8183 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8184 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8185 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8186 </TR></TABLE>
8187 <H3> 6.3.2 Is this Shell Interactive? </H3>
8188 <!--docid::SEC81::-->
8189 <P>
8190
8191 To determine within a startup script whether or not Bash is
8192 running interactively,
8193 test the value of the <SAMP>`-'</SAMP> special parameter.
8194 It contains <CODE>i</CODE> when the shell is interactive.  For example:
8195 </P><P>
8196
8197 <TABLE><tr><td>&nbsp;</td><td class=example><pre>case "$-" in
8198 *i*)    echo This shell is interactive ;;
8199 *)      echo This shell is not interactive ;;
8200 esac
8201 </pre></td></tr></table></P><P>
8202
8203 Alternatively, startup scripts may examine the variable
8204 <CODE>PS1</CODE>; it is unset in non-interactive shells, and set in
8205 interactive shells.  Thus:
8206 </P><P>
8207
8208 <TABLE><tr><td>&nbsp;</td><td class=example><pre>if [ -z "$PS1" ]; then
8209         echo This shell is not interactive
8210 else
8211         echo This shell is interactive
8212 fi
8213 </pre></td></tr></table></P><P>
8214
8215 <A NAME="Interactive Shell Behavior"></A>
8216 <HR SIZE="6">
8217 <A NAME="SEC82"></A>
8218 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8219 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &lt; </A>]</TD>
8220 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &gt; </A>]</TD>
8221 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt;&lt; </A>]</TD>
8222 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> Up </A>]</TD>
8223 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &gt;&gt; </A>]</TD>
8224 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8225 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8226 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8227 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8228 </TR></TABLE>
8229 <H3> 6.3.3 Interactive Shell Behavior </H3>
8230 <!--docid::SEC82::-->
8231 <P>
8232
8233 When the shell is running interactively, it changes its behavior in
8234 several ways.
8235 </P><P>
8236
8237 <OL>
8238 <LI>
8239 Startup files are read and executed as described in <A HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>.
8240 <P>
8241
8242 <LI>
8243 Job Control (see section <A HREF="bashref.html#SEC92">7. Job Control</A>) is enabled by default.  When job
8244 control is in effect, Bash ignores the keyboard-generated job control
8245 signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
8246 <P>
8247
8248 <LI>
8249 Bash expands and displays <CODE>PS1</CODE> before reading the first line
8250 of a command, and expands and displays <CODE>PS2</CODE> before reading the
8251 second and subsequent lines of a multi-line command.
8252 <P>
8253
8254 <LI>
8255 Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command
8256 before printing the primary prompt, <CODE>$PS1</CODE>
8257 (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
8258 <P>
8259
8260 <LI>
8261 Readline (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>) is used to read commands from
8262 the user's terminal.
8263 <P>
8264
8265 <LI>
8266 Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE>
8267 instead of exiting immediately when it receives an <CODE>EOF</CODE> on its
8268 standard input when reading a command (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
8269 <P>
8270
8271 <LI>
8272 Command history (see section <A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>)
8273 and history expansion (see section <A HREF="bashref.html#SEC124">9.3 History Expansion</A>)
8274 are enabled by default.
8275 Bash will save the command history to the file named by <CODE>$HISTFILE</CODE>
8276 when a shell with history enabled exits.
8277 <P>
8278
8279 <LI>
8280 Alias expansion (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>) is performed by default.
8281 <P>
8282
8283 <LI>
8284 In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE>
8285 (see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
8286 <P>
8287
8288 <LI>
8289 In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled
8290 ((see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
8291 <CODE>SIGINT</CODE> will interrupt some shell builtins.
8292 <P>
8293
8294 <LI>
8295 An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit
8296 if the <CODE>huponexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC57">3.7.6 Signals</A>).
8297 <P>
8298
8299 <LI>
8300 The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has
8301 no effect (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
8302 <P>
8303
8304 <LI>
8305 Bash will check for mail periodically, depending on the values of the
8306 <CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables
8307 (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
8308 <P>
8309
8310 <LI>
8311 Expansion errors due to references to unbound shell variables after
8312 <SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit
8313 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
8314 <P>
8315
8316 <LI>
8317 The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset
8318 or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions
8319 (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
8320 <P>
8321
8322 <LI>
8323 Redirection errors encountered by shell builtins will not cause the
8324 shell to exit.
8325 <P>
8326
8327 <LI>
8328 When running in POSIX mode, a special builtin returning an error
8329 status will not cause the shell to exit (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
8330 <P>
8331
8332 <LI>
8333 A failed <CODE>exec</CODE> will not cause the shell to exit
8334 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
8335 <P>
8336
8337 <LI>
8338 Parser syntax errors will not cause the shell to exit.
8339 <P>
8340
8341 <LI>
8342 Simple spelling correction for directory arguments to the <CODE>cd</CODE>
8343 builtin is enabled by default (see the description of the <CODE>cdspell</CODE>
8344 option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
8345 <P>
8346
8347 <LI>
8348 The shell will check the value of the <CODE>TMOUT</CODE> variable and exit
8349 if a command is not read within the specified number of seconds after
8350 printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
8351 <P>
8352
8353 </OL>
8354 <P>
8355
8356 <A NAME="Bash Conditional Expressions"></A>
8357 <HR SIZE="6">
8358 <A NAME="SEC83"></A>
8359 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8360 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt; </A>]</TD>
8361 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &gt; </A>]</TD>
8362 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &lt;&lt; </A>]</TD>
8363 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8364 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
8365 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8366 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8367 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8368 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8369 </TR></TABLE>
8370 <H2> 6.4 Bash Conditional Expressions </H2>
8371 <!--docid::SEC83::-->
8372 <P>
8373
8374 Conditional expressions are used by the <CODE>[[</CODE> compound command
8375 and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands.
8376 </P><P>
8377
8378 Expressions may be unary or binary.
8379 Unary expressions are often used to examine the status of a file.
8380 There are string operators and numeric comparison operators as well.
8381 If the <VAR>file</VAR> argument to one of the primaries is of the form
8382 <TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked.
8383 If the <VAR>file</VAR> argument to one of the primaries is one of
8384 <TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file
8385 descriptor 0, 1, or 2, respectively, is checked.
8386 </P><P>
8387
8388 When used with <CODE>[[</CODE>, the <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
8389 lexicographically using the current locale.
8390 The <CODE>test</CODE> command uses ASCII ordering.
8391 </P><P>
8392
8393 Unless otherwise specified, primaries that operate on files follow symbolic
8394 links and operate on the target of the link, rather than the link itself.
8395 </P><P>
8396
8397 <DL COMPACT>
8398 <DT><CODE>-a <VAR>file</VAR></CODE>
8399 <DD>True if <VAR>file</VAR> exists.
8400 <P>
8401
8402 <DT><CODE>-b <VAR>file</VAR></CODE>
8403 <DD>True if <VAR>file</VAR> exists and is a block special file.
8404 <P>
8405
8406 <DT><CODE>-c <VAR>file</VAR></CODE>
8407 <DD>True if <VAR>file</VAR> exists and is a character special file.
8408 <P>
8409
8410 <DT><CODE>-d <VAR>file</VAR></CODE>
8411 <DD>True if <VAR>file</VAR> exists and is a directory.
8412 <P>
8413
8414 <DT><CODE>-e <VAR>file</VAR></CODE>
8415 <DD>True if <VAR>file</VAR> exists.
8416 <P>
8417
8418 <DT><CODE>-f <VAR>file</VAR></CODE>
8419 <DD>True if <VAR>file</VAR> exists and is a regular file.
8420 <P>
8421
8422 <DT><CODE>-g <VAR>file</VAR></CODE>
8423 <DD>True if <VAR>file</VAR> exists and its set-group-id bit is set.
8424 <P>
8425
8426 <DT><CODE>-h <VAR>file</VAR></CODE>
8427 <DD>True if <VAR>file</VAR> exists and is a symbolic link.
8428 <P>
8429
8430 <DT><CODE>-k <VAR>file</VAR></CODE>
8431 <DD>True if <VAR>file</VAR> exists and its "sticky" bit is set.
8432 <P>
8433
8434 <DT><CODE>-p <VAR>file</VAR></CODE>
8435 <DD>True if <VAR>file</VAR> exists and is a named pipe (FIFO).
8436 <P>
8437
8438 <DT><CODE>-r <VAR>file</VAR></CODE>
8439 <DD>True if <VAR>file</VAR> exists and is readable.
8440 <P>
8441
8442 <DT><CODE>-s <VAR>file</VAR></CODE>
8443 <DD>True if <VAR>file</VAR> exists and has a size greater than zero.
8444 <P>
8445
8446 <DT><CODE>-t <VAR>fd</VAR></CODE>
8447 <DD>True if file descriptor <VAR>fd</VAR> is open and refers to a terminal.
8448 <P>
8449
8450 <DT><CODE>-u <VAR>file</VAR></CODE>
8451 <DD>True if <VAR>file</VAR> exists and its set-user-id bit is set.
8452 <P>
8453
8454 <DT><CODE>-w <VAR>file</VAR></CODE>
8455 <DD>True if <VAR>file</VAR> exists and is writable.
8456 <P>
8457
8458 <DT><CODE>-x <VAR>file</VAR></CODE>
8459 <DD>True if <VAR>file</VAR> exists and is executable.
8460 <P>
8461
8462 <DT><CODE>-G <VAR>file</VAR></CODE>
8463 <DD>True if <VAR>file</VAR> exists and is owned by the effective group id.
8464 <P>
8465
8466 <DT><CODE>-L <VAR>file</VAR></CODE>
8467 <DD>True if <VAR>file</VAR> exists and is a symbolic link.
8468 <P>
8469
8470 <DT><CODE>-N <VAR>file</VAR></CODE>
8471 <DD>True if <VAR>file</VAR> exists and has been modified since it was last read.
8472 <P>
8473
8474 <DT><CODE>-O <VAR>file</VAR></CODE>
8475 <DD>True if <VAR>file</VAR> exists and is owned by the effective user id.
8476 <P>
8477
8478 <DT><CODE>-S <VAR>file</VAR></CODE>
8479 <DD>True if <VAR>file</VAR> exists and is a socket.
8480 <P>
8481
8482 <DT><CODE><VAR>file1</VAR> -ef <VAR>file2</VAR></CODE>
8483 <DD>True if <VAR>file1</VAR> and <VAR>file2</VAR> refer to the same device and
8484 inode numbers.
8485 <P>
8486
8487 <DT><CODE><VAR>file1</VAR> -nt <VAR>file2</VAR></CODE>
8488 <DD>True if <VAR>file1</VAR> is newer (according to modification date)
8489 than <VAR>file2</VAR>, or if <VAR>file1</VAR> exists and <VAR>file2</VAR> does not.
8490 <P>
8491
8492 <DT><CODE><VAR>file1</VAR> -ot <VAR>file2</VAR></CODE>
8493 <DD>True if <VAR>file1</VAR> is older than <VAR>file2</VAR>,
8494 or if <VAR>file2</VAR> exists and <VAR>file1</VAR> does not.
8495 <P>
8496
8497 <DT><CODE>-o <VAR>optname</VAR></CODE>
8498 <DD>True if the shell option <VAR>optname</VAR> is enabled.
8499 The list of options appears in the description of the <SAMP>`-o'</SAMP>
8500 option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
8501 <P>
8502
8503 <DT><CODE>-v <VAR>varname</VAR></CODE>
8504 <DD>True if the shell variable <VAR>varname</VAR> is set (has been assigned a value).
8505 <P>
8506
8507 <DT><CODE>-R <VAR>varname</VAR></CODE>
8508 <DD>True if the shell variable <VAR>varname</VAR> is set and is a name reference.
8509 <P>
8510
8511 <DT><CODE>-z <VAR>string</VAR></CODE>
8512 <DD>True if the length of <VAR>string</VAR> is zero.
8513 <P>
8514
8515 <DT><CODE>-n <VAR>string</VAR></CODE>
8516 <DD><DT><CODE><VAR>string</VAR></CODE>
8517 <DD>True if the length of <VAR>string</VAR> is non-zero.
8518 <P>
8519
8520 <DT><CODE><VAR>string1</VAR> == <VAR>string2</VAR></CODE>
8521 <DD><DT><CODE><VAR>string1</VAR> = <VAR>string2</VAR></CODE>
8522 <DD>True if the strings are equal.
8523 When used with the <CODE>[[</CODE> command, this performs pattern matching as
8524 described above (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
8525 <P>
8526
8527 <SAMP>`='</SAMP> should be used with the <CODE>test</CODE> command for POSIX conformance.
8528 </P><P>
8529
8530 <DT><CODE><VAR>string1</VAR> != <VAR>string2</VAR></CODE>
8531 <DD>True if the strings are not equal.
8532 <P>
8533
8534 <DT><CODE><VAR>string1</VAR> &#60; <VAR>string2</VAR></CODE>
8535 <DD>True if <VAR>string1</VAR> sorts before <VAR>string2</VAR> lexicographically.
8536 <P>
8537
8538 <DT><CODE><VAR>string1</VAR> &#62; <VAR>string2</VAR></CODE>
8539 <DD>True if <VAR>string1</VAR> sorts after <VAR>string2</VAR> lexicographically.
8540 <P>
8541
8542 <DT><CODE><VAR>arg1</VAR> OP <VAR>arg2</VAR></CODE>
8543 <DD><CODE>OP</CODE> is one of 
8544 <SAMP>`-eq'</SAMP>, <SAMP>`-ne'</SAMP>, <SAMP>`-lt'</SAMP>, <SAMP>`-le'</SAMP>, <SAMP>`-gt'</SAMP>, or <SAMP>`-ge'</SAMP>.
8545 These arithmetic binary operators return true if <VAR>arg1</VAR>
8546 is equal to, not equal to, less than, less than or equal to,
8547 greater than, or greater than or equal to <VAR>arg2</VAR>,
8548 respectively.  <VAR>Arg1</VAR> and <VAR>arg2</VAR>
8549 may be positive or negative integers.
8550 </DL>
8551 <P>
8552
8553 <A NAME="Shell Arithmetic"></A>
8554 <HR SIZE="6">
8555 <A NAME="SEC84"></A>
8556 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8557 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt; </A>]</TD>
8558 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &gt; </A>]</TD>
8559 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
8562 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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#SEC142">Index</A>]</TD>
8565 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8566 </TR></TABLE>
8567 <H2> 6.5 Shell Arithmetic </H2>
8568 <!--docid::SEC84::-->
8569 <P>
8570
8571 The shell allows arithmetic expressions to be evaluated, as one of
8572 the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option
8573 to the <CODE>declare</CODE> builtins.
8574 </P><P>
8575
8576 Evaluation is done in fixed-width integers with no check for overflow,
8577 though division by 0 is trapped and flagged as an error.
8578 The operators and their precedence, associativity, and values
8579 are the same as in the C language.
8580 The following list of operators is grouped into levels of
8581 equal-precedence operators.
8582 The levels are listed in order of decreasing precedence. 
8583 </P><P>
8584
8585 <DL COMPACT>
8586
8587 <DT><CODE><VAR>id</VAR>++ <VAR>id</VAR>--</CODE>
8588 <DD>variable post-increment and post-decrement 
8589 <P>
8590
8591 <DT><CODE>++<VAR>id</VAR> --<VAR>id</VAR></CODE>
8592 <DD>variable pre-increment and pre-decrement
8593 <P>
8594
8595 <DT><CODE>- +</CODE>
8596 <DD>unary minus and plus
8597 <P>
8598
8599 <DT><CODE>! ~</CODE>
8600 <DD>logical and bitwise negation
8601 <P>
8602
8603 <DT><CODE>**</CODE>
8604 <DD>exponentiation
8605 <P>
8606
8607 <DT><CODE>* / %</CODE>
8608 <DD>multiplication, division, remainder
8609 <P>
8610
8611 <DT><CODE>+ -</CODE>
8612 <DD>addition, subtraction
8613 <P>
8614
8615 <DT><CODE>&#60;&#60; &#62;&#62;</CODE>
8616 <DD>left and right bitwise shifts
8617 <P>
8618
8619 <DT><CODE>&#60;= &#62;= &#60; &#62;</CODE>
8620 <DD>comparison
8621 <P>
8622
8623 <DT><CODE>== !=</CODE>
8624 <DD>equality and inequality
8625 <P>
8626
8627 <DT><CODE>&#38;</CODE>
8628 <DD>bitwise AND
8629 <P>
8630
8631 <DT><CODE>^</CODE>
8632 <DD>bitwise exclusive OR
8633 <P>
8634
8635 <DT><CODE>|</CODE>
8636 <DD>bitwise OR
8637 <P>
8638
8639 <DT><CODE>&#38;&#38;</CODE>
8640 <DD>logical AND
8641 <P>
8642
8643 <DT><CODE>||</CODE>
8644 <DD>logical OR
8645 <P>
8646
8647 <DT><CODE>expr ? expr : expr</CODE>
8648 <DD>conditional operator
8649 <P>
8650
8651 <DT><CODE>= *= /= %= += -= &#60;&#60;= &#62;&#62;= &#38;= ^= |=</CODE>
8652 <DD>assignment
8653 <P>
8654
8655 <DT><CODE>expr1 , expr2</CODE>
8656 <DD>comma
8657 </DL>
8658 <P>
8659
8660 Shell variables are allowed as operands; parameter expansion is
8661 performed before the expression is evaluated. 
8662 Within an expression, shell variables may also be referenced by name
8663 without using the parameter expansion syntax.
8664 A shell variable that is null or unset evaluates to 0 when referenced
8665 by name without using the parameter expansion syntax.
8666 The value of a variable is evaluated as an arithmetic expression
8667 when it is referenced, or when a variable which has been given the  
8668 <VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value.
8669 A null value evaluates to 0.
8670 A shell variable need not have its <VAR>integer</VAR> attribute turned on
8671 to be used in an expression.
8672 </P><P>
8673
8674 Constants with a leading 0 are interpreted as octal numbers.
8675 A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal.  Otherwise,
8676 numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where the optional <VAR>base</VAR>
8677 is a decimal number between 2 and 64 representing the arithmetic
8678 base, and <VAR>n</VAR> is a number in that base.
8679 If <VAR>base</VAR><CODE>#</CODE> is omitted, then base 10 is used.
8680 When specifying <VAR>n</VAR>,
8681 he digits greater than 9 are represented by the lowercase letters,
8682 the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order.
8683 If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase
8684 letters may be used interchangeably to represent numbers between 10
8685 and 35.
8686 </P><P>
8687
8688 Operators are evaluated in order of precedence.  Sub-expressions in
8689 parentheses are evaluated first and may override the precedence
8690 rules above.
8691 </P><P>
8692
8693 <A NAME="Aliases"></A>
8694 <HR SIZE="6">
8695 <A NAME="SEC85"></A>
8696 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8697 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &lt; </A>]</TD>
8698 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &gt; </A>]</TD>
8699 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &lt;&lt; </A>]</TD>
8700 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8701 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
8702 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8703 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8704 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8705 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8706 </TR></TABLE>
8707 <H2> 6.6 Aliases </H2>
8708 <!--docid::SEC85::-->
8709 <P>
8710
8711 <VAR>Aliases</VAR> allow a string to be substituted for a word when it is used
8712 as the first word of a simple command.
8713 The shell maintains a list of aliases that may be set and unset with
8714 the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands.
8715 </P><P>
8716
8717 The first word of each simple command, if unquoted, is checked to see
8718 if it has an alias.
8719 If so, that word is replaced by the text of the alias.
8720 The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the
8721 shell metacharacters or quoting characters listed above may not appear
8722 in an alias name.
8723 The replacement text may contain any valid
8724 shell input, including shell metacharacters.
8725 The first word of the replacement text is tested for
8726 aliases, but a word that is identical to an alias being expanded
8727 is not expanded a second time.
8728 This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>,
8729 for instance, and Bash does not try to recursively expand the
8730 replacement text.
8731 If the last character of the alias value is a
8732 <VAR>blank</VAR>, then the next command word following the
8733 alias is also checked for alias expansion.
8734 </P><P>
8735
8736 Aliases are created and listed with the <CODE>alias</CODE>
8737 command, and removed with the <CODE>unalias</CODE> command.
8738 </P><P>
8739
8740 There is no mechanism for using arguments in the replacement text,
8741 as in <CODE>csh</CODE>.
8742 If arguments are needed, a shell function should be used
8743 (see section <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>).
8744 </P><P>
8745
8746 Aliases are not expanded when the shell is not interactive,
8747 unless the <CODE>expand_aliases</CODE> shell option is set using
8748 <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
8749 </P><P>
8750
8751 The rules concerning the definition and use of aliases are
8752 somewhat confusing.  Bash
8753 always reads at least one complete line
8754 of input before executing any
8755 of the commands on that line.  Aliases are expanded when a
8756 command is read, not when it is executed.  Therefore, an
8757 alias definition appearing on the same line as another
8758 command does not take effect until the next line of input is read.
8759 The commands following the alias definition
8760 on that line are not affected by the new alias.
8761 This behavior is also an issue when functions are executed.
8762 Aliases are expanded when a function definition is read,
8763 not when the function is executed, because a function definition
8764 is itself a compound command.  As a consequence, aliases
8765 defined in a function are not available until after that
8766 function is executed.  To be safe, always put
8767 alias definitions on a separate line, and do not use <CODE>alias</CODE>
8768 in compound commands.
8769 </P><P>
8770
8771 For almost every purpose, shell functions are preferred over aliases.
8772 </P><P>
8773
8774 <A NAME="Arrays"></A>
8775 <HR SIZE="6">
8776 <A NAME="SEC86"></A>
8777 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8778 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &lt; </A>]</TD>
8779 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> &gt; </A>]</TD>
8780 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> &lt;&lt; </A>]</TD>
8781 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8782 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
8783 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8784 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8785 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8786 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8787 </TR></TABLE>
8788 <H2> 6.7 Arrays </H2>
8789 <!--docid::SEC86::-->
8790 <P>
8791
8792 Bash provides one-dimensional indexed and associative array variables.
8793 Any variable may be used as an indexed array;
8794 the <CODE>declare</CODE> builtin will explicitly declare an array.
8795 There is no maximum
8796 limit on the size of an array, nor any requirement that members
8797 be indexed or assigned contiguously.
8798 Indexed arrays are referenced using integers (including arithmetic
8799 expressions (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>)) and are zero-based;
8800 associative arrays use arbitrary strings.
8801 Unless otherwise noted, indexed array indices must be non-negative integers.
8802 </P><P>
8803
8804 An indexed array is created automatically if any variable is assigned to
8805 using the syntax
8806 <TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>name</VAR>[<VAR>subscript</VAR>]=<VAR>value</VAR>
8807 </pre></td></tr></table></P><P>
8808
8809 The <VAR>subscript</VAR>
8810 is treated as an arithmetic expression that must evaluate to a number.
8811 To explicitly declare an array, use
8812 <TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -a <VAR>name</VAR>
8813 </pre></td></tr></table>The syntax
8814 <TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>]
8815 </pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored.
8816 </P><P>
8817
8818 Associative arrays are created using
8819 <TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -A <VAR>name</VAR>.
8820 </pre></td></tr></table></P><P>
8821
8822 Attributes may be
8823 specified for an array variable using the <CODE>declare</CODE> and
8824 <CODE>readonly</CODE> builtins.  Each attribute applies to all members of
8825 an array.
8826 </P><P>
8827
8828 Arrays are assigned to using compound assignments of the form
8829 <TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>name</VAR>=(<VAR>value1</VAR> <VAR>value2</VAR> <small>...</small> )
8830 </pre></td></tr></table>where each
8831 <VAR>value</VAR> is of the form <CODE>[<VAR>subscript</VAR>]=</CODE><VAR>string</VAR>.
8832 Indexed array assignments do not require anything but <VAR>string</VAR>.
8833 When assigning to indexed arrays, if
8834 the optional subscript is supplied, that index is assigned to;
8835 otherwise the index of the element assigned is the last index assigned
8836 to by the statement plus one.  Indexing starts at zero.
8837 </P><P>
8838
8839 When assigning to an associative array, the subscript is required.
8840 </P><P>
8841
8842 This syntax is also accepted by the <CODE>declare</CODE>
8843 builtin.  Individual array elements may be assigned to using the
8844 <CODE><VAR>name</VAR>[<VAR>subscript</VAR>]=<VAR>value</VAR></CODE> syntax introduced above.
8845 </P><P>
8846
8847 When assigning to an indexed array, if <VAR>name</VAR>
8848 is subscripted by a negative number, that number is
8849 interpreted as relative to one greater than the maximum index of
8850 <VAR>name</VAR>, so negative indices count back from the end of the
8851 array, and an index of -1 references the last element.
8852 </P><P>
8853
8854 Any element of an array may be referenced using
8855 <CODE>${<VAR>name</VAR>[<VAR>subscript</VAR>]}</CODE>.
8856 The braces are required to avoid
8857 conflicts with the shell's filename expansion operators.  If the
8858 <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members
8859 of the array <VAR>name</VAR>.  These subscripts differ only when the word
8860 appears within double quotes.
8861 If the word is double-quoted,
8862 <CODE>${<VAR>name</VAR>[*]}</CODE> expands to a single word with
8863 the value of each array member separated by the first character of the
8864 <CODE>IFS</CODE> variable, and <CODE>${<VAR>name</VAR>[@]}</CODE> expands each element of
8865 <VAR>name</VAR> to a separate word.  When there are no array members,
8866 <CODE>${<VAR>name</VAR>[@]}</CODE> expands to nothing.
8867 If the double-quoted expansion occurs within a word, the expansion of
8868 the first parameter is joined with the beginning part of the original
8869 word, and the expansion of the last parameter is joined with the last
8870 part of the original word.
8871 This is analogous to the
8872 expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>. 
8873 <CODE>${#<VAR>name</VAR>[<VAR>subscript</VAR>]}</CODE> expands to the length of
8874 <CODE>${<VAR>name</VAR>[<VAR>subscript</VAR>]}</CODE>.
8875 If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or
8876 <SAMP>`*'</SAMP>, the expansion is the number of elements in the array. 
8877 Referencing an array variable without a subscript is equivalent to
8878 referencing with a subscript of 0. 
8879 If the <VAR>subscript</VAR>
8880 used to reference an element of an indexed array
8881 evaluates to a number less than zero, it is 
8882 interpreted as relative to one greater than the maximum index of the array,
8883 so negative indices count back from the end of the array,
8884 and an index of -1 refers to the last element.
8885 </P><P>
8886
8887 An array variable is considered set if a subscript has been assigned a
8888 value.  The null string is a valid value.
8889 </P><P>
8890
8891 It is possible to obtain the keys (indices) of an array as well as the values.
8892 ${!<VAR>name</VAR>[@]} and ${!<VAR>name</VAR>[*]} expand to the indices
8893 assigned in array variable <VAR>name</VAR>.
8894 The treatment when in double quotes is similar to the expansion of the
8895 special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP> within double quotes.
8896 </P><P>
8897
8898 The <CODE>unset</CODE> builtin is used to destroy arrays.
8899 <CODE>unset <VAR>name</VAR>[<VAR>subscript</VAR>]</CODE>
8900 destroys the array element at index <VAR>subscript</VAR>.
8901 Negative subscripts to indexed arrays are interpreted as described above.
8902 Care must be taken to avoid unwanted side effects caused by filename
8903 expansion.
8904 <CODE>unset <VAR>name</VAR></CODE>, where <VAR>name</VAR> is an array, removes the
8905 entire array.  A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the
8906 entire array.
8907 </P><P>
8908
8909 The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE>
8910 builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed
8911 array and a <SAMP>`-A'</SAMP> option to specify an associative array.
8912 If both options are supplied, <SAMP>`-A'</SAMP> takes precedence.
8913 The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP>
8914 option to assign a list of words read from the standard input
8915 to an array, and can read values from the standard input into
8916 individual array elements.  The <CODE>set</CODE> and <CODE>declare</CODE>
8917 builtins display array values in a way that allows them to be
8918 reused as input.
8919 </P><P>
8920
8921 <A NAME="The Directory Stack"></A>
8922 <HR SIZE="6">
8923 <A NAME="SEC87"></A>
8924 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8925 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &lt; </A>]</TD>
8926 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &gt; </A>]</TD>
8927 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &lt;&lt; </A>]</TD>
8928 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
8929 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &gt;&gt; </A>]</TD>
8930 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8931 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8932 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8933 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8934 </TR></TABLE>
8935 <H2> 6.8 The Directory Stack </H2>
8936 <!--docid::SEC87::-->
8937 <P>
8938
8939 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
8940 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate
8941                                         the directory stack.</TD></TR>
8942 </TABLE></BLOCKQUOTE>
8943 <P>
8944
8945 The directory stack is a list of recently-visited directories.  The
8946 <CODE>pushd</CODE> builtin adds directories to the stack as it changes
8947 the current directory, and the <CODE>popd</CODE> builtin removes specified
8948 directories from the stack and changes the current directory to
8949 the directory removed.  The <CODE>dirs</CODE> builtin displays the contents
8950 of the directory stack.
8951 </P><P>
8952
8953 The contents of the directory stack are also visible
8954 as the value of the <CODE>DIRSTACK</CODE> shell variable.
8955 </P><P>
8956
8957 <A NAME="Directory Stack Builtins"></A>
8958 <HR SIZE="6">
8959 <A NAME="SEC88"></A>
8960 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8961 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> &lt; </A>]</TD>
8962 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &gt; </A>]</TD>
8963 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &lt;&lt; </A>]</TD>
8964 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> Up </A>]</TD>
8965 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &gt;&gt; </A>]</TD>
8966 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8967 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8968 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
8969 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8970 </TR></TABLE>
8971 <H3> 6.8.1 Directory Stack Builtins </H3>
8972 <!--docid::SEC88::-->
8973 <P>
8974
8975 <DL COMPACT>
8976
8977 <DT><CODE>dirs</CODE>
8978 <DD><A NAME="IDX315"></A>
8979 <TABLE><tr><td>&nbsp;</td><td class=example><pre>dirs [-clpv] [+<VAR>N</VAR> | -<VAR>N</VAR>]
8980 </pre></td></tr></table><P>
8981
8982 Display the list of currently remembered directories.  Directories
8983 are added to the list with the <CODE>pushd</CODE> command; the
8984 <CODE>popd</CODE> command removes directories from the list.
8985 </P><P>
8986
8987 <DL COMPACT>
8988 <DT><CODE>-c</CODE>
8989 <DD>Clears the directory stack by deleting all of the elements.
8990 <DT><CODE>-l</CODE>
8991 <DD>Produces a listing using full pathnames;
8992 the default listing format uses a tilde to denote the home directory.
8993 <DT><CODE>-p</CODE>
8994 <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8995 line.
8996 <DT><CODE>-v</CODE>
8997 <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8998 line, prefixing each entry with its index in the stack.
8999 <DT><CODE>+<VAR>N</VAR></CODE>
9000 <DD>Displays the <VAR>N</VAR>th directory (counting from the left of the
9001 list printed by <CODE>dirs</CODE> when invoked without options), starting
9002 with zero.
9003 <DT><CODE>-<VAR>N</VAR></CODE>
9004 <DD>Displays the <VAR>N</VAR>th directory (counting from the right of the
9005 list printed by <CODE>dirs</CODE> when invoked without options), starting
9006 with zero.
9007 </DL>
9008 <P>
9009
9010 <DT><CODE>popd</CODE>
9011 <DD><A NAME="IDX316"></A>
9012 <TABLE><tr><td>&nbsp;</td><td class=example><pre>popd [-n] [+<VAR>N</VAR> | -<VAR>N</VAR>]
9013 </pre></td></tr></table><P>
9014
9015 Remove the top entry from the directory stack, and <CODE>cd</CODE>
9016 to the new top directory.
9017 When no arguments are given, <CODE>popd</CODE>
9018 removes the top directory from the stack and
9019 performs a <CODE>cd</CODE> to the new top directory.  The
9020 elements are numbered from 0 starting at the first directory listed with
9021 <CODE>dirs</CODE>; that is, <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>.
9022 </P><P>
9023
9024 <DL COMPACT>
9025 <DT><CODE>-n</CODE>
9026 <DD>Suppresses the normal change of directory when removing directories
9027 from the stack, so that only the stack is manipulated.
9028 <DT><CODE>+<VAR>N</VAR></CODE>
9029 <DD>Removes the <VAR>N</VAR>th directory (counting from the left of the
9030 list printed by <CODE>dirs</CODE>), starting with zero.
9031 <DT><CODE>-<VAR>N</VAR></CODE>
9032 <DD>Removes the <VAR>N</VAR>th directory (counting from the right of the
9033 list printed by <CODE>dirs</CODE>), starting with zero.
9034 </DL>
9035 <P>
9036
9037 <A NAME="IDX317"></A>
9038 <DT><CODE>pushd</CODE>
9039 <DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>pushd [-n] [<VAR>+N</VAR> | <VAR>-N</VAR> | <VAR>dir</VAR>]
9040 </pre></td></tr></table><P>
9041
9042 Save the current directory on the top of the directory stack
9043 and then <CODE>cd</CODE> to <VAR>dir</VAR>.
9044 With no arguments, <CODE>pushd</CODE> exchanges the top two directories.
9045 </P><P>
9046
9047 <DL COMPACT>
9048 <DT><CODE>-n</CODE>
9049 <DD>Suppresses the normal change of directory when adding directories
9050 to the stack, so that only the stack is manipulated.
9051 <DT><CODE>+<VAR>N</VAR></CODE>
9052 <DD>Brings the <VAR>N</VAR>th directory (counting from the left of the
9053 list printed by <CODE>dirs</CODE>, starting with zero) to the top of
9054 the list by rotating the stack.
9055 <DT><CODE>-<VAR>N</VAR></CODE>
9056 <DD>Brings the <VAR>N</VAR>th directory (counting from the right of the
9057 list printed by <CODE>dirs</CODE>, starting with zero) to the top of
9058 the list by rotating the stack.
9059 <DT><CODE><VAR>dir</VAR></CODE>
9060 <DD>Makes the current working directory be the top of the stack, making
9061 it the new current directory as if it had been supplied as an argument
9062 to the <CODE>cd</CODE> builtin.
9063 </DL>
9064 </DL>
9065 <P>
9066
9067 <A NAME="Controlling the Prompt"></A>
9068 <HR SIZE="6">
9069 <A NAME="SEC89"></A>
9070 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9071 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &lt; </A>]</TD>
9072 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> &gt; </A>]</TD>
9073 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &lt;&lt; </A>]</TD>
9074 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
9075 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
9076 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9077 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9078 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9079 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9080 </TR></TABLE>
9081 <H2> 6.9 Controlling the Prompt </H2>
9082 <!--docid::SEC89::-->
9083 <P>
9084
9085 The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before
9086 Bash prints each primary prompt.  If <CODE>PROMPT_COMMAND</CODE> is set and
9087 has a non-null value, then the
9088 value is executed just as if it had been typed on the command line.
9089 </P><P>
9090
9091 In addition, the following table describes the special characters which
9092 can appear in the prompt variables <CODE>PS1</CODE> to <CODE>PS4</CODE>:
9093 </P><P>
9094
9095 <DL COMPACT>
9096 <DT><CODE>\a</CODE>
9097 <DD>A bell character.
9098 <DT><CODE>\d</CODE>
9099 <DD>The date, in "Weekday Month Date" format (e.g., "Tue May 26").
9100 <DT><CODE>\D{<VAR>format</VAR>}</CODE>
9101 <DD>The <VAR>format</VAR> is passed to <CODE>strftime</CODE>(3) and the result is inserted
9102 into the prompt string; an empty <VAR>format</VAR> results in a locale-specific
9103 time representation.  The braces are required.
9104 <DT><CODE>\e</CODE>
9105 <DD>An escape character.
9106 <DT><CODE>\h</CODE>
9107 <DD>The hostname, up to the first `.'.
9108 <DT><CODE>\H</CODE>
9109 <DD>The hostname.
9110 <DT><CODE>\j</CODE>
9111 <DD>The number of jobs currently managed by the shell.
9112 <DT><CODE>\l</CODE>
9113 <DD>The basename of the shell's terminal device name.
9114 <DT><CODE>\n</CODE>
9115 <DD>A newline.
9116 <DT><CODE>\r</CODE>
9117 <DD>A carriage return.
9118 <DT><CODE>\s</CODE>
9119 <DD>The name of the shell, the basename of <CODE>$0</CODE> (the portion
9120 following the final slash).
9121 <DT><CODE>\t</CODE>
9122 <DD>The time, in 24-hour HH:MM:SS format.
9123 <DT><CODE>\T</CODE>
9124 <DD>The time, in 12-hour HH:MM:SS format.
9125 <DT><CODE>\@</CODE>
9126 <DD>The time, in 12-hour am/pm format.
9127 <DT><CODE>\A</CODE>
9128 <DD>The time, in 24-hour HH:MM format.
9129 <DT><CODE>\u</CODE>
9130 <DD>The username of the current user.
9131 <DT><CODE>\v</CODE>
9132 <DD>The version of Bash (e.g., 2.00)          
9133 <DT><CODE>\V</CODE>
9134 <DD>The release of Bash, version + patchlevel (e.g., 2.00.0)
9135 <DT><CODE>\w</CODE>
9136 <DD>The current working directory, with <CODE>$HOME</CODE> abbreviated with a tilde
9137 (uses the <CODE>$PROMPT_DIRTRIM</CODE> variable).
9138 <DT><CODE>\W</CODE>
9139 <DD>The basename of <CODE>$PWD</CODE>, with <CODE>$HOME</CODE> abbreviated with a tilde.
9140 <DT><CODE>\!</CODE>
9141 <DD>The history number of this command.
9142 <DT><CODE>\#</CODE>
9143 <DD>The command number of this command.
9144 <DT><CODE>\$</CODE>
9145 <DD>If the effective uid is 0, <CODE>#</CODE>, otherwise <CODE>$</CODE>.
9146 <DT><CODE>\<VAR>nnn</VAR></CODE>
9147 <DD>The character whose ASCII code is the octal value <VAR>nnn</VAR>.
9148 <DT><CODE>\\</CODE>
9149 <DD>A backslash.
9150 <DT><CODE>\[</CODE>
9151 <DD>Begin a sequence of non-printing characters.  This could be used to
9152 embed a terminal control sequence into the prompt.
9153 <DT><CODE>\]</CODE>
9154 <DD>End a sequence of non-printing characters.
9155 </DL>
9156 <P>
9157
9158 The command number and the history number are usually different:
9159 the history number of a command is its position in the history
9160 list, which may include commands restored from the history file
9161 (see section <A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>), while the command number is
9162 the position in the sequence of commands executed during the current
9163 shell session.
9164 </P><P>
9165
9166 After the string is decoded, it is expanded via
9167 parameter expansion, command substitution, arithmetic
9168 expansion, and quote removal, subject to the value of the
9169 <CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
9170 </P><P>
9171
9172 <A NAME="The Restricted Shell"></A>
9173 <HR SIZE="6">
9174 <A NAME="SEC90"></A>
9175 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9176 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &lt; </A>]</TD>
9177 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt; </A>]</TD>
9178 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> &lt;&lt; </A>]</TD>
9179 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
9180 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
9181 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9182 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9183 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9184 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9185 </TR></TABLE>
9186 <H2> 6.10 The Restricted Shell </H2>
9187 <!--docid::SEC90::-->
9188 <P>
9189
9190 If Bash is started with the name <CODE>rbash</CODE>, or the
9191 <SAMP>`--restricted'</SAMP>
9192 or
9193 <SAMP>`-r'</SAMP>
9194 option is supplied at invocation, the shell becomes restricted.
9195 A restricted shell is used to
9196 set up an environment more controlled than the standard shell.
9197 A restricted shell behaves identically to <CODE>bash</CODE>
9198 with the exception that the following are disallowed or not performed:
9199 </P><P>
9200
9201 <UL>
9202 <LI>
9203 Changing directories with the <CODE>cd</CODE> builtin.
9204 <LI>
9205 Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>,
9206 <CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables.
9207 <LI>
9208 Specifying command names containing slashes.
9209 <LI>
9210 Specifying a filename containing a slash as an argument to the <CODE>.</CODE>
9211 builtin command.
9212 <LI>
9213 Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP>
9214 option to the <CODE>hash</CODE> builtin command.
9215 <LI>
9216 Importing function definitions from the shell environment at startup.
9217 <LI>
9218 Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup.
9219 <LI>
9220 Redirecting output using the <SAMP>`&#62;'</SAMP>, <SAMP>`&#62;|'</SAMP>, <SAMP>`&#60;&#62;'</SAMP>, <SAMP>`&#62;&#38;'</SAMP>,
9221 <SAMP>`&#38;&#62;'</SAMP>, and <SAMP>`&#62;&#62;'</SAMP> redirection operators.
9222 <LI>
9223 Using the <CODE>exec</CODE> builtin to replace the shell with another command.
9224 <LI>
9225 Adding or deleting builtin commands with the
9226 <SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin.
9227 <LI>
9228 Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins.
9229 <LI>
9230 Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin.
9231 <LI>
9232 Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>.
9233 </UL>
9234 <P>
9235
9236 These restrictions are enforced after any startup files are read.
9237 </P><P>
9238
9239 When a command that is found to be a shell script is executed
9240 (see section <A HREF="bashref.html#SEC58">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in
9241 the shell spawned to execute the script.
9242 </P><P>
9243
9244 <A NAME="Bash POSIX Mode"></A>
9245 <HR SIZE="6">
9246 <A NAME="SEC91"></A>
9247 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9248 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> &lt; </A>]</TD>
9249 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt; </A>]</TD>
9250 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC71"> &lt;&lt; </A>]</TD>
9251 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> Up </A>]</TD>
9252 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt;&gt; </A>]</TD>
9253 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9254 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9255 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9256 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9257 </TR></TABLE>
9258 <H2> 6.11 Bash POSIX Mode </H2>
9259 <!--docid::SEC91::-->
9260 <P>
9261
9262 Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing
9263 <SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more
9264 closely to the POSIX standard by changing the behavior to
9265 match that specified by POSIX in areas where the Bash default differs.
9266 </P><P>
9267
9268 When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the
9269 startup files.
9270 </P><P>
9271
9272 The following list is what's changed when `POSIX mode' is in effect:
9273 </P><P>
9274
9275 <OL>
9276 <LI>
9277 When a command in the hash table no longer exists, Bash will re-search
9278 <CODE>$PATH</CODE> to find the new location.  This is also available with
9279 <SAMP>`shopt -s checkhash'</SAMP>.
9280 <P>
9281
9282 <LI>
9283 The message printed by the job control code and builtins when a job
9284 exits with a non-zero status is `Done(status)'.
9285 <P>
9286
9287 <LI>
9288 The message printed by the job control code and builtins when a job
9289 is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for
9290 example, <CODE>SIGTSTP</CODE>.
9291 <P>
9292
9293 <LI>
9294 The <CODE>bg</CODE> builtin uses the required format to describe each job placed
9295 in the background, which does not include an indication of whether the job
9296 is the current or previous job.
9297 <P>
9298
9299 <LI>
9300 Reserved words appearing in a context where reserved words are recognized
9301 do not undergo alias expansion.
9302 <P>
9303
9304 <LI>
9305 The POSIX <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to
9306 the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled,
9307 and parameter expansion is performed on the values of <CODE>PS1</CODE> and
9308 <CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option.
9309 <P>
9310
9311 <LI>
9312 The POSIX startup files are executed (<CODE>$ENV</CODE>) rather than
9313 the normal Bash files.
9314 <P>
9315
9316 <LI>
9317 Tilde expansion is only performed on assignments preceding a command
9318 name, rather than on all assignment statements on the line.
9319 <P>
9320
9321 <LI>
9322 The <CODE>command</CODE> builtin does not prevent builtins that take assignment
9323 statements as arguments from expanding them as assignment statements;
9324 when not in POSIX mode, assignment builtins lose their assignment
9325 statement expansion properties when preceded by <CODE>command</CODE>.
9326 <P>
9327
9328 <LI>
9329 The default history file is <TT>`~/.sh_history'</TT> (this is the
9330 default value of <CODE>$HISTFILE</CODE>).
9331 <P>
9332
9333 <LI>
9334 The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line,
9335 separated by spaces, without the <SAMP>`SIG'</SAMP> prefix.
9336 <P>
9337
9338 <LI>
9339 The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP>
9340 prefix.
9341 <P>
9342
9343 <LI>
9344 Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR>
9345 is not found.
9346 <P>
9347
9348 <LI>
9349 Non-interactive shells exit if a syntax error in an arithmetic expansion
9350 results in an invalid expression.
9351 <P>
9352
9353 <LI>
9354 Non-interactive shells exit if there is a syntax error in a script read
9355 with the <CODE>.</CODE> or <CODE>source</CODE> builtins, or in a string processed by
9356 the <CODE>eval</CODE> builtin.
9357 <P>
9358
9359 <LI>
9360 Redirection operators do not perform filename expansion on the word
9361 in the redirection unless the shell is interactive.
9362 <P>
9363
9364 <LI>
9365 Redirection operators do not perform word splitting on the word in the
9366 redirection.
9367 <P>
9368
9369 <LI>
9370 Function names must be valid shell <CODE>name</CODE>s.  That is, they may not
9371 contain characters other than letters, digits, and underscores, and
9372 may not start with a digit.  Declaring a function with an invalid name
9373 causes a fatal syntax error in non-interactive shells.
9374 <P>
9375
9376 <LI>
9377 Function names may not be the same as one of the POSIX special
9378 builtins.
9379 <P>
9380
9381 <LI>
9382 POSIX special builtins are found before shell functions
9383 during command lookup.
9384 <P>
9385
9386 <LI>
9387 The <CODE>time</CODE> reserved word may be used by itself as a command.  When
9388 used in this way, it displays timing statistics for the shell and its
9389 completed children.  The <CODE>TIMEFORMAT</CODE> variable controls the format
9390 of the timing information.
9391 <P>
9392
9393 <LI>
9394 When parsing and expanding a ${<small>...</small>} expansion that appears within
9395 double quotes, single quotes are no longer special and cannot be used to
9396 quote a closing brace or other special character, unless the operator is
9397 one of those defined to perform pattern removal.  In this case, they do
9398 not have to appear as matched pairs.
9399 <P>
9400
9401 <LI>
9402 The parser does not recognize <CODE>time</CODE> as a reserved word if the next
9403 token begins with a <SAMP>`-'</SAMP>.
9404 <P>
9405
9406 <LI>
9407 If a POSIX special builtin returns an error status, a
9408 non-interactive shell exits.  The fatal errors are those listed in
9409 the POSIX standard, and include things like passing incorrect options,
9410 redirection errors, variable assignment errors for assignments preceding
9411 the command name, and so on.
9412 <P>
9413
9414 <LI>
9415 A non-interactive shell exits with an error status if a variable
9416 assignment error occurs when no command name follows the assignment
9417 statements.
9418 A variable assignment error occurs, for example, when trying to assign
9419 a value to a readonly variable.
9420 <P>
9421
9422 <LI>
9423 A non-interactive shell exits with an error status if a variable
9424 assignment error occurs in an assignment statement preceding a special
9425 builtin, but not with any other simple command.
9426 <P>
9427
9428 <LI>
9429 A non-interactive shell exits with an error status if the iteration
9430 variable in a <CODE>for</CODE> statement or the selection variable in a
9431 <CODE>select</CODE> statement is a readonly variable.
9432 <P>
9433
9434 <LI>
9435 Process substitution is not available.
9436 <P>
9437
9438 <LI>
9439 While variable indirection is available, it may not be applied to the
9440 <SAMP>`#'</SAMP> and <SAMP>`?'</SAMP> special parameters.
9441 <P>
9442
9443 <LI>
9444 Assignment statements preceding POSIX special builtins
9445 persist in the shell environment after the builtin completes.
9446 <P>
9447
9448 <LI>
9449 Assignment statements preceding shell function calls persist in the
9450 shell environment after the function returns, as if a POSIX
9451 special builtin command had been executed.
9452 <P>
9453
9454 <LI>
9455 The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their
9456 output in the format required by POSIX.
9457 <P>
9458
9459 <LI>
9460 The <CODE>trap</CODE> builtin displays signal names without the leading
9461 <CODE>SIG</CODE>.
9462 <P>
9463
9464 <LI>
9465 The <CODE>trap</CODE> builtin doesn't check the first argument for a possible
9466 signal specification and revert the signal handling to the original
9467 disposition if it is, unless that argument consists solely of digits and
9468 is a valid signal number.  If users want to reset the handler for a given
9469 signal to the original disposition, they should use <SAMP>`-'</SAMP> as the
9470 first argument.
9471 <P>
9472
9473 <LI>
9474 The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory
9475 for the filename argument if it is not found by searching <CODE>PATH</CODE>.
9476 <P>
9477
9478 <LI>
9479 Subshells spawned to execute command substitutions inherit the value of
9480 the <SAMP>`-e'</SAMP> option from the parent shell.  When not in POSIX mode,
9481 Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
9482 <P>
9483
9484 <LI>
9485 Alias expansion is always enabled, even in non-interactive shells.
9486 <P>
9487
9488 <LI>
9489 When the <CODE>alias</CODE> builtin displays alias definitions, it does not
9490 display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option
9491 is supplied.
9492 <P>
9493
9494 <LI>
9495 When the <CODE>set</CODE> builtin is invoked without options, it does not display
9496 shell function names and definitions.
9497 <P>
9498
9499 <LI>
9500 When the <CODE>set</CODE> builtin is invoked without options, it displays
9501 variable values without quotes, unless they contain shell metacharacters,
9502 even if the result contains nonprinting characters.
9503 <P>
9504
9505 <LI>
9506 When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname
9507 constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument
9508 does not refer to an existing directory, <CODE>cd</CODE> will fail instead of
9509 falling back to <VAR>physical</VAR> mode.
9510 <P>
9511
9512 <LI>
9513 The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the
9514 current directory, even if it is not asked to check the file system with the
9515 <SAMP>`-P'</SAMP> option.
9516 <P>
9517
9518 <LI>
9519 When listing the history, the <CODE>fc</CODE> builtin does not include an
9520 indication of whether or not a history entry has been modified.
9521 <P>
9522
9523 <LI>
9524 The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>.
9525 <P>
9526
9527 <LI>
9528 The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable
9529 file as having been found, though the shell will attempt to execute such a
9530 file if it is the only so-named file found in <CODE>$PATH</CODE>.
9531 <P>
9532
9533 <LI>
9534 The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when
9535 the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$VISUAL</CODE> and
9536 <CODE>$EDITOR</CODE>.
9537 <P>
9538
9539 <LI>
9540 When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret
9541 any arguments to <CODE>echo</CODE> as options.  Each argument is displayed, after
9542 escape characters are converted.
9543 <P>
9544
9545 <LI>
9546 The <CODE>ulimit</CODE> builtin uses a block size of 512 bytes for the <SAMP>`-c'</SAMP>
9547 and <SAMP>`-f'</SAMP> options.
9548 <P>
9549
9550 <LI>
9551 The arrival of <CODE>SIGCHLD</CODE>  when a trap is set on <CODE>SIGCHLD</CODE> does
9552 not interrupt the <CODE>wait</CODE> builtin and cause it to return immediately.
9553 The trap command is run once for each child that exits.
9554 <P>
9555
9556 <LI>
9557 The <CODE>read</CODE> builtin may be interrupted by a signal for which a trap
9558 has been set.
9559 If Bash receives a trapped signal while executing <CODE>read</CODE>, the trap
9560 handler executes and <CODE>read</CODE> returns an exit status greater than 128.
9561 <P>
9562
9563 </OL>
9564 <P>
9565
9566 There is other POSIX behavior that Bash does not implement by
9567 default even when in POSIX mode.
9568 Specifically:
9569 </P><P>
9570
9571 <OL>
9572
9573 <LI>
9574 The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history
9575 entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to
9576 <CODE>ed</CODE>.  <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset.
9577 <P>
9578
9579 <LI>
9580 As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for
9581 the <CODE>echo</CODE> builtin to be fully conformant.
9582 <P>
9583
9584 </OL>
9585 <P>
9586
9587 Bash can be configured to be POSIX-conformant by default, by specifying
9588 the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building
9589 (see section <A HREF="bashref.html#SEC136">10.8 Optional Features</A>).
9590 </P><P>
9591
9592 <A NAME="Job Control"></A>
9593 <HR SIZE="6">
9594 <A NAME="SEC92"></A>
9595 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9596 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt; </A>]</TD>
9597 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> &gt; </A>]</TD>
9598 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &lt;&lt; </A>]</TD>
9599 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
9600 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &gt;&gt; </A>]</TD>
9601 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9602 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9603 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9604 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9605 </TR></TABLE>
9606 <H1> 7. Job Control </H1>
9607 <!--docid::SEC92::-->
9608 <P>
9609
9610 This chapter discusses what job control is, how it works, and how
9611 Bash allows you to access its facilities.
9612 </P><P>
9613
9614 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
9615 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">7.1 Job Control Basics</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR>
9616 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact
9617                                 with job control.</TD></TR>
9618 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job
9619                                 control.</TD></TR>
9620 </TABLE></BLOCKQUOTE>
9621 <P>
9622
9623 <A NAME="Job Control Basics"></A>
9624 <HR SIZE="6">
9625 <A NAME="SEC93"></A>
9626 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9627 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &lt; </A>]</TD>
9628 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &gt; </A>]</TD>
9629 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &lt;&lt; </A>]</TD>
9630 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> Up </A>]</TD>
9631 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &gt;&gt; </A>]</TD>
9632 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9633 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9634 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9635 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9636 </TR></TABLE>
9637 <H2> 7.1 Job Control Basics </H2>
9638 <!--docid::SEC93::-->
9639 <P>
9640
9641 Job control
9642 refers to the ability to selectively stop (suspend)
9643 the execution of processes and continue (resume)
9644 their execution at a later point.  A user typically employs
9645 this facility via an interactive interface supplied jointly
9646 by the operating system kernel's terminal driver and Bash.
9647 </P><P>
9648
9649 The shell associates a <VAR>job</VAR> with each pipeline.  It keeps a
9650 table of currently executing jobs, which may be listed with the
9651 <CODE>jobs</CODE> command.  When Bash starts a job
9652 asynchronously, it prints a line that looks
9653 like:
9654 <TABLE><tr><td>&nbsp;</td><td class=example><pre>[1] 25647
9655 </pre></td></tr></table>indicating that this job is job number 1 and that the process ID
9656 of the last process in the pipeline associated with this job is
9657 25647.  All of the processes in a single pipeline are members of
9658 the same job.  Bash uses the <VAR>job</VAR> abstraction as the
9659 basis for job control. 
9660 </P><P>
9661
9662 To facilitate the implementation of the user interface to job
9663 control, the operating system maintains the notion of a current terminal
9664 process group ID.  Members of this process group (processes whose
9665 process group ID is equal to the current terminal process group
9666 ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>. 
9667 These processes are said to be in the foreground.  Background
9668 processes are those whose process group ID differs from the
9669 terminal's; such processes are immune to keyboard-generated
9670 signals.  Only foreground processes are allowed to read from or, if
9671 the user so specifies with <CODE>stty tostop</CODE>, write to the terminal.
9672 Background processes which attempt to
9673 read from (write to when <CODE>stty tostop</CODE> is in effect) the
9674 terminal are sent a <CODE>SIGTTIN</CODE> (<CODE>SIGTTOU</CODE>)
9675 signal by the kernel's terminal driver,
9676 which, unless caught, suspends the process. 
9677 </P><P>
9678
9679 If the operating system on which Bash is running supports
9680 job control, Bash contains facilities to use it.  Typing the
9681 <VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a
9682 process is running causes that process to be stopped and returns
9683 control to Bash.  Typing the <VAR>delayed suspend</VAR> character
9684 (typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped
9685 when it attempts to read input from the terminal, and control to
9686 be returned to Bash.  The user then manipulates the state of
9687 this job, using the <CODE>bg</CODE> command to continue it in the
9688 background, the <CODE>fg</CODE> command to continue it in the
9689 foreground, or the <CODE>kill</CODE> command to kill it.  A <SAMP>`^Z'</SAMP>
9690 takes effect immediately, and has the additional side effect of
9691 causing pending output and typeahead to be discarded. 
9692 </P><P>
9693
9694 There are a number of ways to refer to a job in the shell.  The
9695 character <SAMP>`%'</SAMP> introduces a job specification (<VAR>jobspec</VAR>).
9696 </P><P>
9697
9698 Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>.
9699 The symbols <SAMP>`%%'</SAMP> and  <SAMP>`%+'</SAMP> refer to the shell's notion of the
9700 current job, which is the last job stopped while it was in the foreground
9701 or started in the background.
9702 A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers
9703 to the current job.
9704 The previous job may be referenced using <SAMP>`%-'</SAMP>.
9705 If there is only a single job, <SAMP>`%+'</SAMP> and <SAMP>`%-'</SAMP> can both be used
9706 to refer to that job.
9707 In output pertaining to jobs (e.g., the output of the <CODE>jobs</CODE>
9708 command), the current job is always flagged with a <SAMP>`+'</SAMP>, and the
9709 previous job with a <SAMP>`-'</SAMP>. 
9710 </P><P>
9711
9712 A job may also be referred to
9713 using a prefix of the name used to start it, or using a substring
9714 that appears in its command line.  For example, <SAMP>`%ce'</SAMP> refers
9715 to a stopped <CODE>ce</CODE> job.  Using <SAMP>`%?ce'</SAMP>, on the
9716 other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in
9717 its command line.  If the prefix or substring matches more than one job,
9718 Bash reports an error.
9719 </P><P>
9720
9721 Simply naming a job can be used to bring it into the foreground:
9722 <SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the
9723 background into the foreground.  Similarly, <SAMP>`%1 &#38;'</SAMP> resumes
9724 job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP>
9725 </P><P>
9726
9727 The shell learns immediately whenever a job changes state. 
9728 Normally, Bash waits until it is about to print a prompt
9729 before reporting changes in a job's status so as to not interrupt
9730 any other output.
9731 If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled,
9732 Bash reports such changes immediately (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
9733 Any trap on <CODE>SIGCHLD</CODE> is executed for each child process
9734 that exits.
9735 </P><P>
9736
9737 If an attempt to exit Bash is made while jobs are stopped, (or running, if
9738 the <CODE>checkjobs</CODE> option is enabled -- see <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), the
9739 shell prints a warning message, and if the <CODE>checkjobs</CODE> option is
9740 enabled, lists the jobs and their statuses.
9741 The <CODE>jobs</CODE> command may then be used to inspect their status.
9742 If a second attempt to exit is made without an intervening command,
9743 Bash does not print another warning, and any stopped jobs are terminated.
9744 </P><P>
9745
9746 <A NAME="Job Control Builtins"></A>
9747 <HR SIZE="6">
9748 <A NAME="SEC94"></A>
9749 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9750 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> &lt; </A>]</TD>
9751 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt; </A>]</TD>
9752 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt;&lt; </A>]</TD>
9753 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> Up </A>]</TD>
9754 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &gt;&gt; </A>]</TD>
9755 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9756 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9757 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9758 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9759 </TR></TABLE>
9760 <H2> 7.2 Job Control Builtins </H2>
9761 <!--docid::SEC94::-->
9762 <P>
9763
9764 <DL COMPACT>
9765
9766 <DT><CODE>bg</CODE>
9767 <DD><A NAME="IDX318"></A>
9768 <TABLE><tr><td>&nbsp;</td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>]
9769 </pre></td></tr></table><P>
9770
9771 Resume each suspended job <VAR>jobspec</VAR> in the background, as if it
9772 had been started with <SAMP>`&#38;'</SAMP>.
9773 If <VAR>jobspec</VAR> is not supplied, the current job is used.
9774 The return status is zero unless it is run when job control is not
9775 enabled, or, when run with job control enabled, any
9776 <VAR>jobspec</VAR> was not found or specifies a job
9777 that was started without job control.
9778 </P><P>
9779
9780 <DT><CODE>fg</CODE>
9781 <DD><A NAME="IDX319"></A>
9782 <TABLE><tr><td>&nbsp;</td><td class=example><pre>fg [<VAR>jobspec</VAR>]
9783 </pre></td></tr></table><P>
9784
9785 Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job.
9786 If <VAR>jobspec</VAR> is not supplied, the current job is used.
9787 The return status is that of the command placed into the foreground,
9788 or non-zero if run when job control is disabled or, when run with
9789 job control enabled, <VAR>jobspec</VAR> does not specify a valid job or
9790 <VAR>jobspec</VAR> specifies a job that was started without job control.
9791 </P><P>
9792
9793 <DT><CODE>jobs</CODE>
9794 <DD><A NAME="IDX320"></A>
9795 <TABLE><tr><td>&nbsp;</td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>]
9796 jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>]
9797 </pre></td></tr></table><P>
9798
9799 The first form lists the active jobs.  The options have the
9800 following meanings:
9801 </P><P>
9802
9803 <DL COMPACT>
9804 <DT><CODE>-l</CODE>
9805 <DD>List process IDs in addition to the normal information.
9806 <P>
9807
9808 <DT><CODE>-n</CODE>
9809 <DD>Display information only about jobs that have changed status since
9810 the user was last notified of their status.
9811 <P>
9812
9813 <DT><CODE>-p</CODE>
9814 <DD>List only the process ID of the job's process group leader.
9815 <P>
9816
9817 <DT><CODE>-r</CODE>
9818 <DD>Display only running jobs.
9819 <P>
9820
9821 <DT><CODE>-s</CODE>
9822 <DD>Display only stopped jobs.
9823 </DL>
9824 <P>
9825
9826 If <VAR>jobspec</VAR> is given,
9827 output is restricted to information about that job. 
9828 If <VAR>jobspec</VAR> is not supplied, the status of all jobs is
9829 listed.
9830 </P><P>
9831
9832 If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any
9833 <VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the
9834 corresponding process group ID, and executes <VAR>command</VAR>,
9835 passing it <VAR>argument</VAR>s, returning its exit status. 
9836 </P><P>
9837
9838 <DT><CODE>kill</CODE>
9839 <DD><A NAME="IDX321"></A>
9840 <TABLE><tr><td>&nbsp;</td><td class=example><pre>kill [-s <VAR>sigspec</VAR>] [-n <VAR>signum</VAR>] [-<VAR>sigspec</VAR>] <VAR>jobspec</VAR> or <VAR>pid</VAR>
9841 kill -l [<VAR>exit_status</VAR>]
9842 </pre></td></tr></table><P>
9843
9844 Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process
9845 named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>.
9846 <VAR>sigspec</VAR> is either a case-insensitive signal name such as
9847 <CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix)
9848 or a signal number; <VAR>signum</VAR> is a signal number.
9849 If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used.
9850 The <SAMP>`-l'</SAMP> option lists the signal names.
9851 If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the
9852 signals corresponding to the arguments are listed, and the return status
9853 is zero.
9854 <VAR>exit_status</VAR> is a number specifying a signal number or the exit
9855 status of a process terminated by a signal.
9856 The return status is zero if at least one signal was successfully sent,
9857 or non-zero if an error occurs or an invalid option is encountered.
9858 </P><P>
9859
9860 <DT><CODE>wait</CODE>
9861 <DD><A NAME="IDX322"></A>
9862 <TABLE><tr><td>&nbsp;</td><td class=example><pre>wait [-n] [<VAR>jobspec</VAR> or <VAR>pid</VAR> <small>...</small>]
9863 </pre></td></tr></table><P>
9864
9865 Wait until the child process specified by each process ID <VAR>pid</VAR>
9866 or job specification <VAR>jobspec</VAR> exits and return the exit status of the
9867 last command waited for.
9868 If a job spec is given, all processes in the job are waited for.
9869 If no arguments are given, all currently active child processes are
9870 waited for, and the return status is zero.
9871 If the <SAMP>`-n'</SAMP> option is supplied, <CODE>wait</CODE> waits for any job to
9872 terminate and returns its exit status.
9873 If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process
9874 of the shell, the return status is 127.
9875 </P><P>
9876
9877 <DT><CODE>disown</CODE>
9878 <DD><A NAME="IDX323"></A>
9879 <TABLE><tr><td>&nbsp;</td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>]
9880 </pre></td></tr></table><P>
9881
9882 Without options, remove each <VAR>jobspec</VAR> from the table of
9883 active jobs.
9884 If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table,
9885 but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell
9886 receives a <CODE>SIGHUP</CODE>.
9887 If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor the
9888 <SAMP>`-r'</SAMP> option is supplied, the current job is used.
9889 If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or
9890 mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR>
9891 argument restricts operation to running jobs.
9892 </P><P>
9893
9894 <DT><CODE>suspend</CODE>
9895 <DD><A NAME="IDX324"></A>
9896 <TABLE><tr><td>&nbsp;</td><td class=example><pre>suspend [-f]
9897 </pre></td></tr></table><P>
9898
9899 Suspend the execution of this shell until it receives a
9900 <CODE>SIGCONT</CODE> signal.
9901 A login shell cannot be suspended; the <SAMP>`-f'</SAMP>
9902 option can be used to override this and force the suspension.
9903 </DL>
9904 <P>
9905
9906 When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE>
9907 builtins do not accept <VAR>jobspec</VAR> arguments.  They must be
9908 supplied process IDs.
9909 </P><P>
9910
9911 <A NAME="Job Control Variables"></A>
9912 <HR SIZE="6">
9913 <A NAME="SEC95"></A>
9914 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9915 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &lt; </A>]</TD>
9916 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &gt; </A>]</TD>
9917 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &lt;&lt; </A>]</TD>
9918 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> Up </A>]</TD>
9919 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &gt;&gt; </A>]</TD>
9920 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9921 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9922 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9923 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9924 </TR></TABLE>
9925 <H2> 7.3 Job Control Variables </H2>
9926 <!--docid::SEC95::-->
9927 <P>
9928
9929 <DL COMPACT>
9930
9931 <A NAME="IDX325"></A>
9932 <DT><CODE>auto_resume</CODE>
9933 <DD><A NAME="IDX326"></A>
9934 This variable controls how the shell interacts with the user and
9935 job control.  If this variable exists then single word simple
9936 commands without redirections are treated as candidates for resumption
9937 of an existing job.  There is no ambiguity allowed; if there is
9938 more than one job beginning with the string typed, then
9939 the most recently accessed job will be selected.
9940 The name of a stopped job, in this context, is the command line
9941 used to start it.  If this variable is set to the value <SAMP>`exact'</SAMP>,
9942 the string supplied must match the name of a stopped job exactly;
9943 if set to <SAMP>`substring'</SAMP>,
9944 the string supplied needs to match a substring of the name of a
9945 stopped job.  The <SAMP>`substring'</SAMP> value provides functionality
9946 analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC93">7.1 Job Control Basics</A>).
9947 If set to any other value, the supplied string must
9948 be a prefix of a stopped job's name; this provides functionality
9949 analogous to the <SAMP>`%'</SAMP> job ID.
9950 <P>
9951
9952 </DL>
9953 <P>
9954
9955 <A NAME="IDX327"></A>
9956 </P><P>
9957
9958 <A NAME="Command Line Editing"></A>
9959 <HR SIZE="6">
9960 <A NAME="SEC96"></A>
9961 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9962 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt; </A>]</TD>
9963 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> &gt; </A>]</TD>
9964 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &lt;&lt; </A>]</TD>
9965 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
9966 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt;&gt; </A>]</TD>
9967 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9968 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9969 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
9970 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9971 </TR></TABLE>
9972 <H1> 8. Command Line Editing </H1>
9973 <!--docid::SEC96::-->
9974 <P>
9975
9976 This chapter describes the basic features of the GNU
9977 command line editing interface.
9978 Command line editing is provided by the Readline library, which is
9979 used by several different programs, including Bash.
9980 Command line editing is enabled by default when using an interactive shell,
9981 unless the <SAMP>`--noediting'</SAMP> option is supplied at shell invocation.
9982 Line editing is also used when using the <SAMP>`-e'</SAMP> option to the
9983 <CODE>read</CODE> builtin command (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
9984 By default, the line editing commands are similar to those of Emacs.
9985 A vi-style line editing interface is also available.
9986 Line editing can be enabled at any time using the <SAMP>`-o emacs'</SAMP> or
9987 <SAMP>`-o vi'</SAMP> options to the <CODE>set</CODE> builtin command
9988 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>), or disabled using the <SAMP>`+o emacs'</SAMP> or 
9989 <SAMP>`+o vi'</SAMP> options to <CODE>set</CODE>.
9990 </P><P>
9991
9992 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
9993 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.1 Introduction to Line Editing</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR>
9994 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC98">8.2 Readline Interaction</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR>
9995 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC104">8.3 Readline Init File</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR>
9996 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC108">8.4 Bindable Readline Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands
9997                                 available for binding</TD></TR>
9998 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">8.5 Readline vi Mode</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline
9999                                 behave like the vi editor.</TD></TR>
10000 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">8.6 Programmable Completion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for
10001                                 a specific command.</TD></TR>
10002 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to
10003                                 complete arguments for a particular command.</TD></TR>
10004 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC120">8.8 A Programmable Completion Example</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">An example shell function for
10005                                 generating possible completions.</TD></TR>
10006 </TABLE></BLOCKQUOTE>
10007 <P>
10008
10009 <A NAME="Introduction and Notation"></A>
10010 <HR SIZE="6">
10011 <A NAME="SEC97"></A>
10012 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10013 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &lt; </A>]</TD>
10014 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> &gt; </A>]</TD>
10015 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &lt;&lt; </A>]</TD>
10016 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
10017 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt;&gt; </A>]</TD>
10018 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10019 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10020 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10021 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10022 </TR></TABLE>
10023 <H2> 8.1 Introduction to Line Editing </H2>
10024 <!--docid::SEC97::-->
10025 <P>
10026
10027 The following paragraphs describe the notation used to represent
10028 keystrokes.
10029 </P><P>
10030
10031 The text <KBD>C-k</KBD> is read as `Control-K' and describes the character
10032 produced when the <KBD>k</KBD> key is pressed while the Control key
10033 is depressed.
10034 </P><P>
10035
10036 The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character
10037 produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD>
10038 key is pressed.
10039 The Meta key is labeled <KBD>ALT</KBD> on many keyboards.
10040 On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of
10041 the space bar), the <KBD>ALT</KBD> on the left side is generally set to
10042 work as a Meta key.
10043 The <KBD>ALT</KBD> key on the right may also be configured to work as a
10044 Meta key or may be configured as some other modifier, such as a
10045 Compose key for typing accented characters.
10046 </P><P>
10047
10048 If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as
10049 a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD>
10050 <EM>first</EM>, and then typing <KBD>k</KBD>.
10051 Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key.
10052 </P><P>
10053
10054 The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the
10055 character produced by <EM>metafying</EM> <KBD>C-k</KBD>.
10056 </P><P>
10057
10058 In addition, several keys have their own names.  Specifically,
10059 <KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all
10060 stand for themselves when seen in this text, or in an init file
10061 (see section <A HREF="bashref.html#SEC104">8.3 Readline Init File</A>).
10062 If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will
10063 produce the desired character.
10064 The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on
10065 some keyboards.
10066 </P><P>
10067
10068 <A NAME="Readline Interaction"></A>
10069 <HR SIZE="6">
10070 <A NAME="SEC98"></A>
10071 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10072 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> &lt; </A>]</TD>
10073 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> &gt; </A>]</TD>
10074 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &lt;&lt; </A>]</TD>
10075 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
10076 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt;&gt; </A>]</TD>
10077 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10078 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10079 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10080 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10081 </TR></TABLE>
10082 <H2> 8.2 Readline Interaction </H2>
10083 <!--docid::SEC98::-->
10084 <P>
10085
10086 Often during an interactive session you type in a long line of text,
10087 only to notice that the first word on the line is misspelled.  The
10088 Readline library gives you a set of commands for manipulating the text
10089 as you type it in, allowing you to just fix your typo, and not forcing
10090 you to retype the majority of the line.  Using these editing commands,
10091 you move the cursor to the place that needs correction, and delete or
10092 insert the text of the corrections.  Then, when you are satisfied with
10093 the line, you simply press <KBD>RET</KBD>.  You do not have to be at the
10094 end of the line to press <KBD>RET</KBD>; the entire line is accepted
10095 regardless of the location of the cursor within the line.
10096 </P><P>
10097
10098 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
10099 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.2.1 Readline Bare Essentials</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The least you need to know about Readline.</TD></TR>
10100 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">8.2.2 Readline Movement Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR>
10101 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to delete text, and how to get it back!</TD></TR>
10102 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.2.4 Readline Arguments</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR>
10103 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.2.5 Searching for Commands in the History</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR>
10104 </TABLE></BLOCKQUOTE>
10105 <P>
10106
10107 <A NAME="Readline Bare Essentials"></A>
10108 <HR SIZE="6">
10109 <A NAME="SEC99"></A>
10110 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10111 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> &lt; </A>]</TD>
10112 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &gt; </A>]</TD>
10113 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &lt;&lt; </A>]</TD>
10114 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
10115 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt;&gt; </A>]</TD>
10116 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10117 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10118 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10119 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10120 </TR></TABLE>
10121 <H3> 8.2.1 Readline Bare Essentials </H3>
10122 <!--docid::SEC99::-->
10123 <P>
10124
10125 In order to enter characters into the line, simply type them.  The typed
10126 character appears where the cursor was, and then the cursor moves one
10127 space to the right.  If you mistype a character, you can use your
10128 erase character to back up and delete the mistyped character.
10129 </P><P>
10130
10131 Sometimes you may mistype a character, and
10132 not notice the error until you have typed several other characters.  In
10133 that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then
10134 correct your mistake.  Afterwards, you can move the cursor to the right
10135 with <KBD>C-f</KBD>.
10136 </P><P>
10137
10138 When you add text in the middle of a line, you will notice that characters
10139 to the right of the cursor are `pushed over' to make room for the text
10140 that you have inserted.  Likewise, when you delete text behind the cursor,
10141 characters to the right of the cursor are `pulled back' to fill in the
10142 blank space created by the removal of the text.  A list of the bare
10143 essentials for editing the text of an input line follows.
10144 </P><P>
10145
10146 <DL COMPACT>
10147 <DT><KBD>C-b</KBD>
10148 <DD>Move back one character.
10149 <DT><KBD>C-f</KBD>
10150 <DD>Move forward one character.
10151 <DT><KBD>DEL</KBD> or <KBD>Backspace</KBD>
10152 <DD>Delete the character to the left of the cursor.
10153 <DT><KBD>C-d</KBD>
10154 <DD>Delete the character underneath the cursor.
10155 <DT>Printing characters
10156 <DD>Insert the character into the line at the cursor.
10157 <DT><KBD>C-_</KBD> or <KBD>C-x C-u</KBD>
10158 <DD>Undo the last editing command.  You can undo all the way back to an
10159 empty line.
10160 </DL>
10161 <P>
10162
10163 (Depending on your configuration, the <KBD>Backspace</KBD> key be set to
10164 delete the character to the left of the cursor and the <KBD>DEL</KBD> key set
10165 to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather
10166 than the character to the left of the cursor.)
10167 </P><P>
10168
10169 <A NAME="Readline Movement Commands"></A>
10170 <HR SIZE="6">
10171 <A NAME="SEC100"></A>
10172 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10173 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> &lt; </A>]</TD>
10174 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &gt; </A>]</TD>
10175 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &lt;&lt; </A>]</TD>
10176 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
10177 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt;&gt; </A>]</TD>
10178 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10179 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10180 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10181 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10182 </TR></TABLE>
10183 <H3> 8.2.2 Readline Movement Commands </H3>
10184 <!--docid::SEC100::-->
10185 <P>
10186
10187 The above table describes the most basic keystrokes that you need
10188 in order to do editing of the input line.  For your convenience, many
10189 other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>,
10190 <KBD>C-d</KBD>, and <KBD>DEL</KBD>.  Here are some commands for moving more rapidly
10191 about the line.
10192 </P><P>
10193
10194 <DL COMPACT>
10195 <DT><KBD>C-a</KBD>
10196 <DD>Move to the start of the line.
10197 <DT><KBD>C-e</KBD>
10198 <DD>Move to the end of the line.
10199 <DT><KBD>M-f</KBD>
10200 <DD>Move forward a word, where a word is composed of letters and digits.
10201 <DT><KBD>M-b</KBD>
10202 <DD>Move backward a word.
10203 <DT><KBD>C-l</KBD>
10204 <DD>Clear the screen, reprinting the current line at the top.
10205 </DL>
10206 <P>
10207
10208 Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves
10209 forward a word.  It is a loose convention that control keystrokes
10210 operate on characters while meta keystrokes operate on words.
10211 </P><P>
10212
10213 <A NAME="Readline Killing Commands"></A>
10214 <HR SIZE="6">
10215 <A NAME="SEC101"></A>
10216 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10217 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &lt; </A>]</TD>
10218 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &gt; </A>]</TD>
10219 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &lt;&lt; </A>]</TD>
10220 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
10221 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt;&gt; </A>]</TD>
10222 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10223 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10224 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10225 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10226 </TR></TABLE>
10227 <H3> 8.2.3 Readline Killing Commands </H3>
10228 <!--docid::SEC101::-->
10229 <P>
10230
10231 <A NAME="IDX328"></A>
10232 <A NAME="IDX329"></A>
10233 </P><P>
10234
10235 <EM>Killing</EM> text means to delete the text from the line, but to save
10236 it away for later use, usually by <EM>yanking</EM> (re-inserting)
10237 it back into the line.
10238 (`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
10239 </P><P>
10240
10241 If the description for a command says that it `kills' text, then you can
10242 be sure that you can get the text back in a different (or the same)
10243 place later.
10244 </P><P>
10245
10246 When you use a kill command, the text is saved in a <EM>kill-ring</EM>.
10247 Any number of consecutive kills save all of the killed text together, so
10248 that when you yank it back, you get it all.  The kill
10249 ring is not line specific; the text that you killed on a previously
10250 typed line is available to be yanked back later, when you are typing
10251 another line.
10252 <A NAME="IDX330"></A>
10253 </P><P>
10254
10255 Here is the list of commands for killing text.
10256 </P><P>
10257
10258 <DL COMPACT>
10259 <DT><KBD>C-k</KBD>
10260 <DD>Kill the text from the current cursor position to the end of the line.
10261 <P>
10262
10263 <DT><KBD>M-d</KBD>
10264 <DD>Kill from the cursor to the end of the current word, or, if between
10265 words, to the end of the next word.
10266 Word boundaries are the same as those used by <KBD>M-f</KBD>.
10267 <P>
10268
10269 <DT><KBD>M-<KBD>DEL</KBD></KBD>
10270 <DD>Kill from the cursor the start of the current word, or, if between
10271 words, to the start of the previous word.
10272 Word boundaries are the same as those used by <KBD>M-b</KBD>.
10273 <P>
10274
10275 <DT><KBD>C-w</KBD>
10276 <DD>Kill from the cursor to the previous whitespace.  This is different than
10277 <KBD>M-<KBD>DEL</KBD></KBD> because the word boundaries differ.
10278 <P>
10279
10280 </DL>
10281 <P>
10282
10283 Here is how to <EM>yank</EM> the text back into the line.  Yanking
10284 means to copy the most-recently-killed text from the kill buffer.
10285 </P><P>
10286
10287 <DL COMPACT>
10288 <DT><KBD>C-y</KBD>
10289 <DD>Yank the most recently killed text back into the buffer at the cursor.
10290 <P>
10291
10292 <DT><KBD>M-y</KBD>
10293 <DD>Rotate the kill-ring, and yank the new top.  You can only do this if
10294 the prior command is <KBD>C-y</KBD> or <KBD>M-y</KBD>.
10295 </DL>
10296 <P>
10297
10298 <A NAME="Readline Arguments"></A>
10299 <HR SIZE="6">
10300 <A NAME="SEC102"></A>
10301 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10302 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &lt; </A>]</TD>
10303 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt; </A>]</TD>
10304 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt;&lt; </A>]</TD>
10305 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
10306 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt;&gt; </A>]</TD>
10307 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10308 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10309 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10311 </TR></TABLE>
10312 <H3> 8.2.4 Readline Arguments </H3>
10313 <!--docid::SEC102::-->
10314 <P>
10315
10316 You can pass numeric arguments to Readline commands.  Sometimes the
10317 argument acts as a repeat count, other times it is the <I>sign</I> of the
10318 argument that is significant.  If you pass a negative argument to a
10319 command which normally acts in a forward direction, that command will
10320 act in a backward direction.  For example, to kill text back to the
10321 start of the line, you might type <SAMP>`M-- C-k'</SAMP>.
10322 </P><P>
10323
10324 The general way to pass numeric arguments to a command is to type meta
10325 digits before the command.  If the first `digit' typed is a minus
10326 sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative.  Once
10327 you have typed one meta digit to get the argument started, you can type
10328 the remainder of the digits, and then the command.  For example, to give
10329 the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>,
10330 which will delete the next ten characters on the input line.
10331 </P><P>
10332
10333 <A NAME="Searching"></A>
10334 <HR SIZE="6">
10335 <A NAME="SEC103"></A>
10336 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10337 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &lt; </A>]</TD>
10338 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt; </A>]</TD>
10339 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &lt;&lt; </A>]</TD>
10340 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> Up </A>]</TD>
10341 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt;&gt; </A>]</TD>
10342 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10343 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10344 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10345 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10346 </TR></TABLE>
10347 <H3> 8.2.5 Searching for Commands in the History </H3>
10348 <!--docid::SEC103::-->
10349 <P>
10350
10351 Readline provides commands for searching through the command history
10352 (see section <A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>)
10353 for lines containing a specified string.
10354 There are two search modes:  <EM>incremental</EM> and <EM>non-incremental</EM>.
10355 </P><P>
10356
10357 Incremental searches begin before the user has finished typing the
10358 search string.
10359 As each character of the search string is typed, Readline displays
10360 the next entry from the history matching the string typed so far.
10361 An incremental search requires only as many characters as needed to
10362 find the desired history entry.
10363 To search backward in the history for a particular string, type
10364 <KBD>C-r</KBD>.  Typing <KBD>C-s</KBD> searches forward through the history.
10365 The characters present in the value of the <CODE>isearch-terminators</CODE> variable
10366 are used to terminate an incremental search.
10367 If that variable has not been assigned a value, the <KBD>ESC</KBD> and
10368 <KBD>C-J</KBD> characters will terminate an incremental search.
10369 <KBD>C-g</KBD> will abort an incremental search and restore the original line.
10370 When the search is terminated, the history entry containing the
10371 search string becomes the current line.
10372 </P><P>
10373
10374 To find other matching entries in the history list, type <KBD>C-r</KBD> or
10375 <KBD>C-s</KBD> as appropriate.
10376 This will search backward or forward in the history for the next
10377 entry matching the search string typed so far.
10378 Any other key sequence bound to a Readline command will terminate
10379 the search and execute that command.
10380 For instance, a <KBD>RET</KBD> will terminate the search and accept
10381 the line, thereby executing the command from the history list.
10382 A movement command will terminate the search, make the last line found
10383 the current line, and begin editing.
10384 </P><P>
10385
10386 Readline remembers the last incremental search string.  If two
10387 <KBD>C-r</KBD>s are typed without any intervening characters defining a new
10388 search string, any remembered search string is used.
10389 </P><P>
10390
10391 Non-incremental searches read the entire search string before starting
10392 to search for matching history lines.  The search string may be
10393 typed by the user or be part of the contents of the current line.
10394 </P><P>
10395
10396 <A NAME="Readline Init File"></A>
10397 <HR SIZE="6">
10398 <A NAME="SEC104"></A>
10399 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10400 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt; </A>]</TD>
10401 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> &gt; </A>]</TD>
10402 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &lt;&lt; </A>]</TD>
10403 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
10404 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &gt;&gt; </A>]</TD>
10405 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10406 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10407 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10408 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10409 </TR></TABLE>
10410 <H2> 8.3 Readline Init File </H2>
10411 <!--docid::SEC104::-->
10412 <P>
10413
10414 Although the Readline library comes with a set of Emacs-like
10415 keybindings installed by default, it is possible to use a different set
10416 of keybindings.
10417 Any user can customize programs that use Readline by putting
10418 commands in an <EM>inputrc</EM> file, conventionally in his home directory.
10419 The name of this
10420 file is taken from the value of the shell variable <CODE>INPUTRC</CODE>.  If
10421 that variable is unset, the default is <TT>`~/.inputrc'</TT>.  If that
10422 file does not exist or cannot be read, the ultimate default is
10423 <TT>`/etc/inputrc'</TT>.
10424 </P><P>
10425
10426 When a program which uses the Readline library starts up, the
10427 init file is read, and the key bindings are set.
10428 </P><P>
10429
10430 In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus
10431 incorporating any changes that you might have made to it.
10432 </P><P>
10433
10434 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
10435 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Syntax for the commands in the inputrc file.</TD></TR>
10436 </TABLE>
10437
10438 <br>
10439 <TABLE BORDER=0 CELLSPACING=0>
10440 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC106">8.3.2 Conditional Init Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Conditional key bindings in the inputrc file.</TD></TR>
10441 </TABLE>
10442
10443 <br>
10444 <TABLE BORDER=0 CELLSPACING=0>
10445 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.3.3 Sample Init File</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">An example inputrc file.</TD></TR>
10446 </TABLE></BLOCKQUOTE>
10447 <P>
10448
10449 <A NAME="Readline Init File Syntax"></A>
10450 <HR SIZE="6">
10451 <A NAME="SEC105"></A>
10452 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10453 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &lt; </A>]</TD>
10454 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &gt; </A>]</TD>
10455 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &lt;&lt; </A>]</TD>
10456 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> Up </A>]</TD>
10457 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &gt;&gt; </A>]</TD>
10458 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10459 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10460 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10461 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10462 </TR></TABLE>
10463 <H3> 8.3.1 Readline Init File Syntax </H3>
10464 <!--docid::SEC105::-->
10465 <P>
10466
10467 There are only a few basic constructs allowed in the
10468 Readline init file.  Blank lines are ignored.
10469 Lines beginning with a <SAMP>`#'</SAMP> are comments.
10470 Lines beginning with a <SAMP>`$'</SAMP> indicate conditional
10471 constructs (see section <A HREF="bashref.html#SEC106">8.3.2 Conditional Init Constructs</A>).  Other lines
10472 denote variable settings and key bindings.
10473 </P><P>
10474
10475 <DL COMPACT>
10476 <DT>Variable Settings
10477 <DD>You can modify the run-time behavior of Readline by
10478 altering the values of variables in Readline
10479 using the <CODE>set</CODE> command within the init file.
10480 The syntax is simple:
10481 <P>
10482
10483 <TABLE><tr><td>&nbsp;</td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR>
10484 </pre></td></tr></table></P><P>
10485
10486 Here, for example, is how to
10487 change from the default Emacs-like key binding to use
10488 <CODE>vi</CODE> line editing commands:
10489 </P><P>
10490
10491 <TABLE><tr><td>&nbsp;</td><td class=example><pre>set editing-mode vi
10492 </pre></td></tr></table></P><P>
10493
10494 Variable names and values, where appropriate, are recognized without regard
10495 to case.  Unrecognized variable names are ignored.
10496 </P><P>
10497
10498 Boolean variables (those that can be set to on or off) are set to on if
10499 the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1.  Any other
10500 value results in the variable being set to off.
10501 </P><P>
10502
10503 The <CODE>bind -V</CODE> command lists the current Readline variable names
10504 and values.  See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>.
10505 </P><P>
10506
10507 A great deal of run-time behavior is changeable with the following
10508 variables.
10509 </P><P>
10510
10511 <A NAME="IDX331"></A>
10512 <DL COMPACT>
10513
10514 <DT><CODE>bell-style</CODE>
10515 <DD><A NAME="IDX332"></A>
10516 Controls what happens when Readline wants to ring the terminal bell.
10517 If set to <SAMP>`none'</SAMP>, Readline never rings the bell.  If set to
10518 <SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available.
10519 If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring
10520 the terminal's bell.
10521 <P>
10522
10523 <DT><CODE>bind-tty-special-chars</CODE>
10524 <DD><A NAME="IDX333"></A>
10525 If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters  
10526 treated specially by the kernel's terminal driver to their Readline
10527 equivalents.
10528 <P>
10529
10530 <DT><CODE>colored-stats</CODE>
10531 <DD><A NAME="IDX334"></A>
10532 If set to <SAMP>`on'</SAMP>, Readline displays possible completions using different
10533 colors to indicate their file type.
10534 The color definitions are taken from the value of the <CODE>LS_COLORS</CODE>
10535 environment variable.
10536 The default is <SAMP>`off'</SAMP>.
10537 <P>
10538
10539 <DT><CODE>comment-begin</CODE>
10540 <DD><A NAME="IDX335"></A>
10541 The string to insert at the beginning of the line when the
10542 <CODE>insert-comment</CODE> command is executed.  The default value
10543 is <CODE>"#"</CODE>.
10544 <P>
10545
10546 <DT><CODE>completion-display-width</CODE>
10547 <DD><A NAME="IDX336"></A>
10548 The number of screen columns used to display possible matches
10549 when performing completion.
10550 The value is ignored if it is less than 0 or greater than the terminal
10551 screen width.
10552 A value of 0 will cause matches to be displayed one per line.
10553 The default value is -1.
10554 <P>
10555
10556 <DT><CODE>completion-ignore-case</CODE>
10557 <DD><A NAME="IDX337"></A>
10558 If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion
10559 in a case-insensitive fashion.
10560 The default value is <SAMP>`off'</SAMP>.
10561 <P>
10562
10563 <DT><CODE>completion-map-case</CODE>
10564 <DD><A NAME="IDX338"></A>
10565 If set to <SAMP>`on'</SAMP>, and <VAR>completion-ignore-case</VAR> is enabled, Readline
10566 treats hyphens (<SAMP>`-'</SAMP>) and underscores (<SAMP>`_'</SAMP>) as equivalent when
10567 performing case-insensitive filename matching and completion.
10568 <P>
10569
10570 <DT><CODE>completion-prefix-display-length</CODE>
10571 <DD><A NAME="IDX339"></A>
10572 The length in characters of the common prefix of a list of possible
10573 completions that is displayed without modification.  When set to a
10574 value greater than zero, common prefixes longer than this value are
10575 replaced with an ellipsis when displaying possible completions.
10576 <P>
10577
10578 <DT><CODE>completion-query-items</CODE>
10579 <DD><A NAME="IDX340"></A>
10580 The number of possible completions that determines when the user is
10581 asked whether the list of possibilities should be displayed.
10582 If the number of possible completions is greater than this value,
10583 Readline will ask the user whether or not he wishes to view
10584 them; otherwise, they are simply listed.
10585 This variable must be set to an integer value greater than or equal to 0.
10586 A negative value means Readline should never ask.
10587 The default limit is <CODE>100</CODE>.
10588 <P>
10589
10590 <DT><CODE>convert-meta</CODE>
10591 <DD><A NAME="IDX341"></A>
10592 If set to <SAMP>`on'</SAMP>, Readline will convert characters with the
10593 eighth bit set to an ASCII key sequence by stripping the eighth
10594 bit and prefixing an <KBD>ESC</KBD> character, converting them to a
10595 meta-prefixed key sequence.  The default value is <SAMP>`on'</SAMP>.
10596 <P>
10597
10598 <DT><CODE>disable-completion</CODE>
10599 <DD><A NAME="IDX342"></A>
10600 If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion.
10601 Completion  characters will be inserted into the line as if they had
10602 been mapped to <CODE>self-insert</CODE>.  The default is <SAMP>`off'</SAMP>.
10603 <P>
10604
10605 <DT><CODE>editing-mode</CODE>
10606 <DD><A NAME="IDX343"></A>
10607 The <CODE>editing-mode</CODE> variable controls which default set of
10608 key bindings is used.  By default, Readline starts up in Emacs editing
10609 mode, where the keystrokes are most similar to Emacs.  This variable can be
10610 set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>.
10611 <P>
10612
10613 <DT><CODE>echo-control-characters</CODE>
10614 <DD>When set to <SAMP>`on'</SAMP>, on operating systems that indicate they support it,
10615 readline echoes a character corresponding to a signal generated from the
10616 keyboard.  The default is <SAMP>`on'</SAMP>.
10617 <P>
10618
10619 <DT><CODE>enable-keypad</CODE>
10620 <DD><A NAME="IDX344"></A>
10621 When set to <SAMP>`on'</SAMP>, Readline will try to enable the application
10622 keypad when it is called.  Some systems need this to enable the
10623 arrow keys.  The default is <SAMP>`off'</SAMP>.
10624 <P>
10625
10626 <DT><CODE>enable-meta-key</CODE>
10627 <DD>When set to <SAMP>`on'</SAMP>, Readline will try to enable any meta modifier
10628 key the terminal claims to support when it is called.  On many terminals,
10629 the meta key is used to send eight-bit characters.
10630 The default is <SAMP>`on'</SAMP>.
10631 <P>
10632
10633 <DT><CODE>expand-tilde</CODE>
10634 <DD><A NAME="IDX345"></A>
10635 If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline
10636 attempts word completion.  The default is <SAMP>`off'</SAMP>.
10637 <P>
10638
10639 <DT><CODE>history-preserve-point</CODE>
10640 <DD><A NAME="IDX346"></A>
10641 If set to <SAMP>`on'</SAMP>, the history code attempts to place the point (the
10642 current cursor position) at the
10643 same location on each history line retrieved with <CODE>previous-history</CODE>
10644 or <CODE>next-history</CODE>.  The default is <SAMP>`off'</SAMP>.
10645 <P>
10646
10647 <DT><CODE>history-size</CODE>
10648 <DD><A NAME="IDX347"></A>
10649 Set the maximum number of history entries saved in the history list.
10650 If set to zero, any existing history entries are deleted and no new entries
10651 are saved.
10652 If set to a value less than zero, the number of history entries is not
10653 limited.
10654 By default, the number of history entries is not limited.
10655 <P>
10656
10657 <DT><CODE>horizontal-scroll-mode</CODE>
10658 <DD><A NAME="IDX348"></A>
10659 This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>.  Setting it
10660 to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll
10661 horizontally on a single screen line when they are longer than the width
10662 of the screen, instead of wrapping onto a new screen line.  By default,
10663 this variable is set to <SAMP>`off'</SAMP>.
10664 <P>
10665
10666 <DT><CODE>input-meta</CODE>
10667 <DD><A NAME="IDX349"></A>
10668 <A NAME="IDX350"></A>
10669 If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it
10670 will not clear the eighth bit in the characters it reads),
10671 regardless of what the terminal claims it can support.  The
10672 default value is <SAMP>`off'</SAMP>.  The name <CODE>meta-flag</CODE> is a
10673 synonym for this variable.
10674 <P>
10675
10676 <DT><CODE>isearch-terminators</CODE>
10677 <DD><A NAME="IDX351"></A>
10678 The string of characters that should terminate an incremental search without
10679 subsequently executing the character as a command (see section <A HREF="bashref.html#SEC103">8.2.5 Searching for Commands in the History</A>).
10680 If this variable has not been given a value, the characters <KBD>ESC</KBD> and
10681 <KBD>C-J</KBD> will terminate an incremental search.
10682 <P>
10683
10684 <DT><CODE>keymap</CODE>
10685 <DD><A NAME="IDX352"></A>
10686 Sets Readline's idea of the current keymap for key binding commands.
10687 Acceptable <CODE>keymap</CODE> names are
10688 <CODE>emacs</CODE>,
10689 <CODE>emacs-standard</CODE>,
10690 <CODE>emacs-meta</CODE>,
10691 <CODE>emacs-ctlx</CODE>,
10692 <CODE>vi</CODE>,
10693 <CODE>vi-move</CODE>,
10694 <CODE>vi-command</CODE>, and
10695 <CODE>vi-insert</CODE>.
10696 <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; <CODE>emacs</CODE> is
10697 equivalent to <CODE>emacs-standard</CODE>.  The default value is <CODE>emacs</CODE>.
10698 The value of the <CODE>editing-mode</CODE> variable also affects the
10699 default keymap.
10700 <P>
10701
10702 <DT><CODE>keyseq-timeout</CODE>
10703 <DD>Specifies the duration Readline will wait for a character when reading an
10704 ambiguous key sequence (one that can form a complete key sequence using
10705 the input read so far, or can take additional input to complete a longer
10706 key sequence).
10707 If no input is received within the timeout, Readline will use the shorter
10708 but complete key sequence.
10709 Readline uses this value to determine whether or not input is
10710 available on the current input source (<CODE>rl_instream</CODE> by default).
10711 The value is specified in milliseconds, so a value of 1000 means that
10712 Readline will wait one second for additional input.
10713 If this variable is set to a value less than or equal to zero, or to a
10714 non-numeric value, Readline will wait until another key is pressed to
10715 decide which key sequence to complete.
10716 The default value is <CODE>500</CODE>.
10717 <P>
10718
10719 <DT><CODE>mark-directories</CODE>
10720 <DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash
10721 appended.  The default is <SAMP>`on'</SAMP>.
10722 <P>
10723
10724 <DT><CODE>mark-modified-lines</CODE>
10725 <DD><A NAME="IDX353"></A>
10726 This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an
10727 asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified.
10728 This variable is <SAMP>`off'</SAMP> by default.
10729 <P>
10730
10731 <DT><CODE>mark-symlinked-directories</CODE>
10732 <DD><A NAME="IDX354"></A>
10733 If set to <SAMP>`on'</SAMP>, completed names which are symbolic links
10734 to directories have a slash appended (subject to the value of
10735 <CODE>mark-directories</CODE>).
10736 The default is <SAMP>`off'</SAMP>.
10737 <P>
10738
10739 <DT><CODE>match-hidden-files</CODE>
10740 <DD><A NAME="IDX355"></A>
10741 This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose
10742 names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename
10743 completion.
10744 If set to <SAMP>`off'</SAMP>, the leading <SAMP>`.'</SAMP> must be
10745 supplied by the user in the filename to be completed.
10746 This variable is <SAMP>`on'</SAMP> by default.
10747 <P>
10748
10749 <DT><CODE>menu-complete-display-prefix</CODE>
10750 <DD><A NAME="IDX356"></A>
10751 If set to <SAMP>`on'</SAMP>, menu completion displays the common prefix of the
10752 list of possible completions (which may be empty) before cycling through
10753 the list.  The default is <SAMP>`off'</SAMP>.
10754 <P>
10755
10756 <DT><CODE>output-meta</CODE>
10757 <DD><A NAME="IDX357"></A>
10758 If set to <SAMP>`on'</SAMP>, Readline will display characters with the
10759 eighth bit set directly rather than as a meta-prefixed escape
10760 sequence.  The default is <SAMP>`off'</SAMP>.
10761 <P>
10762
10763 <DT><CODE>page-completions</CODE>
10764 <DD><A NAME="IDX358"></A>
10765 If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager
10766 to display a screenful of possible completions at a time.
10767 This variable is <SAMP>`on'</SAMP> by default.
10768 <P>
10769
10770 <DT><CODE>print-completions-horizontally</CODE>
10771 <DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches
10772 sorted horizontally in alphabetical order, rather than down the screen.
10773 The default is <SAMP>`off'</SAMP>.
10774 <P>
10775
10776 <DT><CODE>revert-all-at-newline</CODE>
10777 <DD><A NAME="IDX359"></A>
10778 If set to <SAMP>`on'</SAMP>, Readline will undo all changes to history lines
10779 before returning when <CODE>accept-line</CODE> is executed.  By default,
10780 history lines may be modified and retain individual undo lists across
10781 calls to <CODE>readline</CODE>.  The default is <SAMP>`off'</SAMP>.
10782 <P>
10783
10784 <DT><CODE>show-all-if-ambiguous</CODE>
10785 <DD><A NAME="IDX360"></A>
10786 This alters the default behavior of the completion functions.  If
10787 set to <SAMP>`on'</SAMP>, 
10788 words which have more than one possible completion cause the
10789 matches to be listed immediately instead of ringing the bell.
10790 The default value is <SAMP>`off'</SAMP>.
10791 <P>
10792
10793 <DT><CODE>show-all-if-unmodified</CODE>
10794 <DD><A NAME="IDX361"></A>
10795 This alters the default behavior of the completion functions in
10796 a fashion similar to <VAR>show-all-if-ambiguous</VAR>.
10797 If set to <SAMP>`on'</SAMP>, 
10798 words which have more than one possible completion without any
10799 possible partial completion (the possible completions don't share
10800 a common prefix) cause the matches to be listed immediately instead
10801 of ringing the bell.
10802 The default value is <SAMP>`off'</SAMP>.
10803 <P>
10804
10805 <DT><CODE>show-mode-in-prompt</CODE>
10806 <DD><A NAME="IDX362"></A>
10807 If set to <SAMP>`on'</SAMP>, add a character to the beginning of the prompt
10808 indicating the editing mode: emacs (<SAMP>`@'</SAMP>), vi command (<SAMP>`:'</SAMP>),
10809 or vi insertion (<SAMP>`+'</SAMP>).
10810 The default value is <SAMP>`off'</SAMP>.
10811 <P>
10812
10813 <DT><CODE>skip-completed-text</CODE>
10814 <DD><A NAME="IDX363"></A>
10815 If set to <SAMP>`on'</SAMP>, this alters the default completion behavior when
10816 inserting a single match into the line.  It's only active when
10817 performing completion in the middle of a word.  If enabled, readline
10818 does not insert characters from the completion that match characters
10819 after point in the word being completed, so portions of the word
10820 following the cursor are not duplicated.
10821 For instance, if this is enabled, attempting completion when the cursor
10822 is after the <SAMP>`e'</SAMP> in <SAMP>`Makefile'</SAMP> will result in <SAMP>`Makefile'</SAMP>
10823 rather than <SAMP>`Makefilefile'</SAMP>, assuming there is a single possible
10824 completion.
10825 The default value is <SAMP>`off'</SAMP>.
10826 <P>
10827
10828 <DT><CODE>visible-stats</CODE>
10829 <DD><A NAME="IDX364"></A>
10830 If set to <SAMP>`on'</SAMP>, a character denoting a file's type
10831 is appended to the filename when listing possible
10832 completions.  The default is <SAMP>`off'</SAMP>.
10833 <P>
10834
10835 </DL>
10836 <P>
10837
10838 <DT>Key Bindings
10839 <DD>The syntax for controlling key bindings in the init file is
10840 simple.  First you need to find the name of the command that you
10841 want to change.  The following sections contain tables of the command
10842 name, the default keybinding, if any, and a short description of what
10843 the command does.
10844 <P>
10845
10846 Once you know the name of the command, simply place on a line
10847 in the init file the name of the key
10848 you wish to bind the command to, a colon, and then the name of the
10849 command.
10850 There can be no space between the key name and the colon -- that will be
10851 interpreted as part of the key name.
10852 The name of the key can be expressed in different ways, depending on
10853 what you find most comfortable.
10854 </P><P>
10855
10856 In addition to command names, readline allows keys to be bound
10857 to a string that is inserted when the key is pressed (a <VAR>macro</VAR>).
10858 </P><P>
10859
10860 The <CODE>bind -p</CODE> command displays Readline function names and
10861 bindings in a format that can put directly into an initialization file.
10862 See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>.
10863 </P><P>
10864
10865 <DL COMPACT>
10866 <DT><VAR>keyname</VAR>: <VAR>function-name</VAR> or <VAR>macro</VAR>
10867 <DD><VAR>keyname</VAR> is the name of a key spelled out in English.  For example:
10868 <TABLE><tr><td>&nbsp;</td><td class=example><pre>Control-u: universal-argument
10869 Meta-Rubout: backward-kill-word
10870 Control-o: "&#62; output"
10871 </pre></td></tr></table><P>
10872
10873 In the above example, <KBD>C-u</KBD> is bound to the function
10874 <CODE>universal-argument</CODE>,
10875 <KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and
10876 <KBD>C-o</KBD> is bound to run the macro
10877 expressed on the right hand side (that is, to insert the text
10878 <SAMP>`&#62; output'</SAMP> into the line).
10879 </P><P>
10880
10881 A number of symbolic character names are recognized while
10882 processing this key binding syntax:
10883 <VAR>DEL</VAR>,
10884 <VAR>ESC</VAR>,
10885 <VAR>ESCAPE</VAR>,
10886 <VAR>LFD</VAR>,
10887 <VAR>NEWLINE</VAR>,
10888 <VAR>RET</VAR>,
10889 <VAR>RETURN</VAR>,
10890 <VAR>RUBOUT</VAR>,
10891 <VAR>SPACE</VAR>,
10892 <VAR>SPC</VAR>,
10893 and
10894 <VAR>TAB</VAR>.
10895 </P><P>
10896
10897 <DT>"<VAR>keyseq</VAR>": <VAR>function-name</VAR> or <VAR>macro</VAR>
10898 <DD><VAR>keyseq</VAR> differs from <VAR>keyname</VAR> above in that strings
10899 denoting an entire key sequence can be specified, by placing
10900 the key sequence in double quotes.  Some GNU Emacs style key
10901 escapes can be used, as in the following example, but the
10902 special character names are not recognized.
10903 <P>
10904
10905 <TABLE><tr><td>&nbsp;</td><td class=example><pre>"\C-u": universal-argument
10906 "\C-x\C-r": re-read-init-file
10907 "\e[11~": "Function Key 1"
10908 </pre></td></tr></table></P><P>
10909
10910 In the above example, <KBD>C-u</KBD> is again bound to the function
10911 <CODE>universal-argument</CODE> (just as it was in the first example),
10912 <SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>,
10913 and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert
10914 the text <SAMP>`Function Key 1'</SAMP>.
10915 </P><P>
10916
10917 </DL>
10918 <P>
10919
10920 The following GNU Emacs style escape sequences are available when
10921 specifying key sequences:
10922 </P><P>
10923
10924 <DL COMPACT>
10925 <DT><CODE><KBD>\C-</KBD></CODE>
10926 <DD>control prefix
10927 <DT><CODE><KBD>\M-</KBD></CODE>
10928 <DD>meta prefix
10929 <DT><CODE><KBD>\e</KBD></CODE>
10930 <DD>an escape character
10931 <DT><CODE><KBD>\\</KBD></CODE>
10932 <DD>backslash
10933 <DT><CODE><KBD>\"</KBD></CODE>
10934 <DD><KBD>"</KBD>, a double quotation mark
10935 <DT><CODE><KBD>\'</KBD></CODE>
10936 <DD><KBD>'</KBD>, a single quote or apostrophe
10937 </DL>
10938 <P>
10939
10940 In addition to the GNU Emacs style escape sequences, a second
10941 set of backslash escapes is available:
10942 </P><P>
10943
10944 <DL COMPACT>
10945 <DT><CODE>\a</CODE>
10946 <DD>alert (bell)
10947 <DT><CODE>\b</CODE>
10948 <DD>backspace
10949 <DT><CODE>\d</CODE>
10950 <DD>delete
10951 <DT><CODE>\f</CODE>
10952 <DD>form feed
10953 <DT><CODE>\n</CODE>
10954 <DD>newline
10955 <DT><CODE>\r</CODE>
10956 <DD>carriage return
10957 <DT><CODE>\t</CODE>
10958 <DD>horizontal tab
10959 <DT><CODE>\v</CODE>
10960 <DD>vertical tab
10961 <DT><CODE>\<VAR>nnn</VAR></CODE>
10962 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
10963 (one to three digits)
10964 <DT><CODE>\x<VAR>HH</VAR></CODE>
10965 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
10966 (one or two hex digits)
10967 </DL>
10968 <P>
10969
10970 When entering the text of a macro, single or double quotes must
10971 be used to indicate a macro definition.
10972 Unquoted text is assumed to be a function name.
10973 In the macro body, the backslash escapes described above are expanded.
10974 Backslash will quote any other character in the macro text,
10975 including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>.
10976 For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP>
10977 insert a single <SAMP>`\'</SAMP> into the line:
10978 <TABLE><tr><td>&nbsp;</td><td class=example><pre>"\C-x\\": "\\"
10979 </pre></td></tr></table></P><P>
10980
10981 </DL>
10982 <P>
10983
10984 <A NAME="Conditional Init Constructs"></A>
10985 <HR SIZE="6">
10986 <A NAME="SEC106"></A>
10987 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10988 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> &lt; </A>]</TD>
10989 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt; </A>]</TD>
10990 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt;&lt; </A>]</TD>
10991 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> Up </A>]</TD>
10992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &gt;&gt; </A>]</TD>
10993 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10994 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10995 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
10996 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10997 </TR></TABLE>
10998 <H3> 8.3.2 Conditional Init Constructs </H3>
10999 <!--docid::SEC106::-->
11000 <P>
11001
11002 Readline implements a facility similar in spirit to the conditional
11003 compilation features of the C preprocessor which allows key
11004 bindings and variable settings to be performed as the result
11005 of tests.  There are four parser directives used.
11006 </P><P>
11007
11008 <DL COMPACT>
11009 <DT><CODE>$if</CODE>
11010 <DD>The <CODE>$if</CODE> construct allows bindings to be made based on the
11011 editing mode, the terminal being used, or the application using
11012 Readline.  The text of the test extends to the end of the line;
11013 no characters are required to isolate it.
11014 <P>
11015
11016 <DL COMPACT>
11017 <DT><CODE>mode</CODE>
11018 <DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test
11019 whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode.
11020 This may be used in conjunction
11021 with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in
11022 the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if
11023 Readline is starting out in <CODE>emacs</CODE> mode.
11024 <P>
11025
11026 <DT><CODE>term</CODE>
11027 <DD>The <CODE>term=</CODE> form may be used to include terminal-specific
11028 key bindings, perhaps to bind the key sequences output by the
11029 terminal's function keys.  The word on the right side of the
11030 <SAMP>`='</SAMP> is tested against both the full name of the terminal and
11031 the portion of the terminal name before the first <SAMP>`-'</SAMP>.  This
11032 allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>,
11033 for instance.
11034 <P>
11035
11036 <DT><CODE>application</CODE>
11037 <DD>The <VAR>application</VAR> construct is used to include
11038 application-specific settings.  Each program using the Readline
11039 library sets the <VAR>application name</VAR>, and you can test for
11040 a particular value. 
11041 This could be used to bind key sequences to functions useful for
11042 a specific program.  For instance, the following command adds a
11043 key sequence that quotes the current or previous word in Bash:
11044 <TABLE><tr><td>&nbsp;</td><td class=example><pre>$if Bash
11045 # Quote the current or previous word
11046 "\C-xq": "\eb\"\ef\""
11047 $endif
11048 </pre></td></tr></table></DL>
11049 <P>
11050
11051 <DT><CODE>$endif</CODE>
11052 <DD>This command, as seen in the previous example, terminates an
11053 <CODE>$if</CODE> command.
11054 <P>
11055
11056 <DT><CODE>$else</CODE>
11057 <DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if
11058 the test fails.
11059 <P>
11060
11061 <DT><CODE>$include</CODE>
11062 <DD>This directive takes a single filename as an argument and reads commands
11063 and bindings from that file.
11064 For example, the following directive reads from <TT>`/etc/inputrc'</TT>:
11065 <TABLE><tr><td>&nbsp;</td><td class=example><pre>$include /etc/inputrc
11066 </pre></td></tr></table></DL>
11067 <P>
11068
11069 <A NAME="Sample Init File"></A>
11070 <HR SIZE="6">
11071 <A NAME="SEC107"></A>
11072 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11073 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &lt; </A>]</TD>
11074 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &gt; </A>]</TD>
11075 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &lt;&lt; </A>]</TD>
11076 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> Up </A>]</TD>
11077 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &gt;&gt; </A>]</TD>
11078 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11079 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11080 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11081 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11082 </TR></TABLE>
11083 <H3> 8.3.3 Sample Init File </H3>
11084 <!--docid::SEC107::-->
11085 <P>
11086
11087 Here is an example of an <VAR>inputrc</VAR> file.  This illustrates key
11088 binding, variable assignment, and conditional syntax.
11089 </P><P>
11090
11091 <TABLE><tr><td>&nbsp;</td><td class=example><pre># This file controls the behaviour of line input editing for
11092 # programs that use the GNU Readline library.  Existing
11093 # programs include FTP, Bash, and GDB.
11094 #
11095 # You can re-read the inputrc file with C-x C-r.
11096 # Lines beginning with '#' are comments.
11097 #
11098 # First, include any system-wide bindings and variable
11099 # assignments from /etc/Inputrc
11100 $include /etc/Inputrc
11101
11102 #
11103 # Set various bindings for emacs mode.
11104
11105 set editing-mode emacs 
11106
11107 $if mode=emacs
11108
11109 Meta-Control-h: backward-kill-word      Text after the function name is ignored
11110
11111 #
11112 # Arrow keys in keypad mode
11113 #
11114 #"\M-OD":        backward-char
11115 #"\M-OC":        forward-char
11116 #"\M-OA":        previous-history
11117 #"\M-OB":        next-history
11118 #
11119 # Arrow keys in ANSI mode
11120 #
11121 "\M-[D":        backward-char
11122 "\M-[C":        forward-char
11123 "\M-[A":        previous-history
11124 "\M-[B":        next-history
11125 #
11126 # Arrow keys in 8 bit keypad mode
11127 #
11128 #"\M-\C-OD":       backward-char
11129 #"\M-\C-OC":       forward-char
11130 #"\M-\C-OA":       previous-history
11131 #"\M-\C-OB":       next-history
11132 #
11133 # Arrow keys in 8 bit ANSI mode
11134 #
11135 #"\M-\C-[D":       backward-char
11136 #"\M-\C-[C":       forward-char
11137 #"\M-\C-[A":       previous-history
11138 #"\M-\C-[B":       next-history
11139
11140 C-q: quoted-insert
11141
11142 $endif
11143
11144 # An old-style binding.  This happens to be the default.
11145 TAB: complete
11146
11147 # Macros that are convenient for shell interaction
11148 $if Bash
11149 # edit the path
11150 "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
11151 # prepare to type a quoted word --
11152 # insert open and close double quotes
11153 # and move to just after the open quote
11154 "\C-x\"": "\"\"\C-b"
11155 # insert a backslash (testing backslash escapes
11156 # in sequences and macros)
11157 "\C-x\\": "\\"
11158 # Quote the current or previous word
11159 "\C-xq": "\eb\"\ef\""
11160 # Add a binding to refresh the line, which is unbound
11161 "\C-xr": redraw-current-line
11162 # Edit variable on current line.
11163 "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
11164 $endif
11165
11166 # use a visible bell if one is available
11167 set bell-style visible
11168
11169 # don't strip characters to 7 bits when reading
11170 set input-meta on
11171
11172 # allow iso-latin1 characters to be inserted rather
11173 # than converted to prefix-meta sequences
11174 set convert-meta off
11175
11176 # display characters with the eighth bit set directly
11177 # rather than as meta-prefixed characters
11178 set output-meta on
11179
11180 # if there are more than 150 possible completions for
11181 # a word, ask the user if he wants to see all of them
11182 set completion-query-items 150
11183
11184 # For FTP
11185 $if Ftp
11186 "\C-xg": "get \M-?"
11187 "\C-xt": "put \M-?"
11188 "\M-.": yank-last-arg
11189 $endif
11190 </pre></td></tr></table></P><P>
11191
11192 <A NAME="Bindable Readline Commands"></A>
11193 <HR SIZE="6">
11194 <A NAME="SEC108"></A>
11195 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11196 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt; </A>]</TD>
11197 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> &gt; </A>]</TD>
11198 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt;&lt; </A>]</TD>
11199 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
11200 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11201 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11202 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11203 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11204 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11205 </TR></TABLE>
11206 <H2> 8.4 Bindable Readline Commands </H2>
11207 <!--docid::SEC108::-->
11208 <P>
11209
11210 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
11211 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR>
11212 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR>
11213 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR>
11214 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR>
11215 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR>
11216 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Getting Readline to do the typing for you.</TD></TR>
11217 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR>
11218 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR>
11219 </TABLE></BLOCKQUOTE>
11220 <P>
11221
11222 This section describes Readline commands that may be bound to key
11223 sequences.
11224 You can list your key bindings by executing
11225 <CODE>bind -P</CODE> or, for a more terse format, suitable for an
11226 <VAR>inputrc</VAR> file, <CODE>bind -p</CODE>.  (See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>.)
11227 Command names without an accompanying key sequence are unbound by default.
11228 </P><P>
11229
11230 In the following descriptions, <EM>point</EM> refers to the current cursor
11231 position, and <EM>mark</EM> refers to a cursor position saved by the
11232 <CODE>set-mark</CODE> command.
11233 The text between the point and mark is referred to as the <EM>region</EM>.
11234 </P><P>
11235
11236 <A NAME="Commands For Moving"></A>
11237 <HR SIZE="6">
11238 <A NAME="SEC109"></A>
11239 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11240 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &lt; </A>]</TD>
11241 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &gt; </A>]</TD>
11242 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt;&lt; </A>]</TD>
11243 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11244 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11245 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11246 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11247 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11248 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11249 </TR></TABLE>
11250 <H3> 8.4.1 Commands For Moving </H3>
11251 <!--docid::SEC109::-->
11252 <DL COMPACT>
11253 <A NAME="IDX365"></A>
11254 <DT><CODE>beginning-of-line (C-a)</CODE>
11255 <DD><A NAME="IDX366"></A>
11256 Move to the start of the current line.
11257 <P>
11258
11259 <A NAME="IDX367"></A>
11260 <DT><CODE>end-of-line (C-e)</CODE>
11261 <DD><A NAME="IDX368"></A>
11262 Move to the end of the line.
11263 <P>
11264
11265 <A NAME="IDX369"></A>
11266 <DT><CODE>forward-char (C-f)</CODE>
11267 <DD><A NAME="IDX370"></A>
11268 Move forward a character.
11269 <P>
11270
11271 <A NAME="IDX371"></A>
11272 <DT><CODE>backward-char (C-b)</CODE>
11273 <DD><A NAME="IDX372"></A>
11274 Move back a character.
11275 <P>
11276
11277 <A NAME="IDX373"></A>
11278 <DT><CODE>forward-word (M-f)</CODE>
11279 <DD><A NAME="IDX374"></A>
11280 Move forward to the end of the next word.
11281 Words are composed of letters and digits.
11282 <P>
11283
11284 <A NAME="IDX375"></A>
11285 <DT><CODE>backward-word (M-b)</CODE>
11286 <DD><A NAME="IDX376"></A>
11287 Move back to the start of the current or previous word.
11288 Words are composed of letters and digits.
11289 <P>
11290
11291 <A NAME="IDX377"></A>
11292 <DT><CODE>shell-forward-word ()</CODE>
11293 <DD><A NAME="IDX378"></A>
11294 Move forward to the end of the next word.
11295 Words are delimited by non-quoted shell metacharacters.
11296 <P>
11297
11298 <A NAME="IDX379"></A>
11299 <DT><CODE>shell-backward-word ()</CODE>
11300 <DD><A NAME="IDX380"></A>
11301 Move back to the start of the current or previous word.
11302 Words are delimited by non-quoted shell metacharacters.
11303 <P>
11304
11305 <A NAME="IDX381"></A>
11306 <DT><CODE>clear-screen (C-l)</CODE>
11307 <DD><A NAME="IDX382"></A>
11308 Clear the screen and redraw the current line,
11309 leaving the current line at the top of the screen.
11310 <P>
11311
11312 <A NAME="IDX383"></A>
11313 <DT><CODE>redraw-current-line ()</CODE>
11314 <DD><A NAME="IDX384"></A>
11315 Refresh the current line.  By default, this is unbound.
11316 <P>
11317
11318 </DL>
11319 <P>
11320
11321 <A NAME="Commands For History"></A>
11322 <HR SIZE="6">
11323 <A NAME="SEC110"></A>
11324 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11325 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> &lt; </A>]</TD>
11326 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &gt; </A>]</TD>
11327 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &lt;&lt; </A>]</TD>
11328 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11329 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11330 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11331 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11332 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11333 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11334 </TR></TABLE>
11335 <H3> 8.4.2 Commands For Manipulating The History </H3>
11336 <!--docid::SEC110::-->
11337 <P>
11338
11339 <DL COMPACT>
11340 <A NAME="IDX385"></A>
11341 <DT><CODE>accept-line (Newline or Return)</CODE>
11342 <DD><A NAME="IDX386"></A>
11343 Accept the line regardless of where the cursor is.
11344 If this line is
11345 non-empty, add it to the history list according to the setting of
11346 the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables.
11347 If this line is a modified history line, then restore the history line
11348 to its original state.
11349 <P>
11350
11351 <A NAME="IDX387"></A>
11352 <DT><CODE>previous-history (C-p)</CODE>
11353 <DD><A NAME="IDX388"></A>
11354 Move `back' through the history list, fetching the previous command.
11355 <P>
11356
11357 <A NAME="IDX389"></A>
11358 <DT><CODE>next-history (C-n)</CODE>
11359 <DD><A NAME="IDX390"></A>
11360 Move `forward' through the history list, fetching the next command.
11361 <P>
11362
11363 <A NAME="IDX391"></A>
11364 <DT><CODE>beginning-of-history (M-&#60;)</CODE>
11365 <DD><A NAME="IDX392"></A>
11366 Move to the first line in the history.
11367 <P>
11368
11369 <A NAME="IDX393"></A>
11370 <DT><CODE>end-of-history (M-&#62;)</CODE>
11371 <DD><A NAME="IDX394"></A>
11372 Move to the end of the input history, i.e., the line currently
11373 being entered.
11374 <P>
11375
11376 <A NAME="IDX395"></A>
11377 <DT><CODE>reverse-search-history (C-r)</CODE>
11378 <DD><A NAME="IDX396"></A>
11379 Search backward starting at the current line and moving `up' through
11380 the history as necessary.  This is an incremental search.
11381 <P>
11382
11383 <A NAME="IDX397"></A>
11384 <DT><CODE>forward-search-history (C-s)</CODE>
11385 <DD><A NAME="IDX398"></A>
11386 Search forward starting at the current line and moving `down' through
11387 the the history as necessary.  This is an incremental search.
11388 <P>
11389
11390 <A NAME="IDX399"></A>
11391 <DT><CODE>non-incremental-reverse-search-history (M-p)</CODE>
11392 <DD><A NAME="IDX400"></A>
11393 Search backward starting at the current line and moving `up'
11394 through the history as necessary using a non-incremental search
11395 for a string supplied by the user.
11396 <P>
11397
11398 <A NAME="IDX401"></A>
11399 <DT><CODE>non-incremental-forward-search-history (M-n)</CODE>
11400 <DD><A NAME="IDX402"></A>
11401 Search forward starting at the current line and moving `down'
11402 through the the history as necessary using a non-incremental search
11403 for a string supplied by the user.
11404 <P>
11405
11406 <A NAME="IDX403"></A>
11407 <DT><CODE>history-search-forward ()</CODE>
11408 <DD><A NAME="IDX404"></A>
11409 Search forward through the history for the string of characters
11410 between the start of the current line and the point.
11411 The search string must match at the beginning of a history line.
11412 This is a non-incremental search.
11413 By default, this command is unbound.
11414 <P>
11415
11416 <A NAME="IDX405"></A>
11417 <DT><CODE>history-search-backward ()</CODE>
11418 <DD><A NAME="IDX406"></A>
11419 Search backward through the history for the string of characters
11420 between the start of the current line and the point.
11421 The search string must match at the beginning of a history line.
11422 This is a non-incremental search.
11423 By default, this command is unbound.
11424 <P>
11425
11426 <A NAME="IDX407"></A>
11427 <DT><CODE>history-substr-search-forward ()</CODE>
11428 <DD><A NAME="IDX408"></A>
11429 Search forward through the history for the string of characters
11430 between the start of the current line and the point.
11431 The search string may match anywhere in a history line.
11432 This is a non-incremental search.
11433 By default, this command is unbound.
11434 <P>
11435
11436 <A NAME="IDX409"></A>
11437 <DT><CODE>history-substr-search-backward ()</CODE>
11438 <DD><A NAME="IDX410"></A>
11439 Search backward through the history for the string of characters
11440 between the start of the current line and the point.
11441 The search string may match anywhere in a history line.
11442 This is a non-incremental search.
11443 By default, this command is unbound.
11444 <P>
11445
11446 <A NAME="IDX411"></A>
11447 <DT><CODE>yank-nth-arg (M-C-y)</CODE>
11448 <DD><A NAME="IDX412"></A>
11449 Insert the first argument to the previous command (usually
11450 the second word on the previous line) at point.
11451 With an argument <VAR>n</VAR>,
11452 insert the <VAR>n</VAR>th word from the previous command (the words
11453 in the previous command begin with word 0).  A negative argument
11454 inserts the <VAR>n</VAR>th word from the end of the previous command.
11455 Once the argument <VAR>n</VAR> is computed, the argument is extracted
11456 as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified.
11457 <P>
11458
11459 <A NAME="IDX413"></A>
11460 <DT><CODE>yank-last-arg (M-. or M-_)</CODE>
11461 <DD><A NAME="IDX414"></A>
11462 Insert last argument to the previous command (the last word of the
11463 previous history entry).
11464 With a numeric argument, behave exactly like <CODE>yank-nth-arg</CODE>.
11465 Successive calls to <CODE>yank-last-arg</CODE> move back through the history
11466 list, inserting the last word (or the word specified by the argument to
11467 the first call) of each line in turn.
11468 Any numeric argument supplied to these successive calls determines
11469 the direction to move through the history.  A negative argument switches
11470 the direction through the history (back or forward).
11471 The history expansion facilities are used to extract the last argument,
11472 as if the <SAMP>`!$'</SAMP> history expansion had been specified.
11473 <P>
11474
11475 </DL>
11476 <P>
11477
11478 <A NAME="Commands For Text"></A>
11479 <HR SIZE="6">
11480 <A NAME="SEC111"></A>
11481 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11482 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &lt; </A>]</TD>
11483 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &gt; </A>]</TD>
11484 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &lt;&lt; </A>]</TD>
11485 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11486 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11487 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11488 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11489 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11490 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11491 </TR></TABLE>
11492 <H3> 8.4.3 Commands For Changing Text </H3>
11493 <!--docid::SEC111::-->
11494 <P>
11495
11496 <DL COMPACT>
11497
11498 <A NAME="IDX415"></A>
11499 <DT><CODE><I>end-of-file</I> (usually C-d)</CODE>
11500 <DD><A NAME="IDX416"></A>
11501 The character indicating end-of-file as set, for example, by
11502 <CODE>stty</CODE>.  If this character is read when there are no characters
11503 on the line, and point is at the beginning of the line, Readline
11504 interprets it as the end of input and returns EOF.
11505 <P>
11506
11507 <A NAME="IDX417"></A>
11508 <DT><CODE>delete-char (C-d)</CODE>
11509 <DD><A NAME="IDX418"></A>
11510 Delete the character at point.  If this function is bound to the
11511 same character as the tty EOF character, as <KBD>C-d</KBD>
11512 commonly is, see above for the effects.
11513 <P>
11514
11515 <A NAME="IDX419"></A>
11516 <DT><CODE>backward-delete-char (Rubout)</CODE>
11517 <DD><A NAME="IDX420"></A>
11518 Delete the character behind the cursor.  A numeric argument means
11519 to kill the characters instead of deleting them.
11520 <P>
11521
11522 <A NAME="IDX421"></A>
11523 <DT><CODE>forward-backward-delete-char ()</CODE>
11524 <DD><A NAME="IDX422"></A>
11525 Delete the character under the cursor, unless the cursor is at the
11526 end of the line, in which case the character behind the cursor is
11527 deleted.  By default, this is not bound to a key.
11528 <P>
11529
11530 <A NAME="IDX423"></A>
11531 <DT><CODE>quoted-insert (C-q or C-v)</CODE>
11532 <DD><A NAME="IDX424"></A>
11533 Add the next character typed to the line verbatim.  This is
11534 how to insert key sequences like <KBD>C-q</KBD>, for example.
11535 <P>
11536
11537 <A NAME="IDX425"></A>
11538 <DT><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE>
11539 <DD><A NAME="IDX426"></A>
11540 Insert yourself.
11541 <P>
11542
11543 <A NAME="IDX427"></A>
11544 <DT><CODE>transpose-chars (C-t)</CODE>
11545 <DD><A NAME="IDX428"></A>
11546 Drag the character before the cursor forward over
11547 the character at the cursor, moving the
11548 cursor forward as well.  If the insertion point
11549 is at the end of the line, then this
11550 transposes the last two characters of the line.
11551 Negative arguments have no effect.
11552 <P>
11553
11554 <A NAME="IDX429"></A>
11555 <DT><CODE>transpose-words (M-t)</CODE>
11556 <DD><A NAME="IDX430"></A>
11557 Drag the word before point past the word after point,
11558 moving point past that word as well.
11559 If the insertion point is at the end of the line, this transposes
11560 the last two words on the line.
11561 <P>
11562
11563 <A NAME="IDX431"></A>
11564 <DT><CODE>upcase-word (M-u)</CODE>
11565 <DD><A NAME="IDX432"></A>
11566 Uppercase the current (or following) word.  With a negative argument,
11567 uppercase the previous word, but do not move the cursor.
11568 <P>
11569
11570 <A NAME="IDX433"></A>
11571 <DT><CODE>downcase-word (M-l)</CODE>
11572 <DD><A NAME="IDX434"></A>
11573 Lowercase the current (or following) word.  With a negative argument,
11574 lowercase the previous word, but do not move the cursor.
11575 <P>
11576
11577 <A NAME="IDX435"></A>
11578 <DT><CODE>capitalize-word (M-c)</CODE>
11579 <DD><A NAME="IDX436"></A>
11580 Capitalize the current (or following) word.  With a negative argument,
11581 capitalize the previous word, but do not move the cursor.
11582 <P>
11583
11584 <A NAME="IDX437"></A>
11585 <DT><CODE>overwrite-mode ()</CODE>
11586 <DD><A NAME="IDX438"></A>
11587 Toggle overwrite mode.  With an explicit positive numeric argument,
11588 switches to overwrite mode.  With an explicit non-positive numeric
11589 argument, switches to insert mode.  This command affects only
11590 <CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently.
11591 Each call to <CODE>readline()</CODE> starts in insert mode.
11592 <P>
11593
11594 In overwrite mode, characters bound to <CODE>self-insert</CODE> replace
11595 the text at point rather than pushing the text to the right.
11596 Characters bound to <CODE>backward-delete-char</CODE> replace the character
11597 before point with a space.
11598 </P><P>
11599
11600 By default, this command is unbound.
11601 </P><P>
11602
11603 </DL>
11604 <P>
11605
11606 <A NAME="Commands For Killing"></A>
11607 <HR SIZE="6">
11608 <A NAME="SEC112"></A>
11609 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11610 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &lt; </A>]</TD>
11611 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &gt; </A>]</TD>
11612 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &lt;&lt; </A>]</TD>
11613 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11614 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11615 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11616 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11617 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11618 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11619 </TR></TABLE>
11620 <H3> 8.4.4 Killing And Yanking </H3>
11621 <!--docid::SEC112::-->
11622 <P>
11623
11624 <DL COMPACT>
11625
11626 <A NAME="IDX439"></A>
11627 <DT><CODE>kill-line (C-k)</CODE>
11628 <DD><A NAME="IDX440"></A>
11629 Kill the text from point to the end of the line.
11630 <P>
11631
11632 <A NAME="IDX441"></A>
11633 <DT><CODE>backward-kill-line (C-x Rubout)</CODE>
11634 <DD><A NAME="IDX442"></A>
11635 Kill backward to the beginning of the line.
11636 <P>
11637
11638 <A NAME="IDX443"></A>
11639 <DT><CODE>unix-line-discard (C-u)</CODE>
11640 <DD><A NAME="IDX444"></A>
11641 Kill backward from the cursor to the beginning of the current line.
11642 <P>
11643
11644 <A NAME="IDX445"></A>
11645 <DT><CODE>kill-whole-line ()</CODE>
11646 <DD><A NAME="IDX446"></A>
11647 Kill all characters on the current line, no matter where point is.
11648 By default, this is unbound.
11649 <P>
11650
11651 <A NAME="IDX447"></A>
11652 <DT><CODE>kill-word (M-d)</CODE>
11653 <DD><A NAME="IDX448"></A>
11654 Kill from point to the end of the current word, or if between
11655 words, to the end of the next word.
11656 Word boundaries are the same as <CODE>forward-word</CODE>.
11657 <P>
11658
11659 <A NAME="IDX449"></A>
11660 <DT><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE>
11661 <DD><A NAME="IDX450"></A>
11662 Kill the word behind point.
11663 Word boundaries are the same as <CODE>backward-word</CODE>.
11664 <P>
11665
11666 <A NAME="IDX451"></A>
11667 <DT><CODE>shell-kill-word ()</CODE>
11668 <DD><A NAME="IDX452"></A>
11669 Kill from point to the end of the current word, or if between
11670 words, to the end of the next word.
11671 Word boundaries are the same as <CODE>shell-forward-word</CODE>.
11672 <P>
11673
11674 <A NAME="IDX453"></A>
11675 <DT><CODE>shell-backward-kill-word ()</CODE>
11676 <DD><A NAME="IDX454"></A>
11677 Kill the word behind point.
11678 Word boundaries are the same as <CODE>shell-backward-word</CODE>.
11679 <P>
11680
11681 <A NAME="IDX455"></A>
11682 <DT><CODE>unix-word-rubout (C-w)</CODE>
11683 <DD><A NAME="IDX456"></A>
11684 Kill the word behind point, using white space as a word boundary.
11685 The killed text is saved on the kill-ring.
11686 <P>
11687
11688 <A NAME="IDX457"></A>
11689 <DT><CODE>unix-filename-rubout ()</CODE>
11690 <DD><A NAME="IDX458"></A>
11691 Kill the word behind point, using white space and the slash character
11692 as the word boundaries.
11693 The killed text is saved on the kill-ring.
11694 <P>
11695
11696 <A NAME="IDX459"></A>
11697 <DT><CODE>delete-horizontal-space ()</CODE>
11698 <DD><A NAME="IDX460"></A>
11699 Delete all spaces and tabs around point.  By default, this is unbound.
11700 <P>
11701
11702 <A NAME="IDX461"></A>
11703 <DT><CODE>kill-region ()</CODE>
11704 <DD><A NAME="IDX462"></A>
11705 Kill the text in the current region.
11706 By default, this command is unbound.
11707 <P>
11708
11709 <A NAME="IDX463"></A>
11710 <DT><CODE>copy-region-as-kill ()</CODE>
11711 <DD><A NAME="IDX464"></A>
11712 Copy the text in the region to the kill buffer, so it can be yanked
11713 right away.  By default, this command is unbound.
11714 <P>
11715
11716 <A NAME="IDX465"></A>
11717 <DT><CODE>copy-backward-word ()</CODE>
11718 <DD><A NAME="IDX466"></A>
11719 Copy the word before point to the kill buffer.
11720 The word boundaries are the same as <CODE>backward-word</CODE>.
11721 By default, this command is unbound.
11722 <P>
11723
11724 <A NAME="IDX467"></A>
11725 <DT><CODE>copy-forward-word ()</CODE>
11726 <DD><A NAME="IDX468"></A>
11727 Copy the word following point to the kill buffer.
11728 The word boundaries are the same as <CODE>forward-word</CODE>.
11729 By default, this command is unbound.
11730 <P>
11731
11732 <A NAME="IDX469"></A>
11733 <DT><CODE>yank (C-y)</CODE>
11734 <DD><A NAME="IDX470"></A>
11735 Yank the top of the kill ring into the buffer at point.
11736 <P>
11737
11738 <A NAME="IDX471"></A>
11739 <DT><CODE>yank-pop (M-y)</CODE>
11740 <DD><A NAME="IDX472"></A>
11741 Rotate the kill-ring, and yank the new top.  You can only do this if
11742 the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>.
11743 </DL>
11744 <P>
11745
11746 <A NAME="Numeric Arguments"></A>
11747 <HR SIZE="6">
11748 <A NAME="SEC113"></A>
11749 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11750 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &lt; </A>]</TD>
11751 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &gt; </A>]</TD>
11752 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &lt;&lt; </A>]</TD>
11753 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11754 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11755 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11756 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11757 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11758 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11759 </TR></TABLE>
11760 <H3> 8.4.5 Specifying Numeric Arguments </H3>
11761 <!--docid::SEC113::-->
11762 <DL COMPACT>
11763
11764 <A NAME="IDX473"></A>
11765 <DT><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE>
11766 <DD><A NAME="IDX474"></A>
11767 Add this digit to the argument already accumulating, or start a new
11768 argument.  <KBD>M--</KBD> starts a negative argument.
11769 <P>
11770
11771 <A NAME="IDX475"></A>
11772 <DT><CODE>universal-argument ()</CODE>
11773 <DD><A NAME="IDX476"></A>
11774 This is another way to specify an argument.
11775 If this command is followed by one or more digits, optionally with a
11776 leading minus sign, those digits define the argument.
11777 If the command is followed by digits, executing <CODE>universal-argument</CODE>
11778 again ends the numeric argument, but is otherwise ignored.
11779 As a special case, if this command is immediately followed by a
11780 character that is neither a digit or minus sign, the argument count
11781 for the next command is multiplied by four.
11782 The argument count is initially one, so executing this function the
11783 first time makes the argument count four, a second time makes the
11784 argument count sixteen, and so on.
11785 By default, this is not bound to a key.
11786 </DL>
11787 <P>
11788
11789 <A NAME="Commands For Completion"></A>
11790 <HR SIZE="6">
11791 <A NAME="SEC114"></A>
11792 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11793 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &lt; </A>]</TD>
11794 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &gt; </A>]</TD>
11795 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &lt;&lt; </A>]</TD>
11796 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11797 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11798 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11799 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11800 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11801 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11802 </TR></TABLE>
11803 <H3> 8.4.6 Letting Readline Type For You </H3>
11804 <!--docid::SEC114::-->
11805 <P>
11806
11807 <DL COMPACT>
11808 <A NAME="IDX477"></A>
11809 <DT><CODE>complete (<KBD>TAB</KBD>)</CODE>
11810 <DD><A NAME="IDX478"></A>
11811 Attempt to perform completion on the text before point.
11812 The actual completion performed is application-specific.
11813 Bash attempts completion treating the text as a variable (if the
11814 text begins with <SAMP>`$'</SAMP>), username (if the text begins with
11815 <SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or
11816 command (including aliases and functions) in turn.  If none 
11817 of these produces a match, filename completion is attempted.
11818 <P>
11819
11820 <A NAME="IDX479"></A>
11821 <DT><CODE>possible-completions (M-?)</CODE>
11822 <DD><A NAME="IDX480"></A>
11823 List the possible completions of the text before point.
11824 When displaying completions, Readline sets the number of columns used
11825 for display to the value of <CODE>completion-display-width</CODE>, the value of
11826 the environment variable <CODE>COLUMNS</CODE>, or the screen width, in that order.
11827 <P>
11828
11829 <A NAME="IDX481"></A>
11830 <DT><CODE>insert-completions (M-*)</CODE>
11831 <DD><A NAME="IDX482"></A>
11832 Insert all completions of the text before point that would have
11833 been generated by <CODE>possible-completions</CODE>.
11834 <P>
11835
11836 <A NAME="IDX483"></A>
11837 <DT><CODE>menu-complete ()</CODE>
11838 <DD><A NAME="IDX484"></A>
11839 Similar to <CODE>complete</CODE>, but replaces the word to be completed
11840 with a single match from the list of possible completions.
11841 Repeated execution of <CODE>menu-complete</CODE> steps through the list
11842 of possible completions, inserting each match in turn.
11843 At the end of the list of completions, the bell is rung
11844 (subject to the setting of <CODE>bell-style</CODE>)
11845 and the original text is restored.
11846 An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list
11847 of matches; a negative argument may be used to move backward
11848 through the list.
11849 This command is intended to be bound to <KBD>TAB</KBD>, but is unbound
11850 by default.
11851 <P>
11852
11853 <A NAME="IDX485"></A>
11854 <DT><CODE>menu-complete-backward ()</CODE>
11855 <DD><A NAME="IDX486"></A>
11856 Identical to <CODE>menu-complete</CODE>, but moves backward through the list
11857 of possible completions, as if <CODE>menu-complete</CODE> had been given a
11858 negative argument.
11859 <P>
11860
11861 <A NAME="IDX487"></A>
11862 <DT><CODE>delete-char-or-list ()</CODE>
11863 <DD><A NAME="IDX488"></A>
11864 Deletes the character under the cursor if not at the beginning or
11865 end of the line (like <CODE>delete-char</CODE>).
11866 If at the end of the line, behaves identically to
11867 <CODE>possible-completions</CODE>.
11868 This command is unbound by default.
11869 <P>
11870
11871 <A NAME="IDX489"></A>
11872 <DT><CODE>complete-filename (M-/)</CODE>
11873 <DD><A NAME="IDX490"></A>
11874 Attempt filename completion on the text before point.
11875 <P>
11876
11877 <A NAME="IDX491"></A>
11878 <DT><CODE>possible-filename-completions (C-x /)</CODE>
11879 <DD><A NAME="IDX492"></A>
11880 List the possible completions of the text before point,
11881 treating it as a filename.
11882 <P>
11883
11884 <A NAME="IDX493"></A>
11885 <DT><CODE>complete-username (M-~)</CODE>
11886 <DD><A NAME="IDX494"></A>
11887 Attempt completion on the text before point, treating
11888 it as a username.
11889 <P>
11890
11891 <A NAME="IDX495"></A>
11892 <DT><CODE>possible-username-completions (C-x ~)</CODE>
11893 <DD><A NAME="IDX496"></A>
11894 List the possible completions of the text before point,
11895 treating it as a username.
11896 <P>
11897
11898 <A NAME="IDX497"></A>
11899 <DT><CODE>complete-variable (M-$)</CODE>
11900 <DD><A NAME="IDX498"></A>
11901 Attempt completion on the text before point, treating
11902 it as a shell variable.
11903 <P>
11904
11905 <A NAME="IDX499"></A>
11906 <DT><CODE>possible-variable-completions (C-x $)</CODE>
11907 <DD><A NAME="IDX500"></A>
11908 List the possible completions of the text before point,
11909 treating it as a shell variable.
11910 <P>
11911
11912 <A NAME="IDX501"></A>
11913 <DT><CODE>complete-hostname (M-@)</CODE>
11914 <DD><A NAME="IDX502"></A>
11915 Attempt completion on the text before point, treating
11916 it as a hostname.
11917 <P>
11918
11919 <A NAME="IDX503"></A>
11920 <DT><CODE>possible-hostname-completions (C-x @)</CODE>
11921 <DD><A NAME="IDX504"></A>
11922 List the possible completions of the text before point,
11923 treating it as a hostname.
11924 <P>
11925
11926 <A NAME="IDX505"></A>
11927 <DT><CODE>complete-command (M-!)</CODE>
11928 <DD><A NAME="IDX506"></A>
11929 Attempt completion on the text before point, treating
11930 it as a command name.  Command completion attempts to
11931 match the text against aliases, reserved words, shell
11932 functions, shell builtins, and finally executable filenames,
11933 in that order.
11934 <P>
11935
11936 <A NAME="IDX507"></A>
11937 <DT><CODE>possible-command-completions (C-x !)</CODE>
11938 <DD><A NAME="IDX508"></A>
11939 List the possible completions of the text before point,
11940 treating it as a command name.
11941 <P>
11942
11943 <A NAME="IDX509"></A>
11944 <DT><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE>
11945 <DD><A NAME="IDX510"></A>
11946 Attempt completion on the text before point, comparing
11947 the text against lines from the history list for possible
11948 completion matches.
11949 <P>
11950
11951 <A NAME="IDX511"></A>
11952 <DT><CODE>dabbrev-expand ()</CODE>
11953 <DD><A NAME="IDX512"></A>
11954 Attempt menu completion on the text before point, comparing
11955 the text against lines from the history list for possible
11956 completion matches.
11957 <P>
11958
11959 <A NAME="IDX513"></A>
11960 <DT><CODE>complete-into-braces (M-{)</CODE>
11961 <DD><A NAME="IDX514"></A>
11962 Perform filename completion and insert the list of possible completions
11963 enclosed within braces so the list is available to the shell
11964 (see section <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>).
11965 <P>
11966
11967 </DL>
11968 <P>
11969
11970 <A NAME="Keyboard Macros"></A>
11971 <HR SIZE="6">
11972 <A NAME="SEC115"></A>
11973 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11974 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &lt; </A>]</TD>
11975 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt; </A>]</TD>
11976 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt;&lt; </A>]</TD>
11977 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
11978 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
11979 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11980 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11981 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
11982 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11983 </TR></TABLE>
11984 <H3> 8.4.7 Keyboard Macros </H3>
11985 <!--docid::SEC115::-->
11986 <DL COMPACT>
11987
11988 <A NAME="IDX515"></A>
11989 <DT><CODE>start-kbd-macro (C-x ()</CODE>
11990 <DD><A NAME="IDX516"></A>
11991 Begin saving the characters typed into the current keyboard macro.
11992 <P>
11993
11994 <A NAME="IDX517"></A>
11995 <DT><CODE>end-kbd-macro (C-x ))</CODE>
11996 <DD><A NAME="IDX518"></A>
11997 Stop saving the characters typed into the current keyboard macro
11998 and save the definition.
11999 <P>
12000
12001 <A NAME="IDX519"></A>
12002 <DT><CODE>call-last-kbd-macro (C-x e)</CODE>
12003 <DD><A NAME="IDX520"></A>
12004 Re-execute the last keyboard macro defined, by making the characters
12005 in the macro appear as if typed at the keyboard.
12006 <P>
12007
12008 <A NAME="IDX521"></A>
12009 <DT><CODE>print-last-kbd-macro ()</CODE>
12010 <DD><A NAME="IDX522"></A>
12011 Print the last keboard macro defined in a format suitable for the
12012 <VAR>inputrc</VAR> file.
12013 <P>
12014
12015 </DL>
12016 <P>
12017
12018 <A NAME="Miscellaneous Commands"></A>
12019 <HR SIZE="6">
12020 <A NAME="SEC116"></A>
12021 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12022 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &lt; </A>]</TD>
12023 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt; </A>]</TD>
12024 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt;&lt; </A>]</TD>
12025 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> Up </A>]</TD>
12026 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt;&gt; </A>]</TD>
12027 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12028 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12029 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
12030 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12031 </TR></TABLE>
12032 <H3> 8.4.8 Some Miscellaneous Commands </H3>
12033 <!--docid::SEC116::-->
12034 <DL COMPACT>
12035
12036 <A NAME="IDX523"></A>
12037 <DT><CODE>re-read-init-file (C-x C-r)</CODE>
12038 <DD><A NAME="IDX524"></A>
12039 Read in the contents of the <VAR>inputrc</VAR> file, and incorporate
12040 any bindings or variable assignments found there.
12041 <P>
12042
12043 <A NAME="IDX525"></A>
12044 <DT><CODE>abort (C-g)</CODE>
12045 <DD><A NAME="IDX526"></A>
12046 Abort the current editing command and
12047 ring the terminal's bell (subject to the setting of
12048 <CODE>bell-style</CODE>).
12049 <P>
12050
12051 <A NAME="IDX527"></A>
12052 <DT><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE>
12053 <DD><A NAME="IDX528"></A>
12054 If the metafied character <VAR>x</VAR> is lowercase, run the command
12055 that is bound to the corresponding uppercase character.
12056 <P>
12057
12058 <A NAME="IDX529"></A>
12059 <DT><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE>
12060 <DD><A NAME="IDX530"></A>
12061 Metafy the next character typed.  This is for keyboards
12062 without a meta key.  Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing
12063 <KBD>M-f</KBD>.
12064 <P>
12065
12066 <A NAME="IDX531"></A>
12067 <DT><CODE>undo (C-_ or C-x C-u)</CODE>
12068 <DD><A NAME="IDX532"></A>
12069 Incremental undo, separately remembered for each line.
12070 <P>
12071
12072 <A NAME="IDX533"></A>
12073 <DT><CODE>revert-line (M-r)</CODE>
12074 <DD><A NAME="IDX534"></A>
12075 Undo all changes made to this line.  This is like executing the <CODE>undo</CODE>
12076 command enough times to get back to the beginning.
12077 <P>
12078
12079 <A NAME="IDX535"></A>
12080 <DT><CODE>tilde-expand (M-&#38;)</CODE>
12081 <DD><A NAME="IDX536"></A>
12082 Perform tilde expansion on the current word.
12083 <P>
12084
12085 <A NAME="IDX537"></A>
12086 <DT><CODE>set-mark (C-@)</CODE>
12087 <DD><A NAME="IDX538"></A>
12088 Set the mark to the point.  If a
12089 numeric argument is supplied, the mark is set to that position.
12090 <P>
12091
12092 <A NAME="IDX539"></A>
12093 <DT><CODE>exchange-point-and-mark (C-x C-x)</CODE>
12094 <DD><A NAME="IDX540"></A>
12095 Swap the point with the mark.  The current cursor position is set to
12096 the saved position, and the old cursor position is saved as the mark.
12097 <P>
12098
12099 <A NAME="IDX541"></A>
12100 <DT><CODE>character-search (C-])</CODE>
12101 <DD><A NAME="IDX542"></A>
12102 A character is read and point is moved to the next occurrence of that
12103 character.  A negative count searches for previous occurrences.
12104 <P>
12105
12106 <A NAME="IDX543"></A>
12107 <DT><CODE>character-search-backward (M-C-])</CODE>
12108 <DD><A NAME="IDX544"></A>
12109 A character is read and point is moved to the previous occurrence
12110 of that character.  A negative count searches for subsequent
12111 occurrences.
12112 <P>
12113
12114 <A NAME="IDX545"></A>
12115 <DT><CODE>skip-csi-sequence ()</CODE>
12116 <DD><A NAME="IDX546"></A>
12117 Read enough characters to consume a multi-key sequence such as those
12118 defined for keys like Home and End.  Such sequences begin with a
12119 Control Sequence Indicator (CSI), usually ESC-[.  If this sequence is
12120 bound to "\e[", keys producing such sequences will have no effect
12121 unless explicitly bound to a readline command, instead of inserting
12122 stray characters into the editing buffer.  This is unbound by default,
12123 but usually bound to ESC-[.
12124 <P>
12125
12126 <A NAME="IDX547"></A>
12127 <DT><CODE>insert-comment (M-#)</CODE>
12128 <DD><A NAME="IDX548"></A>
12129 Without a numeric argument, the value of the <CODE>comment-begin</CODE>
12130 variable is inserted at the beginning of the current line.
12131 If a numeric argument is supplied, this command acts as a toggle:  if
12132 the characters at the beginning of the line do not match the value
12133 of <CODE>comment-begin</CODE>, the value is inserted, otherwise
12134 the characters in <CODE>comment-begin</CODE> are deleted from the beginning of
12135 the line.
12136 In either case, the line is accepted as if a newline had been typed.
12137 The default value of <CODE>comment-begin</CODE> causes this command
12138 to make the current line a shell comment.
12139 If a numeric argument causes the comment character to be removed, the line
12140 will be executed by the shell.
12141 <P>
12142
12143 <A NAME="IDX549"></A>
12144 <DT><CODE>dump-functions ()</CODE>
12145 <DD><A NAME="IDX550"></A>
12146 Print all of the functions and their key bindings to the
12147 Readline output stream.  If a numeric argument is supplied,
12148 the output is formatted in such a way that it can be made part
12149 of an <VAR>inputrc</VAR> file.  This command is unbound by default.
12150 <P>
12151
12152 <A NAME="IDX551"></A>
12153 <DT><CODE>dump-variables ()</CODE>
12154 <DD><A NAME="IDX552"></A>
12155 Print all of the settable variables and their values to the
12156 Readline output stream.  If a numeric argument is supplied,
12157 the output is formatted in such a way that it can be made part
12158 of an <VAR>inputrc</VAR> file.  This command is unbound by default.
12159 <P>
12160
12161 <A NAME="IDX553"></A>
12162 <DT><CODE>dump-macros ()</CODE>
12163 <DD><A NAME="IDX554"></A>
12164 Print all of the Readline key sequences bound to macros and the
12165 strings they output.  If a numeric argument is supplied,
12166 the output is formatted in such a way that it can be made part
12167 of an <VAR>inputrc</VAR> file.  This command is unbound by default.
12168 <P>
12169
12170 <A NAME="IDX555"></A>
12171 <DT><CODE>glob-complete-word (M-g)</CODE>
12172 <DD><A NAME="IDX556"></A>
12173 The word before point is treated as a pattern for pathname expansion,
12174 with an asterisk implicitly appended.  This pattern is used to
12175 generate a list of matching file names for possible completions.
12176 <P>
12177
12178 <A NAME="IDX557"></A>
12179 <DT><CODE>glob-expand-word (C-x *)</CODE>
12180 <DD><A NAME="IDX558"></A>
12181 The word before point is treated as a pattern for pathname expansion,
12182 and the list of matching file names is inserted, replacing the word.
12183 If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
12184 pathname expansion.
12185 <P>
12186
12187 <A NAME="IDX559"></A>
12188 <DT><CODE>glob-list-expansions (C-x g)</CODE>
12189 <DD><A NAME="IDX560"></A>
12190 The list of expansions that would have been generated by
12191 <CODE>glob-expand-word</CODE> is displayed, and the line is redrawn.
12192 If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
12193 pathname expansion.
12194 <P>
12195
12196 <A NAME="IDX561"></A>
12197 <DT><CODE>display-shell-version (C-x C-v)</CODE>
12198 <DD><A NAME="IDX562"></A>
12199 Display version information about the current instance of Bash.
12200 <P>
12201
12202 <A NAME="IDX563"></A>
12203 <DT><CODE>shell-expand-line (M-C-e)</CODE>
12204 <DD><A NAME="IDX564"></A>
12205 Expand the line as the shell does.
12206 This performs alias and history expansion as well as all of the shell
12207 word expansions (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
12208 <P>
12209
12210 <A NAME="IDX565"></A>
12211 <DT><CODE>history-expand-line (M-^)</CODE>
12212 <DD><A NAME="IDX566"></A>
12213 Perform history expansion on the current line.
12214 <P>
12215
12216 <A NAME="IDX567"></A>
12217 <DT><CODE>magic-space ()</CODE>
12218 <DD><A NAME="IDX568"></A>
12219 Perform history expansion on the current line and insert a space
12220 (see section <A HREF="bashref.html#SEC124">9.3 History Expansion</A>).
12221 <P>
12222
12223 <A NAME="IDX569"></A>
12224 <DT><CODE>alias-expand-line ()</CODE>
12225 <DD><A NAME="IDX570"></A>
12226 Perform alias expansion on the current line (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
12227 <P>
12228
12229 <A NAME="IDX571"></A>
12230 <DT><CODE>history-and-alias-expand-line ()</CODE>
12231 <DD><A NAME="IDX572"></A>
12232 Perform history and alias expansion on the current line.
12233 <P>
12234
12235 <A NAME="IDX573"></A>
12236 <DT><CODE>insert-last-argument (M-. or M-_)</CODE>
12237 <DD><A NAME="IDX574"></A>
12238 A synonym for <CODE>yank-last-arg</CODE>.
12239 <P>
12240
12241 <A NAME="IDX575"></A>
12242 <DT><CODE>operate-and-get-next (C-o)</CODE>
12243 <DD><A NAME="IDX576"></A>
12244 Accept the current line for execution and fetch the next line
12245 relative to the current line from the history for editing.  Any
12246 argument is ignored.
12247 <P>
12248
12249 <A NAME="IDX577"></A>
12250 <DT><CODE>edit-and-execute-command (C-xC-e)</CODE>
12251 <DD><A NAME="IDX578"></A>
12252 Invoke an editor on the current command line, and execute the result as shell
12253 commands.
12254 Bash attempts to invoke
12255 <CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE>
12256 as the editor, in that order.
12257 <P>
12258
12259 </DL>
12260 <P>
12261
12262 <A NAME="Readline vi Mode"></A>
12263 <HR SIZE="6">
12264 <A NAME="SEC117"></A>
12265 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12266 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt; </A>]</TD>
12267 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &gt; </A>]</TD>
12268 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &lt;&lt; </A>]</TD>
12269 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
12270 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt;&gt; </A>]</TD>
12271 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12272 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12273 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
12274 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12275 </TR></TABLE>
12276 <H2> 8.5 Readline vi Mode </H2>
12277 <!--docid::SEC117::-->
12278 <P>
12279
12280 While the Readline library does not have a full set of <CODE>vi</CODE>
12281 editing functions, it does contain enough to allow simple editing
12282 of the line.  The Readline <CODE>vi</CODE> mode behaves as specified in
12283 the POSIX standard.
12284 </P><P>
12285
12286 In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE>
12287 editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP>
12288 commands (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
12289 The Readline default is <CODE>emacs</CODE> mode.
12290 </P><P>
12291
12292 When you enter a line in <CODE>vi</CODE> mode, you are already placed in
12293 `insertion' mode, as if you had typed an <SAMP>`i'</SAMP>.  Pressing <KBD>ESC</KBD>
12294 switches you into `command' mode, where you can edit the text of the
12295 line with the standard <CODE>vi</CODE> movement keys, move to previous
12296 history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and
12297 so forth.
12298 </P><P>
12299
12300 <A NAME="Programmable Completion"></A>
12301 <HR SIZE="6">
12302 <A NAME="SEC118"></A>
12303 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12304 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt; </A>]</TD>
12305 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt; </A>]</TD>
12306 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &lt;&lt; </A>]</TD>
12307 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
12308 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt;&gt; </A>]</TD>
12309 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12311 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
12312 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12313 </TR></TABLE>
12314 <H2> 8.6 Programmable Completion </H2>
12315 <!--docid::SEC118::-->
12316 <P>
12317
12318 When word completion is attempted for an argument to a command for
12319 which a completion specification (a <VAR>compspec</VAR>) has been defined
12320 using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>),
12321 the programmable completion facilities are invoked. 
12322 </P><P>
12323
12324 First, the command name is identified.
12325 If a compspec has been defined for that command, the
12326 compspec is used to generate the list of possible completions for the word.
12327 If the command word is the empty string (completion attempted at the
12328 beginning of an empty line), any compspec defined with
12329 the <SAMP>`-E'</SAMP> option to <CODE>complete</CODE> is used.
12330 If the command word is a full pathname, a compspec for the full
12331 pathname is searched for first.
12332 If no compspec is found for the full pathname, an attempt is made to
12333 find a compspec for the portion following the final slash.
12334 If those searches do not result in a compspec, any compspec defined with
12335 the <SAMP>`-D'</SAMP> option to <CODE>complete</CODE> is used as the default.
12336 </P><P>
12337
12338 Once a compspec has been found, it is used to generate the list of
12339 matching words.
12340 If a compspec is not found, the default Bash completion
12341 described above (see section <A HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A>) is performed.
12342 </P><P>
12343
12344 First, the actions specified by the compspec are used.
12345 Only matches which are prefixed by the word being completed are
12346 returned.
12347 When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or
12348 directory name completion, the shell variable <CODE>FIGNORE</CODE> is
12349 used to filter the matches.
12350 See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
12351 </P><P>
12352
12353 Any completions specified by a filename expansion pattern to the
12354 <SAMP>`-G'</SAMP> option are generated next.
12355 The words generated by the pattern need not match the word being completed.
12356 The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches,
12357 but the <CODE>FIGNORE</CODE> shell variable is used.
12358 </P><P>
12359
12360 Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option
12361 is considered.
12362 The string is first split using the characters in the <CODE>IFS</CODE>
12363 special variable as delimiters.
12364 Shell quoting is honored.
12365 Each word is then expanded using
12366 brace expansion, tilde expansion, parameter and variable expansion,
12367 command substitution, and arithmetic expansion,
12368 as described above (see section <A HREF="bashref.html#SEC29">3.5 Shell Expansions</A>).
12369 The results are split using the rules described above
12370 (see section <A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A>).
12371 The results of the expansion are prefix-matched against the word being
12372 completed, and the matching words become the possible completions.
12373 </P><P>
12374
12375 After these matches have been generated, any shell function or command
12376 specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked.
12377 When the command or function is invoked, the <CODE>COMP_LINE</CODE>,
12378 <CODE>COMP_POINT</CODE>, <CODE>COMP_KEY</CODE>, and <CODE>COMP_TYPE</CODE> variables are
12379 assigned values as described above (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
12380 If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and
12381 <CODE>COMP_CWORD</CODE> variables are also set.
12382 When the function or command is invoked, the first argument ($1) is the
12383 name of the command whose arguments are being completed, the
12384 second argument ($2) is the word being completed, and the third argument
12385 ($3) is the word preceding the word being completed on the current command
12386 line.
12387 No filtering of the generated completions against the word being completed
12388 is performed; the function or command has complete freedom in generating
12389 the matches.
12390 </P><P>
12391
12392 Any function specified with <SAMP>`-F'</SAMP> is invoked first.
12393 The function may use any of the shell facilities, including the
12394 <CODE>compgen</CODE> and <CODE>compopt</CODE> builtins described below
12395 (see section <A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>), to generate the matches.
12396 It must put the possible completions in the <CODE>COMPREPLY</CODE> array
12397 variable, one per array element.
12398 </P><P>
12399
12400 Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked
12401 in an environment equivalent to command substitution.
12402 It should print a list of completions, one per line, to
12403 the standard output.
12404 Backslash may be used to escape a newline, if necessary.
12405 </P><P>
12406
12407 After all of the possible completions are generated, any filter
12408 specified with the <SAMP>`-X'</SAMP> option is applied to the list.
12409 The filter is a pattern as used for pathname expansion; a <SAMP>`&#38;'</SAMP>
12410 in the pattern is replaced with the text of the word being completed.
12411 A literal <SAMP>`&#38;'</SAMP> may be escaped with a backslash; the backslash
12412 is removed before attempting a match.
12413 Any completion that matches the pattern will be removed from the list.
12414 A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion
12415 not matching the pattern will be removed.
12416 </P><P>
12417
12418 Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP>
12419 options are added to each member of the completion list, and the result is
12420 returned to the Readline completion code as the list of possible
12421 completions.
12422 </P><P>
12423
12424 If the previously-applied actions do not generate any matches, and the
12425 <SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the
12426 compspec was defined, directory name completion is attempted. 
12427 </P><P>
12428
12429 If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when
12430 the compspec was defined, directory name completion is attempted and any
12431 matches are added to the results of the other actions.
12432 </P><P>
12433
12434 By default, if a compspec is found, whatever it generates is returned to
12435 the completion code as the full set of possible completions.
12436 The default Bash completions are not attempted, and the Readline default
12437 of filename completion is disabled.
12438 If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when
12439 the compspec was defined, the default Bash completions are attempted
12440 if the compspec generates no matches.
12441 If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the
12442 compspec was defined, Readline's default completion will be performed
12443 if the compspec (and, if attempted, the default Bash completions)
12444 generate no matches.
12445 </P><P>
12446
12447 When a compspec indicates that directory name completion is desired,
12448 the programmable completion functions force Readline to append a slash
12449 to completed names which are symbolic links to directories, subject to
12450 the value of the <VAR>mark-directories</VAR> Readline variable, regardless
12451 of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable.
12452 </P><P>
12453
12454 There is some support for dynamically modifying completions.  This is
12455 most useful when used in combination with a default completion specified
12456 with <SAMP>`-D'</SAMP>.  It's possible for shell functions executed as completion
12457 handlers to indicate that completion should be retried by returning an
12458 exit status of 124.  If a shell function returns 124, and changes
12459 the compspec associated with the command on which completion is being
12460 attempted (supplied as the first argument when the function is executed),
12461 programmable completion restarts from the beginning, with an
12462 attempt to find a new compspec for that command.  This allows a set of
12463 completions to be built dynamically as completion is attempted, rather than
12464 being loaded all at once.
12465 </P><P>
12466
12467 For instance, assuming that there is a library of compspecs, each kept in a
12468 file corresponding to the name of the command, the following default
12469 completion function would load completions dynamically:
12470 </P><P>
12471
12472 <TABLE><tr><td>&nbsp;</td><td class=example><pre>_completion_loader()
12473 {
12474     . "/etc/bash_completion.d/$1.sh" &#62;/dev/null 2&#62;&#38;1 &#38;&#38; return 124
12475 }
12476 complete -D -F _completion_loader -o bashdefault -o default
12477 </pre></td></tr></table></P><P>
12478
12479 <A NAME="Programmable Completion Builtins"></A>
12480 <HR SIZE="6">
12481 <A NAME="SEC119"></A>
12482 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12483 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &lt; </A>]</TD>
12484 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> &gt; </A>]</TD>
12485 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> &lt;&lt; </A>]</TD>
12486 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
12487 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt;&gt; </A>]</TD>
12488 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12489 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12490 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
12491 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12492 </TR></TABLE>
12493 <H2> 8.7 Programmable Completion Builtins </H2>
12494 <!--docid::SEC119::-->
12495 <P>
12496
12497 Three builtin commands are available to manipulate the programmable completion
12498 facilities: one to specify how the arguments to a particular command are to
12499 be completed, and two to modify the completion as it is happening.
12500 </P><P>
12501
12502 <DL COMPACT>
12503 <DT><CODE>compgen</CODE>
12504 <DD><A NAME="IDX579"></A>
12505 <TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE>
12506 </pre></td></tr></table><P>
12507
12508 Generate possible completion matches for <VAR>word</VAR> according to
12509 the <VAR>option</VAR>s, which may be any option accepted by the
12510 <CODE>complete</CODE>
12511 builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write
12512 the matches to the standard output.
12513 When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables
12514 set by the programmable completion facilities, while available, will not
12515 have useful values.
12516 </P><P>
12517
12518 The matches will be generated in the same way as if the programmable
12519 completion code had generated them directly from a completion specification
12520 with the same flags.
12521 If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR>
12522 will be displayed.
12523 </P><P>
12524
12525 The return value is true unless an invalid option is supplied, or no
12526 matches were generated.
12527 </P><P>
12528
12529 <DT><CODE>complete</CODE>
12530 <DD><A NAME="IDX580"></A>
12531 <TABLE><tr><td>&nbsp;</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>]
12532 [-F <VAR>function</VAR>] [-C <VAR>command</VAR>] [-X <VAR>filterpat</VAR>]
12533 [-P <VAR>prefix</VAR>] [-S <VAR>suffix</VAR>] <VAR>name</VAR> [<VAR>name</VAR> <small>...</small>]</CODE>
12534 <CODE>complete -pr [-DE] [<VAR>name</VAR> <small>...</small>]</CODE>
12535 </pre></td></tr></table><P>
12536
12537 Specify how arguments to each <VAR>name</VAR> should be completed.
12538 If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing
12539 completion specifications are printed in a way that allows them to be
12540 reused as input.
12541 The <SAMP>`-r'</SAMP> option removes a completion specification for
12542 each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all
12543 completion specifications.
12544 The <SAMP>`-D'</SAMP> option indicates that the remaining options and actions should
12545 apply to the "default" command completion; that is, completion attempted
12546 on a command for which no completion has previously been defined.
12547 The <SAMP>`-E'</SAMP> option indicates that the remaining options and actions should
12548 apply to "empty" command completion; that is, completion attempted on a 
12549 blank line.
12550 </P><P>
12551
12552 The process of applying these completion specifications when word completion
12553 is attempted is described above (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).  The
12554 <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
12555 </P><P>
12556
12557 Other options, if specified, have the following meanings.
12558 The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options
12559 (and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options)
12560 should be quoted to protect them from expansion before the
12561 <CODE>complete</CODE> builtin is invoked.
12562 </P><P>
12563
12564 <DL COMPACT>
12565 <DT><CODE>-o <VAR>comp-option</VAR></CODE>
12566 <DD>The <VAR>comp-option</VAR> controls several aspects of the compspec's behavior
12567 beyond the simple generation of completions.
12568 <VAR>comp-option</VAR> may be one of: 
12569 <P>
12570
12571 <DL COMPACT>
12572
12573 <DT><CODE>bashdefault</CODE>
12574 <DD>Perform the rest of the default Bash completions if the compspec
12575 generates no matches.
12576 <P>
12577
12578 <DT><CODE>default</CODE>
12579 <DD>Use Readline's default filename completion if the compspec generates
12580 no matches.
12581 <P>
12582
12583 <DT><CODE>dirnames</CODE>
12584 <DD>Perform directory name completion if the compspec generates no matches.
12585 <P>
12586
12587 <DT><CODE>filenames</CODE>
12588 <DD>Tell Readline that the compspec generates filenames, so it can perform any
12589 filename-specific processing (like adding a slash to directory names
12590 quoting special characters, or suppressing trailing spaces).
12591 This option is intended to be used with shell functions specified
12592 with <SAMP>`-F'</SAMP>.
12593 <P>
12594
12595 <DT><CODE>noquote</CODE>
12596 <DD>Tell Readline not to quote the completed words if they are filenames
12597 (quoting filenames is the default).
12598 <P>
12599
12600 <DT><CODE>nospace</CODE>
12601 <DD>Tell Readline not to append a space (the default) to words completed at
12602 the end of the line.
12603 <P>
12604
12605 <DT><CODE>plusdirs</CODE>
12606 <DD>After any matches defined by the compspec are generated, 
12607 directory name completion is attempted and any
12608 matches are added to the results of the other actions.
12609 <P>
12610
12611 </DL>
12612 <P>
12613
12614 <DT><CODE>-A <VAR>action</VAR></CODE>
12615 <DD>The <VAR>action</VAR> may be one of the following to generate a list of possible
12616 completions:
12617 <P>
12618
12619 <DL COMPACT>
12620 <DT><CODE>alias</CODE>
12621 <DD>Alias names.  May also be specified as <SAMP>`-a'</SAMP>.
12622 <P>
12623
12624 <DT><CODE>arrayvar</CODE>
12625 <DD>Array variable names.
12626 <P>
12627
12628 <DT><CODE>binding</CODE>
12629 <DD>Readline key binding names (see section <A HREF="bashref.html#SEC108">8.4 Bindable Readline Commands</A>).
12630 <P>
12631
12632 <DT><CODE>builtin</CODE>
12633 <DD>Names of shell builtin commands.  May also be specified as <SAMP>`-b'</SAMP>.
12634 <P>
12635
12636 <DT><CODE>command</CODE>
12637 <DD>Command names.  May also be specified as <SAMP>`-c'</SAMP>.
12638 <P>
12639
12640 <DT><CODE>directory</CODE>
12641 <DD>Directory names.  May also be specified as <SAMP>`-d'</SAMP>.
12642 <P>
12643
12644 <DT><CODE>disabled</CODE>
12645 <DD>Names of disabled shell builtins.
12646 <P>
12647
12648 <DT><CODE>enabled</CODE>
12649 <DD>Names of enabled shell builtins.
12650 <P>
12651
12652 <DT><CODE>export</CODE>
12653 <DD>Names of exported shell variables.  May also be specified as <SAMP>`-e'</SAMP>.
12654 <P>
12655
12656 <DT><CODE>file</CODE>
12657 <DD>File names.  May also be specified as <SAMP>`-f'</SAMP>.
12658 <P>
12659
12660 <DT><CODE>function</CODE>
12661 <DD>Names of shell functions.
12662 <P>
12663
12664 <DT><CODE>group</CODE>
12665 <DD>Group names.  May also be specified as <SAMP>`-g'</SAMP>.
12666 <P>
12667
12668 <DT><CODE>helptopic</CODE>
12669 <DD>Help topics as accepted by the <CODE>help</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
12670 <P>
12671
12672 <DT><CODE>hostname</CODE>
12673 <DD>Hostnames, as taken from the file specified by the
12674 <CODE>HOSTFILE</CODE> shell variable (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).
12675 <P>
12676
12677 <DT><CODE>job</CODE>
12678 <DD>Job names, if job control is active.  May also be specified as <SAMP>`-j'</SAMP>.
12679 <P>
12680
12681 <DT><CODE>keyword</CODE>
12682 <DD>Shell reserved words.  May also be specified as <SAMP>`-k'</SAMP>.
12683 <P>
12684
12685 <DT><CODE>running</CODE>
12686 <DD>Names of running jobs, if job control is active.
12687 <P>
12688
12689 <DT><CODE>service</CODE>
12690 <DD>Service names.  May also be specified as <SAMP>`-s'</SAMP>.
12691 <P>
12692
12693 <DT><CODE>setopt</CODE>
12694 <DD>Valid arguments for the <SAMP>`-o'</SAMP> option to the <CODE>set</CODE> builtin
12695 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
12696 <P>
12697
12698 <DT><CODE>shopt</CODE>
12699 <DD>Shell option names as accepted by the <CODE>shopt</CODE> builtin
12700 (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
12701 <P>
12702
12703 <DT><CODE>signal</CODE>
12704 <DD>Signal names.
12705 <P>
12706
12707 <DT><CODE>stopped</CODE>
12708 <DD>Names of stopped jobs, if job control is active.
12709 <P>
12710
12711 <DT><CODE>user</CODE>
12712 <DD>User names.  May also be specified as <SAMP>`-u'</SAMP>.
12713 <P>
12714
12715 <DT><CODE>variable</CODE>
12716 <DD>Names of all shell variables.  May also be specified as <SAMP>`-v'</SAMP>.
12717 </DL>
12718 <P>
12719
12720 <DT><CODE>-C <VAR>command</VAR></CODE>
12721 <DD><VAR>command</VAR> is executed in a subshell environment, and its output is
12722 used as the possible completions.
12723 <P>
12724
12725 <DT><CODE>-F <VAR>function</VAR></CODE>
12726 <DD>The shell function <VAR>function</VAR> is executed in the current shell
12727 environment.
12728 When it is executed, $1 is the name of the command whose arguments are
12729 being completed, $2 is the word being completed, and $3 is the word
12730 preceding the word being completed, as described above
12731 (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
12732 When it finishes, the possible completions are retrieved from the value
12733 of the <CODE>COMPREPLY</CODE> array variable.
12734 <P>
12735
12736 <DT><CODE>-G <VAR>globpat</VAR></CODE>
12737 <DD>The filename expansion pattern <VAR>globpat</VAR> is expanded to generate
12738 the possible completions.
12739 <P>
12740
12741 <DT><CODE>-P <VAR>prefix</VAR></CODE>
12742 <DD><VAR>prefix</VAR> is added at the beginning of each possible completion
12743 after all other options have been applied.
12744 <P>
12745
12746 <DT><CODE>-S <VAR>suffix</VAR></CODE>
12747 <DD><VAR>suffix</VAR> is appended to each possible completion
12748 after all other options have been applied.
12749 <P>
12750
12751 <DT><CODE>-W <VAR>wordlist</VAR></CODE>
12752 <DD>The <VAR>wordlist</VAR> is split using the characters in the
12753 <CODE>IFS</CODE> special variable as delimiters, and each resultant word
12754 is expanded.
12755 The possible completions are the members of the resultant list which
12756 match the word being completed.
12757 <P>
12758
12759 <DT><CODE>-X <VAR>filterpat</VAR></CODE>
12760 <DD><VAR>filterpat</VAR> is a pattern as used for filename expansion.
12761 It is applied to the list of possible completions generated by the
12762 preceding options and arguments, and each completion matching
12763 <VAR>filterpat</VAR> is removed from the list.
12764 A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this
12765 case, any completion not matching <VAR>filterpat</VAR> is removed.
12766 </DL>
12767 <P>
12768
12769 The return value is true unless an invalid option is supplied, an option
12770 other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR>
12771 argument, an attempt is made to remove a completion specification for
12772 a <VAR>name</VAR> for which no specification exists, or
12773 an error occurs adding a completion specification.
12774 </P><P>
12775
12776 <DT><CODE>compopt</CODE>
12777 <DD><A NAME="IDX581"></A>
12778 <TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>compopt</CODE> [-o <VAR>option</VAR>] [-DE] [+o <VAR>option</VAR>] [<VAR>name</VAR>]
12779 </pre></td></tr></table>Modify completion options for each <VAR>name</VAR> according to the
12780 <VAR>option</VAR>s, or for the currently-executing completion if no <VAR>name</VAR>s
12781 are supplied.
12782 If no <VAR>option</VAR>s are given, display the completion options for each
12783 <VAR>name</VAR> or the current completion.
12784 The possible values of <VAR>option</VAR> are those valid for the <CODE>complete</CODE>
12785 builtin described above.
12786 The <SAMP>`-D'</SAMP> option indicates that the remaining options should
12787 apply to the "default" command completion; that is, completion attempted
12788 on a command for which no completion has previously been defined.
12789 The <SAMP>`-E'</SAMP> option indicates that the remaining options should
12790 apply to "empty" command completion; that is, completion attempted on a 
12791 blank line.
12792 <P>
12793
12794 The <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
12795 </P><P>
12796
12797 The return value is true unless an invalid option is supplied, an attempt
12798 is made to modify the options for a <VAR>name</VAR> for which no completion
12799 specification exists, or an output error occurs.
12800 </P><P>
12801
12802 </DL>
12803 <P>
12804
12805 <A NAME="A Programmable Completion Example"></A>
12806 <HR SIZE="6">
12807 <A NAME="SEC120"></A>
12808 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12809 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &lt; </A>]</TD>
12810 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt; </A>]</TD>
12811 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &lt;&lt; </A>]</TD>
12812 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> Up </A>]</TD>
12813 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt;&gt; </A>]</TD>
12814 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12815 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12816 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
12817 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12818 </TR></TABLE>
12819 <H2> 8.8 A Programmable Completion Example </H2>
12820 <!--docid::SEC120::-->
12821 <P>
12822
12823 The most common way to obtain additional completion functionality beyond
12824 the default actions <CODE>complete</CODE> and <CODE>compgen</CODE> provide is to use
12825 a shell function and bind it to a particular command using <CODE>complete -F</CODE>.
12826 </P><P>
12827
12828 The following function provides completions for the <CODE>cd</CODE> builtin.
12829 It is a reasonably good example of what shell functions must do when
12830 used for completion.  This function uses the word passsed as <CODE>$2</CODE>
12831 to determine the directory name to complete.  You can also use the
12832 <CODE>COMP_WORDS</CODE> array variable; the current word is indexed by the
12833 <CODE>COMP_CWORD</CODE> variable.
12834 </P><P>
12835
12836 The function relies on the <CODE>complete</CODE> and <CODE>compgen</CODE> builtins
12837 to do much of the work, adding only the things that the Bash <CODE>cd</CODE>
12838 does beyond accepting basic directory names:
12839 tilde expansion (see section <A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>),
12840 searching directories in <VAR>$CDPATH</VAR>, which is described above
12841 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>),
12842 and basic support for the <CODE>cdable_vars</CODE> shell option
12843 (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>).
12844 <CODE>_comp_cd</CODE> modifies the value of <VAR>IFS</VAR> so that it contains only
12845 a newline to accommodate file names containing spaces and tabs --
12846 <CODE>compgen</CODE> prints the possible completions it generates one per line.
12847 </P><P>
12848
12849 Possible completions go into the <VAR>COMPREPLY</VAR> array variable, one
12850 completion per array element.  The programmable completion system retrieves
12851 the completions from there when the function returns.
12852 </P><P>
12853
12854 <TABLE><tr><td>&nbsp;</td><td class=example><pre># A completion function for the cd builtin
12855 # based on the cd completion function from the bash_completion package
12856 _comp_cd()
12857 {
12858     local IFS=$' \t\n'    # normalize IFS
12859     local cur _skipdot _cdpath
12860     local i j k
12861
12862     # Tilde expansion, with side effect of expanding tilde to full pathname
12863     case "$2" in
12864     \~*)    eval cur="$2" ;;
12865     *)      cur=$2 ;;
12866     esac
12867
12868     # no cdpath or absolute pathname -- straight directory completion
12869     if [[ -z "${CDPATH:-}" ]] || [[ "$cur" == @(./*|../*|/*) ]]; then
12870         # compgen prints paths one per line; could also use while loop
12871         IFS=$'\n'
12872         COMPREPLY=( $(compgen -d -- "$cur") )
12873         IFS=$' \t\n'
12874     # CDPATH+directories in the current directory if not in CDPATH
12875     else
12876         IFS=$'\n'
12877         _skipdot=false
12878         # preprocess CDPATH to convert null directory names to .
12879         _cdpath=${CDPATH/#:/.:}
12880         _cdpath=${_cdpath//::/:.:}
12881         _cdpath=${_cdpath/%:/:.}
12882         for i in ${_cdpath//:/$'\n'}; do
12883             if [[ $i -ef . ]]; then _skipdot=true; fi
12884             k="${#COMPREPLY[@]}"
12885             for j in $( compgen -d -- "$i/$cur" ); do
12886                 COMPREPLY[k++]=${j#$i/}        # cut off directory
12887             done
12888         done
12889         $_skipdot || COMPREPLY+=( $(compgen -d -- "$cur") )
12890         IFS=$' \t\n'
12891     fi
12892
12893     # variable names if appropriate shell option set and no completions
12894     if shopt -q cdable_vars &#38;&#38; [[ ${#COMPREPLY[@]} -eq 0 ]]; then
12895         COMPREPLY=( $(compgen -v -- "$cur") )
12896     fi
12897
12898     return 0
12899 }
12900 </pre></td></tr></table></P><P>
12901
12902 We install the completion function using the <SAMP>`-F'</SAMP> option to
12903 <CODE>complete</CODE>:
12904 </P><P>
12905
12906 <TABLE><tr><td>&nbsp;</td><td class=example><pre># Tell readline to quote appropriate and append slashes to directories;
12907 # use the bash default completion for other arguments
12908 complete -o filenames -o nospace -o bashdefault -F _comp_cd cd
12909 </pre></td></tr></table></P><P>
12910
12911 Since we'd like Bash and Readline to take care of some
12912 of the other details for us, we use several other options to tell Bash
12913 and Readline what to do.  The <SAMP>`-o filenames'</SAMP> option tells Readline
12914 that the possible completions should be treated as filenames, and quoted
12915 appropriately.  That option will also cause Readline to append a slash to
12916 filenames it can determine are directories (which is why we might want to
12917 extend <CODE>_comp_cd</CODE> to append a slash if we're using directories found
12918 via <VAR>CDPATH</VAR>: Readline can't tell those completions are directories).
12919 The <SAMP>`-o nospace'</SAMP> option tells Readline to not append a space
12920 character to the directory name, in case we want to append to it.
12921 The <SAMP>`-o bashdefault'</SAMP> option brings in the rest of the "Bash default"
12922 completions -- possible completion that Bash adds to the default Readline
12923 set.  These include things like command name completion, variable completion
12924 for words beginning with <SAMP>`{'</SAMP>, completions containing pathname
12925 expansion patterns (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>), and so on.
12926 </P><P>
12927
12928 Once installed using <CODE>complete</CODE>, <CODE>_comp_cd</CODE> will be called every
12929 time we attempt word completion for a <CODE>cd</CODE> command.
12930 </P><P>
12931
12932 Many more examples -- an extensive collection of completions for most of
12933 the common GNU, Unix, and Linux commands -- are available as part of the
12934 bash_completion project.  This is installed by default on many GNU/Linux
12935 distributions.  Originally written by Ian Macdonald, the project now lives
12936 at <A HREF="http://bash-completion.alioth.debian.org/">http://bash-completion.alioth.debian.org/</A>.  There are ports for
12937 other systems such as Solaris and Mac OS X.
12938 </P><P>
12939
12940 An older version of the bash_completion package is distributed with bash
12941 in the <TT>`examples/complete'</TT> subdirectory.
12942 </P><P>
12943
12944 <A NAME="IDX582"></A>
12945 </P><P>
12946
12947 <A NAME="Using History Interactively"></A>
12948 <HR SIZE="6">
12949 <A NAME="SEC121"></A>
12950 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12951 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> &lt; </A>]</TD>
12952 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &gt; </A>]</TD>
12953 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
12954 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12955 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt;&gt; </A>]</TD>
12956 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12957 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12958 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
12959 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12960 </TR></TABLE>
12961 <H1> 9. Using History Interactively </H1>
12962 <!--docid::SEC121::-->
12963 <P>
12964
12965 This chapter describes how to use the GNU History Library
12966 interactively, from a user's standpoint.
12967 It should be considered a user's guide.
12968 For information on using the GNU History Library in other programs,
12969 see the GNU Readline Library Manual.
12970 </P><P>
12971
12972 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
12973 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash lets you manipulate your command
12974                                 history.</TD></TR>
12975 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC123">9.2 Bash History Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The Bash builtin commands that manipulate
12976                                 the command history.</TD></TR>
12977 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">9.3 History Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR>
12978 </TABLE></BLOCKQUOTE>
12979 <P>
12980
12981 <A NAME="Bash History Facilities"></A>
12982 <HR SIZE="6">
12983 <A NAME="SEC122"></A>
12984 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12985 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &lt; </A>]</TD>
12986 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> &gt; </A>]</TD>
12987 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
12988 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> Up </A>]</TD>
12989 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt;&gt; </A>]</TD>
12990 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12991 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
12993 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12994 </TR></TABLE>
12995 <H2> 9.1 Bash History Facilities </H2>
12996 <!--docid::SEC122::-->
12997 <P>
12998
12999 When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin
13000 is enabled (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>),
13001 the shell provides access to the <EM>command history</EM>,
13002 the list of commands previously typed.
13003 The value of the <CODE>HISTSIZE</CODE> shell variable is used as the
13004 number of commands to save in a history list.
13005 The text of the last <CODE>$HISTSIZE</CODE>
13006 commands (default 500) is saved.
13007 The shell stores each command in the history list prior to
13008 parameter and variable expansion
13009 but after history expansion is performed, subject to the
13010 values of the shell variables
13011 <CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>.
13012 </P><P>
13013
13014 When the shell starts up, the history is initialized from the
13015 file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>).
13016 The file named by the value of <CODE>HISTFILE</CODE> is truncated, if
13017 necessary, to contain no more than the number of lines specified by
13018 the value of the <CODE>HISTFILESIZE</CODE> variable.
13019 When a shell with history enabled exits, the last
13020 <CODE>$HISTSIZE</CODE> lines are copied from the history list to the file
13021 named by <CODE>$HISTFILE</CODE>.
13022 If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>),
13023 the lines are appended to the history file,
13024 otherwise the history file is overwritten.
13025 If <CODE>HISTFILE</CODE>
13026 is unset, or if the history file is unwritable, the history is not saved.
13027 After saving the history, the history file is truncated
13028 to contain no more than <CODE>$HISTFILESIZE</CODE> lines.
13029 If <CODE>HISTFILESIZE</CODE> is unset, or set to null, a non-numeric value, or
13030 a numeric value less than zero, the history file is not truncated.
13031 </P><P>
13032
13033 If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information
13034 associated with each history entry is written to the history file,
13035 marked with the history comment character.
13036 When the history file is read, lines beginning with the history
13037 comment character followed immediately by a digit are interpreted
13038 as timestamps for the previous history line.
13039 </P><P>
13040
13041 The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute
13042 a portion of the history list.
13043 The <CODE>history</CODE> builtin may be used to display or modify the history
13044 list and manipulate the history file.
13045 When using command-line editing, search commands
13046 are available in each editing mode that provide access to the
13047 history list (see section <A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A>).
13048 </P><P>
13049
13050 The shell allows control over which commands are saved on the history
13051 list.  The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE>
13052 variables may be set to cause the shell to save only a subset of the
13053 commands entered.
13054 The <CODE>cmdhist</CODE>
13055 shell option, if enabled, causes the shell to attempt to save each
13056 line of a multi-line command in the same history entry, adding
13057 semicolons where necessary to preserve syntactic correctness.
13058 The <CODE>lithist</CODE>
13059 shell option causes the shell to save the command with embedded newlines
13060 instead of semicolons.
13061 The <CODE>shopt</CODE> builtin is used to set these options.
13062 See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>.
13063 </P><P>
13064
13065 <A NAME="Bash History Builtins"></A>
13066 <HR SIZE="6">
13067 <A NAME="SEC123"></A>
13068 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13069 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &lt; </A>]</TD>
13070 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> &gt; </A>]</TD>
13071 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> &lt;&lt; </A>]</TD>
13072 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> Up </A>]</TD>
13073 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt;&gt; </A>]</TD>
13074 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13075 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13076 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13077 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13078 </TR></TABLE>
13079 <H2> 9.2 Bash History Builtins </H2>
13080 <!--docid::SEC123::-->
13081 <P>
13082
13083 Bash provides two builtin commands which manipulate the
13084 history list and history file.
13085 </P><P>
13086
13087 <DL COMPACT>
13088
13089 <DT><CODE>fc</CODE>
13090 <DD><A NAME="IDX583"></A>
13091 <TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>fc [-e <VAR>ename</VAR>] [-lnr] [<VAR>first</VAR>] [<VAR>last</VAR>]</CODE>
13092 <CODE>fc -s [<VAR>pat</VAR>=<VAR>rep</VAR>] [<VAR>command</VAR>]</CODE>
13093 </pre></td></tr></table><P>
13094
13095 The first form selects a range of commands from <VAR>first</VAR> to
13096 <VAR>last</VAR> from the history list and displays or edits and re-executes
13097 them.
13098 Both <VAR>first</VAR> and
13099 <VAR>last</VAR> may be specified as a string (to locate the most recent
13100 command beginning with that string) or as a number (an index into the
13101 history list, where a negative number is used as an offset from the
13102 current command number).  If <VAR>last</VAR> is not specified it is set to
13103 <VAR>first</VAR>.  If <VAR>first</VAR> is not specified it is set to the previous
13104 command for editing and -16 for listing.  If the <SAMP>`-l'</SAMP> flag is
13105 given, the commands are listed on standard output.  The <SAMP>`-n'</SAMP> flag
13106 suppresses the command numbers when listing.  The <SAMP>`-r'</SAMP> flag
13107 reverses the order of the listing.  Otherwise, the editor given by
13108 <VAR>ename</VAR> is invoked on a file containing those commands.  If
13109 <VAR>ename</VAR> is not given, the value of the following variable expansion
13110 is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>.  This says to use the
13111 value of the <CODE>FCEDIT</CODE> variable if set, or the value of the
13112 <CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set.
13113 When editing is complete, the edited commands are echoed and executed.
13114 </P><P>
13115
13116 In the second form, <VAR>command</VAR> is re-executed after each instance
13117 of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>.
13118 <VAR>command</VAR> is intepreted the same as <VAR>first</VAR> above.
13119 </P><P>
13120
13121 A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so
13122 that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE>
13123 and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
13124 </P><P>
13125
13126 <DT><CODE>history</CODE>
13127 <DD><A NAME="IDX584"></A>
13128 <TABLE><tr><td>&nbsp;</td><td class=example><pre>history [<VAR>n</VAR>]
13129 history -c
13130 history -d <VAR>offset</VAR>
13131 history [-anrw] [<VAR>filename</VAR>]
13132 history -ps <VAR>arg</VAR>
13133 </pre></td></tr></table><P>
13134
13135 With no options, display the history list with line numbers.
13136 Lines prefixed with a <SAMP>`*'</SAMP> have been modified.
13137 An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines.
13138 If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null,
13139 it is used as a format string for <VAR>strftime</VAR> to display
13140 the time stamp associated with each displayed history entry.
13141 No intervening blank is printed between the formatted time stamp
13142 and the history line.
13143 </P><P>
13144
13145 Options, if supplied, have the following meanings:
13146 </P><P>
13147
13148 <DL COMPACT>
13149 <DT><CODE>-c</CODE>
13150 <DD>Clear the history list.  This may be combined
13151 with the other options to replace the history list completely.
13152 <P>
13153
13154 <DT><CODE>-d <VAR>offset</VAR></CODE>
13155 <DD>Delete the history entry at position <VAR>offset</VAR>.
13156 <VAR>offset</VAR> should be specified as it appears when the history is
13157 displayed.
13158 <P>
13159
13160 <DT><CODE>-a</CODE>
13161 <DD>Append the new
13162 history lines (history lines entered since the beginning of the
13163 current Bash session) to the history file.
13164 <P>
13165
13166 <DT><CODE>-n</CODE>
13167 <DD>Append the history lines not already read from the history file
13168 to the current history list.  These are lines appended to the history
13169 file since the beginning of the current Bash session.
13170 <P>
13171
13172 <DT><CODE>-r</CODE>
13173 <DD>Read the history file and append its contents to
13174 the history list.
13175 <P>
13176
13177 <DT><CODE>-w</CODE>
13178 <DD>Write out the current history list to the history file.
13179 <P>
13180
13181 <DT><CODE>-p</CODE>
13182 <DD>Perform history substitution on the <VAR>arg</VAR>s and display the result
13183 on the standard output, without storing the results in the history list.
13184 <P>
13185
13186 <DT><CODE>-s</CODE>
13187 <DD>The <VAR>arg</VAR>s are added to the end of
13188 the history list as a single entry.
13189 <P>
13190
13191 </DL>
13192 <P>
13193
13194 When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is
13195 used, if <VAR>filename</VAR>
13196 is given, then it is used as the history file.  If not, then
13197 the value of the <CODE>HISTFILE</CODE> variable is used.
13198 </P><P>
13199
13200 </DL>
13201 <P>
13202
13203 <A NAME="History Interaction"></A>
13204 <HR SIZE="6">
13205 <A NAME="SEC124"></A>
13206 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13207 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> &lt; </A>]</TD>
13208 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &gt; </A>]</TD>
13209 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
13210 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> Up </A>]</TD>
13211 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt;&gt; </A>]</TD>
13212 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13213 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13214 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13215 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13216 </TR></TABLE>
13217 <H2> 9.3 History Expansion </H2>
13218 <!--docid::SEC124::-->
13219 <P>
13220
13221 The History library provides a history expansion feature that is similar
13222 to the history expansion provided by <CODE>csh</CODE>.  This section
13223 describes the syntax used to manipulate the history information.
13224 </P><P>
13225
13226 History expansions introduce words from the history list into
13227 the input stream, making it easy to repeat commands, insert the
13228 arguments to a previous command into the current input line, or
13229 fix errors in previous commands quickly.
13230 </P><P>
13231
13232 History expansion takes place in two parts.  The first is to determine
13233 which line from the history list should be used during substitution.
13234 The second is to select portions of that line for inclusion into the
13235 current one.  The line selected from the history is called the
13236 <EM>event</EM>, and the portions of that line that are acted upon are
13237 called <EM>words</EM>.  Various <EM>modifiers</EM> are available to manipulate
13238 the selected words.  The line is broken into words in the same fashion
13239 that Bash does, so that several words
13240 surrounded by quotes are considered one word.
13241 History expansions are introduced by the appearance of the
13242 history expansion character, which is <SAMP>`!'</SAMP> by default.
13243 Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion
13244 character.
13245 </P><P>
13246
13247 Several shell options settable with the <CODE>shopt</CODE>
13248 builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>) may be used to tailor
13249 the behavior of history expansion.  If the
13250 <CODE>histverify</CODE> shell option is enabled, and Readline
13251 is being used, history substitutions are not immediately passed to
13252 the shell parser.
13253 Instead, the expanded line is reloaded into the Readline
13254 editing buffer for further modification.
13255 If Readline is being used, and the <CODE>histreedit</CODE>
13256 shell option is enabled, a failed history expansion will be
13257 reloaded into the Readline editing buffer for correction.
13258 The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command
13259 may be used to see what a history expansion will do before using it.
13260 The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to
13261 add commands to the end of the history list without actually executing
13262 them, so that they are available for subsequent recall.
13263 This is most useful in conjunction with Readline.
13264 </P><P>
13265
13266 The shell allows control of the various characters used by the
13267 history expansion mechanism with the <CODE>histchars</CODE> variable,
13268 as explained above (see section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>).  The shell uses
13269 the history comment character to mark history timestamps when
13270 writing the history file.
13271 </P><P>
13272
13273 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
13274 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">9.3.1 Event Designators</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR>
13275 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC126">9.3.2 Word Designators</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR>
13276 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC127">9.3.3 Modifiers</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR>
13277 </TABLE></BLOCKQUOTE>
13278 <P>
13279
13280 <A NAME="Event Designators"></A>
13281 <HR SIZE="6">
13282 <A NAME="SEC125"></A>
13283 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13284 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> &lt; </A>]</TD>
13285 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt; </A>]</TD>
13286 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
13287 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> Up </A>]</TD>
13288 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt;&gt; </A>]</TD>
13289 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13290 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13291 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13292 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13293 </TR></TABLE>
13294 <H3> 9.3.1 Event Designators </H3>
13295 <!--docid::SEC125::-->
13296 <P>
13297
13298 An event designator is a reference to a command line entry in the
13299 history list.
13300 Unless the reference is absolute, events are relative to the current
13301 position in the history list.
13302 <A NAME="IDX585"></A>
13303 </P><P>
13304
13305 <DL COMPACT>
13306
13307 <DT><CODE>!</CODE>
13308 <DD>Start a history substitution, except when followed by a space, tab,
13309 the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the
13310 <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin).
13311 <P>
13312
13313 <DT><CODE>!<VAR>n</VAR></CODE>
13314 <DD>Refer to command line <VAR>n</VAR>.
13315 <P>
13316
13317 <DT><CODE>!-<VAR>n</VAR></CODE>
13318 <DD>Refer to the command <VAR>n</VAR> lines back.
13319 <P>
13320
13321 <DT><CODE>!!</CODE>
13322 <DD>Refer to the previous command.  This is a synonym for <SAMP>`!-1'</SAMP>.
13323 <P>
13324
13325 <DT><CODE>!<VAR>string</VAR></CODE>
13326 <DD>Refer to the most recent command
13327 preceding the current position in the history list
13328 starting with <VAR>string</VAR>.
13329 <P>
13330
13331 <DT><CODE>!?<VAR>string</VAR>[?]</CODE>
13332 <DD>Refer to the most recent command
13333 preceding the current position in the history list
13334 containing <VAR>string</VAR>.
13335 The trailing
13336 <SAMP>`?'</SAMP> may be omitted if the <VAR>string</VAR> is followed immediately by
13337 a newline.
13338 <P>
13339
13340 <DT><CODE>^<VAR>string1</VAR>^<VAR>string2</VAR>^</CODE>
13341 <DD>Quick Substitution.  Repeat the last command, replacing <VAR>string1</VAR>
13342 with <VAR>string2</VAR>.  Equivalent to
13343 <CODE>!!:s/<VAR>string1</VAR>/<VAR>string2</VAR>/</CODE>.
13344 <P>
13345
13346 <DT><CODE>!#</CODE>
13347 <DD>The entire command line typed so far.
13348 <P>
13349
13350 </DL>
13351 <P>
13352
13353 <A NAME="Word Designators"></A>
13354 <HR SIZE="6">
13355 <A NAME="SEC126"></A>
13356 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13357 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &lt; </A>]</TD>
13358 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> &gt; </A>]</TD>
13359 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> &lt;&lt; </A>]</TD>
13360 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> Up </A>]</TD>
13361 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt;&gt; </A>]</TD>
13362 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13363 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13364 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13365 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13366 </TR></TABLE>
13367 <H3> 9.3.2 Word Designators </H3>
13368 <!--docid::SEC126::-->
13369 <P>
13370
13371 Word designators are used to select desired words from the event.
13372 A <SAMP>`:'</SAMP> separates the event specification from the word designator.  It
13373 may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>,
13374 <SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>.  Words are numbered from the beginning
13375 of the line, with the first word being denoted by 0 (zero).  Words are
13376 inserted into the current line separated by single spaces.
13377 </P><P>
13378
13379 For example,
13380 </P><P>
13381
13382 <DL COMPACT>
13383 <DT><CODE>!!</CODE>
13384 <DD>designates the preceding command.  When you type this, the preceding
13385 command is repeated in toto.
13386 <P>
13387
13388 <DT><CODE>!!:$</CODE>
13389 <DD>designates the last argument of the preceding command.  This may be
13390 shortened to <CODE>!$</CODE>.
13391 <P>
13392
13393 <DT><CODE>!fi:2</CODE>
13394 <DD>designates the second argument of the most recent command starting with
13395 the letters <CODE>fi</CODE>.
13396 </DL>
13397 <P>
13398
13399 Here are the word designators:
13400  
13401 <DL COMPACT>
13402
13403 <DT><CODE>0 (zero)</CODE>
13404 <DD>The <CODE>0</CODE>th word.  For many applications, this is the command word.
13405 <P>
13406
13407 <DT><CODE><VAR>n</VAR></CODE>
13408 <DD>The <VAR>n</VAR>th word.
13409 <P>
13410
13411 <DT><CODE>^</CODE>
13412 <DD>The first argument; that is, word 1.
13413 <P>
13414
13415 <DT><CODE>$</CODE>
13416 <DD>The last argument.
13417 <P>
13418
13419 <DT><CODE>%</CODE>
13420 <DD>The word matched by the most recent <SAMP>`?<VAR>string</VAR>?'</SAMP> search.
13421 <P>
13422
13423 <DT><CODE><VAR>x</VAR>-<VAR>y</VAR></CODE>
13424 <DD>A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>.
13425 <P>
13426
13427 <DT><CODE>*</CODE>
13428 <DD>All of the words, except the <CODE>0</CODE>th.  This is a synonym for <SAMP>`1-$'</SAMP>.
13429 It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event;
13430 the empty string is returned in that case.
13431 <P>
13432
13433 <DT><CODE><VAR>x</VAR>*</CODE>
13434 <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP>
13435 <P>
13436
13437 <DT><CODE><VAR>x</VAR>-</CODE>
13438 <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omits the last word.
13439 <P>
13440
13441 </DL>
13442 <P>
13443
13444 If a word designator is supplied without an event specification, the
13445 previous command is used as the event.
13446 </P><P>
13447
13448 <A NAME="Modifiers"></A>
13449 <HR SIZE="6">
13450 <A NAME="SEC127"></A>
13451 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13452 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt; </A>]</TD>
13453 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt; </A>]</TD>
13454 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
13455 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> Up </A>]</TD>
13456 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt;&gt; </A>]</TD>
13457 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13458 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13459 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13460 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13461 </TR></TABLE>
13462 <H3> 9.3.3 Modifiers </H3>
13463 <!--docid::SEC127::-->
13464 <P>
13465
13466 After the optional word designator, you can add a sequence of one or more
13467 of the following modifiers, each preceded by a <SAMP>`:'</SAMP>.
13468 </P><P>
13469
13470 <DL COMPACT>
13471
13472 <DT><CODE>h</CODE>
13473 <DD>Remove a trailing pathname component, leaving only the head.
13474 <P>
13475
13476 <DT><CODE>t</CODE>
13477 <DD>Remove all leading pathname components, leaving the tail.
13478 <P>
13479
13480 <DT><CODE>r</CODE>
13481 <DD>Remove a trailing suffix of the form <SAMP>`.<VAR>suffix</VAR>'</SAMP>, leaving
13482 the basename.
13483 <P>
13484
13485 <DT><CODE>e</CODE>
13486 <DD>Remove all but the trailing suffix.
13487 <P>
13488
13489 <DT><CODE>p</CODE>
13490 <DD>Print the new command but do not execute it.
13491 <P>
13492
13493 <DT><CODE>q</CODE>
13494 <DD>Quote the substituted words, escaping further substitutions.
13495 <P>
13496
13497 <DT><CODE>x</CODE>
13498 <DD>Quote the substituted words as with <SAMP>`q'</SAMP>,
13499 but break into words at spaces, tabs, and newlines.
13500 <P>
13501
13502 <DT><CODE>s/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>
13503 <DD>Substitute <VAR>new</VAR> for the first occurrence of <VAR>old</VAR> in the
13504 event line.  Any delimiter may be used in place of <SAMP>`/'</SAMP>.
13505 The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR>
13506 with a single backslash.  If <SAMP>`&#38;'</SAMP> appears in <VAR>new</VAR>,
13507 it is replaced by <VAR>old</VAR>.  A single backslash will quote
13508 the <SAMP>`&#38;'</SAMP>.  The final delimiter is optional if it is the last
13509 character on the input line.
13510 <P>
13511
13512 <DT><CODE>&#38;</CODE>
13513 <DD>Repeat the previous substitution.
13514 <P>
13515
13516 <DT><CODE>g</CODE>
13517 <DD><DT><CODE>a</CODE>
13518 <DD>Cause changes to be applied over the entire event line.  Used in
13519 conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>,
13520 or with <SAMP>`&#38;'</SAMP>.
13521 <P>
13522
13523 <DT><CODE>G</CODE>
13524 <DD>Apply the following <SAMP>`s'</SAMP> modifier once to each word in the event.
13525 <P>
13526
13527 </DL>
13528 <P>
13529
13530 <A NAME="Installing Bash"></A>
13531 <HR SIZE="6">
13532 <A NAME="SEC128"></A>
13533 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13534 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> &lt; </A>]</TD>
13535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &gt; </A>]</TD>
13536 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &lt;&lt; </A>]</TD>
13537 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13538 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13539 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13540 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13541 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13542 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13543 </TR></TABLE>
13544 <H1> 10. Installing Bash </H1>
13545 <!--docid::SEC128::-->
13546 <P>
13547
13548 This chapter provides basic instructions for installing Bash on
13549 the various supported platforms.  The distribution supports the
13550 GNU operating systems, nearly every version of Unix, and several
13551 non-Unix systems such as BeOS and Interix.
13552 Other independent ports exist for
13553 MS-DOS, OS/2, and Windows platforms.
13554 </P><P>
13555
13556 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
13557 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC129">10.1 Basic Installation</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR>
13558 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.2 Compilers and Options</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various
13559                                 systems.</TD></TR>
13560 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC131">10.3 Compiling For Multiple Architectures</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to compile Bash for more
13561                                                 than one kind of system from
13562                                                 the same source tree.</TD></TR>
13563 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC132">10.4 Installation Names</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to set the various paths used by the installation.</TD></TR>
13564 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC133">10.5 Specifying the System Type</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to configure Bash for a particular system.</TD></TR>
13565 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC134">10.6 Sharing Defaults</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU
13566                         programs.</TD></TR>
13567 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC135">10.7 Operation Controls</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR>
13568 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC136">10.8 Optional Features</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when
13569                         building Bash.</TD></TR>
13570 </TABLE></BLOCKQUOTE>
13571 <P>
13572
13573 <A NAME="Basic Installation"></A>
13574 <HR SIZE="6">
13575 <A NAME="SEC129"></A>
13576 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13577 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &lt; </A>]</TD>
13578 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &gt; </A>]</TD>
13579 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &lt;&lt; </A>]</TD>
13580 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13581 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13582 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13583 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13584 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13585 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13586 </TR></TABLE>
13587 <H2> 10.1 Basic Installation </H2>
13588 <!--docid::SEC129::-->
13589 <P>
13590
13591 These are installation instructions for Bash.
13592 </P><P>
13593
13594 The simplest way to compile Bash is:
13595 </P><P>
13596
13597 <OL>
13598 <LI>
13599 <CODE>cd</CODE> to the directory containing the source code and type
13600 <SAMP>`./configure'</SAMP> to configure Bash for your system.  If you're
13601 using <CODE>csh</CODE> on an old version of System V, you might need to
13602 type <SAMP>`sh ./configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying
13603 to execute <CODE>configure</CODE> itself.
13604 <P>
13605
13606 Running <CODE>configure</CODE> takes some time.
13607 While running, it prints messages telling which features it is
13608 checking for.
13609 </P><P>
13610
13611 <LI>
13612 Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug
13613 reporting script.
13614 <P>
13615
13616 <LI>
13617 Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite.
13618 <P>
13619
13620 <LI>
13621 Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>.
13622 This will also install the manual pages and Info file.
13623 <P>
13624
13625 </OL>
13626 <P>
13627
13628 The <CODE>configure</CODE> shell script attempts to guess correct
13629 values for various system-dependent variables used during
13630 compilation.  It uses those values to create a <TT>`Makefile'</TT> in
13631 each directory of the package (the top directory, the
13632 <TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories,
13633 each directory under <TT>`lib'</TT>, and several others).  It also creates a
13634 <TT>`config.h'</TT> file containing system-dependent definitions. 
13635 Finally, it creates a shell script named <CODE>config.status</CODE> that you
13636 can run in the future to recreate the current configuration, a
13637 file <TT>`config.cache'</TT> that saves the results of its tests to
13638 speed up reconfiguring, and a file <TT>`config.log'</TT> containing
13639 compiler output (useful mainly for debugging <CODE>configure</CODE>). 
13640 If at some point
13641 <TT>`config.cache'</TT> contains results you don't want to keep, you
13642 may remove or edit it. 
13643 </P><P>
13644
13645 To find out more about the options and arguments that the
13646 <CODE>configure</CODE> script understands, type 
13647 </P><P>
13648
13649 <TABLE><tr><td>&nbsp;</td><td class=example><pre>bash-2.04$ ./configure --help
13650 </pre></td></tr></table></P><P>
13651
13652 at the Bash prompt in your Bash source directory.
13653 </P><P>
13654
13655 If you need to do unusual things to compile Bash, please
13656 try to figure out how <CODE>configure</CODE> could check whether or not
13657 to do them, and mail diffs or instructions to
13658 <A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be
13659 considered for the next release.
13660 </P><P>
13661
13662 The file <TT>`configure.ac'</TT> is used to create <CODE>configure</CODE>
13663 by a program called Autoconf.  You only need
13664 <TT>`configure.ac'</TT> if you want to change it or regenerate
13665 <CODE>configure</CODE> using a newer version of Autoconf.  If
13666 you do this, make sure you are using Autoconf version 2.50 or
13667 newer.
13668 </P><P>
13669
13670 You can remove the program binaries and object files from the
13671 source code directory by typing <SAMP>`make clean'</SAMP>.  To also remove the
13672 files that <CODE>configure</CODE> created (so you can compile Bash for
13673 a different kind of computer), type <SAMP>`make distclean'</SAMP>.
13674 </P><P>
13675
13676 <A NAME="Compilers and Options"></A>
13677 <HR SIZE="6">
13678 <A NAME="SEC130"></A>
13679 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13680 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &lt; </A>]</TD>
13681 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &gt; </A>]</TD>
13682 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &lt;&lt; </A>]</TD>
13683 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13684 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13685 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13686 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13687 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13688 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13689 </TR></TABLE>
13690 <H2> 10.2 Compilers and Options </H2>
13691 <!--docid::SEC130::-->
13692 <P>
13693
13694 Some systems require unusual options for compilation or linking
13695 that the <CODE>configure</CODE> script does not know about.  You can
13696 give <CODE>configure</CODE> initial values for variables by setting
13697 them in the environment.  Using a Bourne-compatible shell, you
13698 can do that on the command line like this:
13699 </P><P>
13700
13701 <TABLE><tr><td>&nbsp;</td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
13702 </pre></td></tr></table></P><P>
13703
13704 On systems that have the <CODE>env</CODE> program, you can do it like this:
13705 </P><P>
13706
13707 <TABLE><tr><td>&nbsp;</td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
13708 </pre></td></tr></table></P><P>
13709
13710 The configuration process uses GCC to build Bash if it
13711 is available.
13712 </P><P>
13713
13714 <A NAME="Compiling For Multiple Architectures"></A>
13715 <HR SIZE="6">
13716 <A NAME="SEC131"></A>
13717 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13718 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &lt; </A>]</TD>
13719 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &gt; </A>]</TD>
13720 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &lt;&lt; </A>]</TD>
13721 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13722 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13723 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13724 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13725 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13726 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13727 </TR></TABLE>
13728 <H2> 10.3 Compiling For Multiple Architectures </H2>
13729 <!--docid::SEC131::-->
13730 <P>
13731
13732 You can compile Bash for more than one kind of computer at the
13733 same time, by placing the object files for each architecture in their
13734 own directory.  To do this, you must use a version of <CODE>make</CODE> that
13735 supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>.
13736 <CODE>cd</CODE> to the
13737 directory where you want the object files and executables to go and run
13738 the <CODE>configure</CODE> script from the source directory.  You may need to
13739 supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the
13740 source files are.  <CODE>configure</CODE> automatically checks for the
13741 source code in the directory that <CODE>configure</CODE> is in and in `..'.
13742 </P><P>
13743
13744 If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE>
13745 variable, you can compile Bash for one architecture at a
13746 time in the source code directory.  After you have installed
13747 Bash for one architecture, use <SAMP>`make distclean'</SAMP> before
13748 reconfiguring for another architecture.
13749 </P><P>
13750
13751 Alternatively, if your system supports symbolic links, you can use the
13752 <TT>`support/mkclone'</TT> script to create a build tree which has
13753 symbolic links back to each file in the source directory.  Here's an
13754 example that creates a build directory in the current directory from a
13755 source directory <TT>`/usr/gnu/src/bash-2.0'</TT>:
13756 </P><P>
13757
13758 <TABLE><tr><td>&nbsp;</td><td class=example><pre>bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
13759 </pre></td></tr></table></P><P>
13760
13761 The <CODE>mkclone</CODE> script requires Bash, so you must have already built
13762 Bash for at least one architecture before you can create build
13763 directories for other architectures.
13764 </P><P>
13765
13766 <A NAME="Installation Names"></A>
13767 <HR SIZE="6">
13768 <A NAME="SEC132"></A>
13769 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13770 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &lt; </A>]</TD>
13771 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &gt; </A>]</TD>
13772 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &lt;&lt; </A>]</TD>
13773 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13774 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13775 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13776 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13777 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13778 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13779 </TR></TABLE>
13780 <H2> 10.4 Installation Names </H2>
13781 <!--docid::SEC132::-->
13782 <P>
13783
13784 By default, <SAMP>`make install'</SAMP> will install into
13785 <TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc.  You can
13786 specify an installation prefix other than <TT>`/usr/local'</TT> by
13787 giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>,
13788 or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP>
13789 variable when running <SAMP>`make install'</SAMP>.
13790 </P><P>
13791
13792 You can specify separate installation prefixes for
13793 architecture-specific files and architecture-independent files. 
13794 If you give <CODE>configure</CODE> the option
13795 <SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use
13796 <VAR>PATH</VAR> as the prefix for installing programs and libraries.
13797 Documentation and other data files will still use the regular prefix. 
13798 </P><P>
13799
13800 <A NAME="Specifying the System Type"></A>
13801 <HR SIZE="6">
13802 <A NAME="SEC133"></A>
13803 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13804 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &lt; </A>]</TD>
13805 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &gt; </A>]</TD>
13806 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &lt;&lt; </A>]</TD>
13807 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13808 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13809 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13810 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13811 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13812 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13813 </TR></TABLE>
13814 <H2> 10.5 Specifying the System Type </H2>
13815 <!--docid::SEC133::-->
13816 <P>
13817
13818 There may be some features <CODE>configure</CODE> can not figure out
13819 automatically, but need to determine by the type of host Bash
13820 will run on.  Usually <CODE>configure</CODE> can figure that
13821 out, but if it prints a message saying it can not guess the host
13822 type, give it the <SAMP>`--host=TYPE'</SAMP> option.  <SAMP>`TYPE'</SAMP> can
13823 either be a short name for the system type, such as <SAMP>`sun4'</SAMP>,
13824 or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP>
13825 (e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>).
13826 </P><P>
13827
13828 See the file <TT>`support/config.sub'</TT> for the possible
13829 values of each field. 
13830 </P><P>
13831
13832 <A NAME="Sharing Defaults"></A>
13833 <HR SIZE="6">
13834 <A NAME="SEC134"></A>
13835 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13836 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &lt; </A>]</TD>
13837 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt; </A>]</TD>
13838 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &lt;&lt; </A>]</TD>
13839 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13840 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13841 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13842 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13843 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13844 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13845 </TR></TABLE>
13846 <H2> 10.6 Sharing Defaults </H2>
13847 <!--docid::SEC134::-->
13848 <P>
13849
13850 If you want to set default values for <CODE>configure</CODE> scripts to
13851 share, you can create a site shell script called
13852 <CODE>config.site</CODE> that gives default values for variables like
13853 <CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>.  <CODE>configure</CODE>
13854 looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then
13855 <TT>`PREFIX/etc/config.site'</TT> if it exists.  Or, you can set the
13856 <CODE>CONFIG_SITE</CODE> environment variable to the location of the site
13857 script.  A warning: the Bash <CODE>configure</CODE> looks for a site script,
13858 but not all <CODE>configure</CODE> scripts do.
13859 </P><P>
13860
13861 <A NAME="Operation Controls"></A>
13862 <HR SIZE="6">
13863 <A NAME="SEC135"></A>
13864 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13865 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &lt; </A>]</TD>
13866 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &gt; </A>]</TD>
13867 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &lt;&lt; </A>]</TD>
13868 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13869 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13870 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13871 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13872 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13873 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13874 </TR></TABLE>
13875 <H2> 10.7 Operation Controls </H2>
13876 <!--docid::SEC135::-->
13877 <P>
13878
13879 <CODE>configure</CODE> recognizes the following options to control how it
13880 operates.
13881 </P><P>
13882
13883 <DL COMPACT>
13884
13885 <DT><CODE>--cache-file=<VAR>file</VAR></CODE>
13886 <DD>Use and save the results of the tests in
13887 <VAR>file</VAR> instead of <TT>`./config.cache'</TT>.  Set <VAR>file</VAR> to
13888 <TT>`/dev/null'</TT> to disable caching, for debugging
13889 <CODE>configure</CODE>. 
13890 <P>
13891
13892 <DT><CODE>--help</CODE>
13893 <DD>Print a summary of the options to <CODE>configure</CODE>, and exit.
13894 <P>
13895
13896 <DT><CODE>--quiet</CODE>
13897 <DD><DT><CODE>--silent</CODE>
13898 <DD><DT><CODE>-q</CODE>
13899 <DD>Do not print messages saying which checks are being made.
13900 <P>
13901
13902 <DT><CODE>--srcdir=<VAR>dir</VAR></CODE>
13903 <DD>Look for the Bash source code in directory <VAR>dir</VAR>.  Usually
13904 <CODE>configure</CODE> can determine that directory automatically.
13905 <P>
13906
13907 <DT><CODE>--version</CODE>
13908 <DD>Print the version of Autoconf used to generate the <CODE>configure</CODE>
13909 script, and exit.
13910 </DL>
13911 <P>
13912
13913 <CODE>configure</CODE> also accepts some other, not widely used, boilerplate
13914 options.  <SAMP>`configure --help'</SAMP> prints the complete list.
13915 </P><P>
13916
13917 <A NAME="Optional Features"></A>
13918 <HR SIZE="6">
13919 <A NAME="SEC136"></A>
13920 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13921 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &lt; </A>]</TD>
13922 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt; </A>]</TD>
13923 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &lt;&lt; </A>]</TD>
13924 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> Up </A>]</TD>
13925 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt;&gt; </A>]</TD>
13926 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13927 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13928 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
13929 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13930 </TR></TABLE>
13931 <H2> 10.8 Optional Features </H2>
13932 <!--docid::SEC136::-->
13933 <P>
13934
13935 The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP>
13936 options, where <VAR>feature</VAR> indicates an optional part of Bash.
13937 There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options,
13938 where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>.
13939 To turn off the default use of a package, use
13940 <SAMP>`--without-<VAR>package</VAR>'</SAMP>.  To configure Bash without a feature
13941 that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>.
13942 </P><P>
13943
13944 Here is a complete list of the <SAMP>`--enable-'</SAMP> and
13945 <SAMP>`--with-'</SAMP> options that the Bash <CODE>configure</CODE> recognizes. 
13946 </P><P>
13947
13948 <DL COMPACT>
13949 <DT><CODE>--with-afs</CODE>
13950 <DD>Define if you are using the Andrew File System from Transarc.
13951 <P>
13952
13953 <DT><CODE>--with-bash-malloc</CODE>
13954 <DD>Use the Bash version of
13955 <CODE>malloc</CODE> in the directory <TT>`lib/malloc'</TT>.  This is not the same
13956 <CODE>malloc</CODE> that appears in GNU libc, but an older version
13957 originally derived from the 4.2 BSD <CODE>malloc</CODE>.  This <CODE>malloc</CODE>
13958 is very fast, but wastes some space on each allocation.
13959 This option is enabled by default.
13960 The <TT>`NOTES'</TT> file contains a list of systems for
13961 which this should be turned off, and <CODE>configure</CODE> disables this
13962 option automatically for a number of systems.
13963 <P>
13964
13965 <DT><CODE>--with-curses</CODE>
13966 <DD>Use the curses library instead of the termcap library.  This should
13967 be supplied if your system has an inadequate or incomplete termcap
13968 database.
13969 <P>
13970
13971 <DT><CODE>--with-gnu-malloc</CODE>
13972 <DD>A synonym for <CODE>--with-bash-malloc</CODE>.
13973 <P>
13974
13975 <DT><CODE>--with-installed-readline[=<VAR>PREFIX</VAR>]</CODE>
13976 <DD>Define this to make Bash link with a locally-installed version of Readline
13977 rather than the version in <TT>`lib/readline'</TT>.  This works only with
13978 Readline 5.0 and later versions.  If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not
13979 supplied, <CODE>configure</CODE> uses the values of the make variables
13980 <CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE>
13981 by default, to find the installed version of Readline if it is not in
13982 the standard system include and library directories.
13983 If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in
13984 <TT>`lib/readline'</TT>.
13985 If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as
13986 a directory pathname and looks for
13987 the installed version of Readline in subdirectories of that directory
13988 (include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in
13989 <VAR>PREFIX</VAR>/<CODE>lib</CODE>).
13990 <P>
13991
13992 <DT><CODE>--with-purify</CODE>
13993 <DD>Define this to use the Purify memory allocation checker from Rational
13994 Software.
13995 <P>
13996
13997 <DT><CODE>--enable-minimal-config</CODE>
13998 <DD>This produces a shell with minimal features, close to the historical
13999 Bourne shell.
14000 </DL>
14001 <P>
14002
14003 There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is
14004 compiled and linked, rather than changing run-time features.
14005 </P><P>
14006
14007 <DL COMPACT>
14008 <DT><CODE>--enable-largefile</CODE>
14009 <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
14010 to build programs which can access large files.  This is enabled by
14011 default, if the operating system provides large file support.
14012 <P>
14013
14014 <DT><CODE>--enable-profiling</CODE>
14015 <DD>This builds a Bash binary that produces profiling information to be
14016 processed by <CODE>gprof</CODE> each time it is executed.
14017 <P>
14018
14019 <DT><CODE>--enable-static-link</CODE>
14020 <DD>This causes Bash to be linked statically, if <CODE>gcc</CODE> is being used.
14021 This could be used to build a version to use as root's shell.
14022 </DL>
14023 <P>
14024
14025 The <SAMP>`minimal-config'</SAMP> option can be used to disable all of
14026 the following options, but it is processed first, so individual
14027 options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>. 
14028 </P><P>
14029
14030 All of the following options except for <SAMP>`disabled-builtins'</SAMP>,
14031 <SAMP>`directpand-default'</SAMP>, and
14032 <SAMP>`xpg-echo-default'</SAMP> are
14033 enabled by default, unless the operating system does not provide the
14034 necessary support.
14035 </P><P>
14036
14037 <DL COMPACT>
14038 <DT><CODE>--enable-alias</CODE>
14039 <DD>Allow alias expansion and include the <CODE>alias</CODE> and <CODE>unalias</CODE>
14040 builtins (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
14041 <P>
14042
14043 <DT><CODE>--enable-arith-for-command</CODE>
14044 <DD>Include support for the alternate form of the <CODE>for</CODE> command
14045 that behaves like the C language <CODE>for</CODE> statement
14046 (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
14047 <P>
14048
14049 <DT><CODE>--enable-array-variables</CODE>
14050 <DD>Include support for one-dimensional array shell variables
14051 (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>).
14052 <P>
14053
14054 <DT><CODE>--enable-bang-history</CODE>
14055 <DD>Include support for <CODE>csh</CODE>-like history substitution
14056 (see section <A HREF="bashref.html#SEC124">9.3 History Expansion</A>).
14057 <P>
14058
14059 <DT><CODE>--enable-brace-expansion</CODE>
14060 <DD>Include <CODE>csh</CODE>-like brace expansion
14061 ( <CODE>b{a,b}c</CODE> ==> <CODE>bac bbc</CODE> ).
14062 See <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>, for a complete description.
14063 <P>
14064
14065 <DT><CODE>--enable-casemod-attributes</CODE>
14066 <DD>Include support for case-modifying attributes in the <CODE>declare</CODE> builtin
14067 and assignment statements.  Variables with the <VAR>uppercase</VAR> attribute,
14068 for example, will have their values converted to uppercase upon assignment.
14069 <P>
14070
14071 <DT><CODE>--enable-casemod-expansion</CODE>
14072 <DD>Include support for case-modifying word expansions.
14073 <P>
14074
14075 <DT><CODE>--enable-command-timing</CODE>
14076 <DD>Include support for recognizing <CODE>time</CODE> as a reserved word and for
14077 displaying timing statistics for the pipeline following <CODE>time</CODE>
14078 (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
14079 This allows pipelines as well as shell builtins and functions to be timed.
14080 <P>
14081
14082 <DT><CODE>--enable-cond-command</CODE>
14083 <DD>Include support for the <CODE>[[</CODE> conditional command.
14084 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
14085 <P>
14086
14087 <DT><CODE>--enable-cond-regexp</CODE>
14088 <DD>Include support for matching POSIX regular expressions using the
14089 <SAMP>`=~'</SAMP> binary operator in the <CODE>[[</CODE> conditional command.
14090 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
14091 <P>
14092
14093 <DT><CODE>--enable-coprocesses</CODE>
14094 <DD>Include support for coprocesses and the <CODE>coproc</CODE> reserved word
14095 (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
14096 <P>
14097
14098 <DT><CODE>--enable-debugger</CODE>
14099 <DD>Include support for the bash debugger (distributed separately).
14100 <P>
14101
14102 <DT><CODE>--enable-direxpand-default</CODE>
14103 <DD>Cause the <CODE>direxpand</CODE> shell option (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
14104 to be enabled by default when the shell starts.
14105 It is normally disabled by default.
14106 <P>
14107
14108 <DT><CODE>--enable-directory-stack</CODE>
14109 <DD>Include support for a <CODE>csh</CODE>-like directory stack and the
14110 <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins
14111 (see section <A HREF="bashref.html#SEC87">6.8 The Directory Stack</A>).
14112 <P>
14113
14114 <DT><CODE>--enable-disabled-builtins</CODE>
14115 <DD>Allow builtin commands to be invoked via <SAMP>`builtin xxx'</SAMP>
14116 even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>.
14117 See <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and
14118 <CODE>enable</CODE> builtin commands.
14119 <P>
14120
14121 <DT><CODE>--enable-dparen-arithmetic</CODE>
14122 <DD>Include support for the <CODE>((<small>...</small>))</CODE> command
14123 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
14124 <P>
14125
14126 <DT><CODE>--enable-extended-glob</CODE>
14127 <DD>Include support for the extended pattern matching features described
14128 above under <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>.
14129 <P>
14130
14131 <DT><CODE>--enable-extended-glob-default</CODE>
14132 <DD>Set the default value of the <VAR>extglob</VAR> shell option described
14133 above under <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A> to be enabled.
14134 <P>
14135
14136 <DT><CODE>--enable-glob-asciirange-default</CODE>
14137 <DD>Set the default value of the <VAR>globasciiranges</VAR> shell option described
14138 above under <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A> to be enabled.
14139 This controls the behavior of character ranges when used in pattern matching
14140 bracket expressions.
14141 <P>
14142
14143 <DT><CODE>--enable-help-builtin</CODE>
14144 <DD>Include the <CODE>help</CODE> builtin, which displays help on shell builtins and
14145 variables (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14146 <P>
14147
14148 <DT><CODE>--enable-history</CODE>
14149 <DD>Include command history and the <CODE>fc</CODE> and <CODE>history</CODE>
14150 builtin commands (see section <A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>).
14151 <P>
14152
14153 <DT><CODE>--enable-job-control</CODE>
14154 <DD>This enables the job control features (see section <A HREF="bashref.html#SEC92">7. Job Control</A>),
14155 if the operating system supports them.
14156 <P>
14157
14158 <DT><CODE>--enable-multibyte</CODE>
14159 <DD>This enables support for multibyte characters if the operating
14160 system provides the necessary support.
14161 <P>
14162
14163 <DT><CODE>--enable-net-redirections</CODE>
14164 <DD>This enables the special handling of filenames of the form
14165 <CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> and
14166 <CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
14167 when used in redirections (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
14168 <P>
14169
14170 <DT><CODE>--enable-process-substitution</CODE>
14171 <DD>This enables process substitution (see section <A HREF="bashref.html#SEC35">3.5.6 Process Substitution</A>) if
14172 the operating system provides the necessary support.
14173 <P>
14174
14175 <DT><CODE>--enable-progcomp</CODE>
14176 <DD>Enable the programmable completion facilities
14177 (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>).
14178 If Readline is not enabled, this option has no effect.
14179 <P>
14180
14181 <DT><CODE>--enable-prompt-string-decoding</CODE>
14182 <DD>Turn on the interpretation of a number of backslash-escaped characters
14183 in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt
14184 strings.  See <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>, for a complete list of prompt
14185 string escape sequences.
14186 <P>
14187
14188 <DT><CODE>--enable-readline</CODE>
14189 <DD>Include support for command-line editing and history with the Bash
14190 version of the Readline library (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>).
14191 <P>
14192
14193 <DT><CODE>--enable-restricted</CODE>
14194 <DD>Include support for a <EM>restricted shell</EM>.  If this is enabled, Bash,
14195 when called as <CODE>rbash</CODE>, enters a restricted mode.  See
14196 <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>, for a description of restricted mode.
14197 <P>
14198
14199 <DT><CODE>--enable-select</CODE>
14200 <DD>Include the <CODE>select</CODE> compound command, which allows the generation of
14201 simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
14202 <P>
14203
14204 <DT><CODE>--enable-separate-helpfiles</CODE>
14205 <DD>Use external files for the documentation displayed by the <CODE>help</CODE> builtin
14206 instead of storing the text internally.
14207 <P>
14208
14209 <DT><CODE>--enable-single-help-strings</CODE>
14210 <DD>Store the text displayed by the <CODE>help</CODE> builtin as a single string for
14211 each help topic.  This aids in translating the text to different languages.
14212 You may need to disable this if your compiler cannot handle very long string
14213 literals.
14214 <P>
14215
14216 <DT><CODE>--enable-strict-posix-default</CODE>
14217 <DD>Make Bash POSIX-conformant by default (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
14218 <P>
14219
14220 <DT><CODE>--enable-usg-echo-default</CODE>
14221 <DD>A synonym for <CODE>--enable-xpg-echo-default</CODE>.
14222 <P>
14223
14224 <DT><CODE>--enable-xpg-echo-default</CODE>
14225 <DD>Make the <CODE>echo</CODE> builtin expand backslash-escaped characters by default,
14226 without requiring the <SAMP>`-e'</SAMP> option.
14227 This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>,
14228 which makes the Bash <CODE>echo</CODE> behave more like the version specified in
14229 the Single Unix Specification, version 3.
14230 See section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that
14231 <CODE>echo</CODE> recognizes.
14232 </DL>
14233 <P>
14234
14235 The file <TT>`config-top.h'</TT> contains C Preprocessor
14236 <SAMP>`#define'</SAMP> statements for options which are not settable from
14237 <CODE>configure</CODE>.
14238 Some of these are not meant to be changed; beware of the consequences if
14239 you do.
14240 Read the comments associated with each definition for more
14241 information about its effect.
14242 </P><P>
14243
14244 <A NAME="Reporting Bugs"></A>
14245 <HR SIZE="6">
14246 <A NAME="SEC137"></A>
14247 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14248 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &lt; </A>]</TD>
14249 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt; </A>]</TD>
14250 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &lt;&lt; </A>]</TD>
14251 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
14252 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt;&gt; </A>]</TD>
14253 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14254 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14255 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
14256 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14257 </TR></TABLE>
14258 <H1> A. Reporting Bugs </H1>
14259 <!--docid::SEC137::-->
14260 <P>
14261
14262 Please report all bugs you find in Bash.
14263 But first, you should
14264 make sure that it really is a bug, and that it appears in the latest
14265 version of Bash.
14266 The latest version of Bash is always available for FTP from
14267 <A HREF="ftp://ftp.gnu.org/pub/gnu/bash/">ftp://ftp.gnu.org/pub/gnu/bash/</A>.
14268 </P><P>
14269
14270 Once you have determined that a bug actually exists, use the
14271 <CODE>bashbug</CODE> command to submit a bug report.
14272 If you have a fix, you are encouraged to mail that as well!
14273 Suggestions and `philosophical' bug reports may be mailed
14274 to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet
14275 newsgroup <CODE>gnu.bash.bug</CODE>.
14276 </P><P>
14277
14278 All bug reports should include:
14279 <UL>
14280 <LI>
14281 The version number of Bash.
14282 <LI>
14283 The hardware and operating system.
14284 <LI>
14285 The compiler used to compile Bash.
14286 <LI>
14287 A description of the bug behaviour.
14288 <LI>
14289 A short script or `recipe' which exercises the bug and may be used
14290 to reproduce it.
14291 </UL>
14292 <P>
14293
14294 <CODE>bashbug</CODE> inserts the first three items automatically into
14295 the template it provides for filing a bug report.
14296 </P><P>
14297
14298 Please send all reports concerning this manual to
14299 <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A>.
14300 </P><P>
14301
14302 <A NAME="Major Differences From The Bourne Shell"></A>
14303 <HR SIZE="6">
14304 <A NAME="SEC138"></A>
14305 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14306 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &lt; </A>]</TD>
14307 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> &gt; </A>]</TD>
14308 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &lt;&lt; </A>]</TD>
14309 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
14310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &gt;&gt; </A>]</TD>
14311 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14312 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14313 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
14314 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14315 </TR></TABLE>
14316 <H1> B. Major Differences From The Bourne Shell </H1>
14317 <!--docid::SEC138::-->
14318 <P>
14319
14320 Bash implements essentially the same grammar, parameter and
14321 variable expansion, redirection, and quoting as the Bourne Shell. 
14322 Bash uses the POSIX standard as the specification of
14323 how these features are to be implemented.  There are some
14324 differences between the traditional Bourne shell and Bash; this
14325 section quickly details the differences of significance.  A
14326 number of these differences are explained in greater depth in
14327 previous sections.
14328 This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the
14329 last version of the historical Bourne shell) as the baseline reference.
14330 </P><P>
14331
14332 <UL>
14333
14334 <LI>
14335 Bash is POSIX-conformant, even where the POSIX specification
14336 differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>).
14337 <P>
14338
14339 <LI>
14340 Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>).
14341 <P>
14342
14343 <LI>
14344 Bash has command-line editing (see section <A HREF="bashref.html#SEC96">8. Command Line Editing</A>) and
14345 the <CODE>bind</CODE> builtin.
14346 <P>
14347
14348 <LI>
14349 Bash provides a programmable word completion mechanism
14350 (see section <A HREF="bashref.html#SEC118">8.6 Programmable Completion</A>), and builtin commands
14351 <CODE>complete</CODE>, <CODE>compgen</CODE>, and <CODE>compopt</CODE>, to
14352 manipulate it.
14353 <P>
14354
14355 <LI>
14356 Bash has command history (see section <A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>) and the
14357 <CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it.
14358 The Bash history list maintains timestamp information and uses the
14359 value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it.
14360 <P>
14361
14362 <LI>
14363 Bash implements <CODE>csh</CODE>-like history expansion
14364 (see section <A HREF="bashref.html#SEC124">9.3 History Expansion</A>).
14365 <P>
14366
14367 <LI>
14368 Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC86">6.7 Arrays</A>), and the
14369 appropriate variable expansions and assignment syntax to use them.
14370 Several of the Bash builtins take options to act on arrays.
14371 Bash provides a number of built-in array variables.
14372 <P>
14373
14374 <LI>
14375 The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C
14376 backslash-escaped characters in the text between the single quotes,
14377 is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>).
14378 <P>
14379
14380 <LI>
14381 Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do
14382 locale-specific translation of the characters between the double
14383 quotes.  The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP>
14384 invocation options list the translatable strings found in a script
14385 (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
14386 <P>
14387
14388 <LI>
14389 Bash implements the <CODE>!</CODE> keyword to negate the return value of
14390 a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
14391 Very useful when an <CODE>if</CODE> statement needs to act only if a test fails.
14392 The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to
14393 return a failure status if any command fails.
14394 <P>
14395
14396 <LI>
14397 Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
14398 The display of the timing statistics may be controlled with the
14399 <CODE>TIMEFORMAT</CODE> variable.
14400 <P>
14401
14402 <LI>
14403 Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE>
14404 arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
14405 <P>
14406
14407 <LI>
14408 Bash includes the <CODE>select</CODE> compound command, which allows the
14409 generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
14410 <P>
14411
14412 <LI>
14413 Bash includes the <CODE>[[</CODE> compound command, which makes conditional
14414 testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including
14415 optional regular expression matching.
14416 <P>
14417
14418 <LI>
14419 Bash provides optional case-insensitive matching for the <CODE>case</CODE> and
14420 <CODE>[[</CODE> constructs.
14421 <P>
14422
14423 <LI>
14424 Bash includes brace expansion (see section <A HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>) and tilde
14425 expansion (see section <A HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>).
14426 <P>
14427
14428 <LI>
14429 Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE>
14430 builtins (see section <A HREF="bashref.html#SEC85">6.6 Aliases</A>).
14431 <P>
14432
14433 <LI>
14434 Bash provides shell arithmetic, the <CODE>((</CODE> compound command
14435 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>),
14436 and arithmetic expansion (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>).
14437 <P>
14438
14439 <LI>
14440 Variables present in the shell's initial environment are automatically
14441 exported to child processes.  The Bourne shell does not normally do
14442 this unless the variables are explicitly marked using the <CODE>export</CODE>
14443 command.
14444 <P>
14445
14446 <LI>
14447 Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value
14448 of the variable named on the left hand side.
14449 <P>
14450
14451 <LI>
14452 Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP>
14453 and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from
14454 variable values (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
14455 <P>
14456
14457 <LI>
14458 The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>,
14459 is supported (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
14460 <P>
14461
14462 <LI>
14463 The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>,
14464 which expands to the substring of <CODE>var</CODE>'s value of length
14465 <VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present
14466 (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
14467 <P>
14468
14469 <LI>
14470 The expansion
14471 <CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>,
14472 which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in
14473 the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
14474 <P>
14475
14476 <LI>
14477 The expansion <CODE>${!<VAR>prefix</VAR>*}</CODE> expansion, which expands to
14478 the names of all shell variables whose names begin with <VAR>prefix</VAR>,
14479 is available (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
14480 <P>
14481
14482 <LI>
14483 Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE>
14484 (see section <A HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>).
14485 <P>
14486
14487 <LI>
14488 Bash can expand positional parameters beyond <CODE>$9</CODE> using
14489 <CODE>${<VAR>num</VAR>}</CODE>.
14490 <P>
14491
14492 <LI>
14493 The POSIX <CODE>$()</CODE> form of command substitution
14494 is implemented (see section <A HREF="bashref.html#SEC33">3.5.4 Command Substitution</A>),
14495 and preferred to the Bourne shell's <CODE>"</CODE> (which
14496 is also implemented for backwards compatibility).
14497 <P>
14498
14499 <LI>
14500 Bash has process substitution (see section <A HREF="bashref.html#SEC35">3.5.6 Process Substitution</A>).
14501 <P>
14502
14503 <LI>
14504 Bash automatically assigns variables that provide information about the
14505 current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host
14506 (<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>),
14507 and the instance of Bash that is running (<CODE>BASH</CODE>,
14508 <CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>).  See section <A HREF="bashref.html#SEC68">5.2 Bash Variables</A>,
14509 for details.
14510 <P>
14511
14512 <LI>
14513 The <CODE>IFS</CODE> variable is used to split only the results of expansion,
14514 not all words (see section <A HREF="bashref.html#SEC36">3.5.7 Word Splitting</A>).
14515 This closes a longstanding shell security hole.
14516 <P>
14517
14518 <LI>
14519 The filename expansion bracket expression code uses <SAMP>`!'</SAMP> and <SAMP>`^'</SAMP>
14520 to negate the set of characters between the brackets.
14521 The Bourne shell uses only <SAMP>`!'</SAMP>.
14522 <P>
14523
14524 <LI>
14525 Bash implements the full set of POSIX filename expansion operators,
14526 including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and
14527 <VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>).
14528 <P>
14529
14530 <LI>
14531 Bash implements extended pattern matching features when the <CODE>extglob</CODE>
14532 shell option is enabled (see section <A HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>).
14533 <P>
14534
14535 <LI>
14536 It is possible to have a variable and a function with the same name;
14537 <CODE>sh</CODE> does not separate the two name spaces.
14538 <P>
14539
14540 <LI>
14541 Bash functions are permitted to have local variables using the
14542 <CODE>local</CODE> builtin, and thus useful recursive functions may be written
14543 (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14544 <P>
14545
14546 <LI>
14547 Variable assignments preceding commands affect only that command, even
14548 builtins and functions (see section <A HREF="bashref.html#SEC55">3.7.4 Environment</A>).
14549 In <CODE>sh</CODE>, all variable assignments 
14550 preceding commands are global unless the command is executed from the
14551 file system.
14552 <P>
14553
14554 <LI>
14555 Bash performs filename expansion on filenames specified as operands
14556 to input and output redirection operators (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
14557 <P>
14558
14559 <LI>
14560 Bash contains the <SAMP>`&#60;&#62;'</SAMP> redirection operator, allowing a file to be
14561 opened for both reading and writing, and the <SAMP>`&#38;&#62;'</SAMP> redirection
14562 operator, for directing standard output and standard error to the same
14563 file (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
14564 <P>
14565
14566 <LI>
14567 Bash includes the <SAMP>`&#60;&#60;&#60;'</SAMP> redirection operator, allowing a string to
14568 be used as the standard input to a command.
14569 <P>
14570
14571 <LI>
14572 Bash implements the <SAMP>`[n]&#60;&#38;<VAR>word</VAR>'</SAMP> and <SAMP>`[n]&#62;&#38;<VAR>word</VAR>'</SAMP>
14573 redirection operators, which move one file descriptor to another.
14574 <P>
14575
14576 <LI>
14577 Bash treats a number of filenames specially when they are
14578 used in redirection operators (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
14579 <P>
14580
14581 <LI>
14582 Bash can open network connections to arbitrary machines and services
14583 with the redirection operators (see section <A HREF="bashref.html#SEC40">3.6 Redirections</A>).
14584 <P>
14585
14586 <LI>
14587 The <CODE>noclobber</CODE> option is available to avoid overwriting existing
14588 files with output redirection (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
14589 The <SAMP>`&#62;|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>.
14590 <P>
14591
14592 <LI>
14593 The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
14594 each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and
14595 physical modes.
14596 <P>
14597
14598 <LI>
14599 Bash allows a function to override a builtin with the same name, and provides
14600 access to that builtin's functionality within the function via the
14601 <CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14602 <P>
14603
14604 <LI>
14605 The <CODE>command</CODE> builtin allows selective disabling of functions
14606 when command lookup is performed (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14607 <P>
14608
14609 <LI>
14610 Individual builtins may be enabled or disabled using the <CODE>enable</CODE>
14611 builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14612 <P>
14613
14614 <LI>
14615 The Bash <CODE>exec</CODE> builtin takes additional options that allow users
14616 to control the contents of the environment passed to the executed
14617 command, and what the zeroth argument to the command is to be
14618 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
14619 <P>
14620
14621 <LI>
14622 Shell functions may be exported to children via the environment
14623 using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC25">3.3 Shell Functions</A>).
14624 <P>
14625
14626 <LI>
14627 The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can
14628 take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to
14629 display variables with various attributes set in a format that can be
14630 used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable
14631 attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes
14632 and values simultaneously.
14633 <P>
14634
14635 <LI>
14636 The Bash <CODE>hash</CODE> builtin allows a name to be associated with
14637 an arbitrary filename, even when that filename cannot be found by
14638 searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP>
14639 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
14640 <P>
14641
14642 <LI>
14643 Bash includes a <CODE>help</CODE> builtin for quick reference to shell
14644 facilities (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14645 <P>
14646
14647 <LI>
14648 The <CODE>printf</CODE> builtin is available to display formatted output
14649 (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14650 <P>
14651
14652 <LI>
14653 The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>)
14654 will read a line ending in <SAMP>`\'</SAMP> with
14655 the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a
14656 default if no non-option arguments are supplied.
14657 The Bash <CODE>read</CODE> builtin
14658 also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use
14659 Readline to obtain the line when given the <SAMP>`-e'</SAMP> option.
14660 The <CODE>read</CODE> builtin also has additional options to control input:
14661 the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as
14662 they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out
14663 if input does not arrive within a specified number of seconds, the
14664 <SAMP>`-n'</SAMP> option will allow reading only a specified number of
14665 characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read
14666 until a particular character rather than newline.
14667 <P>
14668
14669 <LI>
14670 The <CODE>return</CODE> builtin may be used to abort execution of scripts
14671 executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins
14672 (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
14673 <P>
14674
14675 <LI>
14676 Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell
14677 optional capabilities (see section <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>), and allows these options
14678 to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC70">6.1 Invoking Bash</A>).
14679 <P>
14680
14681 <LI>
14682 Bash has much more optional behavior controllable with the <CODE>set</CODE>
14683 builtin (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
14684 <P>
14685
14686 <LI>
14687 The <SAMP>`-x'</SAMP> (<SAMP>`xtrace'</SAMP>) option displays commands other than
14688 simple commands when performing an execution trace
14689 (see section <A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>).
14690 <P>
14691
14692 <LI>
14693 The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>)
14694 is slightly different, as it implements the POSIX algorithm,
14695 which specifies the behavior based on the number of arguments.
14696 <P>
14697
14698 <LI>
14699 Bash includes the <CODE>caller</CODE> builtin, which displays the context of
14700 any active subroutine call (a shell function or a script executed with
14701 the <CODE>.</CODE> or <CODE>source</CODE> builtins).  This supports the bash
14702 debugger.
14703 <P>
14704
14705 <LI>
14706 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>) allows a
14707 <CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>.
14708 Commands specified with a <CODE>DEBUG</CODE> trap are executed before every
14709 simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
14710 <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
14711 the first command executes in a shell function.
14712 The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the
14713 function has been given the <CODE>trace</CODE> attribute or the
14714 <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
14715 The <CODE>extdebug</CODE> shell option has additional effects on the
14716 <CODE>DEBUG</CODE> trap.
14717 <P>
14718
14719 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>) allows an
14720 <CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
14721 Commands specified with an <CODE>ERR</CODE> trap are executed after a simple
14722 command fails, with a few exceptions.
14723 The <CODE>ERR</CODE> trap is not inherited by shell functions unless the
14724 <CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled.
14725 </P><P>
14726
14727 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>) allows a
14728 <CODE>RETURN</CODE> pseudo-signal specification, similar to
14729 <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
14730 Commands specified with an <CODE>RETURN</CODE> trap are executed before
14731 execution resumes after a shell function or a shell script executed with
14732 <CODE>.</CODE> or <CODE>source</CODE> returns.
14733 The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the
14734 function has been given the <CODE>trace</CODE> attribute or the
14735 <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
14736 </P><P>
14737
14738 <LI>
14739 The Bash <CODE>type</CODE> builtin is more extensive and gives more information
14740 about the names it finds (see section <A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>).
14741 <P>
14742
14743 <LI>
14744 The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause
14745 the output to be displayed in the form of a <CODE>umask</CODE> command
14746 that may be reused as input (see section <A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>).
14747 <P>
14748
14749 <LI>
14750 Bash implements a <CODE>csh</CODE>-like directory stack, and provides the
14751 <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it
14752 (see section <A HREF="bashref.html#SEC87">6.8 The Directory Stack</A>).
14753 Bash also makes the directory stack visible as the value of the
14754 <CODE>DIRSTACK</CODE> shell variable.
14755 <P>
14756
14757 <LI>
14758 Bash interprets special backslash-escaped characters in the prompt
14759 strings when interactive (see section <A HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>).
14760 <P>
14761
14762 <LI>
14763 The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>);
14764 the SVR4.2 shell restricted mode is too limited.
14765 <P>
14766
14767 <LI>
14768 The <CODE>disown</CODE> builtin can remove a job from the internal shell
14769 job table (see section <A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>) or suppress the sending
14770 of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a
14771 <CODE>SIGHUP</CODE>.
14772 <P>
14773
14774 <LI>
14775 Bash includes a number of features to support a separate debugger for
14776 shell scripts.
14777 <P>
14778
14779 <LI>
14780 The SVR4.2 shell has two privilege-related builtins
14781 (<CODE>mldmode</CODE> and <CODE>priv</CODE>) not present in Bash.
14782 <P>
14783
14784 <LI>
14785 Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins.
14786 <P>
14787
14788 <LI>
14789 Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting.
14790 <P>
14791
14792 <LI>
14793 The SVR4.2 <CODE>sh</CODE> uses a <CODE>TIMEOUT</CODE> variable like Bash uses
14794 <CODE>TMOUT</CODE>.
14795 <P>
14796
14797 </UL>
14798 <P>
14799
14800 More features unique to Bash may be found in <A HREF="bashref.html#SEC69">6. Bash Features</A>.
14801 </P><P>
14802
14803 <HR SIZE="6">
14804 <A NAME="SEC139"></A>
14805 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14806 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &lt; </A>]</TD>
14807 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &gt; </A>]</TD>
14808 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &lt;&lt; </A>]</TD>
14809 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> Up </A>]</TD>
14810 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &gt;&gt; </A>]</TD>
14811 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14812 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14813 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
14814 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14815 </TR></TABLE>
14816 <H2> B.1 Implementation Differences From The SVR4.2 Shell </H2>
14817 <!--docid::SEC139::-->
14818 <P>
14819
14820 Since Bash is a completely new implementation, it does not suffer from
14821 many of the limitations of the SVR4.2 shell.  For instance:
14822 </P><P>
14823
14824 <UL>
14825
14826 <LI>
14827 Bash does not fork a subshell when redirecting into or out of
14828 a shell control structure such as  an <CODE>if</CODE> or <CODE>while</CODE>
14829 statement.
14830 <P>
14831
14832 <LI>
14833 Bash does not allow unbalanced quotes.  The SVR4.2 shell will silently
14834 insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances.
14835 This can be the cause of some hard-to-find errors.
14836 <P>
14837
14838 <LI>
14839 The SVR4.2 shell uses a baroque memory management scheme based on
14840 trapping <CODE>SIGSEGV</CODE>.  If the shell is started from a process with
14841 <CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library
14842 function call), it misbehaves badly.
14843 <P>
14844
14845 <LI>
14846 In a questionable attempt at security, the SVR4.2 shell,
14847 when invoked without the <SAMP>`-p'</SAMP> option, will alter its real
14848 and effective UID and GID if they are less than some
14849 magic threshold value, commonly 100.
14850 This can lead to unexpected results.
14851 <P>
14852
14853 <LI>
14854 The SVR4.2 shell does not allow users to trap <CODE>SIGSEGV</CODE>,
14855 <CODE>SIGALRM</CODE>, or <CODE>SIGCHLD</CODE>.
14856 <P>
14857
14858 <LI>
14859 The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>,
14860 <CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset.
14861 <P>
14862
14863 <LI>
14864 The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of
14865 <SAMP>`|'</SAMP>.
14866 <P>
14867
14868 <LI>
14869 Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>);
14870 the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>).  In
14871 fact, some versions of the shell dump core if the second argument begins
14872 with a <SAMP>`-'</SAMP>.
14873 <P>
14874
14875 <LI>
14876 The SVR4.2 shell exits a script if any builtin fails; Bash exits
14877 a script only if one of the POSIX special builtins fails, and
14878 only for certain failures, as enumerated in the POSIX standard.
14879 <P>
14880
14881 <LI>
14882 The SVR4.2 shell behaves differently when invoked as <CODE>jsh</CODE>
14883 (it turns on job control).
14884 </UL>
14885 <P>
14886
14887 <A NAME="GNU Free Documentation License"></A>
14888 <HR SIZE="6">
14889 <A NAME="SEC140"></A>
14890 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14891 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC139"> &lt; </A>]</TD>
14892 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &gt; </A>]</TD>
14893 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &lt;&lt; </A>]</TD>
14894 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
14895 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &gt;&gt; </A>]</TD>
14896 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14897 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14898 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
14899 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14900 </TR></TABLE>
14901 <H1> C. GNU Free Documentation License </H1>
14902 <!--docid::SEC140::-->
14903 <P>
14904
14905 <center>
14906  Version 1.3, 3 November 2008
14907 </center>
14908 </P><P>
14909
14910 <TABLE><tr><td>&nbsp;</td><td class=display><pre style="font-family: serif">Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
14911 <A HREF="http://fsf.org/">http://fsf.org/</A>
14912
14913 Everyone is permitted to copy and distribute verbatim copies
14914 of this license document, but changing it is not allowed.
14915 </pre></td></tr></table></P><P>
14916
14917 <OL>
14918 <LI>
14919 PREAMBLE
14920 <P>
14921
14922 The purpose of this License is to make a manual, textbook, or other
14923 functional and useful document <EM>free</EM> in the sense of freedom: to
14924 assure everyone the effective freedom to copy and redistribute it,
14925 with or without modifying it, either commercially or noncommercially.
14926 Secondarily, this License preserves for the author and publisher a way
14927 to get credit for their work, while not being considered responsible
14928 for modifications made by others.
14929 </P><P>
14930
14931 This License is a kind of "copyleft", which means that derivative
14932 works of the document must themselves be free in the same sense.  It
14933 complements the GNU General Public License, which is a copyleft
14934 license designed for free software.
14935 </P><P>
14936
14937 We have designed this License in order to use it for manuals for free
14938 software, because free software needs free documentation: a free
14939 program should come with manuals providing the same freedoms that the
14940 software does.  But this License is not limited to software manuals;
14941 it can be used for any textual work, regardless of subject matter or
14942 whether it is published as a printed book.  We recommend this License
14943 principally for works whose purpose is instruction or reference.
14944 </P><P>
14945
14946 <LI>
14947 APPLICABILITY AND DEFINITIONS
14948 <P>
14949
14950 This License applies to any manual or other work, in any medium, that
14951 contains a notice placed by the copyright holder saying it can be
14952 distributed under the terms of this License.  Such a notice grants a
14953 world-wide, royalty-free license, unlimited in duration, to use that
14954 work under the conditions stated herein.  The "Document", below,
14955 refers to any such manual or work.  Any member of the public is a
14956 licensee, and is addressed as "you".  You accept the license if you
14957 copy, modify or distribute the work in a way requiring permission
14958 under copyright law.
14959 </P><P>
14960
14961 A "Modified Version" of the Document means any work containing the
14962 Document or a portion of it, either copied verbatim, or with
14963 modifications and/or translated into another language.
14964 </P><P>
14965
14966 A "Secondary Section" is a named appendix or a front-matter section
14967 of the Document that deals exclusively with the relationship of the
14968 publishers or authors of the Document to the Document's overall
14969 subject (or to related matters) and contains nothing that could fall
14970 directly within that overall subject.  (Thus, if the Document is in
14971 part a textbook of mathematics, a Secondary Section may not explain
14972 any mathematics.)  The relationship could be a matter of historical
14973 connection with the subject or with related matters, or of legal,
14974 commercial, philosophical, ethical or political position regarding
14975 them.
14976 </P><P>
14977
14978 The "Invariant Sections" are certain Secondary Sections whose titles
14979 are designated, as being those of Invariant Sections, in the notice
14980 that says that the Document is released under this License.  If a
14981 section does not fit the above definition of Secondary then it is not
14982 allowed to be designated as Invariant.  The Document may contain zero
14983 Invariant Sections.  If the Document does not identify any Invariant
14984 Sections then there are none.
14985 </P><P>
14986
14987 The "Cover Texts" are certain short passages of text that are listed,
14988 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
14989 the Document is released under this License.  A Front-Cover Text may
14990 be at most 5 words, and a Back-Cover Text may be at most 25 words.
14991 </P><P>
14992
14993 A "Transparent" copy of the Document means a machine-readable copy,
14994 represented in a format whose specification is available to the
14995 general public, that is suitable for revising the document
14996 straightforwardly with generic text editors or (for images composed of
14997 pixels) generic paint programs or (for drawings) some widely available
14998 drawing editor, and that is suitable for input to text formatters or
14999 for automatic translation to a variety of formats suitable for input
15000 to text formatters.  A copy made in an otherwise Transparent file
15001 format whose markup, or absence of markup, has been arranged to thwart
15002 or discourage subsequent modification by readers is not Transparent.
15003 An image format is not Transparent if used for any substantial amount
15004 of text.  A copy that is not "Transparent" is called "Opaque".
15005 </P><P>
15006
15007 Examples of suitable formats for Transparent copies include plain
15008 ASCII without markup, Texinfo input format, LaTeX input
15009 format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available
15010 <FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>,
15011 PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification.  Examples
15012 of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and
15013 <FONT SIZE="-1">JPG</FONT>.  Opaque formats include proprietary formats that can be
15014 read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or
15015 <FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are
15016 not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>,
15017 PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for
15018 output purposes only.
15019 </P><P>
15020
15021 The "Title Page" means, for a printed book, the title page itself,
15022 plus such following pages as are needed to hold, legibly, the material
15023 this License requires to appear in the title page.  For works in
15024 formats which do not have any title page as such, "Title Page" means
15025 the text near the most prominent appearance of the work's title,
15026 preceding the beginning of the body of the text.
15027 </P><P>
15028
15029 The "publisher" means any person or entity that distributes copies
15030 of the Document to the public.
15031 </P><P>
15032
15033 A section "Entitled XYZ" means a named subunit of the Document whose
15034 title either is precisely XYZ or contains XYZ in parentheses following
15035 text that translates XYZ in another language.  (Here XYZ stands for a
15036 specific section name mentioned below, such as "Acknowledgements",
15037 "Dedications", "Endorsements", or "History".)  To "Preserve the Title"
15038 of such a section when you modify the Document means that it remains a
15039 section "Entitled XYZ" according to this definition.
15040 </P><P>
15041
15042 The Document may include Warranty Disclaimers next to the notice which
15043 states that this License applies to the Document.  These Warranty
15044 Disclaimers are considered to be included by reference in this
15045 License, but only as regards disclaiming warranties: any other
15046 implication that these Warranty Disclaimers may have is void and has
15047 no effect on the meaning of this License.
15048 </P><P>
15049
15050 <LI>
15051 VERBATIM COPYING
15052 <P>
15053
15054 You may copy and distribute the Document in any medium, either
15055 commercially or noncommercially, provided that this License, the
15056 copyright notices, and the license notice saying this License applies
15057 to the Document are reproduced in all copies, and that you add no other
15058 conditions whatsoever to those of this License.  You may not use
15059 technical measures to obstruct or control the reading or further
15060 copying of the copies you make or distribute.  However, you may accept
15061 compensation in exchange for copies.  If you distribute a large enough
15062 number of copies you must also follow the conditions in section 3.
15063 </P><P>
15064
15065 You may also lend copies, under the same conditions stated above, and
15066 you may publicly display copies.
15067 </P><P>
15068
15069 <LI>
15070 COPYING IN QUANTITY
15071 <P>
15072
15073 If you publish printed copies (or copies in media that commonly have
15074 printed covers) of the Document, numbering more than 100, and the
15075 Document's license notice requires Cover Texts, you must enclose the
15076 copies in covers that carry, clearly and legibly, all these Cover
15077 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
15078 the back cover.  Both covers must also clearly and legibly identify
15079 you as the publisher of these copies.  The front cover must present
15080 the full title with all words of the title equally prominent and
15081 visible.  You may add other material on the covers in addition.
15082 Copying with changes limited to the covers, as long as they preserve
15083 the title of the Document and satisfy these conditions, can be treated
15084 as verbatim copying in other respects.
15085 </P><P>
15086
15087 If the required texts for either cover are too voluminous to fit
15088 legibly, you should put the first ones listed (as many as fit
15089 reasonably) on the actual cover, and continue the rest onto adjacent
15090 pages.
15091 </P><P>
15092
15093 If you publish or distribute Opaque copies of the Document numbering
15094 more than 100, you must either include a machine-readable Transparent
15095 copy along with each Opaque copy, or state in or with each Opaque copy
15096 a computer-network location from which the general network-using
15097 public has access to download using public-standard network protocols
15098 a complete Transparent copy of the Document, free of added material.
15099 If you use the latter option, you must take reasonably prudent steps,
15100 when you begin distribution of Opaque copies in quantity, to ensure
15101 that this Transparent copy will remain thus accessible at the stated
15102 location until at least one year after the last time you distribute an
15103 Opaque copy (directly or through your agents or retailers) of that
15104 edition to the public.
15105 </P><P>
15106
15107 It is requested, but not required, that you contact the authors of the
15108 Document well before redistributing any large number of copies, to give
15109 them a chance to provide you with an updated version of the Document.
15110 </P><P>
15111
15112 <LI>
15113 MODIFICATIONS
15114 <P>
15115
15116 You may copy and distribute a Modified Version of the Document under
15117 the conditions of sections 2 and 3 above, provided that you release
15118 the Modified Version under precisely this License, with the Modified
15119 Version filling the role of the Document, thus licensing distribution
15120 and modification of the Modified Version to whoever possesses a copy
15121 of it.  In addition, you must do these things in the Modified Version:
15122 </P><P>
15123
15124 <OL>
15125 <LI>
15126 Use in the Title Page (and on the covers, if any) a title distinct
15127 from that of the Document, and from those of previous versions
15128 (which should, if there were any, be listed in the History section
15129 of the Document).  You may use the same title as a previous version
15130 if the original publisher of that version gives permission.
15131 <P>
15132
15133 <LI>
15134 List on the Title Page, as authors, one or more persons or entities
15135 responsible for authorship of the modifications in the Modified
15136 Version, together with at least five of the principal authors of the
15137 Document (all of its principal authors, if it has fewer than five),
15138 unless they release you from this requirement.
15139 <P>
15140
15141 <LI>
15142 State on the Title page the name of the publisher of the
15143 Modified Version, as the publisher.
15144 <P>
15145
15146 <LI>
15147 Preserve all the copyright notices of the Document.
15148 <P>
15149
15150 <LI>
15151 Add an appropriate copyright notice for your modifications
15152 adjacent to the other copyright notices.
15153 <P>
15154
15155 <LI>
15156 Include, immediately after the copyright notices, a license notice
15157 giving the public permission to use the Modified Version under the
15158 terms of this License, in the form shown in the Addendum below.
15159 <P>
15160
15161 <LI>
15162 Preserve in that license notice the full lists of Invariant Sections
15163 and required Cover Texts given in the Document's license notice.
15164 <P>
15165
15166 <LI>
15167 Include an unaltered copy of this License.
15168 <P>
15169
15170 <LI>
15171 Preserve the section Entitled "History", Preserve its Title, and add
15172 to it an item stating at least the title, year, new authors, and
15173 publisher of the Modified Version as given on the Title Page.  If
15174 there is no section Entitled "History" in the Document, create one
15175 stating the title, year, authors, and publisher of the Document as
15176 given on its Title Page, then add an item describing the Modified
15177 Version as stated in the previous sentence.
15178 <P>
15179
15180 <LI>
15181 Preserve the network location, if any, given in the Document for
15182 public access to a Transparent copy of the Document, and likewise
15183 the network locations given in the Document for previous versions
15184 it was based on.  These may be placed in the "History" section.
15185 You may omit a network location for a work that was published at
15186 least four years before the Document itself, or if the original
15187 publisher of the version it refers to gives permission.
15188 <P>
15189
15190 <LI>
15191 For any section Entitled "Acknowledgements" or "Dedications", Preserve
15192 the Title of the section, and preserve in the section all the
15193 substance and tone of each of the contributor acknowledgements and/or
15194 dedications given therein.
15195 <P>
15196
15197 <LI>
15198 Preserve all the Invariant Sections of the Document,
15199 unaltered in their text and in their titles.  Section numbers
15200 or the equivalent are not considered part of the section titles.
15201 <P>
15202
15203 <LI>
15204 Delete any section Entitled "Endorsements".  Such a section
15205 may not be included in the Modified Version.
15206 <P>
15207
15208 <LI>
15209 Do not retitle any existing section to be Entitled "Endorsements" or
15210 to conflict in title with any Invariant Section.
15211 <P>
15212
15213 <LI>
15214 Preserve any Warranty Disclaimers.
15215 </OL>
15216 <P>
15217
15218 If the Modified Version includes new front-matter sections or
15219 appendices that qualify as Secondary Sections and contain no material
15220 copied from the Document, you may at your option designate some or all
15221 of these sections as invariant.  To do this, add their titles to the
15222 list of Invariant Sections in the Modified Version's license notice.
15223 These titles must be distinct from any other section titles.
15224 </P><P>
15225
15226 You may add a section Entitled "Endorsements", provided it contains
15227 nothing but endorsements of your Modified Version by various
15228 parties--for example, statements of peer review or that the text has
15229 been approved by an organization as the authoritative definition of a
15230 standard.
15231 </P><P>
15232
15233 You may add a passage of up to five words as a Front-Cover Text, and a
15234 passage of up to 25 words as a Back-Cover Text, to the end of the list
15235 of Cover Texts in the Modified Version.  Only one passage of
15236 Front-Cover Text and one of Back-Cover Text may be added by (or
15237 through arrangements made by) any one entity.  If the Document already
15238 includes a cover text for the same cover, previously added by you or
15239 by arrangement made by the same entity you are acting on behalf of,
15240 you may not add another; but you may replace the old one, on explicit
15241 permission from the previous publisher that added the old one.
15242 </P><P>
15243
15244 The author(s) and publisher(s) of the Document do not by this License
15245 give permission to use their names for publicity for or to assert or
15246 imply endorsement of any Modified Version.
15247 </P><P>
15248
15249 <LI>
15250 COMBINING DOCUMENTS
15251 <P>
15252
15253 You may combine the Document with other documents released under this
15254 License, under the terms defined in section 4 above for modified
15255 versions, provided that you include in the combination all of the
15256 Invariant Sections of all of the original documents, unmodified, and
15257 list them all as Invariant Sections of your combined work in its
15258 license notice, and that you preserve all their Warranty Disclaimers.
15259 </P><P>
15260
15261 The combined work need only contain one copy of this License, and
15262 multiple identical Invariant Sections may be replaced with a single
15263 copy.  If there are multiple Invariant Sections with the same name but
15264 different contents, make the title of each such section unique by
15265 adding at the end of it, in parentheses, the name of the original
15266 author or publisher of that section if known, or else a unique number.
15267 Make the same adjustment to the section titles in the list of
15268 Invariant Sections in the license notice of the combined work.
15269 </P><P>
15270
15271 In the combination, you must combine any sections Entitled "History"
15272 in the various original documents, forming one section Entitled
15273 "History"; likewise combine any sections Entitled "Acknowledgements",
15274 and any sections Entitled "Dedications".  You must delete all
15275 sections Entitled "Endorsements."
15276 </P><P>
15277
15278 <LI>
15279 COLLECTIONS OF DOCUMENTS
15280 <P>
15281
15282 You may make a collection consisting of the Document and other documents
15283 released under this License, and replace the individual copies of this
15284 License in the various documents with a single copy that is included in
15285 the collection, provided that you follow the rules of this License for
15286 verbatim copying of each of the documents in all other respects.
15287 </P><P>
15288
15289 You may extract a single document from such a collection, and distribute
15290 it individually under this License, provided you insert a copy of this
15291 License into the extracted document, and follow this License in all
15292 other respects regarding verbatim copying of that document.
15293 </P><P>
15294
15295 <LI>
15296 AGGREGATION WITH INDEPENDENT WORKS
15297 <P>
15298
15299 A compilation of the Document or its derivatives with other separate
15300 and independent documents or works, in or on a volume of a storage or
15301 distribution medium, is called an "aggregate" if the copyright
15302 resulting from the compilation is not used to limit the legal rights
15303 of the compilation's users beyond what the individual works permit.
15304 When the Document is included in an aggregate, this License does not
15305 apply to the other works in the aggregate which are not themselves
15306 derivative works of the Document.
15307 </P><P>
15308
15309 If the Cover Text requirement of section 3 is applicable to these
15310 copies of the Document, then if the Document is less than one half of
15311 the entire aggregate, the Document's Cover Texts may be placed on
15312 covers that bracket the Document within the aggregate, or the
15313 electronic equivalent of covers if the Document is in electronic form.
15314 Otherwise they must appear on printed covers that bracket the whole
15315 aggregate.
15316 </P><P>
15317
15318 <LI>
15319 TRANSLATION
15320 <P>
15321
15322 Translation is considered a kind of modification, so you may
15323 distribute translations of the Document under the terms of section 4.
15324 Replacing Invariant Sections with translations requires special
15325 permission from their copyright holders, but you may include
15326 translations of some or all Invariant Sections in addition to the
15327 original versions of these Invariant Sections.  You may include a
15328 translation of this License, and all the license notices in the
15329 Document, and any Warranty Disclaimers, provided that you also include
15330 the original English version of this License and the original versions
15331 of those notices and disclaimers.  In case of a disagreement between
15332 the translation and the original version of this License or a notice
15333 or disclaimer, the original version will prevail.
15334 </P><P>
15335
15336 If a section in the Document is Entitled "Acknowledgements",
15337 "Dedications", or "History", the requirement (section 4) to Preserve
15338 its Title (section 1) will typically require changing the actual
15339 title.
15340 </P><P>
15341
15342 <LI>
15343 TERMINATION
15344 <P>
15345
15346 You may not copy, modify, sublicense, or distribute the Document
15347 except as expressly provided under this License.  Any attempt
15348 otherwise to copy, modify, sublicense, or distribute it is void, and
15349 will automatically terminate your rights under this License.
15350 </P><P>
15351
15352 However, if you cease all violation of this License, then your license
15353 from a particular copyright holder is reinstated (a) provisionally,
15354 unless and until the copyright holder explicitly and finally
15355 terminates your license, and (b) permanently, if the copyright holder
15356 fails to notify you of the violation by some reasonable means prior to
15357 60 days after the cessation.
15358 </P><P>
15359
15360 Moreover, your license from a particular copyright holder is
15361 reinstated permanently if the copyright holder notifies you of the
15362 violation by some reasonable means, this is the first time you have
15363 received notice of violation of this License (for any work) from that
15364 copyright holder, and you cure the violation prior to 30 days after
15365 your receipt of the notice.
15366 </P><P>
15367
15368 Termination of your rights under this section does not terminate the
15369 licenses of parties who have received copies or rights from you under
15370 this License.  If your rights have been terminated and not permanently
15371 reinstated, receipt of a copy of some or all of the same material does
15372 not give you any rights to use it.
15373 </P><P>
15374
15375 <LI>
15376 FUTURE REVISIONS OF THIS LICENSE
15377 <P>
15378
15379 The Free Software Foundation may publish new, revised versions
15380 of the GNU Free Documentation License from time to time.  Such new
15381 versions will be similar in spirit to the present version, but may
15382 differ in detail to address new problems or concerns.  See
15383 <A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>.
15384 </P><P>
15385
15386 Each version of the License is given a distinguishing version number.
15387 If the Document specifies that a particular numbered version of this
15388 License "or any later version" applies to it, you have the option of
15389 following the terms and conditions either of that specified version or
15390 of any later version that has been published (not as a draft) by the
15391 Free Software Foundation.  If the Document does not specify a version
15392 number of this License, you may choose any version ever published (not
15393 as a draft) by the Free Software Foundation.  If the Document
15394 specifies that a proxy can decide which future versions of this
15395 License can be used, that proxy's public statement of acceptance of a
15396 version permanently authorizes you to choose that version for the
15397 Document.
15398 </P><P>
15399
15400 <LI>
15401 RELICENSING
15402 <P>
15403
15404 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
15405 World Wide Web server that publishes copyrightable works and also
15406 provides prominent facilities for anybody to edit those works.  A
15407 public wiki that anybody can edit is an example of such a server.  A
15408 "Massive Multiauthor Collaboration" (or "MMC") contained in the
15409 site means any set of copyrightable works thus published on the MMC
15410 site.
15411 </P><P>
15412
15413 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
15414 license published by Creative Commons Corporation, a not-for-profit
15415 corporation with a principal place of business in San Francisco,
15416 California, as well as future copyleft versions of that license
15417 published by that same organization.
15418 </P><P>
15419
15420 "Incorporate" means to publish or republish a Document, in whole or
15421 in part, as part of another Document.
15422 </P><P>
15423
15424 An MMC is "eligible for relicensing" if it is licensed under this
15425 License, and if all works that were first published under this License
15426 somewhere other than this MMC, and subsequently incorporated in whole
15427 or in part into the MMC, (1) had no cover texts or invariant sections,
15428 and (2) were thus incorporated prior to November 1, 2008.
15429 </P><P>
15430
15431 The operator of an MMC Site may republish an MMC contained in the site
15432 under CC-BY-SA on the same site at any time before August 1, 2009,
15433 provided the MMC is eligible for relicensing.
15434 </P><P>
15435
15436 </OL>
15437 <P>
15438
15439 <A NAME="SEC141"></A>
15440 <H2> ADDENDUM: How to use this License for your documents </H2>
15441 <!--docid::SEC141::-->
15442 <P>
15443
15444 To use this License in a document you have written, include a copy of
15445 the License in the document and put the following copyright and
15446 license notices just after the title page:
15447 </P><P>
15448
15449 <TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>  Copyright (C)  <VAR>year</VAR>  <VAR>your name</VAR>.
15450   Permission is granted to copy, distribute and/or modify this document
15451   under the terms of the GNU Free Documentation License, Version 1.3
15452   or any later version published by the Free Software Foundation;
15453   with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
15454   Texts.  A copy of the license is included in the section entitled ``GNU
15455   Free Documentation License''.
15456 </FONT></pre></td></tr></table></P><P>
15457
15458 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
15459 replace the "with<small>...</small>Texts." line with this:
15460 </P><P>
15461
15462 <TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>    with the Invariant Sections being <VAR>list their titles</VAR>, with
15463     the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts
15464     being <VAR>list</VAR>.
15465 </FONT></pre></td></tr></table></P><P>
15466
15467 If you have Invariant Sections without Cover Texts, or some other
15468 combination of the three, merge those two alternatives to suit the
15469 situation.
15470 </P><P>
15471
15472 If your document contains nontrivial examples of program code, we
15473 recommend releasing these examples in parallel under your choice of
15474 free software license, such as the GNU General Public License,
15475 to permit their use in free software.
15476 </P><P>
15477
15478 <A NAME="Indexes"></A>
15479 <HR SIZE="6">
15480 <A NAME="SEC142"></A>
15481 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15482 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &lt; </A>]</TD>
15483 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &gt; </A>]</TD>
15484 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
15485 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
15486 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
15487 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15488 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15489 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
15490 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15491 </TR></TABLE>
15492 <H1> D. Indexes </H1>
15493 <!--docid::SEC142::-->
15494 <P>
15495
15496 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0> 
15497 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC143">D.1 Index of Shell Builtin Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR>
15498 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC144">D.2 Index of Shell Reserved Words</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR>
15499 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC145">D.3 Parameter and Variable Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the
15500                                 variable you want.</TD></TR>
15501 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC146">D.4 Function Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR>
15502 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC147">D.5 Concept Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in
15503                                 this manual.</TD></TR>
15504 </TABLE></BLOCKQUOTE>
15505 <P>
15506
15507 <A NAME="Builtin Index"></A>
15508 <HR SIZE="6">
15509 <A NAME="SEC143"></A>
15510 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15511 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &lt; </A>]</TD>
15512 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &gt; </A>]</TD>
15513 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
15514 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> Up </A>]</TD>
15515 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
15516 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15517 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15518 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
15519 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15520 </TR></TABLE>
15521 <H2> D.1 Index of Shell Builtin Commands </H2>
15522 <!--docid::SEC143::-->
15523 <table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
15524  &nbsp; 
15525 <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
15526  &nbsp; 
15527 <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
15528  &nbsp; 
15529 <BR>
15530 <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
15531  &nbsp; 
15532 <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
15533  &nbsp; 
15534 <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
15535  &nbsp; 
15536 <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
15537  &nbsp; 
15538 <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
15539  &nbsp; 
15540 <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
15541  &nbsp; 
15542 <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
15543  &nbsp; 
15544 <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
15545  &nbsp; 
15546 <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
15547  &nbsp; 
15548 <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
15549  &nbsp; 
15550 <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
15551  &nbsp; 
15552 <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
15553  &nbsp; 
15554 <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
15555  &nbsp; 
15556 <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
15557  &nbsp; 
15558 <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
15559  &nbsp; 
15560 <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
15561  &nbsp; 
15562 <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
15563  &nbsp; 
15564 <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
15565  &nbsp; 
15566 </td></tr></table><br><P></P>
15567 <TABLE border=0>
15568 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15569 <TR><TD COLSPAN=3> <HR></TD></TR>
15570 <TR><TH><A NAME="bt_."></A>.</TH><TD></TD><TD></TD></TR>
15571 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX78"><CODE>.</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15572 <TR><TD COLSPAN=3> <HR></TD></TR>
15573 <TR><TH><A NAME="bt_:"></A>:</TH><TD></TD><TD></TD></TR>
15574 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX77"><CODE>:</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15575 <TR><TD COLSPAN=3> <HR></TD></TR>
15576 <TR><TH><A NAME="bt_["></A>[</TH><TD></TD><TD></TD></TR>
15577 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX93"><CODE>[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15578 <TR><TD COLSPAN=3> <HR></TD></TR>
15579 <TR><TH><A NAME="bt_A"></A>A</TH><TD></TD><TD></TD></TR>
15580 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX98"><CODE>alias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15581 <TR><TD COLSPAN=3> <HR></TD></TR>
15582 <TR><TH><A NAME="bt_B"></A>B</TH><TD></TD><TD></TD></TR>
15583 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX318"><CODE>bg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
15584 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX99"><CODE>bind</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15585 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX79"><CODE>break</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15586 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX100"><CODE>builtin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15587 <TR><TD COLSPAN=3> <HR></TD></TR>
15588 <TR><TH><A NAME="bt_C"></A>C</TH><TD></TD><TD></TD></TR>
15589 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX101"><CODE>caller</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15590 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX80"><CODE>cd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15591 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX102"><CODE>command</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15592 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX579"><CODE>compgen</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
15593 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX580"><CODE>complete</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
15594 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX581"><CODE>compopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A></TD></TR>
15595 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX81"><CODE>continue</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15596 <TR><TD COLSPAN=3> <HR></TD></TR>
15597 <TR><TH><A NAME="bt_D"></A>D</TH><TD></TD><TD></TD></TR>
15598 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX103"><CODE>declare</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15599 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX315"><CODE>dirs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD></TR>
15600 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX323"><CODE>disown</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
15601 <TR><TD COLSPAN=3> <HR></TD></TR>
15602 <TR><TH><A NAME="bt_E"></A>E</TH><TD></TD><TD></TD></TR>
15603 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX104"><CODE>echo</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15604 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX105"><CODE>enable</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15605 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX82"><CODE>eval</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15606 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX83"><CODE>exec</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15607 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX84"><CODE>exit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15608 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX85"><CODE>export</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15609 <TR><TD COLSPAN=3> <HR></TD></TR>
15610 <TR><TH><A NAME="bt_F"></A>F</TH><TD></TD><TD></TD></TR>
15611 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX583"><CODE>fc</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.2 Bash History Builtins</A></TD></TR>
15612 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX319"><CODE>fg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
15613 <TR><TD COLSPAN=3> <HR></TD></TR>
15614 <TR><TH><A NAME="bt_G"></A>G</TH><TD></TD><TD></TD></TR>
15615 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX86"><CODE>getopts</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15616 <TR><TD COLSPAN=3> <HR></TD></TR>
15617 <TR><TH><A NAME="bt_H"></A>H</TH><TD></TD><TD></TD></TR>
15618 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX87"><CODE>hash</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15619 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX106"><CODE>help</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15620 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX584"><CODE>history</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.2 Bash History Builtins</A></TD></TR>
15621 <TR><TD COLSPAN=3> <HR></TD></TR>
15622 <TR><TH><A NAME="bt_J"></A>J</TH><TD></TD><TD></TD></TR>
15623 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX320"><CODE>jobs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
15624 <TR><TD COLSPAN=3> <HR></TD></TR>
15625 <TR><TH><A NAME="bt_K"></A>K</TH><TD></TD><TD></TD></TR>
15626 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX321"><CODE>kill</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
15627 <TR><TD COLSPAN=3> <HR></TD></TR>
15628 <TR><TH><A NAME="bt_L"></A>L</TH><TD></TD><TD></TD></TR>
15629 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX107"><CODE>let</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15630 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX108"><CODE>local</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15631 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX109"><CODE>logout</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15632 <TR><TD COLSPAN=3> <HR></TD></TR>
15633 <TR><TH><A NAME="bt_M"></A>M</TH><TD></TD><TD></TD></TR>
15634 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX110"><CODE>mapfile</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15635 <TR><TD COLSPAN=3> <HR></TD></TR>
15636 <TR><TH><A NAME="bt_P"></A>P</TH><TD></TD><TD></TD></TR>
15637 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX316"><CODE>popd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD></TR>
15638 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX111"><CODE>printf</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15639 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX317"><CODE>pushd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A></TD></TR>
15640 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX88"><CODE>pwd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15641 <TR><TD COLSPAN=3> <HR></TD></TR>
15642 <TR><TH><A NAME="bt_R"></A>R</TH><TD></TD><TD></TD></TR>
15643 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX112"><CODE>read</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15644 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX113"><CODE>readarray</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15645 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX89"><CODE>readonly</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15646 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX90"><CODE>return</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15647 <TR><TD COLSPAN=3> <HR></TD></TR>
15648 <TR><TH><A NAME="bt_S"></A>S</TH><TD></TD><TD></TD></TR>
15649 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX119"><CODE>set</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A></TD></TR>
15650 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX91"><CODE>shift</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15651 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX120"><CODE>shopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A></TD></TR>
15652 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX114"><CODE>source</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15653 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX324"><CODE>suspend</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
15654 <TR><TD COLSPAN=3> <HR></TD></TR>
15655 <TR><TH><A NAME="bt_T"></A>T</TH><TD></TD><TD></TD></TR>
15656 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX92"><CODE>test</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15657 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX94"><CODE>times</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15658 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX95"><CODE>trap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15659 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX115"><CODE>type</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15660 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX116"><CODE>typeset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15661 <TR><TD COLSPAN=3> <HR></TD></TR>
15662 <TR><TH><A NAME="bt_U"></A>U</TH><TD></TD><TD></TD></TR>
15663 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX117"><CODE>ulimit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15664 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX96"><CODE>umask</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15665 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX118"><CODE>unalias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A></TD></TR>
15666 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX97"><CODE>unset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A></TD></TR>
15667 <TR><TD COLSPAN=3> <HR></TD></TR>
15668 <TR><TH><A NAME="bt_W"></A>W</TH><TD></TD><TD></TD></TR>
15669 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX322"><CODE>wait</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.2 Job Control Builtins</A></TD></TR>
15670 <TR><TD COLSPAN=3> <HR></TD></TR>
15671 </TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
15672  &nbsp; 
15673 <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
15674  &nbsp; 
15675 <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
15676  &nbsp; 
15677 <BR>
15678 <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
15679  &nbsp; 
15680 <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
15681  &nbsp; 
15682 <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
15683  &nbsp; 
15684 <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
15685  &nbsp; 
15686 <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
15687  &nbsp; 
15688 <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
15689  &nbsp; 
15690 <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
15691  &nbsp; 
15692 <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
15693  &nbsp; 
15694 <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
15695  &nbsp; 
15696 <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
15697  &nbsp; 
15698 <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
15699  &nbsp; 
15700 <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
15701  &nbsp; 
15702 <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
15703  &nbsp; 
15704 <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
15705  &nbsp; 
15706 <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
15707  &nbsp; 
15708 <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
15709  &nbsp; 
15710 <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
15711  &nbsp; 
15712 <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
15713  &nbsp; 
15714 </td></tr></table><br><P>
15715
15716 <A NAME="Reserved Word Index"></A>
15717 <HR SIZE="6">
15718 <A NAME="SEC144"></A>
15719 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15720 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &lt; </A>]</TD>
15721 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> &gt; </A>]</TD>
15722 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> &lt;&lt; </A>]</TD>
15723 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> Up </A>]</TD>
15724 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
15725 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15726 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15727 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
15728 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15729 </TR></TABLE>
15730 <H2> D.2 Index of Shell Reserved Words </H2>
15731 <!--docid::SEC144::-->
15732 <table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
15733  &nbsp; 
15734 <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
15735  &nbsp; 
15736 <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
15737  &nbsp; 
15738 <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
15739  &nbsp; 
15740 <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
15741  &nbsp; 
15742 <BR>
15743 <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
15744  &nbsp; 
15745 <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
15746  &nbsp; 
15747 <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
15748  &nbsp; 
15749 <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
15750  &nbsp; 
15751 <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
15752  &nbsp; 
15753 <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
15754  &nbsp; 
15755 <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
15756  &nbsp; 
15757 <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
15758  &nbsp; 
15759 <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
15760  &nbsp; 
15761 </td></tr></table><br><P></P>
15762 <TABLE border=0>
15763 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15764 <TR><TD COLSPAN=3> <HR></TD></TR>
15765 <TR><TH><A NAME="rw_!"></A>!</TH><TD></TD><TD></TD></TR>
15766 <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>
15767 <TR><TD COLSPAN=3> <HR></TD></TR>
15768 <TR><TH><A NAME="rw_["></A>[</TH><TD></TD><TD></TD></TR>
15769 <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>
15770 <TR><TD COLSPAN=3> <HR></TD></TR>
15771 <TR><TH><A NAME="rw_]"></A>]</TH><TD></TD><TD></TD></TR>
15772 <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>
15773 <TR><TD COLSPAN=3> <HR></TD></TR>
15774 <TR><TH><A NAME="rw_{"></A>{</TH><TD></TD><TD></TD></TR>
15775 <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>
15776 <TR><TD COLSPAN=3> <HR></TD></TR>
15777 <TR><TH><A NAME="rw_}"></A>}</TH><TD></TD><TD></TD></TR>
15778 <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>
15779 <TR><TD COLSPAN=3> <HR></TD></TR>
15780 <TR><TH><A NAME="rw_C"></A>C</TH><TD></TD><TD></TD></TR>
15781 <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>
15782 <TR><TD COLSPAN=3> <HR></TD></TR>
15783 <TR><TH><A NAME="rw_D"></A>D</TH><TD></TD><TD></TD></TR>
15784 <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>
15785 <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>
15786 <TR><TD COLSPAN=3> <HR></TD></TR>
15787 <TR><TH><A NAME="rw_E"></A>E</TH><TD></TD><TD></TD></TR>
15788 <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>
15789 <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>
15790 <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>
15791 <TR><TD COLSPAN=3> <HR></TD></TR>
15792 <TR><TH><A NAME="rw_F"></A>F</TH><TD></TD><TD></TD></TR>
15793 <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>
15794 <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>
15795 <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>
15796 <TR><TD COLSPAN=3> <HR></TD></TR>
15797 <TR><TH><A NAME="rw_I"></A>I</TH><TD></TD><TD></TD></TR>
15798 <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>
15799 <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>
15800 <TR><TD COLSPAN=3> <HR></TD></TR>
15801 <TR><TH><A NAME="rw_S"></A>S</TH><TD></TD><TD></TD></TR>
15802 <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>
15803 <TR><TD COLSPAN=3> <HR></TD></TR>
15804 <TR><TH><A NAME="rw_T"></A>T</TH><TD></TD><TD></TD></TR>
15805 <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>
15806 <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>
15807 <TR><TD COLSPAN=3> <HR></TD></TR>
15808 <TR><TH><A NAME="rw_U"></A>U</TH><TD></TD><TD></TD></TR>
15809 <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>
15810 <TR><TD COLSPAN=3> <HR></TD></TR>
15811 <TR><TH><A NAME="rw_W"></A>W</TH><TD></TD><TD></TD></TR>
15812 <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>
15813 <TR><TD COLSPAN=3> <HR></TD></TR>
15814 </TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
15815  &nbsp; 
15816 <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
15817  &nbsp; 
15818 <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
15819  &nbsp; 
15820 <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
15821  &nbsp; 
15822 <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
15823  &nbsp; 
15824 <BR>
15825 <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
15826  &nbsp; 
15827 <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
15828  &nbsp; 
15829 <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
15830  &nbsp; 
15831 <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
15832  &nbsp; 
15833 <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
15834  &nbsp; 
15835 <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
15836  &nbsp; 
15837 <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
15838  &nbsp; 
15839 <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
15840  &nbsp; 
15841 <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
15842  &nbsp; 
15843 </td></tr></table><br><P>
15844
15845 <A NAME="Variable Index"></A>
15846 <HR SIZE="6">
15847 <A NAME="SEC145"></A>
15848 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15849 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &lt; </A>]</TD>
15850 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC146"> &gt; </A>]</TD>
15851 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC146"> &lt;&lt; </A>]</TD>
15852 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> Up </A>]</TD>
15853 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
15854 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15855 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15856 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
15857 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15858 </TR></TABLE>
15859 <H2> D.3 Parameter and Variable Index </H2>
15860 <!--docid::SEC145::-->
15861 <table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
15862  &nbsp; 
15863 <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
15864  &nbsp; 
15865 <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
15866  &nbsp; 
15867 <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
15868  &nbsp; 
15869 <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
15870  &nbsp; 
15871 <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
15872  &nbsp; 
15873 <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
15874  &nbsp; 
15875 <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
15876  &nbsp; 
15877 <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
15878  &nbsp; 
15879 <BR>
15880 <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
15881  &nbsp; 
15882 <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
15883  &nbsp; 
15884 <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
15885  &nbsp; 
15886 <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
15887  &nbsp; 
15888 <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
15889  &nbsp; 
15890 <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
15891  &nbsp; 
15892 <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
15893  &nbsp; 
15894 <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
15895  &nbsp; 
15896 <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
15897  &nbsp; 
15898 <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
15899  &nbsp; 
15900 <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
15901  &nbsp; 
15902 <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
15903  &nbsp; 
15904 <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
15905  &nbsp; 
15906 <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
15907  &nbsp; 
15908 <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
15909  &nbsp; 
15910 <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
15911  &nbsp; 
15912 <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
15913  &nbsp; 
15914 <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
15915  &nbsp; 
15916 <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
15917  &nbsp; 
15918 </td></tr></table><br><P></P>
15919 <TABLE border=0>
15920 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15921 <TR><TD COLSPAN=3> <HR></TD></TR>
15922 <TR><TH><A NAME="vr_!"></A>!</TH><TD></TD><TD></TD></TR>
15923 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX64"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15924 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX65"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15925 <TR><TD COLSPAN=3> <HR></TD></TR>
15926 <TR><TH><A NAME="vr_#"></A>#</TH><TD></TD><TD></TD></TR>
15927 <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>
15928 <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>
15929 <TR><TD COLSPAN=3> <HR></TD></TR>
15930 <TR><TH><A NAME="vr_$"></A>$</TH><TD></TD><TD></TD></TR>
15931 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX61"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15932 <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>
15933 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX66"><CODE>$!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15934 <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>
15935 <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>
15936 <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>
15937 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX60"><CODE>$-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15938 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX69"><CODE>$0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15939 <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>
15940 <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>
15941 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX72"><CODE>$_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15942 <TR><TD COLSPAN=3> <HR></TD></TR>
15943 <TR><TH><A NAME="vr_*"></A>*</TH><TD></TD><TD></TD></TR>
15944 <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>
15945 <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>
15946 <TR><TD COLSPAN=3> <HR></TD></TR>
15947 <TR><TH><A NAME="vr_-"></A>-</TH><TD></TD><TD></TD></TR>
15948 <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>
15949 <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>
15950 <TR><TD COLSPAN=3> <HR></TD></TR>
15951 <TR><TH><A NAME="vr_0"></A>0</TH><TD></TD><TD></TD></TR>
15952 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX67"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15953 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX68"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15954 <TR><TD COLSPAN=3> <HR></TD></TR>
15955 <TR><TH><A NAME="vr_?"></A>?</TH><TD></TD><TD></TD></TR>
15956 <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>
15957 <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>
15958 <TR><TD COLSPAN=3> <HR></TD></TR>
15959 <TR><TH><A NAME="vr_@"></A>@</TH><TD></TD><TD></TD></TR>
15960 <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>
15961 <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>
15962 <TR><TD COLSPAN=3> <HR></TD></TR>
15963 <TR><TH><A NAME="vr__"></A>_</TH><TD></TD><TD></TD></TR>
15964 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX70"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15965 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX71"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.4.2 Special Parameters</A></TD></TR>
15966 <TR><TD COLSPAN=3> <HR></TD></TR>
15967 <TR><TH><A NAME="vr_A"></A>A</TH><TD></TD><TD></TD></TR>
15968 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX325"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD></TR>
15969 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX326"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD></TR>
15970 <TR><TD COLSPAN=3> <HR></TD></TR>
15971 <TR><TH><A NAME="vr_B"></A>B</TH><TD></TD><TD></TD></TR>
15972 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX141"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15973 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX142"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15974 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX147"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15975 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX148"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15976 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX149"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15977 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX150"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15978 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX151"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15979 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX152"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15980 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX153"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15981 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX154"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15982 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX155"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15983 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX156"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15984 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX157"><CODE>BASH_COMPAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15985 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX158"><CODE>BASH_COMPAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15986 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX159"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15987 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX160"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15988 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX161"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15989 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX162"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15990 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX163"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15991 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX164"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15992 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX165"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15993 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX166"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15994 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX167"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15995 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX168"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15996 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX169"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15997 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX170"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15998 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX171"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
15999 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX172"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16000 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX173"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16001 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX174"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16002 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX175"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16003 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX176"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16004 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX143"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16005 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX144"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16006 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX145"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16007 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX146"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16008 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX332"><CODE>bell-style</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16009 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX333"><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>
16010 <TR><TD COLSPAN=3> <HR></TD></TR>
16011 <TR><TH><A NAME="vr_C"></A>C</TH><TD></TD><TD></TD></TR>
16012 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX121"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16013 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX122"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16014 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX177"><CODE>CHILD_MAX</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16015 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX178"><CODE>CHILD_MAX</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16016 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><CODE>colored-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16017 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX179"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16018 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX180"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16019 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><CODE>comment-begin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16020 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX181"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16021 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX182"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16022 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX189"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16023 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX190"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16024 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX183"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16025 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX184"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16026 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX185"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16027 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX186"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16028 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX187"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16029 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX188"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16030 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX191"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16031 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX192"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16032 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX193"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16033 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX194"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16034 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><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>
16035 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><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>
16036 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX338"><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>
16037 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX339"><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>
16038 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX340"><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>
16039 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX195"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16040 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX196"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16041 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX341"><CODE>convert-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16042 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX197"><CODE>COPROC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16043 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX198"><CODE>COPROC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16044 <TR><TD COLSPAN=3> <HR></TD></TR>
16045 <TR><TH><A NAME="vr_D"></A>D</TH><TD></TD><TD></TD></TR>
16046 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX199"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16047 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX200"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16048 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX342"><CODE>disable-completion</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16049 <TR><TD COLSPAN=3> <HR></TD></TR>
16050 <TR><TH><A NAME="vr_E"></A>E</TH><TD></TD><TD></TD></TR>
16051 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX343"><CODE>editing-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16052 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX201"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16053 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX202"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16054 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX344"><CODE>enable-keypad</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16055 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX203"><CODE>ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16056 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX204"><CODE>ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16057 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX205"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16058 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX206"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16059 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX345"><CODE>expand-tilde</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16060 <TR><TD COLSPAN=3> <HR></TD></TR>
16061 <TR><TH><A NAME="vr_F"></A>F</TH><TD></TD><TD></TD></TR>
16062 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX207"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16063 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX208"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16064 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX209"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16065 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX210"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16066 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX211"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16067 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX212"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16068 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX213"><CODE>FUNCNEST</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16069 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX214"><CODE>FUNCNEST</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16070 <TR><TD COLSPAN=3> <HR></TD></TR>
16071 <TR><TH><A NAME="vr_G"></A>G</TH><TD></TD><TD></TD></TR>
16072 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX215"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16073 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX216"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16074 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX217"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16075 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX218"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16076 <TR><TD COLSPAN=3> <HR></TD></TR>
16077 <TR><TH><A NAME="vr_H"></A>H</TH><TD></TD><TD></TD></TR>
16078 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX219"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16079 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX220"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16080 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX221"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16081 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX222"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16082 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX223"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16083 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX224"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16084 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX225"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16085 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX226"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16086 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX227"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16087 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX228"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16088 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX229"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16089 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX230"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16090 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><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>
16091 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>history-size</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16092 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX231"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16093 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX232"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16094 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX233"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16095 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX234"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16096 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX123"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16097 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX124"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16098 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><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>
16099 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX235"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16100 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX236"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16101 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX237"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16102 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX238"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16103 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX239"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16104 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX240"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16105 <TR><TD COLSPAN=3> <HR></TD></TR>
16106 <TR><TH><A NAME="vr_I"></A>I</TH><TD></TD><TD></TD></TR>
16107 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX125"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16108 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX126"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16109 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX241"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16110 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX242"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16111 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><CODE>input-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16112 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX243"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16113 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX244"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16114 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX351"><CODE>isearch-terminators</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16115 <TR><TD COLSPAN=3> <HR></TD></TR>
16116 <TR><TH><A NAME="vr_K"></A>K</TH><TD></TD><TD></TD></TR>
16117 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX352"><CODE>keymap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16118 <TR><TD COLSPAN=3> <HR></TD></TR>
16119 <TR><TH><A NAME="vr_L"></A>L</TH><TD></TD><TD></TD></TR>
16120 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX245"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16121 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX246"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16122 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX247"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16123 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX248"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16124 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX249"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16125 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX250"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16126 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX251"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16127 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX252"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16128 <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>
16129 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX253"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16130 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX254"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16131 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX255"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16132 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX256"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16133 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX257"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16134 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX258"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16135 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX259"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16136 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX260"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16137 <TR><TD COLSPAN=3> <HR></TD></TR>
16138 <TR><TH><A NAME="vr_M"></A>M</TH><TD></TD><TD></TD></TR>
16139 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX261"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16140 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX262"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16141 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX127"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16142 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX128"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16143 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX263"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16144 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX264"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16145 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX129"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16146 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX130"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16147 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX265"><CODE>MAPFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16148 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX266"><CODE>MAPFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16149 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX353"><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>
16150 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX354"><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>
16151 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX355"><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>
16152 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX356"><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>
16153 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX350"><CODE>meta-flag</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16154 <TR><TD COLSPAN=3> <HR></TD></TR>
16155 <TR><TH><A NAME="vr_O"></A>O</TH><TD></TD><TD></TD></TR>
16156 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX267"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16157 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX268"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16158 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX131"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16159 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX132"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16160 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX269"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16161 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX270"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16162 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX133"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16163 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX134"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16164 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX271"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16165 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX272"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16166 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX357"><CODE>output-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16167 <TR><TD COLSPAN=3> <HR></TD></TR>
16168 <TR><TH><A NAME="vr_P"></A>P</TH><TD></TD><TD></TD></TR>
16169 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX358"><CODE>page-completions</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16170 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX135"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16171 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX136"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16172 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX273"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16173 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX274"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16174 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX275"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16175 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX276"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16176 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX277"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16177 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX278"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16178 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX279"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16179 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX280"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16180 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX281"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16181 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX282"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16182 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX137"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16183 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX138"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16184 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX139"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16185 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX140"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A></TD></TR>
16186 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX283"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16187 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX284"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16188 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX285"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16189 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX286"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16190 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX287"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16191 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX288"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16192 <TR><TD COLSPAN=3> <HR></TD></TR>
16193 <TR><TH><A NAME="vr_R"></A>R</TH><TD></TD><TD></TD></TR>
16194 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX289"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16195 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX290"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16196 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX291"><CODE>READLINE_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16197 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX292"><CODE>READLINE_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16198 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX293"><CODE>READLINE_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16199 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX294"><CODE>READLINE_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16200 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX295"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16201 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX296"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16202 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX359"><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>
16203 <TR><TD COLSPAN=3> <HR></TD></TR>
16204 <TR><TH><A NAME="vr_S"></A>S</TH><TD></TD><TD></TD></TR>
16205 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX297"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16206 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX298"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16207 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX299"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16208 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX300"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16209 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX301"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16210 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX302"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16211 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX303"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16212 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX304"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16213 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX360"><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>
16214 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><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>
16215 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX362"><CODE>show-mode-in-prompt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16216 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><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>
16217 <TR><TD COLSPAN=3> <HR></TD></TR>
16218 <TR><TH><A NAME="vr_T"></A>T</TH><TD></TD><TD></TD></TR>
16219 <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>
16220 <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>
16221 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX305"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16222 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX306"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16223 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX307"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16224 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX308"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16225 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX309"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16226 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX310"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16227 <TR><TD COLSPAN=3> <HR></TD></TR>
16228 <TR><TH><A NAME="vr_U"></A>U</TH><TD></TD><TD></TD></TR>
16229 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX311"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16230 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX312"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC68">5.2 Bash Variables</A></TD></TR>
16231 <TR><TD COLSPAN=3> <HR></TD></TR>
16232 <TR><TH><A NAME="vr_V"></A>V</TH><TD></TD><TD></TD></TR>
16233 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX364"><CODE>visible-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16234 <TR><TD COLSPAN=3> <HR></TD></TR>
16235 </TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
16236  &nbsp; 
16237 <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
16238  &nbsp; 
16239 <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
16240  &nbsp; 
16241 <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
16242  &nbsp; 
16243 <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
16244  &nbsp; 
16245 <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
16246  &nbsp; 
16247 <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
16248  &nbsp; 
16249 <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
16250  &nbsp; 
16251 <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
16252  &nbsp; 
16253 <BR>
16254 <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
16255  &nbsp; 
16256 <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
16257  &nbsp; 
16258 <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
16259  &nbsp; 
16260 <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
16261  &nbsp; 
16262 <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
16263  &nbsp; 
16264 <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
16265  &nbsp; 
16266 <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
16267  &nbsp; 
16268 <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
16269  &nbsp; 
16270 <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
16271  &nbsp; 
16272 <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
16273  &nbsp; 
16274 <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
16275  &nbsp; 
16276 <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
16277  &nbsp; 
16278 <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
16279  &nbsp; 
16280 <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
16281  &nbsp; 
16282 <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
16283  &nbsp; 
16284 <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
16285  &nbsp; 
16286 <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
16287  &nbsp; 
16288 <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
16289  &nbsp; 
16290 <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
16291  &nbsp; 
16292 </td></tr></table><br><P>
16293
16294 <A NAME="Function Index"></A>
16295 <HR SIZE="6">
16296 <A NAME="SEC146"></A>
16297 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16298 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> &lt; </A>]</TD>
16299 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC147"> &gt; </A>]</TD>
16300 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC147"> &lt;&lt; </A>]</TD>
16301 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> Up </A>]</TD>
16302 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
16303 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16304 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16305 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
16306 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16307 </TR></TABLE>
16308 <H2> D.4 Function Index </H2>
16309 <!--docid::SEC146::-->
16310 <table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
16311  &nbsp; 
16312 <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
16313  &nbsp; 
16314 <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
16315  &nbsp; 
16316 <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
16317  &nbsp; 
16318 <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
16319  &nbsp; 
16320 <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
16321  &nbsp; 
16322 <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
16323  &nbsp; 
16324 <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
16325  &nbsp; 
16326 <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
16327  &nbsp; 
16328 <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
16329  &nbsp; 
16330 <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
16331  &nbsp; 
16332 <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
16333  &nbsp; 
16334 <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
16335  &nbsp; 
16336 <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
16337  &nbsp; 
16338 <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
16339  &nbsp; 
16340 <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
16341  &nbsp; 
16342 <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
16343  &nbsp; 
16344 <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
16345  &nbsp; 
16346 <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
16347  &nbsp; 
16348 <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
16349  &nbsp; 
16350 </td></tr></table><br><P></P>
16351 <TABLE border=0>
16352 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
16353 <TR><TD COLSPAN=3> <HR></TD></TR>
16354 <TR><TH><A NAME="fn_A"></A>A</TH><TD></TD><TD></TD></TR>
16355 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX525"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16356 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX526"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16357 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX385"><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>
16358 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX386"><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>
16359 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX569"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16360 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX570"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16361 <TR><TD COLSPAN=3> <HR></TD></TR>
16362 <TR><TH><A NAME="fn_B"></A>B</TH><TD></TD><TD></TD></TR>
16363 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX371"><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>
16364 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX372"><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>
16365 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX419"><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>
16366 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX420"><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>
16367 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX441"><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>
16368 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX442"><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>
16369 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX449"><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>
16370 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX450"><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>
16371 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX375"><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>
16372 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX376"><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>
16373 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><CODE>beginning-of-history (M-&#38;#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16374 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><CODE>beginning-of-history (M-&#38;#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16375 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX365"><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>
16376 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX366"><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>
16377 <TR><TD COLSPAN=3> <HR></TD></TR>
16378 <TR><TH><A NAME="fn_C"></A>C</TH><TD></TD><TD></TD></TR>
16379 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX519"><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>
16380 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX520"><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>
16381 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX435"><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>
16382 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX436"><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>
16383 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX541"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16384 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX542"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16385 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX543"><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>
16386 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX544"><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>
16387 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX381"><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>
16388 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX382"><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>
16389 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX477"><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>
16390 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><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>
16391 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX505"><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>
16392 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506"><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>
16393 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><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>
16394 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX490"><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>
16395 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><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>
16396 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX502"><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>
16397 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX513"><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>
16398 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX514"><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>
16399 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX493"><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>
16400 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX494"><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>
16401 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><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>
16402 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><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>
16403 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX465"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16404 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX466"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16405 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX467"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16406 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX468"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16407 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX463"><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>
16408 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX464"><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>
16409 <TR><TD COLSPAN=3> <HR></TD></TR>
16410 <TR><TH><A NAME="fn_D"></A>D</TH><TD></TD><TD></TD></TR>
16411 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX511"><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>
16412 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX512"><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>
16413 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX417"><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>
16414 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX418"><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>
16415 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX487"><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>
16416 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><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>
16417 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX459"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16418 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX460"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16419 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, &#60;small&#62;...&#60;/small&#62; <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
16420 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX474"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, &#60;small&#62;...&#60;/small&#62; <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
16421 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX561"><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>
16422 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX562"><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>
16423 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX527"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16424 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX528"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16425 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX433"><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>
16426 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX434"><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>
16427 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX549"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16428 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX550"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16429 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX553"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16430 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX554"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16431 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX551"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16432 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX552"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16433 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX509"><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>
16434 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510"><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>
16435 <TR><TD COLSPAN=3> <HR></TD></TR>
16436 <TR><TH><A NAME="fn_E"></A>E</TH><TD></TD><TD></TD></TR>
16437 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX577"><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>
16438 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX578"><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>
16439 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX517"><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>
16440 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX518"><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>
16441 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE><I>end-of-file</I> (usually C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
16442 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX416"><CODE><I>end-of-file</I> (usually C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
16443 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><CODE>end-of-history (M-&#38;#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16444 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX394"><CODE>end-of-history (M-&#38;#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16445 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX367"><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>
16446 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX368"><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>
16447 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX539"><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>
16448 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX540"><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>
16449 <TR><TD COLSPAN=3> <HR></TD></TR>
16450 <TR><TH><A NAME="fn_F"></A>F</TH><TD></TD><TD></TD></TR>
16451 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX421"><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>
16452 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX422"><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>
16453 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX369"><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>
16454 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX370"><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>
16455 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><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>
16456 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX398"><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>
16457 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX373"><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>
16458 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX374"><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>
16459 <TR><TD COLSPAN=3> <HR></TD></TR>
16460 <TR><TH><A NAME="fn_G"></A>G</TH><TD></TD><TD></TD></TR>
16461 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX555"><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>
16462 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX556"><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>
16463 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX557"><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>
16464 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX558"><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>
16465 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX559"><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>
16466 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX560"><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>
16467 <TR><TD COLSPAN=3> <HR></TD></TR>
16468 <TR><TH><A NAME="fn_H"></A>H</TH><TD></TD><TD></TD></TR>
16469 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX571"><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>
16470 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX572"><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>
16471 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX565"><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>
16472 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX566"><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>
16473 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX405"><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>
16474 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX406"><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>
16475 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX403"><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>
16476 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX404"><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>
16477 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX409"><CODE>history-substr-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16478 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX410"><CODE>history-substr-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16479 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX407"><CODE>history-substr-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16480 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX408"><CODE>history-substr-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A></TD></TR>
16481 <TR><TD COLSPAN=3> <HR></TD></TR>
16482 <TR><TH><A NAME="fn_I"></A>I</TH><TD></TD><TD></TD></TR>
16483 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX547"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16484 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX548"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16485 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX481"><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>
16486 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX482"><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>
16487 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX573"><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>
16488 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX574"><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>
16489 <TR><TD COLSPAN=3> <HR></TD></TR>
16490 <TR><TH><A NAME="fn_K"></A>K</TH><TD></TD><TD></TD></TR>
16491 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX439"><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>
16492 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX440"><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>
16493 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX461"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16494 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX462"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16495 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX445"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16496 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX446"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16497 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX447"><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>
16498 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX448"><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>
16499 <TR><TD COLSPAN=3> <HR></TD></TR>
16500 <TR><TH><A NAME="fn_M"></A>M</TH><TD></TD><TD></TD></TR>
16501 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX567"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16502 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX568"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16503 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX483"><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>
16504 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX484"><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>
16505 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX485"><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>
16506 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX486"><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>
16507 <TR><TD COLSPAN=3> <HR></TD></TR>
16508 <TR><TH><A NAME="fn_N"></A>N</TH><TD></TD><TD></TD></TR>
16509 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><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>
16510 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><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>
16511 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX401"><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>
16512 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX402"><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>
16513 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX399"><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>
16514 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX400"><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>
16515 <TR><TD COLSPAN=3> <HR></TD></TR>
16516 <TR><TH><A NAME="fn_O"></A>O</TH><TD></TD><TD></TD></TR>
16517 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX575"><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>
16518 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX576"><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>
16519 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
16520 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX438"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
16521 <TR><TD COLSPAN=3> <HR></TD></TR>
16522 <TR><TH><A NAME="fn_P"></A>P</TH><TD></TD><TD></TD></TR>
16523 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><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>
16524 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX508"><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>
16525 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><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>
16526 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX480"><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>
16527 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX491"><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>
16528 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX492"><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>
16529 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX503"><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>
16530 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX504"><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>
16531 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX495"><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>
16532 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX496"><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>
16533 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><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>
16534 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><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>
16535 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX529"><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>
16536 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX530"><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>
16537 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX387"><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>
16538 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX388"><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>
16539 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX521"><CODE>print-last-kbd-macro ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
16540 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX522"><CODE>print-last-kbd-macro ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A></TD></TR>
16541 <TR><TD COLSPAN=3> <HR></TD></TR>
16542 <TR><TH><A NAME="fn_Q"></A>Q</TH><TD></TD><TD></TD></TR>
16543 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX423"><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>
16544 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX424"><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>
16545 <TR><TD COLSPAN=3> <HR></TD></TR>
16546 <TR><TH><A NAME="fn_R"></A>R</TH><TD></TD><TD></TD></TR>
16547 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX523"><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>
16548 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX524"><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>
16549 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX383"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
16550 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX384"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
16551 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX395"><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>
16552 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><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>
16553 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX533"><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>
16554 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX534"><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>
16555 <TR><TD COLSPAN=3> <HR></TD></TR>
16556 <TR><TH><A NAME="fn_S"></A>S</TH><TD></TD><TD></TD></TR>
16557 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX425"><CODE>self-insert (a, b, A, 1, !, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
16558 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX426"><CODE>self-insert (a, b, A, 1, !, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A></TD></TR>
16559 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX537"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16560 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX538"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16561 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX453"><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>
16562 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX454"><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>
16563 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX379"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
16564 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX380"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
16565 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX563"><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>
16566 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX564"><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>
16567 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX377"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
16568 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX378"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A></TD></TR>
16569 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX451"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16570 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX452"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16571 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX545"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16572 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX546"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16573 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX515"><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>
16574 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX516"><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>
16575 <TR><TD COLSPAN=3> <HR></TD></TR>
16576 <TR><TH><A NAME="fn_T"></A>T</TH><TD></TD><TD></TD></TR>
16577 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX535"><CODE>tilde-expand (M-&#38;#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16578 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX536"><CODE>tilde-expand (M-&#38;#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A></TD></TR>
16579 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX427"><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>
16580 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX428"><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>
16581 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX429"><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>
16582 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX430"><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>
16583 <TR><TD COLSPAN=3> <HR></TD></TR>
16584 <TR><TH><A NAME="fn_U"></A>U</TH><TD></TD><TD></TD></TR>
16585 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX531"><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>
16586 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX532"><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>
16587 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX475"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
16588 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX476"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A></TD></TR>
16589 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX457"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16590 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX458"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16591 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX443"><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>
16592 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX444"><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>
16593 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX455"><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>
16594 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX456"><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>
16595 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX431"><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>
16596 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX432"><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>
16597 <TR><TD COLSPAN=3> <HR></TD></TR>
16598 <TR><TH><A NAME="fn_Y"></A>Y</TH><TD></TD><TD></TD></TR>
16599 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX469"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16600 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX470"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A></TD></TR>
16601 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX413"><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>
16602 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><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>
16603 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX411"><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>
16604 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX412"><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>
16605 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX471"><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>
16606 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><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>
16607 <TR><TD COLSPAN=3> <HR></TD></TR>
16608 </TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
16609  &nbsp; 
16610 <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
16611  &nbsp; 
16612 <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
16613  &nbsp; 
16614 <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
16615  &nbsp; 
16616 <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
16617  &nbsp; 
16618 <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
16619  &nbsp; 
16620 <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
16621  &nbsp; 
16622 <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
16623  &nbsp; 
16624 <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
16625  &nbsp; 
16626 <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
16627  &nbsp; 
16628 <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
16629  &nbsp; 
16630 <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
16631  &nbsp; 
16632 <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
16633  &nbsp; 
16634 <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
16635  &nbsp; 
16636 <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
16637  &nbsp; 
16638 <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
16639  &nbsp; 
16640 <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
16641  &nbsp; 
16642 <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
16643  &nbsp; 
16644 <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
16645  &nbsp; 
16646 <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
16647  &nbsp; 
16648 </td></tr></table><br><P>
16649
16650 <A NAME="Concept Index"></A>
16651 <HR SIZE="6">
16652 <A NAME="SEC147"></A>
16653 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16654 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC146"> &lt; </A>]</TD>
16655 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt; ]</TD>
16656 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
16657 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> Up </A>]</TD>
16658 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
16659 <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16660 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16661 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
16662 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16663 </TR></TABLE>
16664 <H2> D.5 Concept Index </H2>
16665 <!--docid::SEC147::-->
16666 <table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
16667  &nbsp; 
16668 <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
16669  &nbsp; 
16670 <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
16671  &nbsp; 
16672 <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
16673  &nbsp; 
16674 <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
16675  &nbsp; 
16676 <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
16677  &nbsp; 
16678 <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
16679  &nbsp; 
16680 <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
16681  &nbsp; 
16682 <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
16683  &nbsp; 
16684 <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
16685  &nbsp; 
16686 <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
16687  &nbsp; 
16688 <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
16689  &nbsp; 
16690 <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
16691  &nbsp; 
16692 <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
16693  &nbsp; 
16694 <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
16695  &nbsp; 
16696 <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
16697  &nbsp; 
16698 <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
16699  &nbsp; 
16700 <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
16701  &nbsp; 
16702 <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
16703  &nbsp; 
16704 <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
16705  &nbsp; 
16706 <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
16707  &nbsp; 
16708 <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
16709  &nbsp; 
16710 </td></tr></table><br><P></P>
16711 <TABLE border=0>
16712 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
16713 <TR><TD COLSPAN=3> <HR></TD></TR>
16714 <TR><TH><A NAME="cp_A"></A>A</TH><TD></TD><TD></TD></TR>
16715 <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>
16716 <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>
16717 <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>
16718 <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>
16719 <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>
16720 <TR><TD COLSPAN=3> <HR></TD></TR>
16721 <TR><TH><A NAME="cp_B"></A>B</TH><TD></TD><TD></TD></TR>
16722 <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>
16723 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC129">Bash configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC129">10.1 Basic Installation</A></TD></TR>
16724 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC129">Bash installation</A></TD><TD valign=top><A HREF="bashref.html#SEC129">10.1 Basic Installation</A></TD></TR>
16725 <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>
16726 <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>
16727 <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>
16728 <TR><TD COLSPAN=3> <HR></TD></TR>
16729 <TR><TH><A NAME="cp_C"></A>C</TH><TD></TD><TD></TD></TR>
16730 <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>
16731 <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>
16732 <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>
16733 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC122">command history</A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A></TD></TR>
16734 <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>
16735 <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>
16736 <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>
16737 <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>
16738 <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>
16739 <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>
16740 <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>
16741 <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>
16742 <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>
16743 <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>
16744 <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>
16745 <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>
16746 <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>
16747 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC129">configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC129">10.1 Basic Installation</A></TD></TR>
16748 <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>
16749 <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>
16750 <TR><TD COLSPAN=3> <HR></TD></TR>
16751 <TR><TH><A NAME="cp_D"></A>D</TH><TD></TD><TD></TD></TR>
16752 <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>
16753 <TR><TD COLSPAN=3> <HR></TD></TR>
16754 <TR><TH><A NAME="cp_E"></A>E</TH><TD></TD><TD></TD></TR>
16755 <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>
16756 <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>
16757 <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>
16758 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC125">event designators</A></TD><TD valign=top><A HREF="bashref.html#SEC125">9.3.1 Event Designators</A></TD></TR>
16759 <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>
16760 <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>
16761 <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>
16762 <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>
16763 <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>
16764 <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>
16765 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX73">expansion, filename</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
16766 <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>
16767 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX74">expansion, pathname</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
16768 <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>
16769 <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>
16770 <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>
16771 <TR><TD COLSPAN=3> <HR></TD></TR>
16772 <TR><TH><A NAME="cp_F"></A>F</TH><TD></TD><TD></TD></TR>
16773 <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>
16774 <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>
16775 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX75">filename expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
16776 <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>
16777 <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>
16778 <TR><TD COLSPAN=3> <HR></TD></TR>
16779 <TR><TH><A NAME="cp_H"></A>H</TH><TD></TD><TD></TD></TR>
16780 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">history builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.2 Bash History Builtins</A></TD></TR>
16781 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX585">history events</A></TD><TD valign=top><A HREF="bashref.html#SEC125">9.3.1 Event Designators</A></TD></TR>
16782 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC124">history expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC124">9.3 History Expansion</A></TD></TR>
16783 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC122">history list</A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.1 Bash History Facilities</A></TD></TR>
16784 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX582">History, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC120">8.8 A Programmable Completion Example</A></TD></TR>
16785 <TR><TD COLSPAN=3> <HR></TD></TR>
16786 <TR><TH><A NAME="cp_I"></A>I</TH><TD></TD><TD></TD></TR>
16787 <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>
16788 <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>
16789 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC129">installation</A></TD><TD valign=top><A HREF="bashref.html#SEC129">10.1 Basic Installation</A></TD></TR>
16790 <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>
16791 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX314">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC70">6.1 Invoking Bash</A></TD></TR>
16792 <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>
16793 <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>
16794 <TR><TD COLSPAN=3> <HR></TD></TR>
16795 <TR><TH><A NAME="cp_J"></A>J</TH><TD></TD><TD></TD></TR>
16796 <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>
16797 <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>
16798 <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>
16799 <TR><TD COLSPAN=3> <HR></TD></TR>
16800 <TR><TH><A NAME="cp_K"></A>K</TH><TD></TD><TD></TD></TR>
16801 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX330">kill ring</A></TD><TD valign=top><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD></TR>
16802 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX328">killing text</A></TD><TD valign=top><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD></TR>
16803 <TR><TD COLSPAN=3> <HR></TD></TR>
16804 <TR><TH><A NAME="cp_L"></A>L</TH><TD></TD><TD></TD></TR>
16805 <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>
16806 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX313">login shell</A></TD><TD valign=top><A HREF="bashref.html#SEC70">6.1 Invoking Bash</A></TD></TR>
16807 <TR><TD COLSPAN=3> <HR></TD></TR>
16808 <TR><TH><A NAME="cp_M"></A>M</TH><TD></TD><TD></TD></TR>
16809 <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>
16810 <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>
16811 <TR><TD COLSPAN=3> <HR></TD></TR>
16812 <TR><TH><A NAME="cp_N"></A>N</TH><TD></TD><TD></TD></TR>
16813 <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>
16814 <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>
16815 <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>
16816 <TR><TD COLSPAN=3> <HR></TD></TR>
16817 <TR><TH><A NAME="cp_O"></A>O</TH><TD></TD><TD></TD></TR>
16818 <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>
16819 <TR><TD COLSPAN=3> <HR></TD></TR>
16820 <TR><TH><A NAME="cp_P"></A>P</TH><TD></TD><TD></TD></TR>
16821 <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>
16822 <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>
16823 <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>
16824 <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>
16825 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX76">pathname expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A></TD></TR>
16826 <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>
16827 <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>
16828 <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>
16829 <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>
16830 <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>
16831 <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>
16832 <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>
16833 <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>
16834 <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>
16835 <TR><TD COLSPAN=3> <HR></TD></TR>
16836 <TR><TH><A NAME="cp_Q"></A>Q</TH><TD></TD><TD></TD></TR>
16837 <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>
16838 <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>
16839 <TR><TD COLSPAN=3> <HR></TD></TR>
16840 <TR><TH><A NAME="cp_R"></A>R</TH><TD></TD><TD></TD></TR>
16841 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX327">Readline, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC95">7.3 Job Control Variables</A></TD></TR>
16842 <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>
16843 <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>
16844 <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>
16845 <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>
16846 <TR><TD COLSPAN=3> <HR></TD></TR>
16847 <TR><TH><A NAME="cp_S"></A>S</TH><TD></TD><TD></TD></TR>
16848 <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>
16849 <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>
16850 <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>
16851 <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>
16852 <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>
16853 <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>
16854 <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>
16855 <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>
16856 <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>
16857 <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>
16858 <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>
16859 <TR><TD COLSPAN=3> <HR></TD></TR>
16860 <TR><TH><A NAME="cp_T"></A>T</TH><TD></TD><TD></TD></TR>
16861 <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>
16862 <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>
16863 <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>
16864 <TR><TD COLSPAN=3> <HR></TD></TR>
16865 <TR><TH><A NAME="cp_V"></A>V</TH><TD></TD><TD></TD></TR>
16866 <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>
16867 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX331">variables, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A></TD></TR>
16868 <TR><TD COLSPAN=3> <HR></TD></TR>
16869 <TR><TH><A NAME="cp_W"></A>W</TH><TD></TD><TD></TD></TR>
16870 <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>
16871 <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>
16872 <TR><TD COLSPAN=3> <HR></TD></TR>
16873 <TR><TH><A NAME="cp_Y"></A>Y</TH><TD></TD><TD></TD></TR>
16874 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX329">yanking text</A></TD><TD valign=top><A HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A></TD></TR>
16875 <TR><TD COLSPAN=3> <HR></TD></TR>
16876 </TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
16877  &nbsp; 
16878 <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
16879  &nbsp; 
16880 <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
16881  &nbsp; 
16882 <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
16883  &nbsp; 
16884 <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
16885  &nbsp; 
16886 <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
16887  &nbsp; 
16888 <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
16889  &nbsp; 
16890 <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
16891  &nbsp; 
16892 <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
16893  &nbsp; 
16894 <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
16895  &nbsp; 
16896 <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
16897  &nbsp; 
16898 <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
16899  &nbsp; 
16900 <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
16901  &nbsp; 
16902 <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
16903  &nbsp; 
16904 <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
16905  &nbsp; 
16906 <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
16907  &nbsp; 
16908 <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
16909  &nbsp; 
16910 <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
16911  &nbsp; 
16912 <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
16913  &nbsp; 
16914 <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
16915  &nbsp; 
16916 <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
16917  &nbsp; 
16918 <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
16919  &nbsp; 
16920 </td></tr></table><br><P>
16921
16922 <HR SIZE="6">
16923 <A NAME="SEC_Contents"></A>
16924 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16925 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16926 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16927 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
16928 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16929 </TR></TABLE>
16930 <H1>Table of Contents</H1>
16931 <UL>
16932 <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
16933 <BR>
16934 <UL>
16935 <A NAME="TOC2" HREF="bashref.html#SEC2">1.1 What is Bash?</A>
16936 <BR>
16937 <A NAME="TOC3" HREF="bashref.html#SEC3">1.2 What is a shell?</A>
16938 <BR>
16939 </UL>
16940 <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
16941 <BR>
16942 <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
16943 <BR>
16944 <UL>
16945 <A NAME="TOC6" HREF="bashref.html#SEC6">3.1 Shell Syntax</A>
16946 <BR>
16947 <UL>
16948 <A NAME="TOC7" HREF="bashref.html#SEC7">3.1.1 Shell Operation</A>
16949 <BR>
16950 <A NAME="TOC8" HREF="bashref.html#SEC8">3.1.2 Quoting</A>
16951 <BR>
16952 <UL>
16953 <A NAME="TOC9" HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A>
16954 <BR>
16955 <A NAME="TOC10" HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A>
16956 <BR>
16957 <A NAME="TOC11" HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A>
16958 <BR>
16959 <A NAME="TOC12" HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>
16960 <BR>
16961 <A NAME="TOC13" HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>
16962 <BR>
16963 </UL>
16964 <A NAME="TOC14" HREF="bashref.html#SEC14">3.1.3 Comments</A>
16965 <BR>
16966 </UL>
16967 <A NAME="TOC15" HREF="bashref.html#SEC15">3.2 Shell Commands</A>
16968 <BR>
16969 <UL>
16970 <A NAME="TOC16" HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>
16971 <BR>
16972 <A NAME="TOC17" HREF="bashref.html#SEC17">3.2.2 Pipelines</A>
16973 <BR>
16974 <A NAME="TOC18" HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>
16975 <BR>
16976 <A NAME="TOC19" HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>
16977 <BR>
16978 <UL>
16979 <A NAME="TOC20" HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>
16980 <BR>
16981 <A NAME="TOC21" HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>
16982 <BR>
16983 <A NAME="TOC22" HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>
16984 <BR>
16985 </UL>
16986 <A NAME="TOC23" HREF="bashref.html#SEC23">3.2.5 Coprocesses</A>
16987 <BR>
16988 <A NAME="TOC24" HREF="bashref.html#SEC24">3.2.6 GNU Parallel</A>
16989 <BR>
16990 </UL>
16991 <A NAME="TOC25" HREF="bashref.html#SEC25">3.3 Shell Functions</A>
16992 <BR>
16993 <A NAME="TOC26" HREF="bashref.html#SEC26">3.4 Shell Parameters</A>
16994 <BR>
16995 <UL>
16996 <A NAME="TOC27" HREF="bashref.html#SEC27">3.4.1 Positional Parameters</A>
16997 <BR>
16998 <A NAME="TOC28" HREF="bashref.html#SEC28">3.4.2 Special Parameters</A>
16999 <BR>
17000 </UL>
17001 <A NAME="TOC29" HREF="bashref.html#SEC29">3.5 Shell Expansions</A>
17002 <BR>
17003 <UL>
17004 <A NAME="TOC30" HREF="bashref.html#SEC30">3.5.1 Brace Expansion</A>
17005 <BR>
17006 <A NAME="TOC31" HREF="bashref.html#SEC31">3.5.2 Tilde Expansion</A>
17007 <BR>
17008 <A NAME="TOC32" HREF="bashref.html#SEC32">3.5.3 Shell Parameter Expansion</A>
17009 <BR>
17010 <A NAME="TOC33" HREF="bashref.html#SEC33">3.5.4 Command Substitution</A>
17011 <BR>
17012 <A NAME="TOC34" HREF="bashref.html#SEC34">3.5.5 Arithmetic Expansion</A>
17013 <BR>
17014 <A NAME="TOC35" HREF="bashref.html#SEC35">3.5.6 Process Substitution</A>
17015 <BR>
17016 <A NAME="TOC36" HREF="bashref.html#SEC36">3.5.7 Word Splitting</A>
17017 <BR>
17018 <A NAME="TOC37" HREF="bashref.html#SEC37">3.5.8 Filename Expansion</A>
17019 <BR>
17020 <UL>
17021 <A NAME="TOC38" HREF="bashref.html#SEC38">3.5.8.1 Pattern Matching</A>
17022 <BR>
17023 </UL>
17024 <A NAME="TOC39" HREF="bashref.html#SEC39">3.5.9 Quote Removal</A>
17025 <BR>
17026 </UL>
17027 <A NAME="TOC40" HREF="bashref.html#SEC40">3.6 Redirections</A>
17028 <BR>
17029 <UL>
17030 <A NAME="TOC41" HREF="bashref.html#SEC41">3.6.1 Redirecting Input</A>
17031 <BR>
17032 <A NAME="TOC42" HREF="bashref.html#SEC42">3.6.2 Redirecting Output</A>
17033 <BR>
17034 <A NAME="TOC43" HREF="bashref.html#SEC43">3.6.3 Appending Redirected Output</A>
17035 <BR>
17036 <A NAME="TOC44" HREF="bashref.html#SEC44">3.6.4 Redirecting Standard Output and Standard Error</A>
17037 <BR>
17038 <A NAME="TOC45" HREF="bashref.html#SEC45">3.6.5 Appending Standard Output and Standard Error</A>
17039 <BR>
17040 <A NAME="TOC46" HREF="bashref.html#SEC46">3.6.6 Here Documents</A>
17041 <BR>
17042 <A NAME="TOC47" HREF="bashref.html#SEC47">3.6.7 Here Strings</A>
17043 <BR>
17044 <A NAME="TOC48" HREF="bashref.html#SEC48">3.6.8 Duplicating File Descriptors</A>
17045 <BR>
17046 <A NAME="TOC49" HREF="bashref.html#SEC49">3.6.9 Moving File Descriptors</A>
17047 <BR>
17048 <A NAME="TOC50" HREF="bashref.html#SEC50">3.6.10 Opening File Descriptors for Reading and Writing</A>
17049 <BR>
17050 </UL>
17051 <A NAME="TOC51" HREF="bashref.html#SEC51">3.7 Executing Commands</A>
17052 <BR>
17053 <UL>
17054 <A NAME="TOC52" HREF="bashref.html#SEC52">3.7.1 Simple Command Expansion</A>
17055 <BR>
17056 <A NAME="TOC53" HREF="bashref.html#SEC53">3.7.2 Command Search and Execution</A>
17057 <BR>
17058 <A NAME="TOC54" HREF="bashref.html#SEC54">3.7.3 Command Execution Environment</A>
17059 <BR>
17060 <A NAME="TOC55" HREF="bashref.html#SEC55">3.7.4 Environment</A>
17061 <BR>
17062 <A NAME="TOC56" HREF="bashref.html#SEC56">3.7.5 Exit Status</A>
17063 <BR>
17064 <A NAME="TOC57" HREF="bashref.html#SEC57">3.7.6 Signals</A>
17065 <BR>
17066 </UL>
17067 <A NAME="TOC58" HREF="bashref.html#SEC58">3.8 Shell Scripts</A>
17068 <BR>
17069 </UL>
17070 <A NAME="TOC59" HREF="bashref.html#SEC59">4. Shell Builtin Commands</A>
17071 <BR>
17072 <UL>
17073 <A NAME="TOC60" HREF="bashref.html#SEC60">4.1 Bourne Shell Builtins</A>
17074 <BR>
17075 <A NAME="TOC61" HREF="bashref.html#SEC61">4.2 Bash Builtin Commands</A>
17076 <BR>
17077 <A NAME="TOC62" HREF="bashref.html#SEC62">4.3 Modifying Shell Behavior</A>
17078 <BR>
17079 <UL>
17080 <A NAME="TOC63" HREF="bashref.html#SEC63">4.3.1 The Set Builtin</A>
17081 <BR>
17082 <A NAME="TOC64" HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>
17083 <BR>
17084 </UL>
17085 <A NAME="TOC65" HREF="bashref.html#SEC65">4.4 Special Builtins</A>
17086 <BR>
17087 </UL>
17088 <A NAME="TOC66" HREF="bashref.html#SEC66">5. Shell Variables</A>
17089 <BR>
17090 <UL>
17091 <A NAME="TOC67" HREF="bashref.html#SEC67">5.1 Bourne Shell Variables</A>
17092 <BR>
17093 <A NAME="TOC68" HREF="bashref.html#SEC68">5.2 Bash Variables</A>
17094 <BR>
17095 </UL>
17096 <A NAME="TOC69" HREF="bashref.html#SEC69">6. Bash Features</A>
17097 <BR>
17098 <UL>
17099 <A NAME="TOC70" HREF="bashref.html#SEC70">6.1 Invoking Bash</A>
17100 <BR>
17101 <A NAME="TOC71" HREF="bashref.html#SEC71">6.2 Bash Startup Files</A>
17102 <BR>
17103 <A NAME="TOC79" HREF="bashref.html#SEC79">6.3 Interactive Shells</A>
17104 <BR>
17105 <UL>
17106 <A NAME="TOC80" HREF="bashref.html#SEC80">6.3.1 What is an Interactive Shell?</A>
17107 <BR>
17108 <A NAME="TOC81" HREF="bashref.html#SEC81">6.3.2 Is this Shell Interactive?</A>
17109 <BR>
17110 <A NAME="TOC82" HREF="bashref.html#SEC82">6.3.3 Interactive Shell Behavior</A>
17111 <BR>
17112 </UL>
17113 <A NAME="TOC83" HREF="bashref.html#SEC83">6.4 Bash Conditional Expressions</A>
17114 <BR>
17115 <A NAME="TOC84" HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>
17116 <BR>
17117 <A NAME="TOC85" HREF="bashref.html#SEC85">6.6 Aliases</A>
17118 <BR>
17119 <A NAME="TOC86" HREF="bashref.html#SEC86">6.7 Arrays</A>
17120 <BR>
17121 <A NAME="TOC87" HREF="bashref.html#SEC87">6.8 The Directory Stack</A>
17122 <BR>
17123 <UL>
17124 <A NAME="TOC88" HREF="bashref.html#SEC88">6.8.1 Directory Stack Builtins</A>
17125 <BR>
17126 </UL>
17127 <A NAME="TOC89" HREF="bashref.html#SEC89">6.9 Controlling the Prompt</A>
17128 <BR>
17129 <A NAME="TOC90" HREF="bashref.html#SEC90">6.10 The Restricted Shell</A>
17130 <BR>
17131 <A NAME="TOC91" HREF="bashref.html#SEC91">6.11 Bash POSIX Mode</A>
17132 <BR>
17133 </UL>
17134 <A NAME="TOC92" HREF="bashref.html#SEC92">7. Job Control</A>
17135 <BR>
17136 <UL>
17137 <A NAME="TOC93" HREF="bashref.html#SEC93">7.1 Job Control Basics</A>
17138 <BR>
17139 <A NAME="TOC94" HREF="bashref.html#SEC94">7.2 Job Control Builtins</A>
17140 <BR>
17141 <A NAME="TOC95" HREF="bashref.html#SEC95">7.3 Job Control Variables</A>
17142 <BR>
17143 </UL>
17144 <A NAME="TOC96" HREF="bashref.html#SEC96">8. Command Line Editing</A>
17145 <BR>
17146 <UL>
17147 <A NAME="TOC97" HREF="bashref.html#SEC97">8.1 Introduction to Line Editing</A>
17148 <BR>
17149 <A NAME="TOC98" HREF="bashref.html#SEC98">8.2 Readline Interaction</A>
17150 <BR>
17151 <UL>
17152 <A NAME="TOC99" HREF="bashref.html#SEC99">8.2.1 Readline Bare Essentials</A>
17153 <BR>
17154 <A NAME="TOC100" HREF="bashref.html#SEC100">8.2.2 Readline Movement Commands</A>
17155 <BR>
17156 <A NAME="TOC101" HREF="bashref.html#SEC101">8.2.3 Readline Killing Commands</A>
17157 <BR>
17158 <A NAME="TOC102" HREF="bashref.html#SEC102">8.2.4 Readline Arguments</A>
17159 <BR>
17160 <A NAME="TOC103" HREF="bashref.html#SEC103">8.2.5 Searching for Commands in the History</A>
17161 <BR>
17162 </UL>
17163 <A NAME="TOC104" HREF="bashref.html#SEC104">8.3 Readline Init File</A>
17164 <BR>
17165 <UL>
17166 <A NAME="TOC105" HREF="bashref.html#SEC105">8.3.1 Readline Init File Syntax</A>
17167 <BR>
17168 <A NAME="TOC106" HREF="bashref.html#SEC106">8.3.2 Conditional Init Constructs</A>
17169 <BR>
17170 <A NAME="TOC107" HREF="bashref.html#SEC107">8.3.3 Sample Init File</A>
17171 <BR>
17172 </UL>
17173 <A NAME="TOC108" HREF="bashref.html#SEC108">8.4 Bindable Readline Commands</A>
17174 <BR>
17175 <UL>
17176 <A NAME="TOC109" HREF="bashref.html#SEC109">8.4.1 Commands For Moving</A>
17177 <BR>
17178 <A NAME="TOC110" HREF="bashref.html#SEC110">8.4.2 Commands For Manipulating The History</A>
17179 <BR>
17180 <A NAME="TOC111" HREF="bashref.html#SEC111">8.4.3 Commands For Changing Text</A>
17181 <BR>
17182 <A NAME="TOC112" HREF="bashref.html#SEC112">8.4.4 Killing And Yanking</A>
17183 <BR>
17184 <A NAME="TOC113" HREF="bashref.html#SEC113">8.4.5 Specifying Numeric Arguments</A>
17185 <BR>
17186 <A NAME="TOC114" HREF="bashref.html#SEC114">8.4.6 Letting Readline Type For You</A>
17187 <BR>
17188 <A NAME="TOC115" HREF="bashref.html#SEC115">8.4.7 Keyboard Macros</A>
17189 <BR>
17190 <A NAME="TOC116" HREF="bashref.html#SEC116">8.4.8 Some Miscellaneous Commands</A>
17191 <BR>
17192 </UL>
17193 <A NAME="TOC117" HREF="bashref.html#SEC117">8.5 Readline vi Mode</A>
17194 <BR>
17195 <A NAME="TOC118" HREF="bashref.html#SEC118">8.6 Programmable Completion</A>
17196 <BR>
17197 <A NAME="TOC119" HREF="bashref.html#SEC119">8.7 Programmable Completion Builtins</A>
17198 <BR>
17199 <A NAME="TOC120" HREF="bashref.html#SEC120">8.8 A Programmable Completion Example</A>
17200 <BR>
17201 </UL>
17202 <A NAME="TOC121" HREF="bashref.html#SEC121">9. Using History Interactively</A>
17203 <BR>
17204 <UL>
17205 <A NAME="TOC122" HREF="bashref.html#SEC122">9.1 Bash History Facilities</A>
17206 <BR>
17207 <A NAME="TOC123" HREF="bashref.html#SEC123">9.2 Bash History Builtins</A>
17208 <BR>
17209 <A NAME="TOC124" HREF="bashref.html#SEC124">9.3 History Expansion</A>
17210 <BR>
17211 <UL>
17212 <A NAME="TOC125" HREF="bashref.html#SEC125">9.3.1 Event Designators</A>
17213 <BR>
17214 <A NAME="TOC126" HREF="bashref.html#SEC126">9.3.2 Word Designators</A>
17215 <BR>
17216 <A NAME="TOC127" HREF="bashref.html#SEC127">9.3.3 Modifiers</A>
17217 <BR>
17218 </UL>
17219 </UL>
17220 <A NAME="TOC128" HREF="bashref.html#SEC128">10. Installing Bash</A>
17221 <BR>
17222 <UL>
17223 <A NAME="TOC129" HREF="bashref.html#SEC129">10.1 Basic Installation</A>
17224 <BR>
17225 <A NAME="TOC130" HREF="bashref.html#SEC130">10.2 Compilers and Options</A>
17226 <BR>
17227 <A NAME="TOC131" HREF="bashref.html#SEC131">10.3 Compiling For Multiple Architectures</A>
17228 <BR>
17229 <A NAME="TOC132" HREF="bashref.html#SEC132">10.4 Installation Names</A>
17230 <BR>
17231 <A NAME="TOC133" HREF="bashref.html#SEC133">10.5 Specifying the System Type</A>
17232 <BR>
17233 <A NAME="TOC134" HREF="bashref.html#SEC134">10.6 Sharing Defaults</A>
17234 <BR>
17235 <A NAME="TOC135" HREF="bashref.html#SEC135">10.7 Operation Controls</A>
17236 <BR>
17237 <A NAME="TOC136" HREF="bashref.html#SEC136">10.8 Optional Features</A>
17238 <BR>
17239 </UL>
17240 <A NAME="TOC137" HREF="bashref.html#SEC137">A. Reporting Bugs</A>
17241 <BR>
17242 <A NAME="TOC138" HREF="bashref.html#SEC138">B. Major Differences From The Bourne Shell</A>
17243 <BR>
17244 <UL>
17245 <A NAME="TOC139" HREF="bashref.html#SEC139">B.1 Implementation Differences From The SVR4.2 Shell</A>
17246 <BR>
17247 </UL>
17248 <A NAME="TOC140" HREF="bashref.html#SEC140">C. GNU Free Documentation License</A>
17249 <BR>
17250 <A NAME="TOC142" HREF="bashref.html#SEC142">D. Indexes</A>
17251 <BR>
17252 <UL>
17253 <A NAME="TOC143" HREF="bashref.html#SEC143">D.1 Index of Shell Builtin Commands</A>
17254 <BR>
17255 <A NAME="TOC144" HREF="bashref.html#SEC144">D.2 Index of Shell Reserved Words</A>
17256 <BR>
17257 <A NAME="TOC145" HREF="bashref.html#SEC145">D.3 Parameter and Variable Index</A>
17258 <BR>
17259 <A NAME="TOC146" HREF="bashref.html#SEC146">D.4 Function Index</A>
17260 <BR>
17261 <A NAME="TOC147" HREF="bashref.html#SEC147">D.5 Concept Index</A>
17262 <BR>
17263 </UL>
17264 </UL>
17265 <HR SIZE=1>
17266 <A NAME="SEC_OVERVIEW"></A>
17267 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
17268 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
17269 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
17270 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
17271 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
17272 </TR></TABLE>
17273 <H1>Short Table of Contents</H1>
17274 <BLOCKQUOTE>
17275 <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
17276 <BR>
17277 <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
17278 <BR>
17279 <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
17280 <BR>
17281 <A NAME="TOC59" HREF="bashref.html#SEC59">4. Shell Builtin Commands</A>
17282 <BR>
17283 <A NAME="TOC66" HREF="bashref.html#SEC66">5. Shell Variables</A>
17284 <BR>
17285 <A NAME="TOC69" HREF="bashref.html#SEC69">6. Bash Features</A>
17286 <BR>
17287 <A NAME="TOC92" HREF="bashref.html#SEC92">7. Job Control</A>
17288 <BR>
17289 <A NAME="TOC96" HREF="bashref.html#SEC96">8. Command Line Editing</A>
17290 <BR>
17291 <A NAME="TOC121" HREF="bashref.html#SEC121">9. Using History Interactively</A>
17292 <BR>
17293 <A NAME="TOC128" HREF="bashref.html#SEC128">10. Installing Bash</A>
17294 <BR>
17295 <A NAME="TOC137" HREF="bashref.html#SEC137">A. Reporting Bugs</A>
17296 <BR>
17297 <A NAME="TOC138" HREF="bashref.html#SEC138">B. Major Differences From The Bourne Shell</A>
17298 <BR>
17299 <A NAME="TOC140" HREF="bashref.html#SEC140">C. GNU Free Documentation License</A>
17300 <BR>
17301 <A NAME="TOC142" HREF="bashref.html#SEC142">D. Indexes</A>
17302 <BR>
17303
17304 </BLOCKQUOTE>
17305 <HR SIZE=1>
17306 <A NAME="SEC_About"></A>
17307 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
17308 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
17309 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
17310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142">Index</A>]</TD>
17311 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
17312 </TR></TABLE>
17313 <H1>About this document</H1>
17314 This document was generated by <I>Chet Ramey</I> on <I>February, 24  2014</I>
17315 using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
17316 "><I>texi2html</I></A>
17317 <P></P>  
17318 The buttons in the navigation panels have the following meaning:
17319 <P></P>
17320 <table border = "1">
17321 <TR>
17322 <TH> Button </TH>
17323 <TH> Name </TH>
17324 <TH> Go to </TH>
17325 <TH> From 1.2.3 go to</TH>
17326 </TR>
17327 <TR>
17328 <TD ALIGN="CENTER">
17329  [ &lt; ] </TD>
17330 <TD ALIGN="CENTER">
17331 Back
17332 </TD>
17333 <TD>
17334 previous section in reading order
17335 </TD>
17336 <TD>
17337 1.2.2
17338 </TD>
17339 </TR>
17340 <TR>
17341 <TD ALIGN="CENTER">
17342  [ &gt; ] </TD>
17343 <TD ALIGN="CENTER">
17344 Forward
17345 </TD>
17346 <TD>
17347 next section in reading order
17348 </TD>
17349 <TD>
17350 1.2.4
17351 </TD>
17352 </TR>
17353 <TR>
17354 <TD ALIGN="CENTER">
17355  [ &lt;&lt; ] </TD>
17356 <TD ALIGN="CENTER">
17357 FastBack
17358 </TD>
17359 <TD>
17360 previous or up-and-previous section 
17361 </TD>
17362 <TD>
17363 1.1
17364 </TD>
17365 </TR>
17366 <TR>
17367 <TD ALIGN="CENTER">
17368  [ Up ] </TD>
17369 <TD ALIGN="CENTER">
17370 Up
17371 </TD>
17372 <TD>
17373 up section
17374 </TD>
17375 <TD>
17376 1.2
17377 </TD>
17378 </TR>
17379 <TR>
17380 <TD ALIGN="CENTER">
17381  [ &gt;&gt; ] </TD>
17382 <TD ALIGN="CENTER">
17383 FastForward
17384 </TD>
17385 <TD>
17386 next or up-and-next section
17387 </TD>
17388 <TD>
17389 1.3
17390 </TD>
17391 </TR>
17392 <TR>
17393 <TD ALIGN="CENTER">
17394  [Top] </TD>
17395 <TD ALIGN="CENTER">
17396 Top
17397 </TD>
17398 <TD>
17399 cover (top) of document
17400 </TD>
17401 <TD>
17402  &nbsp; 
17403 </TD>
17404 </TR>
17405 <TR>
17406 <TD ALIGN="CENTER">
17407  [Contents] </TD>
17408 <TD ALIGN="CENTER">
17409 Contents
17410 </TD>
17411 <TD>
17412 table of contents
17413 </TD>
17414 <TD>
17415  &nbsp; 
17416 </TD>
17417 </TR>
17418 <TR>
17419 <TD ALIGN="CENTER">
17420  [Index] </TD>
17421 <TD ALIGN="CENTER">
17422 Index
17423 </TD>
17424 <TD>
17425 concept index
17426 </TD>
17427 <TD>
17428  &nbsp; 
17429 </TD>
17430 </TR>
17431 <TR>
17432 <TD ALIGN="CENTER">
17433  [ ? ] </TD>
17434 <TD ALIGN="CENTER">
17435 About
17436 </TD>
17437 <TD>
17438 this page
17439 </TD>
17440 <TD>
17441  &nbsp; 
17442 </TD>
17443 </TR>
17444 </TABLE>
17445 <P></P>
17446 where the <STRONG> Example </STRONG> assumes that the current position 
17447 is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of 
17448 the following structure:
17449 <UL>
17450 <LI> 1. Section One  </LI>
17451 <UL>
17452 <LI>1.1 Subsection One-One</LI>
17453 <UL>
17454 <LI> ... </LI>
17455 </UL>
17456 <LI>1.2 Subsection One-Two</LI>
17457 <UL>
17458 <LI>1.2.1 Subsubsection One-Two-One
17459 </LI><LI>1.2.2 Subsubsection One-Two-Two
17460 </LI><LI>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp; <STRONG>
17461 &lt;== Current Position </STRONG>
17462 </LI><LI>1.2.4 Subsubsection One-Two-Four
17463 </LI></UL>
17464 <LI>1.3 Subsection One-Three</LI>
17465 <UL>
17466 <LI> ... </LI>
17467 </UL>
17468 <LI>1.4 Subsection One-Four</LI>
17469 </UL>
17470 </UL>
17471
17472 <HR SIZE=1>
17473 <BR>  
17474 <FONT SIZE="-1">
17475 This document was generated
17476 by <I>Chet Ramey</I> on <I>February, 24  2014</I>
17477 using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
17478 "><I>texi2html</I></A>
17479
17480 </BODY>
17481 </HTML>