2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <!-- Created on December, 29 2009 by texi2html 1.64 -->
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
9 Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10 Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
14 <TITLE>Bash Reference Manual: </TITLE>
16 <META NAME="description" CONTENT="Bash Reference Manual: ">
17 <META NAME="keywords" CONTENT="Bash Reference Manual: ">
18 <META NAME="resource-type" CONTENT="document">
19 <META NAME="distribution" CONTENT="global">
20 <META NAME="Generator" CONTENT="texi2html 1.64">
24 <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
26 <A NAME="SEC_Top"></A>
27 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
28 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
29 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
30 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
31 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
33 <H1>Bash Reference Manual</H1></P><P>
35 This text is a brief description of the features that are present in
36 the Bash shell (version 4.1, 23 December 2009).
39 This is Edition 4.1, last updated 23 December 2009,
40 of <CITE>The GNU Bash Reference Manual</CITE>,
41 for <CODE>Bash</CODE>, Version 4.1.
44 Bash contains features that appear in other popular shells, and some
45 features that only appear in Bash. Some of the shells that Bash has
46 borrowed concepts from are the Bourne Shell (<TT>`sh'</TT>), the Korn Shell
47 (<TT>`ksh'</TT>), and the C-shell (<TT>`csh'</TT> and its successor,
48 <TT>`tcsh'</TT>). The following menu breaks the features up into
49 categories based upon which one of these other shells inspired the
53 This manual is meant as a brief introduction to features found in
54 Bash. The Bash manual page should be used as the definitive
55 reference on shell behavior.
58 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
59 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC1">1. Introduction</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">An introduction to the shell.</TD></TR>
60 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC4">2. Definitions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Some definitions used in the rest of this
62 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The shell "building blocks".</TD></TR>
63 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands that are a part of the shell.</TD></TR>
64 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC65">5. Shell Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables used or set by Bash.</TD></TR>
65 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC68">6. Bash Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Features found only in Bash.</TD></TR>
66 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC91">7. Job Control</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What job control is and how Bash allows you
68 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC95">8. Command Line Editing</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Chapter describing the command line
69 editing features.</TD></TR>
70 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC119">9. Using History Interactively</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command History Expansion</TD></TR>
71 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC126">10. Installing Bash</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to build and install Bash on your system.</TD></TR>
72 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC135">A. Reporting Bugs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to report bugs in Bash.</TD></TR>
73 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A terse list of the differences
74 between Bash and historical
75 versions of /bin/sh.</TD></TR>
76 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC138">C. GNU Free Documentation License</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Copying and sharing this documentation.</TD></TR>
77 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC140">D. Indexes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Various indexes for this manual.</TD></TR>
83 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
84 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> < </A>]</TD>
85 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> > </A>]</TD>
86 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
87 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
88 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD>
89 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
90 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
91 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
92 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
94 <A NAME="Introduction"></A>
95 <H1> 1. Introduction </H1>
97 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
98 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC2">1.1 What is Bash?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A short description of Bash.</TD></TR>
99 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC3">1.2 What is a shell?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A brief introduction to shells.</TD></TR>
100 </TABLE></BLOCKQUOTE>
103 <A NAME="What is Bash?"></A>
106 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
107 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> < </A>]</TD>
108 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> > </A>]</TD>
109 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
110 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD>
111 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD>
112 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
113 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
114 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
115 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
117 <H2> 1.1 What is Bash? </H2>
121 Bash is the shell, or command language interpreter,
122 for the GNU operating system.
123 The name is an acronym for the <SAMP>`Bourne-Again SHell'</SAMP>,
124 a pun on Stephen Bourne, the author of the direct ancestor of
125 the current Unix shell <CODE>sh</CODE>,
126 which appeared in the Seventh Edition Bell Labs Research version
130 Bash is largely compatible with <CODE>sh</CODE> and incorporates useful
131 features from the Korn shell <CODE>ksh</CODE> and the C shell <CODE>csh</CODE>.
132 It is intended to be a conformant implementation of the IEEE
133 POSIX Shell and Tools portion of the IEEE POSIX
134 specification (IEEE Standard 1003.1).
135 It offers functional improvements over <CODE>sh</CODE> for both interactive and
139 While the GNU operating system provides other shells, including
140 a version of <CODE>csh</CODE>, Bash is the default shell.
141 Like other GNU software, Bash is quite portable. It currently runs
142 on nearly every version of Unix and a few other operating systems -
143 independently-supported ports exist for MS-DOS, OS/2,
144 and Windows platforms.
147 <A NAME="What is a shell?"></A>
150 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
151 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> < </A>]</TD>
152 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> > </A>]</TD>
153 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
154 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> Up </A>]</TD>
155 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> >> </A>]</TD>
156 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
157 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
158 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
159 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
161 <H2> 1.2 What is a shell? </H2>
165 At its base, a shell is simply a macro processor that executes
166 commands. The term macro processor means functionality where text
167 and symbols are expanded to create larger expressions.
170 A Unix shell is both a command interpreter and a programming
171 language. As a command interpreter, the shell provides the user
172 interface to the rich set of GNU utilities. The programming
173 language features allow these utilities to be combined.
174 Files containing commands can be created, and become
175 commands themselves. These new commands have the same status as
176 system commands in directories such as <TT>`/bin'</TT>, allowing users
177 or groups to establish custom environments to automate their common
181 Shells may be used interactively or non-interactively. In
182 interactive mode, they accept input typed from the keyboard.
183 When executing non-interactively, shells execute commands read
187 A shell allows execution of GNU commands, both synchronously and
189 The shell waits for synchronous commands to complete before accepting
190 more input; asynchronous commands continue to execute in parallel
191 with the shell while it reads and executes additional commands.
192 The <EM>redirection</EM> constructs permit
193 fine-grained control of the input and output of those commands.
194 Moreover, the shell allows control over the contents of commands'
198 Shells also provide a small set of built-in
199 commands (<EM>builtins</EM>) implementing functionality impossible
200 or inconvenient to obtain via separate utilities.
201 For example, <CODE>cd</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, and
202 <CODE>exec</CODE>) cannot be implemented outside of the shell because
203 they directly manipulate the shell itself.
204 The <CODE>history</CODE>, <CODE>getopts</CODE>, <CODE>kill</CODE>, or <CODE>pwd</CODE>
205 builtins, among others, could be implemented in separate utilities,
206 but they are more convenient to use as builtin commands.
207 All of the shell builtins are described in
211 While executing commands is essential, most of the power (and
212 complexity) of shells is due to their embedded programming
213 languages. Like any high-level language, the shell provides
214 variables, flow control constructs, quoting, and functions.
217 Shells offer features geared specifically for
218 interactive use rather than to augment the programming language.
219 These interactive features include job control, command line
220 editing, command history and aliases. Each of these features is
221 described in this manual.
224 <A NAME="Definitions"></A>
227 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
228 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> < </A>]</TD>
229 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> > </A>]</TD>
230 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
231 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
232 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> >> </A>]</TD>
233 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
234 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
235 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
236 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
238 <H1> 2. Definitions </H1>
240 These definitions are used throughout the remainder of this manual.
245 <DT><CODE>POSIX</CODE>
246 <DD><A NAME="IDX1"></A>
247 A family of open system standards based on Unix. Bash
248 is primarily concerned with the Shell and Utilities portion of the
249 POSIX 1003.1 standard.
252 <DT><CODE>blank</CODE>
253 <DD>A space or tab character.
256 <DT><CODE>builtin</CODE>
257 <DD><A NAME="IDX2"></A>
258 A command that is implemented internally by the shell itself, rather
259 than by an executable program somewhere in the file system.
262 <DT><CODE>control operator</CODE>
263 <DD><A NAME="IDX3"></A>
264 A <CODE>token</CODE> that performs a control function. It is a <CODE>newline</CODE>
265 or one of the following:
266 <SAMP>`||'</SAMP>, <SAMP>`&&'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`;;'</SAMP>,
267 <SAMP>`|'</SAMP>, <SAMP>`|&'</SAMP>, <SAMP>`('</SAMP>, or <SAMP>`)'</SAMP>.
270 <DT><CODE>exit status</CODE>
271 <DD><A NAME="IDX4"></A>
272 The value returned by a command to its caller. The value is restricted
273 to eight bits, so the maximum value is 255.
276 <DT><CODE>field</CODE>
277 <DD><A NAME="IDX5"></A>
278 A unit of text that is the result of one of the shell expansions. After
279 expansion, when executing a command, the resulting fields are used as
280 the command name and arguments.
283 <DT><CODE>filename</CODE>
284 <DD><A NAME="IDX6"></A>
285 A string of characters used to identify a file.
289 <DD><A NAME="IDX7"></A>
290 A set of processes comprising a pipeline, and any processes descended
291 from it, that are all in the same process group.
294 <DT><CODE>job control</CODE>
295 <DD><A NAME="IDX8"></A>
296 A mechanism by which users can selectively stop (suspend) and restart
297 (resume) execution of processes.
300 <DT><CODE>metacharacter</CODE>
301 <DD><A NAME="IDX9"></A>
302 A character that, when unquoted, separates words. A metacharacter is
303 a <CODE>blank</CODE> or one of the following characters:
304 <SAMP>`|'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`('</SAMP>, <SAMP>`)'</SAMP>, <SAMP>`<'</SAMP>, or
305 <SAMP>`>'</SAMP>.
308 <DT><CODE>name</CODE>
309 <DD><A NAME="IDX10"></A>
311 A <CODE>word</CODE> consisting solely of letters, numbers, and underscores,
312 and beginning with a letter or underscore. <CODE>Name</CODE>s are used as
313 shell variable and function names.
314 Also referred to as an <CODE>identifier</CODE>.
317 <DT><CODE>operator</CODE>
318 <DD><A NAME="IDX12"></A>
319 A <CODE>control operator</CODE> or a <CODE>redirection operator</CODE>.
320 See section <A HREF="bashref.html#SEC39">3.6 Redirections</A>, for a list of redirection operators.
321 Operators contain at least one unquoted <CODE>metacharacter</CODE>.
324 <DT><CODE>process group</CODE>
325 <DD><A NAME="IDX13"></A>
326 A collection of related processes each having the same process
330 <DT><CODE>process group ID</CODE>
331 <DD><A NAME="IDX14"></A>
332 A unique identifier that represents a <CODE>process group</CODE>
336 <DT><CODE>reserved word</CODE>
337 <DD><A NAME="IDX15"></A>
338 A <CODE>word</CODE> that has a special meaning to the shell. Most reserved
339 words introduce shell flow control constructs, such as <CODE>for</CODE> and
343 <DT><CODE>return status</CODE>
344 <DD><A NAME="IDX16"></A>
345 A synonym for <CODE>exit status</CODE>.
348 <DT><CODE>signal</CODE>
349 <DD><A NAME="IDX17"></A>
350 A mechanism by which a process may be notified by the kernel
351 of an event occurring in the system.
354 <DT><CODE>special builtin</CODE>
355 <DD><A NAME="IDX18"></A>
356 A shell builtin command that has been classified as special by the
360 <DT><CODE>token</CODE>
361 <DD><A NAME="IDX19"></A>
362 A sequence of characters considered a single unit by the shell.
363 It is either a <CODE>word</CODE> or an <CODE>operator</CODE>.
366 <DT><CODE>word</CODE>
367 <DD><A NAME="IDX20"></A>
368 A sequence of characters treated as a unit by the shell.
369 Words may not include unquoted <CODE>metacharacters</CODE>.
373 <A NAME="Basic Shell Features"></A>
376 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
377 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> < </A>]</TD>
378 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> > </A>]</TD>
379 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD>
380 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
382 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
383 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
387 <H1> 3. Basic Shell Features </H1>
391 Bash is an acronym for <SAMP>`Bourne-Again SHell'</SAMP>.
393 the traditional Unix shell originally written by Stephen Bourne.
394 All of the Bourne shell builtin commands are available in Bash,
395 The rules for evaluation and quoting are taken from the POSIX
396 specification for the `standard' Unix shell.
399 This chapter briefly summarizes the shell's `building blocks':
400 commands, control structures, shell functions, shell <I>parameters</I>,
402 <I>redirections</I>, which are a way to direct input and output from
403 and to named files, and how the shell executes commands.
406 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
407 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC6">3.1 Shell Syntax</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What your input means to the shell.</TD></TR>
408 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC15">3.2 Shell Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The types of commands you can use.</TD></TR>
409 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Grouping commands by name.</TD></TR>
410 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell stores values.</TD></TR>
411 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC28">3.5 Shell Expansions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands parameters and the various
412 expansions available.</TD></TR>
413 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC39">3.6 Redirections</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to control where input and output go.</TD></TR>
414 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC50">3.7 Executing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when you run a command.</TD></TR>
415 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC57">3.8 Shell Scripts</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Executing files of shell commands.</TD></TR>
416 </TABLE></BLOCKQUOTE>
419 <A NAME="Shell Syntax"></A>
422 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
423 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> < </A>]</TD>
424 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> > </A>]</TD>
425 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
426 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
427 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD>
428 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
429 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
430 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
431 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
433 <H2> 3.1 Shell Syntax </H2>
435 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
436 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC7">3.1.1 Shell Operation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The basic operation of the shell.</TD></TR>
437 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC8">3.1.2 Quoting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from characters.</TD></TR>
438 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC14">3.1.3 Comments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify comments.</TD></TR>
439 </TABLE></BLOCKQUOTE>
442 When the shell reads input, it proceeds through a
443 sequence of operations. If the input indicates the beginning of a
444 comment, the shell ignores the comment symbol (<SAMP>`#'</SAMP>), and the rest
447 Otherwise, roughly speaking, the shell reads its input and
448 divides the input into words and operators, employing the quoting rules
449 to select which meanings to assign various words and characters.
452 The shell then parses these tokens into commands and other constructs,
453 removes the special meaning of certain words or characters, expands
454 others, redirects input and output as needed, executes the specified
455 command, waits for the command's exit status, and makes that exit status
456 available for further inspection or processing.
459 <A NAME="Shell Operation"></A>
462 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
463 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> < </A>]</TD>
464 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> > </A>]</TD>
465 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
466 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
467 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD>
468 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
469 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
470 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
471 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
473 <H3> 3.1.1 Shell Operation </H3>
477 The following is a brief description of the shell's operation when it
478 reads and executes a command. Basically, the shell does the
484 Reads its input from a file (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), from a string
485 supplied as an argument to the <SAMP>`-c'</SAMP> invocation option
486 (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>), or from the user's terminal.
490 Breaks the input into words and operators, obeying the quoting rules
491 described in <A HREF="bashref.html#SEC8">3.1.2 Quoting</A>. These tokens are separated by
492 <CODE>metacharacters</CODE>. Alias expansion is performed by this step
493 (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
497 Parses the tokens into simple and compound commands
498 (see section <A HREF="bashref.html#SEC15">3.2 Shell Commands</A>).
502 Performs the various shell expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>), breaking
503 the expanded tokens into lists of filenames (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>)
504 and commands and arguments.
508 Performs any necessary redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) and removes
509 the redirection operators and their operands from the argument list.
513 Executes the command (see section <A HREF="bashref.html#SEC50">3.7 Executing Commands</A>).
517 Optionally waits for the command to complete and collects its exit
518 status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>).
524 <A NAME="Quoting"></A>
527 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
528 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> < </A>]</TD>
529 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> > </A>]</TD>
530 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD>
531 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
532 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
533 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
534 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
536 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
538 <H3> 3.1.2 Quoting </H3>
540 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
541 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from a single
543 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to inhibit all interpretation of a sequence
544 of characters.</TD></TR>
545 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to suppress most of the interpretation of a
546 sequence of characters.</TD></TR>
547 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to expand ANSI-C sequences in quoted strings.</TD></TR>
548 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to translate strings into different languages.</TD></TR>
549 </TABLE></BLOCKQUOTE>
552 Quoting is used to remove the special meaning of certain
553 characters or words to the shell. Quoting can be used to
554 disable special treatment for special characters, to prevent
555 reserved words from being recognized as such, and to prevent
559 Each of the shell metacharacters (see section <A HREF="bashref.html#SEC4">2. Definitions</A>)
560 has special meaning to the shell and must be quoted if it is to
562 When the command history expansion facilities are being used
563 (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>), the
564 <VAR>history expansion</VAR> character, usually <SAMP>`!'</SAMP>, must be quoted
565 to prevent history expansion. See section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>, for
566 more details concerning history expansion.
569 There are three quoting mechanisms: the
570 <VAR>escape character</VAR>, single quotes, and double quotes.
573 <A NAME="Escape Character"></A>
576 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
577 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> < </A>]</TD>
578 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> > </A>]</TD>
579 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD>
580 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
581 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
582 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
583 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
584 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
585 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
587 <H4> 3.1.2.1 Escape Character </H4>
589 A non-quoted backslash <SAMP>`\'</SAMP> is the Bash escape character.
590 It preserves the literal value of the next character that follows,
591 with the exception of <CODE>newline</CODE>. If a <CODE>\newline</CODE> pair
592 appears, and the backslash itself is not quoted, the <CODE>\newline</CODE>
593 is treated as a line continuation (that is, it is removed from
594 the input stream and effectively ignored).
597 <A NAME="Single Quotes"></A>
600 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
601 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> < </A>]</TD>
602 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> > </A>]</TD>
603 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> << </A>]</TD>
604 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
605 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
606 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
607 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
608 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
609 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
611 <H4> 3.1.2.2 Single Quotes </H4>
612 <!--docid::SEC10::-->
615 Enclosing characters in single quotes (<SAMP>`''</SAMP>) preserves the literal value
616 of each character within the quotes. A single quote may not occur
617 between single quotes, even when preceded by a backslash.
620 <A NAME="Double Quotes"></A>
623 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
624 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> < </A>]</TD>
625 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> > </A>]</TD>
626 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> << </A>]</TD>
627 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
628 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
629 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
630 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
631 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
632 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
634 <H4> 3.1.2.3 Double Quotes </H4>
635 <!--docid::SEC11::-->
638 Enclosing characters in double quotes (<SAMP>`"'</SAMP>) preserves the literal value
639 of all characters within the quotes, with the exception of
640 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`\'</SAMP>,
641 and, when history expansion is enabled, <SAMP>`!'</SAMP>.
642 The characters <SAMP>`$'</SAMP> and <SAMP>``'</SAMP>
643 retain their special meaning within double quotes (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
644 The backslash retains its special meaning only when followed by one of
645 the following characters:
646 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`"'</SAMP>, <SAMP>`\'</SAMP>, or <CODE>newline</CODE>.
647 Within double quotes, backslashes that are followed by one of these
648 characters are removed. Backslashes preceding characters without a
649 special meaning are left unmodified.
650 A double quote may be quoted within double quotes by preceding it with
652 If enabled, history expansion will be performed unless an <SAMP>`!'</SAMP>
653 appearing in double quotes is escaped using a backslash.
654 The backslash preceding the <SAMP>`!'</SAMP> is not removed.
657 The special parameters <SAMP>`*'</SAMP> and <SAMP>`@'</SAMP> have special meaning
658 when in double quotes (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
661 <A NAME="ANSI-C Quoting"></A>
664 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
665 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> < </A>]</TD>
666 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> > </A>]</TD>
667 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> << </A>]</TD>
668 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
669 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
670 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
671 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
672 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
673 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
675 <H4> 3.1.2.4 ANSI-C Quoting </H4>
676 <!--docid::SEC12::-->
679 Words of the form <CODE>$'<VAR>string</VAR>'</CODE> are treated specially. The
680 word expands to <VAR>string</VAR>, with backslash-escaped characters replaced
681 as specified by the ANSI C standard. Backslash escape sequences, if
682 present, are decoded as follows:
691 <DD><DT><CODE>\E</CODE>
692 <DD>an escape character (not ANSI C)
709 <DT><CODE>\<VAR>nnn</VAR></CODE>
710 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
711 (one to three digits)
712 <DT><CODE>\x<VAR>HH</VAR></CODE>
713 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
714 (one or two hex digits)
715 <DT><CODE>\c<VAR>x</VAR></CODE>
716 <DD>a control-<VAR>x</VAR> character
720 The expanded result is single-quoted, as if the dollar sign had not
724 <A NAME="Locale Translation"></A>
727 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
728 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> < </A>]</TD>
729 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> > </A>]</TD>
730 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> << </A>]</TD>
731 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
732 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> >> </A>]</TD>
733 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
734 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
735 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
736 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
738 <H4> 3.1.2.5 Locale-Specific Translation </H4>
739 <!--docid::SEC13::-->
742 A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause
743 the string to be translated according to the current locale.
744 If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign
746 If the string is translated and replaced, the replacement is
753 Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE>
754 shell variable. Others create the name of the message catalog from the
755 value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a
756 suffix of <SAMP>`.mo'</SAMP>. If you use the <CODE>TEXTDOMAIN</CODE> variable, you
757 may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of
758 the message catalog files. Still others use both variables in this
760 <CODE>TEXTDOMAINDIR</CODE>/<CODE>LC_MESSAGES</CODE>/LC_MESSAGES/<CODE>TEXTDOMAIN</CODE>.mo.
763 <A NAME="Comments"></A>
766 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
767 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> < </A>]</TD>
768 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> > </A>]</TD>
769 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
770 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
771 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> >> </A>]</TD>
772 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
773 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
774 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
775 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
777 <H3> 3.1.3 Comments </H3>
778 <!--docid::SEC14::-->
781 In a non-interactive shell, or an interactive shell in which the
782 <CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE>
783 builtin is enabled (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>),
784 a word beginning with <SAMP>`#'</SAMP>
785 causes that word and all remaining characters on that line to
786 be ignored. An interactive shell without the <CODE>interactive_comments</CODE>
787 option enabled does not allow comments. The <CODE>interactive_comments</CODE>
788 option is on by default in interactive shells.
789 See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for a description of what makes
793 <A NAME="Shell Commands"></A>
796 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
797 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> < </A>]</TD>
798 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> > </A>]</TD>
799 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD>
800 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
801 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD>
802 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
803 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
804 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
805 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
807 <H2> 3.2 Shell Commands </H2>
808 <!--docid::SEC15::-->
811 A simple shell command such as <CODE>echo a b c</CODE> consists of the command
812 itself followed by arguments, separated by spaces.
815 More complex shell commands are composed of simple commands arranged together
816 in a variety of ways: in a pipeline in which the output of one command
817 becomes the input of a second, in a loop or conditional construct, or in
821 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
822 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The most common type of command.</TD></TR>
823 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Connecting the input and output of several
825 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to execute commands sequentially.</TD></TR>
826 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for control flow.</TD></TR>
827 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Two-way communication between commands.</TD></TR>
828 </TABLE></BLOCKQUOTE>
831 <A NAME="Simple Commands"></A>
834 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
835 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> < </A>]</TD>
836 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> > </A>]</TD>
837 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD>
838 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
839 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD>
840 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
841 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
842 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
843 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
845 <H3> 3.2.1 Simple Commands </H3>
846 <!--docid::SEC16::-->
849 A simple command is the kind of command encountered most often.
850 It's just a sequence of words separated by <CODE>blank</CODE>s, terminated
851 by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>). The
852 first word generally specifies a command to be executed, with the
853 rest of the words being that command's arguments.
856 The return status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>) of a simple command is
857 its exit status as provided
858 by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if
859 the command was terminated by signal <VAR>n</VAR>.
862 <A NAME="Pipelines"></A>
865 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
866 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> < </A>]</TD>
867 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> > </A>]</TD>
868 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> << </A>]</TD>
869 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
870 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD>
871 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
872 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
873 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
874 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
876 <H3> 3.2.2 Pipelines </H3>
877 <!--docid::SEC17::-->
880 A <CODE>pipeline</CODE> is a sequence of simple commands separated by one of
881 the control operators <SAMP>`|'</SAMP> or <SAMP>`|&'</SAMP>.
887 The format for a pipeline is
888 <TABLE><tr><td> </td><td class=example><pre>[<CODE>time</CODE> [<CODE>-p</CODE>]] [<CODE>!</CODE>] <VAR>command1</VAR> [ [<CODE>|</CODE> or <CODE>|&</CODE>] <VAR>command2</VAR> <small>...</small>]
889 </pre></td></tr></table></P><P>
891 The output of each command in the pipeline is connected via a pipe
892 to the input of the next command.
893 That is, each command reads the previous command's output. This
894 connection is performed before any redirections specified by the
898 If <SAMP>`|&'</SAMP> is used, the standard error of <VAR>command1</VAR> is connected to
899 <VAR>command2</VAR>'s standard input through the pipe; it is shorthand for
900 <CODE>2>&1 |</CODE>. This implicit redirection of the standard error is
901 performed after any redirections specified by the command.
904 The reserved word <CODE>time</CODE> causes timing statistics
905 to be printed for the pipeline once it finishes.
906 The statistics currently consist of elapsed (wall-clock) time and
907 user and system time consumed by the command's execution.
908 The <SAMP>`-p'</SAMP> option changes the output format to that specified
910 The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that
911 specifies how the timing information should be displayed.
912 See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of the available formats.
913 The use of <CODE>time</CODE> as a reserved word permits the timing of
914 shell builtins, shell functions, and pipelines. An external
915 <CODE>time</CODE> command cannot time these easily.
918 If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the
919 shell waits for all commands in the pipeline to complete.
922 Each command in a pipeline is executed in its own subshell
923 (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>). The exit
924 status of a pipeline is the exit status of the last command in the
925 pipeline, unless the <CODE>pipefail</CODE> option is enabled
926 (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
927 If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the
928 value of the last (rightmost) command to exit with a non-zero status,
929 or zero if all commands exit successfully.
930 If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the
931 exit status is the logical negation of the exit status as described
933 The shell waits for all commands in the pipeline to terminate before
940 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
941 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> < </A>]</TD>
942 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> > </A>]</TD>
943 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> << </A>]</TD>
944 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
945 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD>
946 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
947 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
948 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
949 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
951 <H3> 3.2.3 Lists of Commands </H3>
952 <!--docid::SEC18::-->
955 A <CODE>list</CODE> is a sequence of one or more pipelines separated by one
956 of the operators <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`&&'</SAMP>, or <SAMP>`||'</SAMP>,
957 and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&'</SAMP>, or a
958 <CODE>newline</CODE>.
961 Of these list operators, <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP>
962 have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&'</SAMP>,
963 which have equal precedence.
966 A sequence of one or more newlines may appear in a <CODE>list</CODE>
967 to delimit commands, equivalent to a semicolon.
970 If a command is terminated by the control operator <SAMP>`&'</SAMP>,
971 the shell executes the command asynchronously in a subshell.
972 This is known as executing the command in the <VAR>background</VAR>.
973 The shell does not wait for the command to finish, and the return
975 When job control is not active (see section <A HREF="bashref.html#SEC91">7. Job Control</A>),
976 the standard input for asynchronous commands, in the absence of any
977 explicit redirections, is redirected from <CODE>/dev/null</CODE>.
980 Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell
981 waits for each command to terminate in turn. The return status is the
982 exit status of the last command executed.
985 AND and OR lists are sequences of one or more pipelines
986 separated by the control operators <SAMP>`&&'</SAMP> and <SAMP>`||'</SAMP>,
987 respectively. AND and OR lists are executed with left
991 An AND list has the form
992 <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> && <VAR>command2</VAR>
993 </pre></td></tr></table></P><P>
995 <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
996 returns an exit status of zero.
999 An OR list has the form
1000 <TABLE><tr><td> </td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR>
1001 </pre></td></tr></table></P><P>
1003 <VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
1004 returns a non-zero exit status.
1007 The return status of
1008 AND and OR lists is the exit status of the last command
1009 executed in the list.
1012 <A NAME="Compound Commands"></A>
1014 <A NAME="SEC19"></A>
1015 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1016 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> < </A>]</TD>
1017 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> > </A>]</TD>
1018 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD>
1019 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1020 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1021 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1022 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1023 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1024 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1026 <H3> 3.2.4 Compound Commands </H3>
1027 <!--docid::SEC19::-->
1030 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1031 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for iterative action.</TD></TR>
1032 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Shell commands for conditional execution.</TD></TR>
1033 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Ways to group commands.</TD></TR>
1034 </TABLE></BLOCKQUOTE>
1037 Compound commands are the shell programming constructs.
1038 Each construct begins with a reserved word or control operator and is
1039 terminated by a corresponding reserved word or operator.
1040 Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with a compound command
1041 apply to all commands within that compound command unless explicitly overridden.
1044 Bash provides looping constructs, conditional commands, and mechanisms
1045 to group commands and execute them as a unit.
1048 <A NAME="Looping Constructs"></A>
1050 <A NAME="SEC20"></A>
1051 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1052 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> < </A>]</TD>
1053 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> > </A>]</TD>
1054 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD>
1055 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1056 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1057 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1058 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1059 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1060 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1062 <H4> 3.2.4.1 Looping Constructs </H4>
1063 <!--docid::SEC20::-->
1066 Bash supports the following looping constructs.
1069 Note that wherever a <SAMP>`;'</SAMP> appears in the description of a
1070 command's syntax, it may be replaced with one or more newlines.
1074 <DT><CODE>until</CODE>
1075 <DD><A NAME="IDX27"></A>
1076 <A NAME="IDX28"></A>
1077 <A NAME="IDX29"></A>
1078 The syntax of the <CODE>until</CODE> command is:
1079 <TABLE><tr><td> </td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1080 </pre></td></tr></table>Execute <VAR>consequent-commands</VAR> as long as
1081 <VAR>test-commands</VAR> has an exit status which is not zero.
1082 The return status is the exit status of the last command executed
1083 in <VAR>consequent-commands</VAR>, or zero if none was executed.
1086 <DT><CODE>while</CODE>
1087 <DD><A NAME="IDX30"></A>
1088 The syntax of the <CODE>while</CODE> command is:
1089 <TABLE><tr><td> </td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1090 </pre></td></tr></table><P>
1092 Execute <VAR>consequent-commands</VAR> as long as
1093 <VAR>test-commands</VAR> has an exit status of zero.
1094 The return status is the exit status of the last command executed
1095 in <VAR>consequent-commands</VAR>, or zero if none was executed.
1098 <DT><CODE>for</CODE>
1099 <DD><A NAME="IDX31"></A>
1100 The syntax of the <CODE>for</CODE> command is:
1103 <TABLE><tr><td> </td><td class=example><pre>for <VAR>name</VAR> [ [in [<VAR>words</VAR> <small>...</small>] ] ; ] do <VAR>commands</VAR>; done
1104 </pre></td></tr></table>Expand <VAR>words</VAR>, and execute <VAR>commands</VAR> once for each member
1105 in the resultant list, with <VAR>name</VAR> bound to the current member.
1106 If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command
1107 executes the <VAR>commands</VAR> once for each positional parameter that is
1108 set, as if <SAMP>`in "$@"'</SAMP> had been specified
1109 (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>).
1110 The return status is the exit status of the last command that executes.
1111 If there are no items in the expansion of <VAR>words</VAR>, no commands are
1112 executed, and the return status is zero.
1115 An alternate form of the <CODE>for</CODE> command is also supported:
1118 <TABLE><tr><td> </td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done
1119 </pre></td></tr></table>First, the arithmetic expression <VAR>expr1</VAR> is evaluated according
1120 to the rules described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
1121 The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly
1122 until it evaluates to zero.
1123 Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are
1124 executed and the arithmetic expression <VAR>expr3</VAR> is evaluated.
1125 If any expression is omitted, it behaves as if it evaluates to 1.
1126 The return value is the exit status of the last command in <VAR>list</VAR>
1127 that is executed, or false if any of the expressions is invalid.
1133 The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
1134 may be used to control loop execution.
1137 <A NAME="Conditional Constructs"></A>
1139 <A NAME="SEC21"></A>
1140 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1141 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> < </A>]</TD>
1142 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> > </A>]</TD>
1143 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> << </A>]</TD>
1144 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1145 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1146 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1147 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1148 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1149 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1151 <H4> 3.2.4.2 Conditional Constructs </H4>
1152 <!--docid::SEC21::-->
1157 <DD><A NAME="IDX32"></A>
1158 <A NAME="IDX33"></A>
1159 <A NAME="IDX34"></A>
1160 <A NAME="IDX35"></A>
1161 <A NAME="IDX36"></A>
1162 The syntax of the <CODE>if</CODE> command is:
1165 <TABLE><tr><td> </td><td class=example><pre>if <VAR>test-commands</VAR>; then
1166 <VAR>consequent-commands</VAR>;
1167 [elif <VAR>more-test-commands</VAR>; then
1168 <VAR>more-consequents</VAR>;]
1169 [else <VAR>alternate-consequents</VAR>;]
1171 </pre></td></tr></table></P><P>
1173 The <VAR>test-commands</VAR> list is executed, and if its return status is zero,
1174 the <VAR>consequent-commands</VAR> list is executed.
1175 If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list
1176 is executed in turn, and if its exit status is zero,
1177 the corresponding <VAR>more-consequents</VAR> is executed and the
1179 If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and
1180 the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause
1181 has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed.
1182 The return status is the exit status of the last command executed, or
1183 zero if no condition tested true.
1186 <DT><CODE>case</CODE>
1187 <DD><A NAME="IDX37"></A>
1188 <A NAME="IDX38"></A>
1189 <A NAME="IDX39"></A>
1190 The syntax of the <CODE>case</CODE> command is:
1193 <TABLE><tr><td> </td><td class=example><pre><CODE>case <VAR>word</VAR> in [ [(] <VAR>pattern</VAR> [| <VAR>pattern</VAR>]<small>...</small>) <VAR>command-list</VAR> ;;]<small>...</small> esac</CODE>
1194 </pre></td></tr></table></P><P>
1196 <CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to
1197 the first <VAR>pattern</VAR> that matches <VAR>word</VAR>.
1198 If the shell option <CODE>nocasematch</CODE>
1199 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1200 is enabled, the match is performed without regard to the case
1201 of alphabetic characters.
1202 The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP>
1203 operator terminates a pattern list.
1204 A list of patterns and an associated command-list is known
1205 as a <VAR>clause</VAR>.
1208 Each clause must be terminated with <SAMP>`;;'</SAMP>, <SAMP>`;&'</SAMP>, or <SAMP>`;;&'</SAMP>.
1209 The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command
1210 substitution, arithmetic expansion, and quote removal before matching is
1211 attempted. Each <VAR>pattern</VAR> undergoes tilde expansion, parameter
1212 expansion, command substitution, and arithmetic expansion.
1215 There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated
1216 by a <SAMP>`;;'</SAMP>, <SAMP>`;&'</SAMP>, or <SAMP>`;;&'</SAMP>.
1217 The first pattern that matches determines the
1218 command-list that is executed.
1221 Here is an example using <CODE>case</CODE> in a script that could be used to
1222 describe one interesting feature of an animal:
1225 <TABLE><tr><td> </td><td class=example><pre>echo -n "Enter the name of an animal: "
1227 echo -n "The $ANIMAL has "
1229 horse | dog | cat) echo -n "four";;
1230 man | kangaroo ) echo -n "two";;
1231 *) echo -n "an unknown number of";;
1234 </pre></td></tr></table></P><P>
1238 If the <SAMP>`;;'</SAMP> operator is used, no subsequent matches are attempted after
1239 the first pattern match.
1240 Using <SAMP>`;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes execution to continue with
1241 the <VAR>command-list</VAR> associated with the next clause, if any.
1242 Using <SAMP>`;;&'</SAMP> in place of <SAMP>`;;'</SAMP> causes the shell to test the patterns
1243 in the next clause, if any, and execute any associated <VAR>command-list</VAR>
1244 on a successful match.
1247 The return status is zero if no <VAR>pattern</VAR> is matched. Otherwise, the
1248 return status is the exit status of the <VAR>command-list</VAR> executed.
1251 <DT><CODE>select</CODE>
1252 <DD><A NAME="IDX40"></A>
1255 The <CODE>select</CODE> construct allows the easy generation of menus.
1256 It has almost the same syntax as the <CODE>for</CODE> command:
1259 <TABLE><tr><td> </td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done
1260 </pre></td></tr></table></P><P>
1262 The list of words following <CODE>in</CODE> is expanded, generating a list
1263 of items. The set of expanded words is printed on the standard
1264 error output stream, each preceded by a number. If the
1265 <SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed,
1266 as if <SAMP>`in "$@"'</SAMP> had been specified.
1267 The <CODE>PS3</CODE> prompt is then displayed and a line is read from the
1269 If the line consists of a number corresponding to one of the displayed
1270 words, then the value of <VAR>name</VAR> is set to that word.
1271 If the line is empty, the words and prompt are displayed again.
1272 If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes.
1273 Any other value read causes <VAR>name</VAR> to be set to null.
1274 The line read is saved in the variable <CODE>REPLY</CODE>.
1277 The <VAR>commands</VAR> are executed after each selection until a
1278 <CODE>break</CODE> command is executed, at which
1279 point the <CODE>select</CODE> command completes.
1282 Here is an example that allows the user to pick a filename from the
1283 current directory, and displays the name and index of the file
1287 <TABLE><tr><td> </td><td class=example><pre>select fname in *;
1289 echo you picked $fname \($REPLY\)
1292 </pre></td></tr></table></P><P>
1294 <DT><CODE>((<small>...</small>))</CODE>
1295 <DD><TABLE><tr><td> </td><td class=example><pre>(( <VAR>expression</VAR> ))
1296 </pre></td></tr></table><P>
1298 The arithmetic <VAR>expression</VAR> is evaluated according to the rules
1299 described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
1300 If the value of the expression is non-zero, the return status is 0;
1301 otherwise the return status is 1. This is exactly equivalent to
1302 <TABLE><tr><td> </td><td class=example><pre>let "<VAR>expression</VAR>"
1303 </pre></td></tr></table>See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a full description of the <CODE>let</CODE> builtin.
1306 <DT><CODE>[[<small>...</small>]]</CODE>
1307 <DD><A NAME="IDX41"></A>
1308 <A NAME="IDX42"></A>
1309 <TABLE><tr><td> </td><td class=example><pre>[[ <VAR>expression</VAR> ]]
1310 </pre></td></tr></table><P>
1312 Return a status of 0 or 1 depending on the evaluation of
1313 the conditional expression <VAR>expression</VAR>.
1314 Expressions are composed of the primaries described below in
1315 <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>.
1316 Word splitting and filename expansion are not performed on the words
1317 between the <SAMP>`[['</SAMP> and <SAMP>`]]'</SAMP>; tilde expansion, parameter and
1318 variable expansion, arithmetic expansion, command substitution, process
1319 substitution, and quote removal are performed.
1320 Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized
1324 When used with <SAMP>`[['</SAMP>, The <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators sort
1325 lexicographically using the current locale.
1328 When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the
1329 right of the operator is considered a pattern and matched according
1330 to the rules described below in <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>.
1331 If the shell option <CODE>nocasematch</CODE>
1332 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1333 is enabled, the match is performed without regard to the case
1334 of alphabetic characters.
1335 The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not
1336 match (<SAMP>`!='</SAMP>)the pattern, and 1 otherwise.
1337 Any part of the pattern may be quoted to force it to be matched as a
1341 An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same
1342 precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>.
1343 When it is used, the string to the right of the operator is considered
1344 an extended regular expression and matched accordingly (as in <I>regex</I>3)).
1345 The return value is 0 if the string matches
1346 the pattern, and 1 otherwise.
1347 If the regular expression is syntactically incorrect, the conditional
1348 expression's return value is 2.
1349 If the shell option <CODE>nocasematch</CODE>
1350 (see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1351 is enabled, the match is performed without regard to the case
1352 of alphabetic characters.
1353 Any part of the pattern may be quoted to force it to be matched as a
1355 Substrings matched by parenthesized subexpressions within the regular
1356 expression are saved in the array variable <CODE>BASH_REMATCH</CODE>.
1357 The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string
1358 matching the entire regular expression.
1359 The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the
1360 string matching the <VAR>n</VAR>th parenthesized subexpression.
1363 Expressions may be combined using the following operators, listed
1364 in decreasing order of precedence:
1368 <DT><CODE>( <VAR>expression</VAR> )</CODE>
1369 <DD>Returns the value of <VAR>expression</VAR>.
1370 This may be used to override the normal precedence of operators.
1373 <DT><CODE>! <VAR>expression</VAR></CODE>
1374 <DD>True if <VAR>expression</VAR> is false.
1377 <DT><CODE><VAR>expression1</VAR> && <VAR>expression2</VAR></CODE>
1378 <DD>True if both <VAR>expression1</VAR> and <VAR>expression2</VAR> are true.
1381 <DT><CODE><VAR>expression1</VAR> || <VAR>expression2</VAR></CODE>
1382 <DD>True if either <VAR>expression1</VAR> or <VAR>expression2</VAR> is true.
1384 The <CODE>&&</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the
1385 value of <VAR>expression1</VAR> is sufficient to determine the return
1386 value of the entire conditional expression.
1392 <A NAME="Command Grouping"></A>
1394 <A NAME="SEC22"></A>
1395 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1396 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> < </A>]</TD>
1397 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> > </A>]</TD>
1398 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> << </A>]</TD>
1399 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1400 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> >> </A>]</TD>
1401 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1402 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1403 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1404 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1406 <H4> 3.2.4.3 Grouping Commands </H4>
1407 <!--docid::SEC22::-->
1410 Bash provides two ways to group a list of commands to be executed
1411 as a unit. When commands are grouped, redirections may be applied
1412 to the entire command list. For example, the output of all the
1413 commands in the list may be redirected to a single stream.
1418 <DD><TABLE><tr><td> </td><td class=example><pre>( <VAR>list</VAR> )
1419 </pre></td></tr></table><P>
1421 Placing a list of commands between parentheses causes a subshell
1422 environment to be created (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and each
1423 of the commands in <VAR>list</VAR> to be executed in that subshell. Since the
1424 <VAR>list</VAR> is executed in a subshell, variable assignments do not remain in
1425 effect after the subshell completes.
1429 <DD><A NAME="IDX43"></A>
1430 <A NAME="IDX44"></A>
1431 <TABLE><tr><td> </td><td class=example><pre>{ <VAR>list</VAR>; }
1432 </pre></td></tr></table><P>
1434 Placing a list of commands between curly braces causes the list to
1435 be executed in the current shell context. No subshell is created.
1436 The semicolon (or newline) following <VAR>list</VAR> is required.
1440 In addition to the creation of a subshell, there is a subtle difference
1441 between these two constructs due to historical reasons. The braces
1442 are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR>
1443 by <CODE>blank</CODE>s or other shell metacharacters.
1444 The parentheses are <CODE>operators</CODE>, and are
1445 recognized as separate tokens by the shell even if they are not separated
1446 from the <VAR>list</VAR> by whitespace.
1449 The exit status of both of these constructs is the exit status of
1453 <A NAME="Coprocesses"></A>
1455 <A NAME="SEC23"></A>
1456 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1457 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> < </A>]</TD>
1458 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> > </A>]</TD>
1459 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> << </A>]</TD>
1460 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1461 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> >> </A>]</TD>
1462 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1463 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1464 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1465 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1467 <H3> 3.2.5 Coprocesses </H3>
1468 <!--docid::SEC23::-->
1471 A <CODE>coprocess</CODE> is a shell command preceded by the <CODE>coproc</CODE>
1473 A coprocess is executed asynchronously in a subshell, as if the command
1474 had been terminated with the <SAMP>`&'</SAMP> control operator, with a two-way pipe
1475 established between the executing shell and the coprocess.
1478 The format for a coprocess is:
1479 <TABLE><tr><td> </td><td class=example><pre><CODE>coproc</CODE> [<VAR>NAME</VAR>] <VAR>command</VAR> [<VAR>redirections</VAR>]
1480 </pre></td></tr></table></P><P>
1482 This creates a coprocess named <VAR>NAME</VAR>.
1483 If <VAR>NAME</VAR> is not supplied, the default name is <VAR>COPROC</VAR>.
1484 <VAR>NAME</VAR> must not be supplied if <VAR>command</VAR> is a simple
1485 command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>); otherwise, it is interpreted as
1486 the first word of the simple command.
1489 When the coproc is executed, the shell creates an array variable
1490 (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
1491 named <VAR>NAME</VAR> in the context of the executing shell.
1492 The standard output of <VAR>command</VAR>
1493 is connected via a pipe to a file descriptor in the executing shell,
1494 and that file descriptor is assigned to <VAR>NAME</VAR>[0].
1495 The standard input of <VAR>command</VAR>
1496 is connected via a pipe to a file descriptor in the executing shell,
1497 and that file descriptor is assigned to <VAR>NAME</VAR>[1].
1498 This pipe is established before any redirections specified by the
1499 command (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
1500 The file descriptors can be utilized as arguments to shell commands
1501 and redirections using standard word expansions.
1504 The process id of the shell spawned to execute the coprocess is
1505 available as the value of the variable <VAR>NAME</VAR>_PID.
1506 The <CODE>wait</CODE>
1507 builtin command may be used to wait for the coprocess to terminate.
1510 The return status of a coprocess is the exit status of <VAR>command</VAR>.
1513 <A NAME="Shell Functions"></A>
1515 <A NAME="SEC24"></A>
1516 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1517 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> < </A>]</TD>
1518 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> > </A>]</TD>
1519 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> << </A>]</TD>
1520 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1521 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
1522 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1523 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1524 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1525 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1527 <H2> 3.3 Shell Functions </H2>
1528 <!--docid::SEC24::-->
1531 Shell functions are a way to group commands for later execution
1532 using a single name for the group. They are executed just like
1533 a "regular" command.
1534 When the name of a shell function is used as a simple command name,
1535 the list of commands associated with that function name is executed.
1536 Shell functions are executed in the current
1537 shell context; no new process is created to interpret them.
1540 Functions are declared using this syntax:
1541 <A NAME="IDX45"></A>
1542 <TABLE><tr><td> </td><td class=example><pre>[ <CODE>function</CODE> ] <VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ]
1543 </pre></td></tr></table></P><P>
1545 This defines a shell function named <VAR>name</VAR>. The reserved
1546 word <CODE>function</CODE> is optional.
1547 If the <CODE>function</CODE> reserved
1548 word is supplied, the parentheses are optional.
1549 The <VAR>body</VAR> of the function is the compound command
1550 <VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>).
1551 That command is usually a <VAR>list</VAR> enclosed between { and }, but
1552 may be any compound command listed above.
1553 <VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the
1555 Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with the shell function
1556 are performed when the function is executed.
1559 A function definition may be deleted using the <SAMP>`-f'</SAMP> option to the
1560 <CODE>unset</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
1563 The exit status of a function definition is zero unless a syntax error
1564 occurs or a readonly function with the same name already exists.
1565 When executed, the exit status of a function is the exit status of the
1566 last command executed in the body.
1569 Note that for historical reasons, in the most common usage the curly braces
1570 that surround the body of the function must be separated from the body by
1571 <CODE>blank</CODE>s or newlines.
1572 This is because the braces are reserved words and are only recognized
1573 as such when they are separated from the command list
1574 by whitespace or another shell metacharacter.
1575 Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon,
1576 a <SAMP>`&'</SAMP>, or a newline.
1579 When a function is executed, the arguments to the
1580 function become the positional parameters
1581 during its execution (see section <A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>).
1582 The special parameter <SAMP>`#'</SAMP> that expands to the number of
1583 positional parameters is updated to reflect the change.
1584 Special parameter <CODE>0</CODE> is unchanged.
1585 The first element of the <CODE>FUNCNAME</CODE> variable is set to the
1586 name of the function while the function is executing.
1589 All other aspects of the shell execution
1590 environment are identical between a function and its caller
1591 with these exceptions:
1592 the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps
1593 are not inherited unless the function has been given the
1594 <CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or
1595 the <CODE>-o functrace</CODE> option has been enabled with
1596 the <CODE>set</CODE> builtin,
1597 (in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps),
1598 and the <CODE>ERR</CODE> trap is not inherited unless the <CODE>-o errtrace</CODE>
1599 shell option has been enabled.
1600 See section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>, for the description of the
1601 <CODE>trap</CODE> builtin.
1604 If the builtin command <CODE>return</CODE>
1605 is executed in a function, the function completes and
1606 execution resumes with the next command after the function
1608 Any command associated with the <CODE>RETURN</CODE> trap is executed
1609 before execution resumes.
1610 When a function completes, the values of the
1611 positional parameters and the special parameter <SAMP>`#'</SAMP>
1612 are restored to the values they had prior to the function's
1613 execution. If a numeric argument is given to <CODE>return</CODE>,
1614 that is the function's return status; otherwise the function's
1615 return status is the exit status of the last command executed
1616 before the <CODE>return</CODE>.
1619 Variables local to the function may be declared with the
1620 <CODE>local</CODE> builtin. These variables are visible only to
1621 the function and the commands it invokes.
1624 Function names and definitions may be listed with the
1625 <SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> or <CODE>typeset</CODE>
1626 builtin commands (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
1627 The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE>
1628 will list the function names only
1629 (and optionally the source file and line number, if the <CODE>extdebug</CODE>
1630 shell option is enabled).
1631 Functions may be exported so that subshells
1632 automatically have them defined with the
1633 <SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin
1634 (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
1635 Note that shell functions and variables with the same name may result
1636 in multiple identically-named entries in the environment passed to the
1638 Care should be taken in cases where this may cause a problem.
1641 Functions may be recursive. No limit is placed on the number of
1645 <A NAME="Shell Parameters"></A>
1647 <A NAME="SEC25"></A>
1648 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1649 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> < </A>]</TD>
1650 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> > </A>]</TD>
1651 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD>
1652 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1653 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD>
1654 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1655 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1656 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1657 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1659 <H2> 3.4 Shell Parameters </H2>
1660 <!--docid::SEC25::-->
1663 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1664 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR>
1665 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR>
1666 </TABLE></BLOCKQUOTE>
1669 A <VAR>parameter</VAR> is an entity that stores values.
1670 It can be a <CODE>name</CODE>, a number, or one of the special characters
1672 A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>.
1673 A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>.
1674 Attributes are assigned using the <CODE>declare</CODE> builtin command
1675 (see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
1678 A parameter is set if it has been assigned a value. The null string is
1679 a valid value. Once a variable is set, it may be unset only by using
1680 the <CODE>unset</CODE> builtin command.
1683 A variable may be assigned to by a statement of the form
1684 <TABLE><tr><td> </td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>]
1685 </pre></td></tr></table>If <VAR>value</VAR>
1686 is not given, the variable is assigned the null string. All
1687 <VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion,
1688 command substitution, arithmetic expansion, and quote
1689 removal (detailed below). If the variable has its <CODE>integer</CODE>
1690 attribute set, then <VAR>value</VAR>
1691 is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE>
1692 expansion is not used (see section <A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>).
1693 Word splitting is not performed, with the exception
1694 of <CODE>"$@"</CODE> as explained below.
1695 Filename expansion is not performed.
1696 Assignment statements may also appear as arguments to the
1698 <CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>,
1699 and <CODE>local</CODE> builtin commands.
1702 In the context where an assignment statement is assigning a value
1703 to a shell variable or array index (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the <SAMP>`+='</SAMP>
1704 operator can be used to
1705 append to or add to the variable's previous value.
1706 When <SAMP>`+='</SAMP> is applied to a variable for which the integer attribute
1707 has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and
1708 added to the variable's current value, which is also evaluated.
1709 When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment
1710 (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the
1711 variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new
1712 values are appended to the array beginning at one greater than the array's
1713 maximum index (for indexed arrays), or added as additional key-value pairs
1714 in an associative array.
1715 When applied to a string-valued variable, <VAR>value</VAR> is expanded and
1716 appended to the variable's value.
1719 <A NAME="Positional Parameters"></A>
1721 <A NAME="SEC26"></A>
1722 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1723 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> < </A>]</TD>
1724 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> > </A>]</TD>
1725 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD>
1726 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD>
1727 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD>
1728 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1729 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1730 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1731 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1733 <H3> 3.4.1 Positional Parameters </H3>
1734 <!--docid::SEC26::-->
1737 A <VAR>positional parameter</VAR> is a parameter denoted by one or more
1738 digits, other than the single digit <CODE>0</CODE>. Positional parameters are
1739 assigned from the shell's arguments when it is invoked,
1740 and may be reassigned using the <CODE>set</CODE> builtin command.
1741 Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or
1742 as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit.
1743 Positional parameters may not be assigned to with assignment statements.
1744 The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and
1745 unset them (see section <A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>).
1746 The positional parameters are
1747 temporarily replaced when a shell function is executed
1748 (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
1751 When a positional parameter consisting of more than a single
1752 digit is expanded, it must be enclosed in braces.
1755 <A NAME="Special Parameters"></A>
1757 <A NAME="SEC27"></A>
1758 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1759 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> < </A>]</TD>
1760 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> > </A>]</TD>
1761 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> << </A>]</TD>
1762 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD>
1763 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> >> </A>]</TD>
1764 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1765 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1766 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1767 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1769 <H3> 3.4.2 Special Parameters </H3>
1770 <!--docid::SEC27::-->
1773 The shell treats several parameters specially. These parameters may
1774 only be referenced; assignment to them is not allowed.
1779 <A NAME="IDX46"></A>
1781 <DD><A NAME="IDX47"></A>
1782 Expands to the positional parameters, starting from one. When the
1783 expansion occurs within double quotes, it expands to a single word
1784 with the value of each parameter separated by the first character
1785 of the <CODE>IFS</CODE>
1786 special variable. That is, <CODE>"$*"</CODE> is equivalent
1787 to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR>
1788 is the first character of the value of the <CODE>IFS</CODE>
1790 If <CODE>IFS</CODE> is unset, the parameters are separated by spaces.
1791 If <CODE>IFS</CODE> is null, the parameters are joined without intervening
1795 <A NAME="IDX48"></A>
1797 <DD><A NAME="IDX49"></A>
1798 Expands to the positional parameters, starting from one. When the
1799 expansion occurs within double quotes, each parameter expands to a
1800 separate word. That is, <CODE>"$@"</CODE> is equivalent to
1801 <CODE>"$1" "$2" <small>...</small></CODE>.
1802 If the double-quoted expansion occurs within a word, the expansion of
1803 the first parameter is joined with the beginning part of the original
1804 word, and the expansion of the last parameter is joined with the last
1805 part of the original word.
1806 When there are no positional parameters, <CODE>"$@"</CODE> and
1808 expand to nothing (i.e., they are removed).
1811 <A NAME="IDX50"></A>
1813 <DD><A NAME="IDX51"></A>
1814 Expands to the number of positional parameters in decimal.
1817 <A NAME="IDX52"></A>
1819 <DD><A NAME="IDX53"></A>
1820 Expands to the exit status of the most recently executed foreground
1824 <A NAME="IDX54"></A>
1826 <DD><A NAME="IDX55"></A>
1827 (A hyphen.) Expands to the current option flags as specified upon
1828 invocation, by the <CODE>set</CODE>
1829 builtin command, or those set by the shell itself
1830 (such as the <SAMP>`-i'</SAMP> option).
1833 <A NAME="IDX56"></A>
1835 <DD><A NAME="IDX57"></A>
1836 Expands to the process ID of the shell. In a <CODE>()</CODE> subshell, it
1837 expands to the process ID of the invoking shell, not the subshell.
1840 <A NAME="IDX58"></A>
1842 <DD><A NAME="IDX59"></A>
1843 Expands to the process ID of the most recently executed background
1844 (asynchronous) command.
1847 <A NAME="IDX60"></A>
1849 <DD><A NAME="IDX61"></A>
1850 Expands to the name of the shell or shell script. This is set at
1851 shell initialization. If Bash is invoked with a file of commands
1852 (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file.
1853 If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>),
1854 then <CODE>$0</CODE> is set to the first argument after the string to be
1855 executed, if one is present. Otherwise, it is set
1856 to the filename used to invoke Bash, as given by argument zero.
1859 <A NAME="IDX62"></A>
1861 <DD><A NAME="IDX63"></A>
1863 At shell startup, set to the absolute pathname used to invoke the
1864 shell or shell script being executed as passed in the environment
1866 Subsequently, expands to the last argument to the previous command,
1868 Also set to the full pathname used to invoke each command executed
1869 and placed in the environment exported to that command.
1870 When checking mail, this parameter holds the name of the mail file.
1874 <A NAME="Shell Expansions"></A>
1876 <A NAME="SEC28"></A>
1877 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1878 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> < </A>]</TD>
1879 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> > </A>]</TD>
1880 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD>
1881 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1882 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
1883 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1884 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1885 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1886 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1888 <H2> 3.5 Shell Expansions </H2>
1889 <!--docid::SEC28::-->
1892 Expansion is performed on the command line after it has been split into
1893 <CODE>token</CODE>s. There are seven kinds of expansion performed:
1897 <LI>parameter and variable expansion
1898 <LI>command substitution
1899 <LI>arithmetic expansion
1901 <LI>filename expansion
1905 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1906 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR>
1907 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR>
1908 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR>
1909 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Using the output of a command as an argument.</TD></TR>
1910 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR>
1911 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a
1913 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the results of expansion are split into separate
1914 arguments.</TD></TR>
1915 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A shorthand for specifying filenames matching patterns.</TD></TR>
1916 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How and when quote characters are removed from
1918 </TABLE></BLOCKQUOTE>
1921 The order of expansions is: brace expansion, tilde expansion,
1922 parameter, variable, and arithmetic expansion and
1923 command substitution
1924 (done in a left-to-right fashion), word splitting, and filename
1928 On systems that can support it, there is an additional expansion
1929 available: <VAR>process substitution</VAR>. This is performed at the
1930 same time as parameter, variable, and arithmetic expansion and
1931 command substitution.
1934 Only brace expansion, word splitting, and filename expansion
1935 can change the number of words of the expansion; other expansions
1936 expand a single word to a single word.
1937 The only exceptions to this are the expansions of
1938 <CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE>
1939 (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
1942 After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>)
1946 <A NAME="Brace Expansion"></A>
1948 <A NAME="SEC29"></A>
1949 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1950 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> < </A>]</TD>
1951 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> > </A>]</TD>
1952 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD>
1953 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
1954 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
1955 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1956 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1957 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1958 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1960 <H3> 3.5.1 Brace Expansion </H3>
1961 <!--docid::SEC29::-->
1964 Brace expansion is a mechanism by which arbitrary strings may be generated.
1965 This mechanism is similar to
1966 <VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>),
1967 but the file names generated need not exist.
1968 Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>,
1969 followed by either a series of comma-separated strings or a seqeunce expression
1970 between a pair of braces,
1971 followed by an optional <VAR>postscript</VAR>.
1972 The preamble is prefixed to each string contained within the braces, and
1973 the postscript is then appended to each resulting string, expanding left
1977 Brace expansions may be nested.
1978 The results of each expanded string are not sorted; left to right order
1981 <TABLE><tr><td> </td><td class=example><pre>bash$ echo a{d,c,b}e
1983 </pre></td></tr></table></P><P>
1985 A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>[..<VAR>incr</VAR>]}</CODE>,
1986 where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters,
1987 and <VAR>incr</VAR>, an optional increment, is an integer.
1988 When integers are supplied, the expression expands to each number between
1989 <VAR>x</VAR> and <VAR>y</VAR>, inclusive.
1990 Supplied integers may be prefixed with <SAMP>`0'</SAMP> to force each term to have the
1991 same width. When either <VAR>x</VAR> or <VAR>y</VAR> begins with a zero, the shell
1992 attempts to force all generated terms to contain the same number of digits,
1993 zero-padding where necessary.
1994 When characters are supplied, the expression expands to each character
1995 lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive. Note that
1996 both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type.
1997 When the increment is supplied, it is used as the difference between
1998 each term. The default increment is 1 or -1 as appropriate.
2001 Brace expansion is performed before any other expansions,
2002 and any characters special to other expansions are preserved
2003 in the result. It is strictly textual. Bash
2004 does not apply any syntactic interpretation to the context of the
2005 expansion or the text between the braces.
2006 To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2007 is not considered eligible for brace expansion.
2010 A correctly-formed brace expansion must contain unquoted opening
2011 and closing braces, and at least one unquoted comma or a valid
2012 sequence expression.
2013 Any incorrectly formed brace expansion is left unchanged.
2016 A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its
2017 being considered part of a brace expression.
2018 To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2019 is not considered eligible for brace expansion.
2022 This construct is typically used as shorthand when the common
2023 prefix of the strings to be generated is longer than in the
2025 <TABLE><tr><td> </td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs}
2026 </pre></td></tr></table>or
2027 <TABLE><tr><td> </td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
2028 </pre></td></tr></table></P><P>
2030 <A NAME="Tilde Expansion"></A>
2032 <A NAME="SEC30"></A>
2033 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2034 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> < </A>]</TD>
2035 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> > </A>]</TD>
2036 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> << </A>]</TD>
2037 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2038 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2039 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2040 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2041 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2042 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2044 <H3> 3.5.2 Tilde Expansion </H3>
2045 <!--docid::SEC30::-->
2048 If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the
2049 characters up to the first unquoted slash (or all characters,
2050 if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>.
2051 If none of the characters in the tilde-prefix are quoted, the
2052 characters in the tilde-prefix following the tilde are treated as a
2053 possible <VAR>login name</VAR>.
2054 If this login name is the null string, the tilde is replaced with the
2055 value of the <CODE>HOME</CODE> shell variable.
2056 If <CODE>HOME</CODE> is unset, the home directory of the user executing the
2057 shell is substituted instead.
2058 Otherwise, the tilde-prefix is replaced with the home directory
2059 associated with the specified login name.
2062 If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of
2063 the shell variable <CODE>PWD</CODE> replaces the tilde-prefix.
2064 If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable
2065 <CODE>OLDPWD</CODE>, if it is set, is substituted.
2068 If the characters following the tilde in the tilde-prefix consist of a
2069 number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>,
2070 the tilde-prefix is replaced with the
2071 corresponding element from the directory stack, as it would be displayed
2072 by the <CODE>dirs</CODE> builtin invoked with the characters following tilde
2073 in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
2074 If the tilde-prefix, sans the tilde, consists of a number without a
2075 leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed.
2078 If the login name is invalid, or the tilde expansion fails, the word is
2082 Each variable assignment is checked for unquoted tilde-prefixes immediately
2083 following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>.
2084 In these cases, tilde expansion is also performed.
2085 Consequently, one may use file names with tildes in assignments to
2086 <CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>,
2087 and the shell assigns the expanded value.
2090 The following table shows how Bash treats unquoted tilde-prefixes:
2095 <DD>The value of <CODE>$HOME</CODE>
2096 <DT><CODE>~/foo</CODE>
2097 <DD><TT>`$HOME/foo'</TT>
2100 <DT><CODE>~fred/foo</CODE>
2101 <DD>The subdirectory <CODE>foo</CODE> of the home directory of the user
2105 <DT><CODE>~+/foo</CODE>
2106 <DD><TT>`$PWD/foo'</TT>
2109 <DT><CODE>~-/foo</CODE>
2110 <DD><TT>`${OLDPWD-'~-'}/foo'</TT>
2113 <DT><CODE>~<VAR>N</VAR></CODE>
2114 <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2117 <DT><CODE>~+<VAR>N</VAR></CODE>
2118 <DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2121 <DT><CODE>~-<VAR>N</VAR></CODE>
2122 <DD>The string that would be displayed by <SAMP>`dirs -<VAR>N</VAR>'</SAMP>
2128 <A NAME="Shell Parameter Expansion"></A>
2130 <A NAME="SEC31"></A>
2131 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2132 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> < </A>]</TD>
2133 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> > </A>]</TD>
2134 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> << </A>]</TD>
2135 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2136 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2137 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2138 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2139 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2140 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2142 <H3> 3.5.3 Shell Parameter Expansion </H3>
2143 <!--docid::SEC31::-->
2146 The <SAMP>`$'</SAMP> character introduces parameter expansion,
2147 command substitution, or arithmetic expansion. The parameter name
2148 or symbol to be expanded may be enclosed in braces, which
2149 are optional but serve to protect the variable to be expanded from
2150 characters immediately following it which could be
2151 interpreted as part of the name.
2154 When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP>
2155 not escaped by a backslash or within a quoted string, and not within an
2156 embedded arithmetic expansion, command substitution, or parameter
2160 The basic form of parameter expansion is ${<VAR>parameter</VAR>}.
2161 The value of <VAR>parameter</VAR> is substituted. The braces are required
2162 when <VAR>parameter</VAR>
2163 is a positional parameter with more than one digit,
2164 or when <VAR>parameter</VAR>
2165 is followed by a character that is not to be
2166 interpreted as part of its name.
2169 If the first character of <VAR>parameter</VAR> is an exclamation point (!),
2170 a level of variable indirection is introduced.
2171 Bash uses the value of the variable formed from the rest of
2172 <VAR>parameter</VAR> as the name of the variable; this variable is then
2173 expanded and that value is used in the rest of the substitution, rather
2174 than the value of <VAR>parameter</VAR> itself.
2175 This is known as <CODE>indirect expansion</CODE>.
2176 The exceptions to this are the expansions of ${!<VAR>prefix*</VAR>}
2177 and ${!<VAR>name</VAR>[@]}
2179 The exclamation point must immediately follow the left brace in order to
2180 introduce indirection.
2183 In each of the cases below, <VAR>word</VAR> is subject to tilde expansion,
2184 parameter expansion, command substitution, and arithmetic expansion.
2187 When not performing substring expansion, using the form described
2188 below, Bash tests for a parameter that is unset or null.
2189 Omitting the colon results in a test only for a parameter that is unset.
2190 Put another way, if the colon is included,
2191 the operator tests for both <VAR>parameter</VAR>'s existence and that its value
2192 is not null; if the colon is omitted, the operator tests only for existence.
2197 <DT><CODE>${<VAR>parameter</VAR>:-<VAR>word</VAR>}</CODE>
2198 <DD>If <VAR>parameter</VAR> is unset or null, the expansion of
2199 <VAR>word</VAR> is substituted. Otherwise, the value of
2200 <VAR>parameter</VAR> is substituted.
2203 <DT><CODE>${<VAR>parameter</VAR>:=<VAR>word</VAR>}</CODE>
2204 <DD>If <VAR>parameter</VAR>
2205 is unset or null, the expansion of <VAR>word</VAR>
2206 is assigned to <VAR>parameter</VAR>.
2207 The value of <VAR>parameter</VAR> is then substituted.
2208 Positional parameters and special parameters may not be assigned to
2212 <DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE>
2213 <DD>If <VAR>parameter</VAR>
2214 is null or unset, the expansion of <VAR>word</VAR> (or a message
2215 to that effect if <VAR>word</VAR>
2216 is not present) is written to the standard error and the shell, if it
2217 is not interactive, exits. Otherwise, the value of <VAR>parameter</VAR> is
2221 <DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE>
2222 <DD>If <VAR>parameter</VAR>
2223 is null or unset, nothing is substituted, otherwise the expansion of
2224 <VAR>word</VAR> is substituted.
2227 <DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>}</CODE>
2228 <DD><DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>:<VAR>length</VAR>}</CODE>
2229 <DD>Expands to up to <VAR>length</VAR> characters of <VAR>parameter</VAR>
2230 starting at the character specified by <VAR>offset</VAR>.
2231 If <VAR>length</VAR> is omitted, expands to the substring of
2232 <VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>.
2233 <VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions
2234 (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
2235 This is referred to as Substring Expansion.
2238 <VAR>length</VAR> must evaluate to a number greater than or equal to zero.
2239 If <VAR>offset</VAR> evaluates to a number less than zero, the value
2240 is used as an offset from the end of the value of <VAR>parameter</VAR>.
2241 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional
2242 parameters beginning at <VAR>offset</VAR>.
2243 If <VAR>parameter</VAR> is an indexed array name subscripted
2244 by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the result is the <VAR>length</VAR>
2245 members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>.
2246 A negative <VAR>offset</VAR> is taken relative to one greater than the maximum
2247 index of the specified array.
2248 Substring expansion applied to an associative array produces undefined
2252 Note that a negative offset must be separated from the colon by at least
2253 one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion.
2254 Substring indexing is zero-based unless the positional parameters
2255 are used, in which case the indexing starts at 1 by default.
2256 If <VAR>offset</VAR> is 0, and the positional parameters are used, <CODE>$@</CODE> is
2257 prefixed to the list.
2260 <DT><CODE>${!<VAR>prefix</VAR>*}</CODE>
2261 <DD><DT><CODE>${!<VAR>prefix</VAR>@}</CODE>
2262 <DD>Expands to the names of variables whose names begin with <VAR>prefix</VAR>,
2263 separated by the first character of the <CODE>IFS</CODE> special variable.
2264 When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2265 variable name expands to a separate word.
2268 <DT><CODE>${!<VAR>name</VAR>[@]}</CODE>
2269 <DD><DT><CODE>${!<VAR>name</VAR>[*]}</CODE>
2270 <DD>If <VAR>name</VAR> is an array variable, expands to the list of array indices
2271 (keys) assigned in <VAR>name</VAR>.
2272 If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null
2274 When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2275 key expands to a separate word.
2278 <DT><CODE>${#<VAR>parameter</VAR>}</CODE>
2279 <DD>The length in characters of the expanded value of <VAR>parameter</VAR> is
2281 If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted
2282 is the number of positional parameters.
2283 If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>,
2284 the value substituted is the number of elements in the array.
2287 <DT><CODE>${<VAR>parameter</VAR>#<VAR>word</VAR>}</CODE>
2288 <DD><DT><CODE>${<VAR>parameter</VAR>##<VAR>word</VAR>}</CODE>
2289 <DD>The <VAR>word</VAR>
2290 is expanded to produce a pattern just as in filename
2291 expansion (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). If the pattern matches
2292 the beginning of the expanded value of <VAR>parameter</VAR>,
2293 then the result of the expansion is the expanded value of <VAR>parameter</VAR>
2294 with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the
2295 longest matching pattern (the <SAMP>`##'</SAMP> case) deleted.
2296 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2297 the pattern removal operation is applied to each positional
2298 parameter in turn, and the expansion is the resultant list.
2299 If <VAR>parameter</VAR> is an array variable subscripted with
2300 <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2301 the pattern removal operation is applied to each member of the
2302 array in turn, and the expansion is the resultant list.
2305 <DT><CODE>${<VAR>parameter</VAR>%<VAR>word</VAR>}</CODE>
2306 <DD><DT><CODE>${<VAR>parameter</VAR>%%<VAR>word</VAR>}</CODE>
2307 <DD>The <VAR>word</VAR> is expanded to produce a pattern just as in
2309 If the pattern matches a trailing portion of the expanded value of
2310 <VAR>parameter</VAR>, then the result of the expansion is the value of
2311 <VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case)
2312 or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted.
2313 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2314 the pattern removal operation is applied to each positional
2315 parameter in turn, and the expansion is the resultant list.
2316 If <VAR>parameter</VAR>
2317 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2318 the pattern removal operation is applied to each member of the
2319 array in turn, and the expansion is the resultant list.
2322 <DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE>
2325 The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2327 <VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR>
2328 against its value is replaced with <VAR>string</VAR>.
2329 If <VAR>pattern</VAR> begins with <SAMP>`/'</SAMP>, all matches of <VAR>pattern</VAR> are
2330 replaced with <VAR>string</VAR>. Normally only the first match is replaced.
2331 If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning
2332 of the expanded value of <VAR>parameter</VAR>.
2333 If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end
2334 of the expanded value of <VAR>parameter</VAR>.
2335 If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted
2336 and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted.
2337 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2338 the substitution operation is applied to each positional
2339 parameter in turn, and the expansion is the resultant list.
2340 If <VAR>parameter</VAR>
2341 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2342 the substitution operation is applied to each member of the
2343 array in turn, and the expansion is the resultant list.
2346 <DT><CODE>${<VAR>parameter</VAR>^<VAR>pattern</VAR>}</CODE>
2347 <DD><DT><CODE>${<VAR>parameter</VAR>^^<VAR>pattern</VAR>}</CODE>
2348 <DD><DT><CODE>${<VAR>parameter</VAR>,<VAR>pattern</VAR>}</CODE>
2349 <DD><DT><CODE>${<VAR>parameter</VAR>,,<VAR>pattern</VAR>}</CODE>
2350 <DD>This expansion modifies the case of alphabetic characters in <VAR>parameter</VAR>.
2351 The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2353 The <SAMP>`^'</SAMP> operator converts lowercase letters matching <VAR>pattern</VAR>
2354 to uppercase; the <SAMP>`,'</SAMP> operator converts matching uppercase letters
2356 The <SAMP>`^^'</SAMP> and <SAMP>`,,'</SAMP> expansions convert each matched character in the
2357 expanded value; the <SAMP>`^'</SAMP> and <SAMP>`,'</SAMP> expansions match and convert only
2358 the first character in the expanded value.
2359 If <VAR>pattern</VAR> is omitted, it is treated like a <SAMP>`?'</SAMP>, which matches
2361 If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2362 the case modification operation is applied to each positional
2363 parameter in turn, and the expansion is the resultant list.
2364 If <VAR>parameter</VAR>
2365 is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2366 the case modification operation is applied to each member of the
2367 array in turn, and the expansion is the resultant list.
2373 <A NAME="Command Substitution"></A>
2375 <A NAME="SEC32"></A>
2376 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2377 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> < </A>]</TD>
2378 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> > </A>]</TD>
2379 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> << </A>]</TD>
2380 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2382 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2383 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2387 <H3> 3.5.4 Command Substitution </H3>
2388 <!--docid::SEC32::-->
2391 Command substitution allows the output of a command to replace
2393 Command substitution occurs when a command is enclosed as follows:
2394 <TABLE><tr><td> </td><td class=example><pre>$(<VAR>command</VAR>)
2395 </pre></td></tr></table>or
2396 <TABLE><tr><td> </td><td class=example><pre>`<VAR>command</VAR>`
2397 </pre></td></tr></table></P><P>
2399 Bash performs the expansion by executing <VAR>command</VAR> and
2400 replacing the command substitution with the standard output of the
2401 command, with any trailing newlines deleted.
2402 Embedded newlines are not deleted, but they may be removed during
2404 The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be
2405 replaced by the equivalent but faster <CODE>$(< <VAR>file</VAR>)</CODE>.
2408 When the old-style backquote form of substitution is used,
2409 backslash retains its literal meaning except when followed by
2410 <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>.
2411 The first backquote not preceded by a backslash terminates the
2412 command substitution.
2413 When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between
2414 the parentheses make up the command; none are treated specially.
2417 Command substitutions may be nested. To nest when using the backquoted
2418 form, escape the inner backquotes with backslashes.
2421 If the substitution appears within double quotes, word splitting and
2422 filename expansion are not performed on the results.
2425 <A NAME="Arithmetic Expansion"></A>
2427 <A NAME="SEC33"></A>
2428 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2429 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> < </A>]</TD>
2430 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> > </A>]</TD>
2431 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> << </A>]</TD>
2432 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2433 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2434 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2435 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2436 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2437 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2439 <H3> 3.5.5 Arithmetic Expansion </H3>
2440 <!--docid::SEC33::-->
2443 Arithmetic expansion allows the evaluation of an arithmetic expression
2444 and the substitution of the result. The format for arithmetic expansion is:
2447 <TABLE><tr><td> </td><td class=example><pre>$(( <VAR>expression</VAR> ))
2448 </pre></td></tr></table></P><P>
2450 The expression is treated as if it were within double quotes, but
2451 a double quote inside the parentheses is not treated specially.
2452 All tokens in the expression undergo parameter expansion, command
2453 substitution, and quote removal.
2454 Arithmetic expansions may be nested.
2457 The evaluation is performed according to the rules listed below
2458 (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
2459 If the expression is invalid, Bash prints a message indicating
2460 failure to the standard error and no substitution occurs.
2463 <A NAME="Process Substitution"></A>
2465 <A NAME="SEC34"></A>
2466 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2467 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> < </A>]</TD>
2468 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> > </A>]</TD>
2469 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> << </A>]</TD>
2470 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2471 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2472 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2473 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2474 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2475 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2477 <H3> 3.5.6 Process Substitution </H3>
2478 <!--docid::SEC34::-->
2481 Process substitution is supported on systems that support named
2482 pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files.
2483 It takes the form of
2484 <TABLE><tr><td> </td><td class=example><pre><(<VAR>list</VAR>)
2485 </pre></td></tr></table>or
2486 <TABLE><tr><td> </td><td class=example><pre>>(<VAR>list</VAR>)
2487 </pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a
2488 FIFO or some file in <TT>`/dev/fd'</TT>. The name of this file is
2489 passed as an argument to the current command as the result of the
2490 expansion. If the <CODE>>(<VAR>list</VAR>)</CODE> form is used, writing to
2491 the file will provide input for <VAR>list</VAR>. If the
2492 <CODE><(<VAR>list</VAR>)</CODE> form is used, the file passed as an
2493 argument should be read to obtain the output of <VAR>list</VAR>.
2494 Note that no space may appear between the <CODE><</CODE> or <CODE>></CODE>
2495 and the left parenthesis, otherwise the construct would be interpreted
2499 When available, process substitution is performed simultaneously with
2500 parameter and variable expansion, command substitution, and arithmetic
2504 <A NAME="Word Splitting"></A>
2506 <A NAME="SEC35"></A>
2507 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2508 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> < </A>]</TD>
2509 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> > </A>]</TD>
2510 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> << </A>]</TD>
2511 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2512 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2513 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2514 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2515 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2516 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2518 <H3> 3.5.7 Word Splitting </H3>
2519 <!--docid::SEC35::-->
2522 The shell scans the results of parameter expansion, command substitution,
2523 and arithmetic expansion that did not occur within double quotes for
2527 The shell treats each character of <CODE>$IFS</CODE> as a delimiter, and splits
2528 the results of the other expansions into words on these characters.
2529 If <CODE>IFS</CODE> is unset, or its value is exactly <CODE><space><tab><newline></CODE>,
2530 the default, then sequences of
2531 <CODE> <space></CODE>, <CODE><tab></CODE>, and <CODE><newline></CODE>
2532 at the beginning and end of the results of the previous
2533 expansions are ignored, and any sequence of <CODE>IFS</CODE>
2534 characters not at the beginning or end serves to delimit words.
2535 If <CODE>IFS</CODE> has a value other than the default, then sequences of
2536 the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE>
2537 are ignored at the beginning and end of the
2538 word, as long as the whitespace character is in the
2539 value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character).
2540 Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE>
2541 whitespace, along with any adjacent <CODE>IFS</CODE>
2542 whitespace characters, delimits a field. A sequence of <CODE>IFS</CODE>
2543 whitespace characters is also treated as a delimiter.
2544 If the value of <CODE>IFS</CODE> is null, no word splitting occurs.
2547 Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained.
2548 Unquoted implicit null arguments, resulting from the expansion of
2549 parameters that have no values, are removed.
2550 If a parameter with no value is expanded within double quotes, a
2551 null argument results and is retained.
2554 Note that if no expansion occurs, no splitting
2558 <A NAME="Filename Expansion"></A>
2560 <A NAME="SEC36"></A>
2561 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2562 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> < </A>]</TD>
2563 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> > </A>]</TD>
2564 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD>
2565 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2566 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD>
2567 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2568 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2569 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2570 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2572 <H3> 3.5.8 Filename Expansion </H3>
2573 <!--docid::SEC36::-->
2574 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
2575 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How the shell matches patterns.</TD></TR>
2576 </TABLE></BLOCKQUOTE>
2577 <A NAME="IDX64"></A>
2578 <A NAME="IDX65"></A>
2579 <A NAME="IDX66"></A>
2580 <A NAME="IDX67"></A>
2583 After word splitting, unless the <SAMP>`-f'</SAMP> option has been set
2584 (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), Bash scans each word for the characters
2585 <SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>.
2586 If one of these characters appears, then the word is
2587 regarded as a <VAR>pattern</VAR>,
2588 and replaced with an alphabetically sorted list of
2589 file names matching the pattern. If no matching file names are found,
2590 and the shell option <CODE>nullglob</CODE> is disabled, the word is left
2592 If the <CODE>nullglob</CODE> option is set, and no matches are found, the word
2594 If the <CODE>failglob</CODE> shell option is set, and no matches are found,
2595 an error message is printed and the command is not executed.
2596 If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed
2597 without regard to the case of alphabetic characters.
2600 When a pattern is used for filename expansion, the character <SAMP>`.'</SAMP>
2601 at the start of a filename or immediately following a slash
2602 must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set.
2603 When matching a file name, the slash character must always be
2605 In other cases, the <SAMP>`.'</SAMP> character is not treated specially.
2608 See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>,
2609 for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>,
2610 <CODE>failglob</CODE>, and <CODE>dotglob</CODE> options.
2613 The <CODE>GLOBIGNORE</CODE>
2614 shell variable may be used to restrict the set of filenames matching a
2615 pattern. If <CODE>GLOBIGNORE</CODE>
2616 is set, each matching filename that also matches one of the patterns in
2617 <CODE>GLOBIGNORE</CODE> is removed from the list of matches. The filenames
2618 <TT>`.'</TT> and <TT>`..'</TT>
2619 are always ignored when <CODE>GLOBIGNORE</CODE>
2620 is set and not null.
2621 However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of
2622 enabling the <CODE>dotglob</CODE>
2623 shell option, so all other filenames beginning with a
2624 <SAMP>`.'</SAMP> will match.
2625 To get the old behavior of ignoring filenames beginning with a
2626 <SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>.
2627 The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE>
2631 <A NAME="Pattern Matching"></A>
2633 <A NAME="SEC37"></A>
2634 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2635 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> < </A>]</TD>
2636 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> > </A>]</TD>
2637 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> << </A>]</TD>
2638 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> Up </A>]</TD>
2639 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> >> </A>]</TD>
2640 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2641 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2642 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2643 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2645 <H4> 3.5.8.1 Pattern Matching </H4>
2646 <!--docid::SEC37::-->
2649 Any character that appears in a pattern, other than the special pattern
2650 characters described below, matches itself.
2651 The NUL character may not occur in a pattern.
2652 A backslash escapes the following character; the
2653 escaping backslash is discarded when matching.
2654 The special pattern characters must be quoted if they are to be matched
2658 The special pattern characters have the following meanings:
2661 <DD>Matches any string, including the null string.
2662 When the <CODE>globstar</CODE> shell option is enabled, and <SAMP>`*'</SAMP> is used in
2663 a filename expansion context, two adjacent <SAMP>`*'</SAMP>s used as a single
2664 pattern will match all files and zero or more directories and
2666 If followed by a <SAMP>`/'</SAMP>, two adjacent <SAMP>`*'</SAMP>s will match only
2667 directories and subdirectories.
2669 <DD>Matches any single character.
2670 <DT><CODE>[<small>...</small>]</CODE>
2671 <DD>Matches any one of the enclosed characters. A pair of characters
2672 separated by a hyphen denotes a <VAR>range expression</VAR>;
2673 any character that sorts between those two characters, inclusive,
2674 using the current locale's collating sequence and character set,
2675 is matched. If the first character following the
2676 <SAMP>`['</SAMP> is a <SAMP>`!'</SAMP> or a <SAMP>`^'</SAMP>
2677 then any character not enclosed is matched. A <SAMP>`-'</SAMP>
2678 may be matched by including it as the first or last character
2679 in the set. A <SAMP>`]'</SAMP> may be matched by including it as the first
2680 character in the set.
2681 The sorting order of characters in range expressions is determined by
2682 the current locale and the value of the <CODE>LC_COLLATE</CODE> shell variable,
2686 For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to
2687 <SAMP>`[abcdxyz]'</SAMP>. Many locales sort characters in dictionary order, and in
2688 these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>;
2689 it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example. To obtain
2690 the traditional interpretation of ranges in bracket expressions, you can
2691 force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or
2692 <CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>.
2695 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified
2697 <CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the
2698 following classes defined in the POSIX standard:
2699 <TABLE><tr><td> </td><td class=example><pre>alnum alpha ascii blank cntrl digit graph lower
2700 print punct space upper word xdigit
2701 </pre></td></tr></table>A character class matches any character belonging to that class.
2702 The <CODE>word</CODE> character class matches letters, digits, and the character
2706 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be
2707 specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which
2708 matches all characters with the same collation weight (as defined
2709 by the current locale) as the character <VAR>c</VAR>.
2712 Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE>
2713 matches the collating symbol <VAR>symbol</VAR>.
2717 If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE>
2718 builtin, several extended pattern matching operators are recognized.
2719 In the following description, a <VAR>pattern-list</VAR> is a list of one
2720 or more patterns separated by a <SAMP>`|'</SAMP>.
2721 Composite patterns may be formed using one or more of the following
2726 <DT><CODE>?(<VAR>pattern-list</VAR>)</CODE>
2727 <DD>Matches zero or one occurrence of the given patterns.
2730 <DT><CODE>*(<VAR>pattern-list</VAR>)</CODE>
2731 <DD>Matches zero or more occurrences of the given patterns.
2734 <DT><CODE>+(<VAR>pattern-list</VAR>)</CODE>
2735 <DD>Matches one or more occurrences of the given patterns.
2738 <DT><CODE>@(<VAR>pattern-list</VAR>)</CODE>
2739 <DD>Matches one of the given patterns.
2742 <DT><CODE>!(<VAR>pattern-list</VAR>)</CODE>
2743 <DD>Matches anything except one of the given patterns.
2747 <A NAME="Quote Removal"></A>
2749 <A NAME="SEC38"></A>
2750 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2751 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> < </A>]</TD>
2752 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> > </A>]</TD>
2753 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> << </A>]</TD>
2754 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2755 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> >> </A>]</TD>
2756 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2757 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2758 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2759 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2761 <H3> 3.5.9 Quote Removal </H3>
2762 <!--docid::SEC38::-->
2765 After the preceding expansions, all unquoted occurrences of the
2766 characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not
2767 result from one of the above expansions are removed.
2770 <A NAME="Redirections"></A>
2772 <A NAME="SEC39"></A>
2773 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2774 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> < </A>]</TD>
2775 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> > </A>]</TD>
2776 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD>
2777 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
2778 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
2779 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2780 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2781 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2782 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2784 <H2> 3.6 Redirections </H2>
2785 <!--docid::SEC39::-->
2788 Before a command is executed, its input and output
2789 may be <VAR>redirected</VAR>
2790 using a special notation interpreted by the shell.
2791 Redirection may also be used to open and close files for the
2792 current shell execution environment. The following redirection
2793 operators may precede or appear anywhere within a
2794 simple command or may follow a command.
2795 Redirections are processed in the order they appear, from
2799 Each redirection that may be preceded by a file descriptor number
2800 may instead be preceded by a word of the form {<VAR>varname</VAR>}.
2801 In this case, for each redirection operator except
2802 >&- and <&-, the shell will allocate a file descriptor greater
2803 than 10 and assign it to {<VAR>varname</VAR>}. If >&- or <&- is preceded
2804 by {<VAR>varname</VAR>}, the value of <VAR>varname</VAR> defines the file
2805 descriptor to close.
2808 In the following descriptions, if the file descriptor number is
2809 omitted, and the first character of the redirection operator is
2810 <SAMP>`<'</SAMP>, the redirection refers to the standard input (file
2811 descriptor 0). If the first character of the redirection operator
2812 is <SAMP>`>'</SAMP>, the redirection refers to the standard output (file
2816 The word following the redirection operator in the following
2817 descriptions, unless otherwise noted, is subjected to brace expansion,
2818 tilde expansion, parameter expansion, command substitution, arithmetic
2819 expansion, quote removal, filename expansion, and word splitting.
2820 If it expands to more than one word, Bash reports an error.
2823 Note that the order of redirections is significant. For example,
2825 <TABLE><tr><td> </td><td class=example><pre>ls > <VAR>dirlist</VAR> 2>&1
2826 </pre></td></tr></table>directs both standard output (file descriptor 1) and standard error
2827 (file descriptor 2) to the file <VAR>dirlist</VAR>, while the command
2828 <TABLE><tr><td> </td><td class=example><pre>ls 2>&1 > <VAR>dirlist</VAR>
2829 </pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>,
2830 because the standard error was made a copy of the standard output
2831 before the standard output was redirected to <VAR>dirlist</VAR>.
2834 Bash handles several filenames specially when they are used in
2835 redirections, as described in the following table:
2839 <DT><CODE>/dev/fd/<VAR>fd</VAR></CODE>
2840 <DD>If <VAR>fd</VAR> is a valid integer, file descriptor <VAR>fd</VAR> is duplicated.
2843 <DT><CODE>/dev/stdin</CODE>
2844 <DD>File descriptor 0 is duplicated.
2847 <DT><CODE>/dev/stdout</CODE>
2848 <DD>File descriptor 1 is duplicated.
2851 <DT><CODE>/dev/stderr</CODE>
2852 <DD>File descriptor 2 is duplicated.
2855 <DT><CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2856 <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2857 is an integer port number or service name, Bash attempts to open a TCP
2858 connection to the corresponding socket.
2861 <DT><CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2862 <DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2863 is an integer port number or service name, Bash attempts to open a UDP
2864 connection to the corresponding socket.
2870 A failure to open or create a file causes the redirection to fail.
2873 Redirections using file descriptors greater than 9 should be used with
2874 care, as they may conflict with file descriptors the shell uses
2879 <A NAME="SEC40"></A>
2880 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2881 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> < </A>]</TD>
2882 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> > </A>]</TD>
2883 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD>
2884 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2885 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
2886 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2887 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2888 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2889 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2891 <H3> 3.6.1 Redirecting Input </H3>
2892 <!--docid::SEC40::-->
2893 Redirection of input causes the file whose name results from
2894 the expansion of <VAR>word</VAR>
2895 to be opened for reading on file descriptor <CODE>n</CODE>,
2896 or the standard input (file descriptor 0) if <CODE>n</CODE>
2900 The general format for redirecting input is:
2901 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<<VAR>word</VAR>
2902 </pre></td></tr></table></P><P>
2905 <A NAME="SEC41"></A>
2906 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2907 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> < </A>]</TD>
2908 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> > </A>]</TD>
2909 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> << </A>]</TD>
2910 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2911 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
2912 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2913 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2914 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2915 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2917 <H3> 3.6.2 Redirecting Output </H3>
2918 <!--docid::SEC41::-->
2919 Redirection of output causes the file whose name results from
2920 the expansion of <VAR>word</VAR>
2921 to be opened for writing on file descriptor <VAR>n</VAR>,
2922 or the standard output (file descriptor 1) if <VAR>n</VAR>
2923 is not specified. If the file does not exist it is created;
2924 if it does exist it is truncated to zero size.
2927 The general format for redirecting output is:
2928 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>[|]<VAR>word</VAR>
2929 </pre></td></tr></table></P><P>
2931 If the redirection operator is <SAMP>`>'</SAMP>, and the <CODE>noclobber</CODE>
2932 option to the <CODE>set</CODE> builtin has been enabled, the redirection
2933 will fail if the file whose name results from the expansion of
2934 <VAR>word</VAR> exists and is a regular file.
2935 If the redirection operator is <SAMP>`>|'</SAMP>, or the redirection operator is
2936 <SAMP>`>'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection
2937 is attempted even if the file named by <VAR>word</VAR> exists.
2941 <A NAME="SEC42"></A>
2942 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2943 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> < </A>]</TD>
2944 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> > </A>]</TD>
2945 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> << </A>]</TD>
2946 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2947 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
2948 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2949 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2950 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2951 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2953 <H3> 3.6.3 Appending Redirected Output </H3>
2954 <!--docid::SEC42::-->
2955 Redirection of output in this fashion
2956 causes the file whose name results from
2957 the expansion of <VAR>word</VAR>
2958 to be opened for appending on file descriptor <VAR>n</VAR>,
2959 or the standard output (file descriptor 1) if <VAR>n</VAR>
2960 is not specified. If the file does not exist it is created.
2963 The general format for appending output is:
2964 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>><VAR>word</VAR>
2965 </pre></td></tr></table></P><P>
2968 <A NAME="SEC43"></A>
2969 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2970 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> < </A>]</TD>
2971 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> > </A>]</TD>
2972 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> << </A>]</TD>
2973 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2974 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
2975 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2976 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2977 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2978 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2980 <H3> 3.6.4 Redirecting Standard Output and Standard Error </H3>
2981 <!--docid::SEC43::-->
2982 This construct allows both the
2983 standard output (file descriptor 1) and
2984 the standard error output (file descriptor 2)
2985 to be redirected to the file whose name is the
2986 expansion of <VAR>word</VAR>.
2989 There are two formats for redirecting standard output and
2991 <TABLE><tr><td> </td><td class=example><pre>&><VAR>word</VAR>
2992 </pre></td></tr></table>and
2993 <TABLE><tr><td> </td><td class=example><pre>>&<VAR>word</VAR>
2994 </pre></td></tr></table>Of the two forms, the first is preferred.
2995 This is semantically equivalent to
2996 <TABLE><tr><td> </td><td class=example><pre>><VAR>word</VAR> 2>&1
2997 </pre></td></tr></table></P><P>
3000 <A NAME="SEC44"></A>
3001 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3002 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> < </A>]</TD>
3003 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> > </A>]</TD>
3004 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> << </A>]</TD>
3005 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3006 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
3007 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3008 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3009 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3010 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3012 <H3> 3.6.5 Appending Standard Output and Standard Error </H3>
3013 <!--docid::SEC44::-->
3014 This construct allows both the
3015 standard output (file descriptor 1) and
3016 the standard error output (file descriptor 2)
3017 to be appended to the file whose name is the
3018 expansion of <VAR>word</VAR>.
3021 The format for appending standard output and standard error is:
3022 <TABLE><tr><td> </td><td class=example><pre>&>><VAR>word</VAR>
3023 </pre></td></tr></table>This is semantically equivalent to
3024 <TABLE><tr><td> </td><td class=example><pre>>><VAR>word</VAR> 2>&1
3025 </pre></td></tr></table></P><P>
3028 <A NAME="SEC45"></A>
3029 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3030 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> < </A>]</TD>
3031 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> > </A>]</TD>
3032 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> << </A>]</TD>
3033 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3034 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
3035 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3036 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3037 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3038 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3040 <H3> 3.6.6 Here Documents </H3>
3041 <!--docid::SEC45::-->
3042 This type of redirection instructs the shell to read input from the
3043 current source until a line containing only <VAR>word</VAR>
3044 (with no trailing blanks) is seen. All of
3045 the lines read up to that point are then used as the standard
3046 input for a command.
3049 The format of here-documents is:
3050 <TABLE><tr><td> </td><td class=example><pre><<[-]<VAR>word</VAR>
3051 <VAR>here-document</VAR>
3052 <VAR>delimiter</VAR>
3053 </pre></td></tr></table></P><P>
3055 No parameter expansion, command substitution, arithmetic expansion,
3056 or filename expansion is performed on
3057 <VAR>word</VAR>. If any characters in <VAR>word</VAR> are quoted, the
3058 <VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>,
3059 and the lines in the here-document are not expanded.
3060 If <VAR>word</VAR> is unquoted,
3061 all lines of the here-document are subjected to parameter expansion,
3062 command substitution, and arithmetic expansion. In the latter
3063 case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP>
3064 must be used to quote the characters
3065 <SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>.
3068 If the redirection operator is <SAMP>`<<-'</SAMP>,
3069 then all leading tab characters are stripped from input lines and the
3070 line containing <VAR>delimiter</VAR>.
3071 This allows here-documents within shell scripts to be indented in a
3076 <A NAME="SEC46"></A>
3077 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3078 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> < </A>]</TD>
3079 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> > </A>]</TD>
3080 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> << </A>]</TD>
3081 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3082 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
3083 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3084 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3085 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3086 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3088 <H3> 3.6.7 Here Strings </H3>
3089 <!--docid::SEC46::-->
3090 A variant of here documents, the format is:
3091 <TABLE><tr><td> </td><td class=example><pre><<< <VAR>word</VAR>
3092 </pre></td></tr></table><P>
3094 The <VAR>word</VAR> is expanded and supplied to the command on its standard
3099 <A NAME="SEC47"></A>
3100 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3101 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> < </A>]</TD>
3102 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> > </A>]</TD>
3103 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> << </A>]</TD>
3104 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3105 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
3106 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3107 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3108 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3109 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3111 <H3> 3.6.8 Duplicating File Descriptors </H3>
3112 <!--docid::SEC47::-->
3113 The redirection operator
3114 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>word</VAR>
3115 </pre></td></tr></table>is used to duplicate input file descriptors.
3117 expands to one or more digits, the file descriptor denoted by <VAR>n</VAR>
3118 is made to be a copy of that file descriptor.
3119 If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3120 input, a redirection error occurs.
3122 evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed. If
3123 <VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used.
3127 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>word</VAR>
3128 </pre></td></tr></table>is used similarly to duplicate output file descriptors. If
3129 <VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used.
3130 If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3131 output, a redirection error occurs.
3132 As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not
3133 expand to one or more digits, the standard output and standard
3134 error are redirected as described previously.
3138 <A NAME="SEC48"></A>
3139 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3140 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> < </A>]</TD>
3141 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> > </A>]</TD>
3142 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> << </A>]</TD>
3143 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3144 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
3145 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3146 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3147 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3148 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3150 <H3> 3.6.9 Moving File Descriptors </H3>
3151 <!--docid::SEC48::-->
3152 The redirection operator
3153 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<&<VAR>digit</VAR>-
3154 </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3155 or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified.
3156 <VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>.
3159 Similarly, the redirection operator
3160 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]>&<VAR>digit</VAR>-
3161 </pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3162 or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified.
3166 <A NAME="SEC49"></A>
3167 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3168 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> < </A>]</TD>
3169 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> > </A>]</TD>
3170 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> << </A>]</TD>
3171 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3172 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> >> </A>]</TD>
3173 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3174 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3175 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3176 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3178 <H3> 3.6.10 Opening File Descriptors for Reading and Writing </H3>
3179 <!--docid::SEC49::-->
3180 The redirection operator
3181 <TABLE><tr><td> </td><td class=example><pre>[<VAR>n</VAR>]<><VAR>word</VAR>
3182 </pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR>
3183 to be opened for both reading and writing on file descriptor
3184 <VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR>
3185 is not specified. If the file does not exist, it is created.
3188 <A NAME="Executing Commands"></A>
3190 <A NAME="SEC50"></A>
3191 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3192 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> < </A>]</TD>
3193 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> > </A>]</TD>
3194 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD>
3195 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3196 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD>
3197 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3198 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3199 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3200 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3202 <H2> 3.7 Executing Commands </H2>
3203 <!--docid::SEC50::-->
3206 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3207 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before
3208 executing them.</TD></TR>
3209 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash finds commands and runs them.</TD></TR>
3210 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash
3211 executes commands that are not
3212 shell builtins.</TD></TR>
3213 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR>
3214 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash
3215 interprets it.</TD></TR>
3216 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs
3217 receives a signal.</TD></TR>
3218 </TABLE></BLOCKQUOTE>
3221 <A NAME="Simple Command Expansion"></A>
3223 <A NAME="SEC51"></A>
3224 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3225 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> < </A>]</TD>
3226 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> > </A>]</TD>
3227 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD>
3228 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3229 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD>
3230 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3231 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3232 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3233 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3235 <H3> 3.7.1 Simple Command Expansion </H3>
3236 <!--docid::SEC51::-->
3239 When a simple command is executed, the shell performs the following
3240 expansions, assignments, and redirections, from left to right.
3245 The words that the parser has marked as variable assignments (those
3246 preceding the command name) and redirections are saved for later
3251 The words that are not variable assignments or redirections are
3252 expanded (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
3253 If any words remain after expansion, the first word
3254 is taken to be the name of the command and the remaining words are
3259 Redirections are performed as described above (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
3263 The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde
3264 expansion, parameter expansion, command substitution, arithmetic expansion,
3265 and quote removal before being assigned to the variable.
3269 If no command name results, the variable assignments affect the current
3270 shell environment. Otherwise, the variables are added to the environment
3271 of the executed command and do not affect the current shell environment.
3272 If any of the assignments attempts to assign a value to a readonly variable,
3273 an error occurs, and the command exits with a non-zero status.
3276 If no command name results, redirections are performed, but do not
3277 affect the current shell environment. A redirection error causes the
3278 command to exit with a non-zero status.
3281 If there is a command name left after expansion, execution proceeds as
3282 described below. Otherwise, the command exits. If one of the expansions
3283 contained a command substitution, the exit status of the command is
3284 the exit status of the last command substitution performed. If there
3285 were no command substitutions, the command exits with a status of zero.
3288 <A NAME="Command Search and Execution"></A>
3290 <A NAME="SEC52"></A>
3291 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3292 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> < </A>]</TD>
3293 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> > </A>]</TD>
3294 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> << </A>]</TD>
3295 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3296 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD>
3297 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3298 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3299 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3300 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3302 <H3> 3.7.2 Command Search and Execution </H3>
3303 <!--docid::SEC52::-->
3306 After a command has been split into words, if it results in a
3307 simple command and an optional list of arguments, the following
3313 If the command name contains no slashes, the shell attempts to
3314 locate it. If there exists a shell function by that name, that
3315 function is invoked as described in <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>.
3319 If the name does not match a function, the shell searches for
3320 it in the list of shell builtins. If a match is found, that
3325 If the name is neither a shell function nor a builtin,
3326 and contains no slashes, Bash searches each element of
3327 <CODE>$PATH</CODE> for a directory containing an executable file
3328 by that name. Bash uses a hash table to remember the full
3329 pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches
3330 (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
3331 A full search of the directories in <CODE>$PATH</CODE>
3332 is performed only if the command is not found in the hash table.
3333 If the search is unsuccessful, the shell searches for a defined shell
3334 function named <CODE>command_not_found_handle</CODE>.
3335 If that function exists, it is invoked with the original command and
3336 the original command's arguments as its arguments, and the function's
3337 exit status becomes the exit status of the shell.
3338 If that function is not defined, the shell prints an error
3339 message and returns an exit status of 127.
3343 If the search is successful, or if the command name contains
3344 one or more slashes, the shell executes the named program in
3345 a separate execution environment.
3346 Argument 0 is set to the name given, and the remaining arguments
3347 to the command are set to the arguments supplied, if any.
3351 If this execution fails because the file is not in executable
3352 format, and the file is not a directory, it is assumed to be a
3353 <VAR>shell script</VAR> and the shell executes it as described in
3354 <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>.
3358 If the command was not begun asynchronously, the shell waits for
3359 the command to complete and collects its exit status.
3365 <A NAME="Command Execution Environment"></A>
3367 <A NAME="SEC53"></A>
3368 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3369 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> < </A>]</TD>
3370 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> > </A>]</TD>
3371 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> << </A>]</TD>
3372 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3373 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD>
3374 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3375 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3376 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3377 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3379 <H3> 3.7.3 Command Execution Environment </H3>
3380 <!--docid::SEC53::-->
3383 The shell has an <VAR>execution environment</VAR>, which consists of the
3389 open files inherited by the shell at invocation, as modified by
3390 redirections supplied to the <CODE>exec</CODE> builtin
3394 the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or
3395 <CODE>popd</CODE>, or inherited by the shell at invocation
3399 the file creation mode mask as set by <CODE>umask</CODE> or inherited from
3404 current traps set by <CODE>trap</CODE>
3408 shell parameters that are set by variable assignment or with <CODE>set</CODE>
3409 or inherited from the shell's parent in the environment
3413 shell functions defined during execution or inherited from the shell's
3414 parent in the environment
3418 options enabled at invocation (either by default or with command-line
3419 arguments) or by <CODE>set</CODE>
3423 options enabled by <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
3427 shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>)
3431 various process IDs, including those of background jobs
3432 (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of
3439 When a simple command other than a builtin or shell function
3440 is to be executed, it
3441 is invoked in a separate execution environment that consists of
3442 the following. Unless otherwise noted, the values are inherited
3448 the shell's open files, plus any modifications and additions specified
3449 by redirections to the command
3453 the current working directory
3457 the file creation mode mask
3461 shell variables and functions marked for export, along with variables
3462 exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>)
3466 traps caught by the shell are reset to the values inherited from the
3467 shell's parent, and traps ignored by the shell are ignored
3473 A command invoked in this separate environment cannot affect the
3474 shell's execution environment.
3477 Command substitution, commands grouped with parentheses,
3478 and asynchronous commands are invoked in a
3479 subshell environment that is a duplicate of the shell environment,
3480 except that traps caught by the shell are reset to the values
3481 that the shell inherited from its parent at invocation. Builtin
3482 commands that are invoked as part of a pipeline are also executed
3483 in a subshell environment. Changes made to the subshell environment
3484 cannot affect the shell's execution environment.
3487 Subshells spawned to execute command substitutions inherit the value of
3488 the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
3489 Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
3492 If a command is followed by a <SAMP>`&'</SAMP> and job control is not active, the
3493 default standard input for the command is the empty file <TT>`/dev/null'</TT>.
3494 Otherwise, the invoked command inherits the file descriptors of the calling
3495 shell as modified by redirections.
3498 <A NAME="Environment"></A>
3500 <A NAME="SEC54"></A>
3501 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3502 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> < </A>]</TD>
3503 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> > </A>]</TD>
3504 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> << </A>]</TD>
3505 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3506 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD>
3507 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3508 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3509 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3510 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3512 <H3> 3.7.4 Environment </H3>
3513 <!--docid::SEC54::-->
3516 When a program is invoked it is given an array of strings
3517 called the <VAR>environment</VAR>.
3518 This is a list of name-value pairs, of the form <CODE>name=value</CODE>.
3521 Bash provides several ways to manipulate the environment.
3522 On invocation, the shell scans its own environment and
3523 creates a parameter for each name found, automatically marking
3524 it for <VAR>export</VAR>
3525 to child processes. Executed commands inherit the environment.
3526 The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP>
3527 commands allow parameters and functions to be added to and
3528 deleted from the environment. If the value of a parameter
3529 in the environment is modified, the new value becomes part
3530 of the environment, replacing the old. The environment
3531 inherited by any executed command consists of the shell's
3532 initial environment, whose values may be modified in the shell,
3533 less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP>
3534 commands, plus any additions via the <CODE>export</CODE> and
3535 <SAMP>`declare -x'</SAMP> commands.
3538 The environment for any simple command
3539 or function may be augmented temporarily by prefixing it with
3540 parameter assignments, as described in <A HREF="bashref.html#SEC25">3.4 Shell Parameters</A>.
3541 These assignment statements affect only the environment seen
3545 If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), then all
3546 parameter assignments are placed in the environment for a command,
3547 not just those that precede the command name.
3550 When Bash invokes an external command, the variable <SAMP>`$_'</SAMP>
3551 is set to the full path name of the command and passed to that
3552 command in its environment.
3555 <A NAME="Exit Status"></A>
3557 <A NAME="SEC55"></A>
3558 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3559 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> < </A>]</TD>
3560 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> > </A>]</TD>
3561 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> << </A>]</TD>
3562 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3563 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD>
3564 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3565 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3566 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3567 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3569 <H3> 3.7.5 Exit Status </H3>
3570 <!--docid::SEC55::-->
3573 The exit status of an executed command is the value returned by the
3574 <VAR>waitpid</VAR> system call or equivalent function. Exit statuses
3575 fall between 0 and 255, though, as explained below, the shell may
3576 use values above 125 specially. Exit statuses from shell builtins and
3577 compound commands are also limited to this range. Under certain
3578 circumstances, the shell will use special values to indicate specific
3582 For the shell's purposes, a command which exits with a
3583 zero exit status has succeeded.
3584 A non-zero exit status indicates failure.
3585 This seemingly counter-intuitive scheme is used so there
3586 is one well-defined way to indicate success and a variety of
3587 ways to indicate various failure modes.
3588 When a command terminates on a fatal signal whose number is <VAR>N</VAR>,
3589 Bash uses the value 128+<VAR>N</VAR> as the exit status.
3592 If a command is not found, the child process created to
3593 execute it returns a status of 127. If a command is found
3594 but is not executable, the return status is 126.
3597 If a command fails because of an error during expansion or redirection,
3598 the exit status is greater than zero.
3601 The exit status is used by the Bash conditional commands
3602 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list
3603 constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>).
3606 All of the Bash builtins return an exit status of zero if they succeed
3607 and a non-zero status on failure, so they may be used by the
3608 conditional and list constructs.
3609 All builtins return an exit status of 2 to indicate incorrect usage.
3612 <A NAME="Signals"></A>
3614 <A NAME="SEC56"></A>
3615 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3616 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> < </A>]</TD>
3617 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> > </A>]</TD>
3618 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> << </A>]</TD>
3619 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3620 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> >> </A>]</TD>
3621 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3622 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3623 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3624 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3626 <H3> 3.7.6 Signals </H3>
3627 <!--docid::SEC56::-->
3630 When Bash is interactive, in the absence of any traps, it ignores
3631 <CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell),
3632 and <CODE>SIGINT</CODE>
3633 is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible).
3634 When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops.
3635 In all cases, Bash ignores <CODE>SIGQUIT</CODE>.
3636 If job control is in effect (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), Bash
3637 ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3640 Non-builtin commands started by Bash have signal handlers set to the
3641 values inherited by the shell from its parent.
3642 When job control is not in effect, asynchronous commands
3643 ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited
3645 Commands run as a result of
3646 command substitution ignore the keyboard-generated job control signals
3647 <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3650 The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>.
3651 Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to
3652 all jobs, running or stopped.
3653 Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive
3654 the <CODE>SIGHUP</CODE>.
3655 To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a
3656 particular job, it should be removed
3657 from the jobs table with the <CODE>disown</CODE>
3658 builtin (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or marked
3659 to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>.
3662 If the <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE>
3663 (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when
3664 an interactive login shell exits.
3667 If Bash is waiting for a command to complete and receives a signal
3668 for which a trap has been set, the trap will not be executed until
3669 the command completes.
3670 When Bash is waiting for an asynchronous
3671 command via the <CODE>wait</CODE> builtin, the reception of a signal for
3672 which a trap has been set will cause the <CODE>wait</CODE> builtin to return
3673 immediately with an exit status greater than 128, immediately after
3674 which the trap is executed.
3677 <A NAME="Shell Scripts"></A>
3679 <A NAME="SEC57"></A>
3680 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3681 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> < </A>]</TD>
3682 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> > </A>]</TD>
3683 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> << </A>]</TD>
3684 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3685 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> >> </A>]</TD>
3686 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3687 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3688 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3689 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3691 <H2> 3.8 Shell Scripts </H2>
3692 <!--docid::SEC57::-->
3695 A shell script is a text file containing shell commands. When such
3696 a file is used as the first non-option argument when invoking Bash,
3697 and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied
3698 (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>),
3699 Bash reads and executes commands from the file, then exits. This
3700 mode of operation creates a non-interactive shell. The shell first
3701 searches for the file in the current directory, and looks in the
3702 directories in <CODE>$PATH</CODE> if not found there.
3706 a shell script, it sets the special parameter <CODE>0</CODE> to the name
3707 of the file, rather than the name of the shell, and the positional
3708 parameters are set to the remaining arguments, if any are given.
3709 If no additional arguments are supplied, the positional parameters
3713 A shell script may be made executable by using the <CODE>chmod</CODE> command
3714 to turn on the execute bit. When Bash finds such a file while
3715 searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to
3716 execute it. In other words, executing
3717 <TABLE><tr><td> </td><td class=example><pre>filename <VAR>arguments</VAR>
3718 </pre></td></tr></table>is equivalent to executing
3719 <TABLE><tr><td> </td><td class=example><pre>bash filename <VAR>arguments</VAR>
3720 </pre></td></tr></table></P><P>
3722 if <CODE>filename</CODE> is an executable shell script.
3723 This subshell reinitializes itself, so that the effect is as if a
3724 new shell had been invoked to interpret the script, with the
3725 exception that the locations of commands remembered by the parent
3726 (see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
3727 are retained by the child.
3730 Most versions of Unix make this a part of the operating system's command
3731 execution mechanism. If the first line of a script begins with
3732 the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies
3733 an interpreter for the program.
3734 Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other
3735 interpreter and write the rest of the script file in that language.
3738 The arguments to the interpreter
3739 consist of a single optional argument following the interpreter
3740 name on the first line of the script file, followed by the name of
3741 the script file, followed by the rest of the arguments. Bash
3742 will perform this action on operating systems that do not handle it
3743 themselves. Note that some older versions of Unix limit the interpreter
3744 name and argument to a maximum of 32 characters.
3747 Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that
3748 Bash has been installed in <TT>`/bin'</TT>), since this ensures that
3749 Bash will be used to interpret the script, even if it is executed
3750 under another shell.
3753 <A NAME="Shell Builtin Commands"></A>
3755 <A NAME="SEC58"></A>
3756 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3757 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> < </A>]</TD>
3758 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> > </A>]</TD>
3759 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD>
3760 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
3761 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD>
3762 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3763 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3764 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3765 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3767 <H1> 4. Shell Builtin Commands </H1>
3768 <!--docid::SEC58::-->
3771 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3772 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands inherited from the Bourne
3774 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Table of builtins specific to Bash.</TD></TR>
3775 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtins to modify shell attributes and
3776 optional behavior.</TD></TR>
3777 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC64">4.4 Special Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands classified specially by
3779 </TABLE></BLOCKQUOTE>
3782 Builtin commands are contained within the shell itself.
3783 When the name of a builtin command is used as the first word of
3784 a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes
3785 the command directly, without invoking another program.
3786 Builtin commands are necessary to implement functionality impossible
3787 or inconvenient to obtain with separate utilities.
3790 This section briefly describes the builtins which Bash inherits from
3791 the Bourne Shell, as well as the builtin commands which are unique
3792 to or have been extended in Bash.
3795 Several builtin commands are described in other chapters: builtin
3796 commands which provide the Bash interface to the job control
3797 facilities (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>), the directory stack
3798 (see section <A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>), the command history
3799 (see section <A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>), and the programmable completion
3800 facilities (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>).
3803 Many of the builtins have been extended by POSIX or Bash.
3806 Unless otherwise noted, each builtin command documented as accepting
3807 options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP>
3808 to signify the end of the options.
3809 The <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE>
3810 builtins do not accept options and do not treat <SAMP>`--'</SAMP> specially.
3811 The <CODE>exit</CODE>, <CODE>logout</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, <CODE>let</CODE>,
3812 and <CODE>shift</CODE> builtins accept and process arguments beginning
3813 with <SAMP>`-'</SAMP> without requiring <SAMP>`--'</SAMP>.
3814 Other builtins that accept arguments but are not specified as accepting
3815 options interpret arguments beginning with <SAMP>`-'</SAMP> as invalid options and
3816 require <SAMP>`--'</SAMP> to prevent this interpretation.
3819 <A NAME="Bourne Shell Builtins"></A>
3821 <A NAME="SEC59"></A>
3822 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3823 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> < </A>]</TD>
3824 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> > </A>]</TD>
3825 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD>
3826 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
3827 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD>
3828 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3829 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3830 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3831 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3833 <H2> 4.1 Bourne Shell Builtins </H2>
3834 <!--docid::SEC59::-->
3837 The following shell builtin commands are inherited from the Bourne Shell.
3838 These commands are implemented as specified by the POSIX standard.
3842 <DT><CODE>: (a colon)</CODE>
3843 <DD><A NAME="IDX68"></A>
3844 <TABLE><tr><td> </td><td class=example><pre>: [<VAR>arguments</VAR>]
3845 </pre></td></tr></table>Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections.
3846 The return status is zero.
3849 <DT><CODE>. (a period)</CODE>
3850 <DD><A NAME="IDX69"></A>
3851 <TABLE><tr><td> </td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>]
3852 </pre></td></tr></table>Read and execute commands from the <VAR>filename</VAR> argument in the
3853 current shell context. If <VAR>filename</VAR> does not contain a slash,
3854 the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>.
3855 When Bash is not in POSIX mode, the current directory is searched
3856 if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>.
3857 If any <VAR>arguments</VAR> are supplied, they become the positional
3858 parameters when <VAR>filename</VAR> is executed. Otherwise the positional
3859 parameters are unchanged.
3860 The return status is the exit status of the last command executed, or
3861 zero if no commands are executed. If <VAR>filename</VAR> is not found, or
3862 cannot be read, the return status is non-zero.
3863 This builtin is equivalent to <CODE>source</CODE>.
3866 <DT><CODE>break</CODE>
3867 <DD><A NAME="IDX70"></A>
3868 <TABLE><tr><td> </td><td class=example><pre>break [<VAR>n</VAR>]
3869 </pre></td></tr></table>Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop.
3870 If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited.
3871 <VAR>n</VAR> must be greater than or equal to 1.
3872 The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
3876 <DD><A NAME="IDX71"></A>
3877 <TABLE><tr><td> </td><td class=example><pre>cd [-L|-P] [<VAR>directory</VAR>]
3878 </pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>.
3879 If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell
3881 If the shell variable <CODE>CDPATH</CODE> exists, it is used as a search path.
3882 If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used.
3885 The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic
3886 links are followed by default or with the <SAMP>`-L'</SAMP> option.
3887 If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>.
3890 If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if
3891 <SAMP>`-'</SAMP> is the first argument, and the directory change is
3892 successful, the absolute pathname of the new working directory is
3893 written to the standard output.
3896 The return status is zero if the directory is successfully changed,
3900 <DT><CODE>continue</CODE>
3901 <DD><A NAME="IDX72"></A>
3902 <TABLE><tr><td> </td><td class=example><pre>continue [<VAR>n</VAR>]
3903 </pre></td></tr></table>Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>,
3904 <CODE>until</CODE>, or <CODE>select</CODE> loop.
3905 If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop
3907 <VAR>n</VAR> must be greater than or equal to 1.
3908 The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
3911 <DT><CODE>eval</CODE>
3912 <DD><A NAME="IDX73"></A>
3913 <TABLE><tr><td> </td><td class=example><pre>eval [<VAR>arguments</VAR>]
3914 </pre></td></tr></table>The arguments are concatenated together into a single command, which is
3915 then read and executed, and its exit status returned as the exit status
3916 of <CODE>eval</CODE>.
3917 If there are no arguments or only empty arguments, the return status is
3921 <DT><CODE>exec</CODE>
3922 <DD><A NAME="IDX74"></A>
3923 <TABLE><tr><td> </td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]]
3924 </pre></td></tr></table>If <VAR>command</VAR>
3925 is supplied, it replaces the shell without creating a new process.
3926 If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the
3927 beginning of the zeroth argument passed to <VAR>command</VAR>.
3928 This is what the <CODE>login</CODE> program does.
3929 The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty
3931 If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth
3932 argument to <VAR>command</VAR>.
3933 If no <VAR>command</VAR> is specified, redirections may be used to affect
3934 the current shell environment. If there are no redirection errors, the
3935 return status is zero; otherwise the return status is non-zero.
3938 <DT><CODE>exit</CODE>
3939 <DD><A NAME="IDX75"></A>
3940 <TABLE><tr><td> </td><td class=example><pre>exit [<VAR>n</VAR>]
3941 </pre></td></tr></table>Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent.
3942 If <VAR>n</VAR> is omitted, the exit status is that of the last command executed.
3943 Any trap on <CODE>EXIT</CODE> is executed before the shell terminates.
3946 <DT><CODE>export</CODE>
3947 <DD><A NAME="IDX76"></A>
3948 <TABLE><tr><td> </td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]]
3949 </pre></td></tr></table>Mark each <VAR>name</VAR> to be passed to child processes
3950 in the environment. If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s
3951 refer to shell functions; otherwise the names refer to shell variables.
3952 The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export.
3953 If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a
3954 list of exported names is displayed.
3955 The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input.
3956 If a variable name is followed by =<VAR>value</VAR>, the value of
3957 the variable is set to <VAR>value</VAR>.
3960 The return status is zero unless an invalid option is supplied, one of
3961 the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied
3962 with a name that is not a shell function.
3965 <DT><CODE>getopts</CODE>
3966 <DD><A NAME="IDX77"></A>
3967 <TABLE><tr><td> </td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>]
3968 </pre></td></tr></table><CODE>getopts</CODE> is used by shell scripts to parse positional parameters.
3969 <VAR>optstring</VAR> contains the option characters to be recognized; if a
3970 character is followed by a colon, the option is expected to have an
3971 argument, which should be separated from it by white space.
3972 The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be
3973 used as option characters.
3974 Each time it is invoked, <CODE>getopts</CODE>
3975 places the next option in the shell variable <VAR>name</VAR>, initializing
3976 <VAR>name</VAR> if it does not exist,
3977 and the index of the next argument to be processed into the
3978 variable <CODE>OPTIND</CODE>.
3979 <CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script
3981 When an option requires an argument,
3982 <CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>.
3983 The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually
3984 reset between multiple calls to <CODE>getopts</CODE> within the same shell
3985 invocation if a new set of parameters is to be used.
3988 When the end of options is encountered, <CODE>getopts</CODE> exits with a
3989 return value greater than zero.
3990 <CODE>OPTIND</CODE> is set to the index of the first non-option argument,
3991 and <CODE>name</CODE> is set to <SAMP>`?'</SAMP>.
3994 <CODE>getopts</CODE>
3995 normally parses the positional parameters, but if more arguments are
3996 given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead.
3999 <CODE>getopts</CODE> can report errors in two ways. If the first character of
4000 <VAR>optstring</VAR> is a colon, <VAR>silent</VAR>
4001 error reporting is used. In normal operation diagnostic messages
4002 are printed when invalid options or missing option arguments are
4004 If the variable <CODE>OPTERR</CODE>
4005 is set to 0, no error messages will be displayed, even if the first
4006 character of <CODE>optstring</CODE> is not a colon.
4009 If an invalid option is seen,
4010 <CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent,
4011 prints an error message and unsets <CODE>OPTARG</CODE>.
4012 If <CODE>getopts</CODE> is silent, the option character found is placed in
4013 <CODE>OPTARG</CODE> and no diagnostic message is printed.
4016 If a required argument is not found, and <CODE>getopts</CODE>
4017 is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>,
4018 <CODE>OPTARG</CODE> is unset, and a diagnostic message is printed.
4019 If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in
4020 <VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found.
4023 <DT><CODE>hash</CODE>
4024 <DD><A NAME="IDX78"></A>
4025 <TABLE><tr><td> </td><td class=example><pre>hash [-r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>]
4026 </pre></td></tr></table>Remember the full pathnames of commands specified as <VAR>name</VAR> arguments,
4027 so they need not be searched for on subsequent invocations.
4028 The commands are found by searching through the directories listed in
4030 The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is
4031 used as the location of <VAR>name</VAR>.
4032 The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations.
4033 The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location
4034 of each <VAR>name</VAR>.
4035 If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each
4036 <VAR>name</VAR> corresponds is printed. If multiple <VAR>name</VAR> arguments are
4037 supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed
4039 The <SAMP>`-l'</SAMP> option causes output to be displayed in a format
4040 that may be reused as input.
4041 If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied,
4042 information about remembered commands is printed.
4043 The return status is zero unless a <VAR>name</VAR> is not found or an invalid
4047 <DT><CODE>pwd</CODE>
4048 <DD><A NAME="IDX79"></A>
4049 <TABLE><tr><td> </td><td class=example><pre>pwd [-LP]
4050 </pre></td></tr></table>Print the absolute pathname of the current working directory.
4051 If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not
4052 contain symbolic links.
4053 If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain
4055 The return status is zero unless an error is encountered while
4056 determining the name of the current directory or an invalid option
4060 <DT><CODE>readonly</CODE>
4061 <DD><A NAME="IDX80"></A>
4062 <TABLE><tr><td> </td><td class=example><pre>readonly [-aApf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small>
4063 </pre></td></tr></table>Mark each <VAR>name</VAR> as readonly.
4064 The values of these names may not be changed by subsequent assignment.
4065 If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell
4067 The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed
4068 array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers
4069 to an associative array variable.
4070 If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP>
4071 option is supplied, a list of all readonly names is printed.
4072 The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that
4073 may be reused as input.
4074 If a variable name is followed by =<VAR>value</VAR>, the value of
4075 the variable is set to <VAR>value</VAR>.
4076 The return status is zero unless an invalid option is supplied, one of
4077 the <VAR>name</VAR> arguments is not a valid shell variable or function name,
4078 or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function.
4081 <DT><CODE>return</CODE>
4082 <DD><A NAME="IDX81"></A>
4083 <TABLE><tr><td> </td><td class=example><pre>return [<VAR>n</VAR>]
4084 </pre></td></tr></table>Cause a shell function to exit with the return value <VAR>n</VAR>.
4085 If <VAR>n</VAR> is not supplied, the return value is the exit status of the
4086 last command executed in the function.
4087 This may also be used to terminate execution of a script being executed
4088 with the <CODE>.</CODE> (or <CODE>source</CODE>) builtin, returning either <VAR>n</VAR> or
4089 the exit status of the last command executed within the script as the exit
4090 status of the script.
4091 Any command associated with the <CODE>RETURN</CODE> trap is executed
4092 before execution resumes after the function or script.
4093 The return status is non-zero if <CODE>return</CODE> is used outside a function
4094 and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>.
4097 <DT><CODE>shift</CODE>
4098 <DD><A NAME="IDX82"></A>
4099 <TABLE><tr><td> </td><td class=example><pre>shift [<VAR>n</VAR>]
4100 </pre></td></tr></table>Shift the positional parameters to the left by <VAR>n</VAR>.
4101 The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are
4102 renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>.
4103 Parameters represented by the numbers <CODE>$#</CODE> to <CODE>$#</CODE>-<VAR>n</VAR>+1
4105 <VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>.
4106 If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters
4108 If <VAR>n</VAR> is not supplied, it is assumed to be 1.
4109 The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or
4110 less than zero, non-zero otherwise.
4113 <DT><CODE>test</CODE>
4114 <DD><DT><CODE>[</CODE>
4115 <DD><A NAME="IDX83"></A>
4116 <A NAME="IDX84"></A>
4117 Evaluate a conditional expression <VAR>expr</VAR>.
4118 Each operator and operand must be a separate argument.
4119 Expressions are composed of the primaries described below in
4120 <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>.
4121 <CODE>test</CODE> does not accept any options, nor does it accept and ignore
4122 an argument of <SAMP>`--'</SAMP> as signifying the end of options.
4125 When the <CODE>[</CODE> form is used, the last argument to the command must
4126 be a <CODE>]</CODE>.
4129 Expressions may be combined using the following operators, listed in
4130 decreasing order of precedence.
4131 The evaluation depends on the number of arguments; see below.
4135 <DT><CODE>! <VAR>expr</VAR></CODE>
4136 <DD>True if <VAR>expr</VAR> is false.
4139 <DT><CODE>( <VAR>expr</VAR> )</CODE>
4140 <DD>Returns the value of <VAR>expr</VAR>.
4141 This may be used to override the normal precedence of operators.
4144 <DT><CODE><VAR>expr1</VAR> -a <VAR>expr2</VAR></CODE>
4145 <DD>True if both <VAR>expr1</VAR> and <VAR>expr2</VAR> are true.
4148 <DT><CODE><VAR>expr1</VAR> -o <VAR>expr2</VAR></CODE>
4149 <DD>True if either <VAR>expr1</VAR> or <VAR>expr2</VAR> is true.
4153 The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional
4154 expressions using a set of rules based on the number of arguments.
4159 <DD>The expression is false.
4163 <DD>The expression is true if and only if the argument is not null.
4167 <DD>If the first argument is <SAMP>`!'</SAMP>, the expression is true if and
4168 only if the second argument is null.
4169 If the first argument is one of the unary conditional operators
4170 (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the expression
4171 is true if the unary test is true.
4172 If the first argument is not a valid unary operator, the expression is
4177 <DD>If the second argument is one of the binary conditional
4178 operators (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the
4179 result of the expression is the result of the binary test using the
4180 first and third arguments as operands.
4181 The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators
4182 when there are three arguments.
4183 If the first argument is <SAMP>`!'</SAMP>, the value is the negation of
4184 the two-argument test using the second and third arguments.
4185 If the first argument is exactly <SAMP>`('</SAMP> and the third argument is
4186 exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second
4188 Otherwise, the expression is false.
4192 <DD>If the first argument is <SAMP>`!'</SAMP>, the result is the negation of
4193 the three-argument expression composed of the remaining arguments.
4194 Otherwise, the expression is parsed and evaluated according to
4195 precedence using the rules listed above.
4198 <DT>5 or more arguments
4199 <DD>The expression is parsed and evaluated according to precedence
4200 using the rules listed above.
4204 <DT><CODE>times</CODE>
4205 <DD><A NAME="IDX85"></A>
4206 <TABLE><tr><td> </td><td class=example><pre>times
4207 </pre></td></tr></table>Print out the user and system times used by the shell and its children.
4208 The return status is zero.
4211 <DT><CODE>trap</CODE>
4212 <DD><A NAME="IDX86"></A>
4213 <TABLE><tr><td> </td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>]
4214 </pre></td></tr></table>The commands in <VAR>arg</VAR> are to be read and executed when the
4215 shell receives signal <VAR>sigspec</VAR>. If <VAR>arg</VAR> is absent (and
4216 there is a single <VAR>sigspec</VAR>) or
4217 equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset
4218 to the value it had when the shell was started.
4219 If <VAR>arg</VAR> is the null string, then the signal specified by
4220 each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes.
4221 If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied,
4222 the shell displays the trap commands associated with each <VAR>sigspec</VAR>.
4223 If no arguments are supplied, or
4224 only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands
4225 associated with each signal number in a form that may be reused as
4227 The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names
4228 and their corresponding numbers.
4229 Each <VAR>sigspec</VAR> is either a signal name or a signal number.
4230 Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional.
4233 If a <VAR>sigspec</VAR>
4234 is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits.
4235 If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed
4236 before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
4237 <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
4238 the first command executes in a shell function.
4239 Refer to the description of the <CODE>extdebug</CODE> option to the
4240 <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) for details of its
4241 effect on the <CODE>DEBUG</CODE> trap.
4242 If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed
4243 each time a shell function or a script executed with the <CODE>.</CODE> or
4244 <CODE>source</CODE> builtins finishes executing.
4247 If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR>
4248 is executed whenever a simple command has a non-zero exit status,
4249 subject to the following conditions.
4250 The <CODE>ERR</CODE> trap is not executed if the failed command is part of the
4251 command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword,
4252 part of the test following the <CODE>if</CODE> or <CODE>elif</CODE> reserved words,
4253 part of a command executed in a <CODE>&&</CODE> or <CODE>||</CODE> list,
4254 or if the command's return
4255 status is being inverted using <CODE>!</CODE>.
4256 These are the same conditions obeyed by the <CODE>errexit</CODE> option.
4259 Signals ignored upon entry to the shell cannot be trapped or reset.
4260 Trapped signals that are not being ignored are reset to their original
4261 values in a subshell or subshell environment when one is created.
4264 The return status is zero unless a <VAR>sigspec</VAR> does not specify a
4268 <DT><CODE>umask</CODE>
4269 <DD><A NAME="IDX87"></A>
4270 <TABLE><tr><td> </td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>]
4271 </pre></td></tr></table>Set the shell process's file creation mask to <VAR>mode</VAR>. If
4272 <VAR>mode</VAR> begins with a digit, it is interpreted as an octal number;
4273 if not, it is interpreted as a symbolic mode mask similar
4274 to that accepted by the <CODE>chmod</CODE> command. If <VAR>mode</VAR> is
4275 omitted, the current value of the mask is printed. If the <SAMP>`-S'</SAMP>
4276 option is supplied without a <VAR>mode</VAR> argument, the mask is printed
4277 in a symbolic format.
4278 If the <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR>
4279 is omitted, the output is in a form that may be reused as input.
4280 The return status is zero if the mode is successfully changed or if
4281 no <VAR>mode</VAR> argument is supplied, and non-zero otherwise.
4284 Note that when the mode is interpreted as an octal number, each number
4285 of the umask is subtracted from <CODE>7</CODE>. Thus, a umask of <CODE>022</CODE>
4286 results in permissions of <CODE>755</CODE>.
4289 <DT><CODE>unset</CODE>
4290 <DD><A NAME="IDX88"></A>
4291 <TABLE><tr><td> </td><td class=example><pre>unset [-fv] [<VAR>name</VAR>]
4292 </pre></td></tr></table>Each variable or function <VAR>name</VAR> is removed.
4293 If no options are supplied, or the <SAMP>`-v'</SAMP> option is given, each
4294 <VAR>name</VAR> refers to a shell variable.
4295 If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell
4296 functions, and the function definition is removed.
4297 Readonly variables and functions may not be unset.
4298 The return status is zero unless a <VAR>name</VAR> is readonly.
4302 <A NAME="Bash Builtins"></A>
4304 <A NAME="SEC60"></A>
4305 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4306 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> < </A>]</TD>
4307 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> > </A>]</TD>
4308 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> << </A>]</TD>
4309 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
4310 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD>
4311 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4312 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4313 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
4314 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4316 <H2> 4.2 Bash Builtin Commands </H2>
4317 <!--docid::SEC60::-->
4320 This section describes builtin commands which are unique to
4321 or have been extended in Bash.
4322 Some of these commands are specified in the POSIX standard.
4327 <DT><CODE>alias</CODE>
4328 <DD><A NAME="IDX89"></A>
4329 <TABLE><tr><td> </td><td class=example><pre>alias [<CODE>-p</CODE>] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4330 </pre></td></tr></table><P>
4332 Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints
4333 the list of aliases on the standard output in a form that allows
4334 them to be reused as input.
4335 If arguments are supplied, an alias is defined for each <VAR>name</VAR>
4336 whose <VAR>value</VAR> is given. If no <VAR>value</VAR> is given, the name
4337 and value of the alias is printed.
4338 Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>.
4341 <DT><CODE>bind</CODE>
4342 <DD><A NAME="IDX90"></A>
4343 <TABLE><tr><td> </td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSV]
4344 bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>]
4345 bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR>
4346 bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR>
4347 bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR>
4348 bind <VAR>readline-command</VAR>
4349 </pre></td></tr></table><P>
4351 Display current Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>)
4352 key and function bindings,
4353 bind a key sequence to a Readline function or macro,
4354 or set a Readline variable.
4355 Each non-option argument is a command as it would appear in a
4356 Readline initialization file (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>),
4357 but each binding or command must be passed as a separate argument; e.g.,
4358 <SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>.
4361 Options, if supplied, have the following meanings:
4365 <DT><CODE>-m <VAR>keymap</VAR></CODE>
4366 <DD>Use <VAR>keymap</VAR> as the keymap to be affected by
4367 the subsequent bindings. Acceptable <VAR>keymap</VAR>
4370 <CODE>emacs-standard</CODE>,
4371 <CODE>emacs-meta</CODE>,
4372 <CODE>emacs-ctlx</CODE>,
4374 <CODE>vi-move</CODE>,
4375 <CODE>vi-command</CODE>, and
4376 <CODE>vi-insert</CODE>.
4377 <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>;
4378 <CODE>emacs</CODE> is equivalent to <CODE>emacs-standard</CODE>.
4382 <DD>List the names of all Readline functions.
4386 <DD>Display Readline function names and bindings in such a way that they
4387 can be used as input or in a Readline initialization file.
4391 <DD>List current Readline function names and bindings.
4395 <DD>Display Readline variable names and values in such a way that they
4396 can be used as input or in a Readline initialization file.
4400 <DD>List current Readline variable names and values.
4404 <DD>Display Readline key sequences bound to macros and the strings they output
4405 in such a way that they can be used as input or in a Readline
4406 initialization file.
4410 <DD>Display Readline key sequences bound to macros and the strings they output.
4413 <DT><CODE>-f <VAR>filename</VAR></CODE>
4414 <DD>Read key bindings from <VAR>filename</VAR>.
4417 <DT><CODE>-q <VAR>function</VAR></CODE>
4418 <DD>Query about which keys invoke the named <VAR>function</VAR>.
4421 <DT><CODE>-u <VAR>function</VAR></CODE>
4422 <DD>Unbind all keys bound to the named <VAR>function</VAR>.
4425 <DT><CODE>-r <VAR>keyseq</VAR></CODE>
4426 <DD>Remove any current binding for <VAR>keyseq</VAR>.
4429 <DT><CODE>-x <VAR>keyseq:shell-command</VAR></CODE>
4430 <DD>Cause <VAR>shell-command</VAR> to be executed whenever <VAR>keyseq</VAR> is
4432 When <VAR>shell-command</VAR> is executed, the shell sets the
4433 <CODE>READLINE_LINE</CODE> variable to the contents of the Readline line
4434 buffer and the <CODE>READLINE_POINT</CODE> variable to the current location
4435 of the insertion point.
4436 If the executed command changes the value of <CODE>READLINE_LINE</CODE> or
4437 <CODE>READLINE_POINT</CODE>, those new values will be reflected in the
4442 The return status is zero unless an invalid option is supplied or an
4446 <DT><CODE>builtin</CODE>
4447 <DD><A NAME="IDX91"></A>
4448 <TABLE><tr><td> </td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]]
4449 </pre></td></tr></table>Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status.
4450 This is useful when defining a shell function with the same
4451 name as a shell builtin, retaining the functionality of the builtin within
4453 The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell
4457 <DT><CODE>caller</CODE>
4458 <DD><A NAME="IDX92"></A>
4459 <TABLE><tr><td> </td><td class=example><pre>caller [<VAR>expr</VAR>]
4460 </pre></td></tr></table>Returns the context of any active subroutine call (a shell function or
4461 a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins).
4464 Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source
4465 filename of the current subroutine call.
4466 If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE>
4467 displays the line number, subroutine name, and source file corresponding
4468 to that position in the current execution call stack. This extra
4469 information may be used, for example, to print a stack trace. The
4470 current frame is frame 0.
4473 The return value is 0 unless the shell is not executing a subroutine
4474 call or <VAR>expr</VAR> does not correspond to a valid position in the
4478 <DT><CODE>command</CODE>
4479 <DD><A NAME="IDX93"></A>
4480 <TABLE><tr><td> </td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>]
4481 </pre></td></tr></table>Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function
4482 named <VAR>command</VAR>.
4483 Only shell builtin commands or commands found by searching the
4484 <CODE>PATH</CODE> are executed.
4485 If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP>
4486 within the function will execute the external command <CODE>ls</CODE>
4487 instead of calling the function recursively.
4488 The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE>
4489 that is guaranteed to find all of the standard utilities.
4490 The return status in this case is 127 if <VAR>command</VAR> cannot be
4491 found or an error occurred, and the exit status of <VAR>command</VAR>
4495 If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a
4496 description of <VAR>command</VAR> is printed. The <SAMP>`-v'</SAMP> option
4497 causes a single word indicating the command or file name used to
4498 invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces
4499 a more verbose description. In this case, the return status is
4500 zero if <VAR>command</VAR> is found, and non-zero if not.
4503 <DT><CODE>declare</CODE>
4504 <DD><A NAME="IDX94"></A>
4505 <TABLE><tr><td> </td><td class=example><pre>declare [-aAfFilrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4506 </pre></td></tr></table><P>
4508 Declare variables and give them attributes. If no <VAR>name</VAR>s
4509 are given, then display the values of variables instead.
4512 The <SAMP>`-p'</SAMP> option will display the attributes and values of each
4514 When <SAMP>`-p'</SAMP> is used with <VAR>name</VAR> arguments, additional options
4518 When <SAMP>`-p'</SAMP> is supplied without <VAR>name</VAR> arguments, <CODE>declare</CODE>
4519 will display the attributes and values of all variables having the
4520 attributes specified by the additional options.
4521 If no other options are supplied with <SAMP>`-p'</SAMP>, <CODE>declare</CODE> will
4522 display the attributes and values of all shell variables. The <SAMP>`-f'</SAMP>
4523 option will restrict the display to shell functions.
4526 The <SAMP>`-F'</SAMP> option inhibits the display of function definitions;
4527 only the function name and attributes are printed.
4528 If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE>
4529 (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the source file name and line number where
4530 the function is defined are displayed as well.
4531 <SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>.
4532 The following options can be used to restrict output to variables with
4533 the specified attributes or to give variables attributes:
4538 <DD>Each <VAR>name</VAR> is an indexed array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
4542 <DD>Each <VAR>name</VAR> is an associative array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
4546 <DD>Use function names only.
4550 <DD>The variable is to be treated as
4551 an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) is
4552 performed when the variable is assigned a value.
4556 <DD>When the variable is assigned a value, all upper-case characters are
4557 converted to lower-case.
4558 The upper-case attribute is disabled.
4562 <DD>Make <VAR>name</VAR>s readonly. These names cannot then be assigned values
4563 by subsequent assignment statements or unset.
4567 <DD>Give each <VAR>name</VAR> the <CODE>trace</CODE> attribute.
4568 Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from
4570 The trace attribute has no special meaning for variables.
4574 <DD>When the variable is assigned a value, all lower-case characters are
4575 converted to upper-case.
4576 The lower-case attribute is disabled.
4580 <DD>Mark each <VAR>name</VAR> for export to subsequent commands via
4585 Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead,
4586 with the exceptions that <SAMP>`+a'</SAMP>
4587 may not be used to destroy an array variable and <SAMP>`+r'</SAMP> will not
4588 remove the readonly attribute.
4589 When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local,
4590 as with the <CODE>local</CODE> command. If a variable name is followed by
4591 =<VAR>value</VAR>, the value of the variable is set to <VAR>value</VAR>.
4594 The return status is zero unless an invalid option is encountered,
4595 an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>,
4596 an attempt is made to assign a value to a readonly variable,
4597 an attempt is made to assign a value to an array variable without
4598 using the compound assignment syntax (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>),
4599 one of the <VAR>names</VAR> is not a valid shell variable name,
4600 an attempt is made to turn off readonly status for a readonly variable,
4601 an attempt is made to turn off array status for an array variable,
4602 or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>.
4605 <DT><CODE>echo</CODE>
4606 <DD><A NAME="IDX95"></A>
4607 <TABLE><tr><td> </td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>]
4608 </pre></td></tr></table>Output the <VAR>arg</VAR>s, separated by spaces, terminated with a
4610 The return status is always 0.
4611 If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed.
4612 If the <SAMP>`-e'</SAMP> option is given, interpretation of the following
4613 backslash-escaped characters is enabled.
4614 The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters,
4615 even on systems where they are interpreted by default.
4616 The <CODE>xpg_echo</CODE> shell option may be used to
4617 dynamically determine whether or not <CODE>echo</CODE> expands these
4618 escape characters by default.
4619 <CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options.
4622 <CODE>echo</CODE> interprets the following escape sequences:
4629 <DD>suppress further output
4644 <DT><CODE>\0<VAR>nnn</VAR></CODE>
4645 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
4646 (zero to three octal digits)
4647 <DT><CODE>\x<VAR>HH</VAR></CODE>
4648 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
4649 (one or two hex digits)
4653 <DT><CODE>enable</CODE>
4654 <DD><A NAME="IDX96"></A>
4655 <TABLE><tr><td> </td><td class=example><pre>enable [-a] [-dnps] [-f <VAR>filename</VAR>] [<VAR>name</VAR> <small>...</small>]
4656 </pre></td></tr></table>Enable and disable builtin shell commands.
4657 Disabling a builtin allows a disk command which has the same name
4658 as a shell builtin to be executed without specifying a full pathname,
4659 even though the shell normally searches for builtins before disk commands.
4660 If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled. Otherwise
4661 <VAR>name</VAR>s are enabled. For example, to use the <CODE>test</CODE> binary
4662 found via <CODE>$PATH</CODE> instead of the shell builtin version, type
4663 <SAMP>`enable -n test'</SAMP>.
4666 If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear,
4667 a list of shell builtins is printed. With no other arguments, the list
4668 consists of all enabled shell builtins.
4669 The <SAMP>`-a'</SAMP> option means to list
4670 each builtin with an indication of whether or not it is enabled.
4673 The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR>
4674 from shared object <VAR>filename</VAR>, on systems that support dynamic loading.
4675 The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>.
4678 If there are no options, a list of the shell builtins is displayed.
4679 The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special
4680 builtins. If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes
4681 a special builtin (see section <A HREF="bashref.html#SEC64">4.4 Special Builtins</A>).
4684 The return status is zero unless a <VAR>name</VAR> is not a shell builtin
4685 or there is an error loading a new builtin from a shared object.
4688 <DT><CODE>help</CODE>
4689 <DD><A NAME="IDX97"></A>
4690 <TABLE><tr><td> </td><td class=example><pre>help [-dms] [<VAR>pattern</VAR>]
4691 </pre></td></tr></table>Display helpful information about builtin commands.
4692 If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help
4693 on all commands matching <VAR>pattern</VAR>, otherwise a list of
4694 the builtins is printed.
4697 Options, if supplied, have the following meanings:
4702 <DD>Display a short description of each <VAR>pattern</VAR>
4704 <DD>Display the description of each <VAR>pattern</VAR> in a manpage-like format
4706 <DD>Display only a short usage synopsis for each <VAR>pattern</VAR>
4710 The return status is zero unless no command matches <VAR>pattern</VAR>.
4713 <DT><CODE>let</CODE>
4714 <DD><A NAME="IDX98"></A>
4715 <TABLE><tr><td> </td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR>]
4716 </pre></td></tr></table>The <CODE>let</CODE> builtin allows arithmetic to be performed on shell
4717 variables. Each <VAR>expression</VAR> is evaluated according to the
4718 rules given below in <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>. If the
4719 last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1;
4720 otherwise 0 is returned.
4723 <DT><CODE>local</CODE>
4724 <DD><A NAME="IDX99"></A>
4725 <TABLE><tr><td> </td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>
4726 </pre></td></tr></table>For each argument, a local variable named <VAR>name</VAR> is created,
4727 and assigned <VAR>value</VAR>.
4728 The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>.
4729 <CODE>local</CODE> can only be used within a function; it makes the variable
4730 <VAR>name</VAR> have a visible scope restricted to that function and its
4731 children. The return status is zero unless <CODE>local</CODE> is used outside
4732 a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a
4736 <DT><CODE>logout</CODE>
4737 <DD><A NAME="IDX100"></A>
4738 <TABLE><tr><td> </td><td class=example><pre>logout [<VAR>n</VAR>]
4739 </pre></td></tr></table>Exit a login shell, returning a status of <VAR>n</VAR> to the shell's
4743 <DT><CODE>mapfile</CODE>
4744 <DD><A NAME="IDX101"></A>
4745 <TABLE><tr><td> </td><td class=example><pre>mapfile [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [
4746 -C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
4747 </pre></td></tr></table>Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
4748 or from file descriptor <VAR>fd</VAR>
4749 if the <SAMP>`-u'</SAMP> option is supplied.
4750 The variable <CODE>MAPFILE</CODE> is the default <VAR>array</VAR>.
4751 Options, if supplied, have the following meanings:
4755 <DD>Copy at most <VAR>count</VAR> lines. If <VAR>count</VAR> is 0, all lines are copied.
4757 <DD>Begin assigning to <VAR>array</VAR> at index <VAR>origin</VAR>.
4758 The default index is 0.
4760 <DD>Discard the first <VAR>count</VAR> lines read.
4762 <DD>Remove a trailing newline from each line read.
4764 <DD>Read lines from file descriptor <VAR>fd</VAR> instead of the standard input.
4766 <DD>Evaluate <VAR>callback</VAR> each time <VAR>quantum</VAR>P lines are read.
4767 The <SAMP>`-c'</SAMP> option specifies <VAR>quantum</VAR>.
4769 <DD>Specify the number of lines read between each call to <VAR>callback</VAR>.
4773 If <SAMP>`-C'</SAMP> is specified without <SAMP>`-c'</SAMP>,
4774 the default quantum is 5000.
4775 When <VAR>callback</VAR> is evaluated, it is supplied the index of the next
4776 array element to be assigned as an additional argument.
4777 <VAR>callback</VAR> is evaluated after the line is read but before the
4778 array element is assigned.
4781 If not supplied with an explicit origin, <CODE>mapfile</CODE> will clear <VAR>array</VAR>
4782 before assigning to it.
4785 <CODE>mapfile</CODE> returns successfully unless an invalid option or option
4786 argument is supplied, <VAR>array</VAR> is invalid or unassignable, or <VAR>array</VAR>
4787 is not an indexed array.
4790 <DT><CODE>printf</CODE>
4791 <DD><A NAME="IDX102"></A>
4792 <TABLE><tr><td> </td><td class=example><pre>printf [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>]
4793 </pre></td></tr></table>Write the formatted <VAR>arguments</VAR> to the standard output under the
4794 control of the <VAR>format</VAR>.
4795 The <VAR>format</VAR> is a character string which contains three types of objects:
4796 plain characters, which are simply copied to standard output, character
4797 escape sequences, which are converted and copied to the standard output, and
4798 format specifications, each of which causes printing of the next successive
4799 <VAR>argument</VAR>.
4800 In addition to the standard <CODE>printf(1)</CODE> formats, <SAMP>`%b'</SAMP> causes
4801 <CODE>printf</CODE> to expand backslash escape sequences in the corresponding
4802 <VAR>argument</VAR>,
4803 (except that <SAMP>`\c'</SAMP> terminates output, backslashes in
4804 <SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes
4805 beginning with <SAMP>`\0'</SAMP> may contain up to four digits),
4806 and <SAMP>`%q'</SAMP> causes <CODE>printf</CODE> to output the
4807 corresponding <VAR>argument</VAR> in a format that can be reused as shell input.
4810 The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable
4811 <VAR>var</VAR> rather than being printed to the standard output.
4814 The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>.
4815 If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the
4816 extra format specifications behave as if a zero value or null string, as
4817 appropriate, had been supplied. The return value is zero on success,
4818 non-zero on failure.
4821 <DT><CODE>read</CODE>
4822 <DD><A NAME="IDX103"></A>
4823 <TABLE><tr><td> </td><td class=example><pre>read [-ers] [-a <VAR>aname</VAR>] [-d <VAR>delim</VAR>] [-i <VAR>text</VAR>] [-n <VAR>nchars</VAR>] [-N <VAR>nchars</VAR>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>]
4824 </pre></td></tr></table>One line is read from the standard input, or from the file descriptor
4825 <VAR>fd</VAR> supplied as an argument to the <SAMP>`-u'</SAMP> option, and the first word
4826 is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>,
4827 and so on, with leftover words and their intervening separators assigned
4828 to the last <VAR>name</VAR>.
4829 If there are fewer words read from the input stream than names,
4830 the remaining names are assigned empty values.
4831 The characters in the value of the <CODE>IFS</CODE> variable
4832 are used to split the line into words.
4833 The backslash character <SAMP>`\'</SAMP> may be used to remove any special
4834 meaning for the next character read and for line continuation.
4835 If no names are supplied, the line read is assigned to the
4836 variable <CODE>REPLY</CODE>.
4837 The return code is zero, unless end-of-file is encountered, <CODE>read</CODE>
4838 times out (in which case the return code is greater than 128), or an
4839 invalid file descriptor is supplied as the argument to <SAMP>`-u'</SAMP>.
4842 Options, if supplied, have the following meanings:
4846 <DT><CODE>-a <VAR>aname</VAR></CODE>
4847 <DD>The words are assigned to sequential indices of the array variable
4848 <VAR>aname</VAR>, starting at 0.
4849 All elements are removed from <VAR>aname</VAR> before the assignment.
4850 Other <VAR>name</VAR> arguments are ignored.
4853 <DT><CODE>-d <VAR>delim</VAR></CODE>
4854 <DD>The first character of <VAR>delim</VAR> is used to terminate the input line,
4855 rather than newline.
4859 <DD>Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to obtain the line.
4860 Readline uses the current (or default, if line editing was not previously
4861 active) editing settings.
4864 <DT><CODE>-i <VAR>text</VAR></CODE>
4865 <DD>If Readline is being used to read the line, <VAR>text</VAR> is placed into
4866 the editing buffer before editing begins.
4869 <DT><CODE>-n <VAR>nchars</VAR></CODE>
4870 <DD><CODE>read</CODE> returns after reading <VAR>nchars</VAR> characters rather than
4871 waiting for a complete line of input, but honor a delimiter if fewer
4872 than <VAR>nchars</VAR> characters are read before the delimiter.
4875 <DT><CODE>-N <VAR>nchars</VAR></CODE>
4876 <DD><CODE>read</CODE> returns after reading exactly <VAR>nchars</VAR> characters rather
4877 than waiting for a complete line of input, unless EOF is encountered or
4878 <CODE>read</CODE> times out.
4879 Delimiter characters encountered in the input are
4880 not treated specially and do not cause <CODE>read</CODE> to return until
4881 <VAR>nchars</VAR> characters are read.
4884 <DT><CODE>-p <VAR>prompt</VAR></CODE>
4885 <DD>Display <VAR>prompt</VAR>, without a trailing newline, before attempting
4887 The prompt is displayed only if input is coming from a terminal.
4891 <DD>If this option is given, backslash does not act as an escape character.
4892 The backslash is considered to be part of the line.
4893 In particular, a backslash-newline pair may not be used as a line
4898 <DD>Silent mode. If input is coming from a terminal, characters are
4902 <DT><CODE>-t <VAR>timeout</VAR></CODE>
4903 <DD>Cause <CODE>read</CODE> to time out and return failure if a complete line of
4904 input is not read within <VAR>timeout</VAR> seconds.
4905 <VAR>timeout</VAR> may be a decimal number with a fractional portion following
4907 This option is only effective if <CODE>read</CODE> is reading input from a
4908 terminal, pipe, or other special file; it has no effect when reading
4910 If <VAR>timeout</VAR> is 0, <CODE>read</CODE> returns success if input is available on
4911 the specified file descriptor, failure otherwise.
4912 The exit status is greater than 128 if the timeout is exceeded.
4915 <DT><CODE>-u <VAR>fd</VAR></CODE>
4916 <DD>Read input from file descriptor <VAR>fd</VAR>.
4922 <DT><CODE>readarray</CODE>
4923 <DD><A NAME="IDX104"></A>
4924 <TABLE><tr><td> </td><td class=example><pre>readarray [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [
4925 -C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
4926 </pre></td></tr></table>Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
4927 or from file descriptor <VAR>fd</VAR>
4928 if the <SAMP>`-u'</SAMP> option is supplied.
4931 A synonym for <CODE>mapfile</CODE>.
4934 <DT><CODE>source</CODE>
4935 <DD><A NAME="IDX105"></A>
4936 <TABLE><tr><td> </td><td class=example><pre>source <VAR>filename</VAR>
4937 </pre></td></tr></table>A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
4940 <DT><CODE>type</CODE>
4941 <DD><A NAME="IDX106"></A>
4942 <TABLE><tr><td> </td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>]
4943 </pre></td></tr></table>For each <VAR>name</VAR>, indicate how it would be interpreted if used as a
4947 If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word
4948 which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>,
4949 <SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>,
4950 if <VAR>name</VAR> is an alias, shell function, shell builtin,
4951 disk file, or shell reserved word, respectively.
4952 If the <VAR>name</VAR> is not found, then nothing is printed, and
4953 <CODE>type</CODE> returns a failure status.
4956 If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name
4957 of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP>
4958 would not return <SAMP>`file'</SAMP>.
4961 The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if
4962 <SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>.
4965 If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value,
4966 not necessarily the file that appears first in <CODE>$PATH</CODE>.
4969 If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places
4970 that contain an executable named <VAR>file</VAR>.
4971 This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option
4975 If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find
4976 shell functions, as with the <CODE>command</CODE> builtin.
4979 The return status is zero if all of the <VAR>names</VAR> are found, non-zero
4980 if any are not found.
4983 <DT><CODE>typeset</CODE>
4984 <DD><A NAME="IDX107"></A>
4985 <TABLE><tr><td> </td><td class=example><pre>typeset [-afFrxi] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4986 </pre></td></tr></table>The <CODE>typeset</CODE> command is supplied for compatibility with the Korn
4987 shell; however, it has been deprecated in favor of the <CODE>declare</CODE>
4991 <DT><CODE>ulimit</CODE>
4992 <DD><A NAME="IDX108"></A>
4993 <TABLE><tr><td> </td><td class=example><pre>ulimit [-abcdefilmnpqrstuvxHST] [<VAR>limit</VAR>]
4994 </pre></td></tr></table><CODE>ulimit</CODE> provides control over the resources available to processes
4995 started by the shell, on systems that allow such control. If an
4996 option is given, it is interpreted as follows:
4999 <DD>Change and report the soft limit associated with a resource.
5003 <DD>Change and report the hard limit associated with a resource.
5007 <DD>All current limits are reported.
5011 <DD>The maximum socket buffer size.
5015 <DD>The maximum size of core files created.
5019 <DD>The maximum size of a process's data segment.
5023 <DD>The maximum scheduling priority ("nice").
5027 <DD>The maximum size of files written by the shell and its children.
5031 <DD>The maximum number of pending signals.
5035 <DD>The maximum size that may be locked into memory.
5039 <DD>The maximum resident set size (many systems do not honor this limit).
5043 <DD>The maximum number of open file descriptors (most systems do not
5044 allow this value to be set).
5048 <DD>The pipe buffer size.
5052 <DD>The maximum number of bytes in POSIX message queues.
5056 <DD>The maximum real-time scheduling priority.
5060 <DD>The maximum stack size.
5064 <DD>The maximum amount of cpu time in seconds.
5068 <DD>The maximum number of processes available to a single user.
5072 <DD>The maximum amount of virtual memory available to the process.
5076 <DD>The maximum number of file locks.
5080 <DD>The maximum number of threads.
5086 If <VAR>limit</VAR> is given, it is the new value of the specified resource;
5087 the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and
5088 <CODE>unlimited</CODE> stand for the current hard limit, the current soft limit,
5089 and no limit, respectively.
5090 A hard limit cannot be increased by a non-root user once it is set;
5091 a soft limit may be increased up to the value of the hard limit.
5092 Otherwise, the current value of the soft limit for the specified resource
5093 is printed, unless the <SAMP>`-H'</SAMP> option is supplied.
5094 When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied,
5095 both the hard and soft limits are set.
5096 If no option is given, then <SAMP>`-f'</SAMP> is assumed. Values are in 1024-byte
5097 increments, except for <SAMP>`-t'</SAMP>, which is in seconds, <SAMP>`-p'</SAMP>,
5098 which is in units of 512-byte blocks, and <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which
5099 are unscaled values.
5102 The return status is zero unless an invalid option or argument is supplied,
5103 or an error occurs while setting a new limit.
5106 <DT><CODE>unalias</CODE>
5107 <DD><A NAME="IDX109"></A>
5108 <TABLE><tr><td> </td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ]
5109 </pre></td></tr></table><P>
5111 Remove each <VAR>name</VAR> from the list of aliases. If <SAMP>`-a'</SAMP> is
5112 supplied, all aliases are removed.
5113 Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>.
5119 <A NAME="Modifying Shell Behavior"></A>
5121 <A NAME="SEC61"></A>
5122 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5123 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> < </A>]</TD>
5124 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> > </A>]</TD>
5125 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD>
5126 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
5127 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD>
5128 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5129 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5130 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5131 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5133 <H2> 4.3 Modifying Shell Behavior </H2>
5134 <!--docid::SEC61::-->
5136 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
5137 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Change the values of shell attributes and
5138 positional parameters.</TD></TR>
5139 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modify shell optional behavior.</TD></TR>
5140 </TABLE></BLOCKQUOTE>
5143 <A NAME="The Set Builtin"></A>
5145 <A NAME="SEC62"></A>
5146 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5147 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> < </A>]</TD>
5148 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> > </A>]</TD>
5149 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD>
5150 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD>
5151 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD>
5152 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5153 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5154 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5155 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5157 <H3> 4.3.1 The Set Builtin </H3>
5158 <!--docid::SEC62::-->
5161 This builtin is so complicated that it deserves its own section. <CODE>set</CODE>
5162 allows you to change the values of shell options and set the positional
5163 parameters, or to display the names and values of shell variables.
5167 <DT><CODE>set</CODE>
5168 <DD><A NAME="IDX110"></A>
5169 <TABLE><tr><td> </td><td class=example><pre>set [--abefhkmnptuvxBCEHPT] [-o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>]
5170 set [+abefhkmnptuvxBCEHPT] [+o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>]
5171 </pre></td></tr></table><P>
5173 If no options or arguments are supplied, <CODE>set</CODE> displays the names
5174 and values of all shell variables and functions, sorted according to the
5175 current locale, in a format that may be reused as input
5176 for setting or resetting the currently-set variables.
5177 Read-only variables cannot be reset.
5178 In POSIX mode, only shell variables are listed.
5181 When options are supplied, they set or unset shell attributes.
5182 Options, if specified, have the following meanings:
5187 <DD>Mark variables and function which are modified or created for export
5188 to the environment of subsequent commands.
5192 <DD>Cause the status of terminated background jobs to be reported
5193 immediately, rather than before printing the next primary prompt.
5197 <DD>Exit immediately if a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>), which may consist
5198 of a single simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>),
5199 a subshell command enclosed in parentheses (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>),
5200 or one of the commands executed as part of a command list enclosed
5201 by braces (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>)
5202 returns a non-zero status.
5203 The shell does not exit if the command that fails is part of the
5204 command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> keyword,
5205 part of the test in an <CODE>if</CODE> statement,
5206 part of any command executed in a <CODE>&&</CODE> or <CODE>||</CODE> list except
5207 the command following the final <CODE>&&</CODE> or <CODE>||</CODE>,
5208 any command in a pipeline but the last,
5209 or if the command's return status is being inverted with <CODE>!</CODE>.
5210 A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits.
5213 This option applies to the shell environment and each subshell environment
5214 separately (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and may cause
5215 subshells to exit before executing all the commands in the subshell.
5219 <DD>Disable filename expansion (globbing).
5223 <DD>Locate and remember (hash) commands as they are looked up for execution.
5224 This option is enabled by default.
5228 <DD>All arguments in the form of assignment statements are placed
5229 in the environment for a command, not just those that precede
5234 <DD>Job control is enabled (see section <A HREF="bashref.html#SEC91">7. Job Control</A>).
5238 <DD>Read commands but do not execute them; this may be used to check a
5239 script for syntax errors.
5240 This option is ignored by interactive shells.
5243 <DT><CODE>-o <VAR>option-name</VAR></CODE>
5246 Set the option corresponding to <VAR>option-name</VAR>:
5250 <DT><CODE>allexport</CODE>
5251 <DD>Same as <CODE>-a</CODE>.
5254 <DT><CODE>braceexpand</CODE>
5255 <DD>Same as <CODE>-B</CODE>.
5258 <DT><CODE>emacs</CODE>
5259 <DD>Use an <CODE>emacs</CODE>-style line editing interface (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>).
5260 This also affects the editing interface used for <CODE>read -e</CODE>.
5263 <DT><CODE>errexit</CODE>
5264 <DD>Same as <CODE>-e</CODE>.
5267 <DT><CODE>errtrace</CODE>
5268 <DD>Same as <CODE>-E</CODE>.
5271 <DT><CODE>functrace</CODE>
5272 <DD>Same as <CODE>-T</CODE>.
5275 <DT><CODE>hashall</CODE>
5276 <DD>Same as <CODE>-h</CODE>.
5279 <DT><CODE>histexpand</CODE>
5280 <DD>Same as <CODE>-H</CODE>.
5283 <DT><CODE>history</CODE>
5284 <DD>Enable command history, as described in <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>.
5285 This option is on by default in interactive shells.
5288 <DT><CODE>ignoreeof</CODE>
5289 <DD>An interactive shell will not exit upon reading EOF.
5292 <DT><CODE>keyword</CODE>
5293 <DD>Same as <CODE>-k</CODE>.
5296 <DT><CODE>monitor</CODE>
5297 <DD>Same as <CODE>-m</CODE>.
5300 <DT><CODE>noclobber</CODE>
5301 <DD>Same as <CODE>-C</CODE>.
5304 <DT><CODE>noexec</CODE>
5305 <DD>Same as <CODE>-n</CODE>.
5308 <DT><CODE>noglob</CODE>
5309 <DD>Same as <CODE>-f</CODE>.
5312 <DT><CODE>nolog</CODE>
5313 <DD>Currently ignored.
5316 <DT><CODE>notify</CODE>
5317 <DD>Same as <CODE>-b</CODE>.
5320 <DT><CODE>nounset</CODE>
5321 <DD>Same as <CODE>-u</CODE>.
5324 <DT><CODE>onecmd</CODE>
5325 <DD>Same as <CODE>-t</CODE>.
5328 <DT><CODE>physical</CODE>
5329 <DD>Same as <CODE>-P</CODE>.
5332 <DT><CODE>pipefail</CODE>
5333 <DD>If set, the return value of a pipeline is the value of the last
5334 (rightmost) command to exit with a non-zero status, or zero if all
5335 commands in the pipeline exit successfully.
5336 This option is disabled by default.
5339 <DT><CODE>posix</CODE>
5340 <DD>Change the behavior of Bash where the default operation differs
5341 from the POSIX standard to match the standard
5342 (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
5343 This is intended to make Bash behave as a strict superset of that
5347 <DT><CODE>privileged</CODE>
5348 <DD>Same as <CODE>-p</CODE>.
5351 <DT><CODE>verbose</CODE>
5352 <DD>Same as <CODE>-v</CODE>.
5356 <DD>Use a <CODE>vi</CODE>-style line editing interface.
5357 This also affects the editing interface used for <CODE>read -e</CODE>.
5360 <DT><CODE>xtrace</CODE>
5361 <DD>Same as <CODE>-x</CODE>.
5366 <DD>Turn on privileged mode.
5367 In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not
5368 processed, shell functions are not inherited from the environment,
5369 and the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE> and <CODE>GLOBIGNORE</CODE>
5370 variables, if they appear in the environment, are ignored.
5371 If the shell is started with the effective user (group) id not equal to the
5372 real user (group) id, and the <CODE>-p</CODE> option is not supplied, these actions
5373 are taken and the effective user id is set to the real user id.
5374 If the <CODE>-p</CODE> option is supplied at startup, the effective user id is
5376 Turning this option off causes the effective user
5377 and group ids to be set to the real user and group ids.
5381 <DD>Exit after reading and executing one command.
5385 <DD>Treat unset variables and parameters other than the special parameters
5386 <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP> as an error when performing parameter expansion.
5387 An error message will be written to the standard error, and a non-interactive
5392 <DD>Print shell input lines as they are read.
5396 <DD>Print a trace of simple commands, <CODE>for</CODE> commands, <CODE>case</CODE>
5397 commands, <CODE>select</CODE> commands, and arithmetic <CODE>for</CODE> commands
5398 and their arguments or associated word lists after they are
5399 expanded and before they are executed. The value of the <CODE>PS4</CODE>
5400 variable is expanded and the resultant value is printed before
5401 the command and its expanded arguments.
5405 <DD>The shell will perform brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>).
5406 This option is on by default.
5410 <DD>Prevent output redirection using <SAMP>`>'</SAMP>, <SAMP>`>&'</SAMP>, and <SAMP>`<>'</SAMP>
5411 from overwriting existing files.
5415 <DD>If set, any trap on <CODE>ERR</CODE> is inherited by shell functions, command
5416 substitutions, and commands executed in a subshell environment.
5417 The <CODE>ERR</CODE> trap is normally not inherited in such cases.
5421 <DD>Enable <SAMP>`!'</SAMP> style history substitution (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
5422 This option is on by default for interactive shells.
5426 <DD>If set, do not follow symbolic links when performing commands such as
5427 <CODE>cd</CODE> which change the current directory. The physical directory
5428 is used instead. By default, Bash follows
5429 the logical chain of directories when performing commands
5430 which change the current directory.
5433 For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT>
5435 <TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD
5439 </pre></td></tr></table></P><P>
5441 If <CODE>set -P</CODE> is on, then:
5442 <TABLE><tr><td> </td><td class=example><pre>$ cd /usr/sys; echo $PWD
5446 </pre></td></tr></table></P><P>
5449 <DD>If set, any trap on <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> are inherited by
5450 shell functions, command substitutions, and commands executed
5451 in a subshell environment.
5452 The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited
5457 <DD>If no arguments follow this option, then the positional parameters are
5458 unset. Otherwise, the positional parameters are set to the
5459 <VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>.
5463 <DD>Signal the end of options, cause all remaining <VAR>arguments</VAR>
5464 to be assigned to the positional parameters. The <SAMP>`-x'</SAMP>
5465 and <SAMP>`-v'</SAMP> options are turned off.
5466 If there are no arguments, the positional parameters remain unchanged.
5470 Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be
5471 turned off. The options can also be used upon invocation of the
5472 shell. The current set of options may be found in <CODE>$-</CODE>.
5475 The remaining N <VAR>arguments</VAR> are positional parameters and are
5476 assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small> <CODE>$N</CODE>.
5477 The special parameter <CODE>#</CODE> is set to N.
5480 The return status is always zero unless an invalid option is supplied.
5484 <A NAME="The Shopt Builtin"></A>
5486 <A NAME="SEC63"></A>
5487 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5488 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> < </A>]</TD>
5489 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> > </A>]</TD>
5490 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> << </A>]</TD>
5491 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD>
5492 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> >> </A>]</TD>
5493 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5494 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5495 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5496 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5498 <H3> 4.3.2 The Shopt Builtin </H3>
5499 <!--docid::SEC63::-->
5502 This builtin allows you to change additional shell optional behavior.
5507 <DT><CODE>shopt</CODE>
5508 <DD><A NAME="IDX111"></A>
5509 <TABLE><tr><td> </td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>]
5510 </pre></td></tr></table>Toggle the values of variables controlling optional shell behavior.
5511 With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable
5512 options is displayed, with an indication of whether or not each is set.
5513 The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that
5514 may be reused as input.
5515 Other options have the following meanings:
5520 <DD>Enable (set) each <VAR>optname</VAR>.
5524 <DD>Disable (unset) each <VAR>optname</VAR>.
5528 <DD>Suppresses normal output; the return status
5529 indicates whether the <VAR>optname</VAR> is set or unset.
5530 If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>,
5531 the return status is zero if all <VAR>optnames</VAR> are enabled;
5536 <DD>Restricts the values of
5537 <VAR>optname</VAR> to be those defined for the <SAMP>`-o'</SAMP> option to the
5538 <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
5542 If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP>
5543 is used with no <VAR>optname</VAR> arguments, the display is limited to
5544 those options which are set or unset, respectively.
5547 Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off)
5551 The return status when listing options is zero if all <VAR>optnames</VAR>
5552 are enabled, non-zero otherwise. When setting or unsetting options,
5553 the return status is zero unless an <VAR>optname</VAR> is not a valid shell
5557 The list of <CODE>shopt</CODE> options is:
5560 <DT><CODE>autocd</CODE>
5561 <DD>If set, a command name that is the name of a directory is executed as if
5562 it were the argument to the <CODE>cd</CODE> command.
5563 This option is only used by interactive shells.
5566 <DT><CODE>cdable_vars</CODE>
5567 <DD>If this is set, an argument to the <CODE>cd</CODE> builtin command that
5568 is not a directory is assumed to be the name of a variable whose
5569 value is the directory to change to.
5572 <DT><CODE>cdspell</CODE>
5573 <DD>If set, minor errors in the spelling of a directory component in a
5574 <CODE>cd</CODE> command will be corrected.
5575 The errors checked for are transposed characters,
5576 a missing character, and a character too many.
5577 If a correction is found, the corrected path is printed,
5578 and the command proceeds.
5579 This option is only used by interactive shells.
5582 <DT><CODE>checkhash</CODE>
5583 <DD>If this is set, Bash checks that a command found in the hash
5584 table exists before trying to execute it. If a hashed command no
5585 longer exists, a normal path search is performed.
5588 <DT><CODE>checkjobs</CODE>
5589 <DD>If set, Bash lists the status of any stopped and running jobs before
5590 exiting an interactive shell. If any jobs are running, this causes
5591 the exit to be deferred until a second exit is attempted without an
5592 intervening command (see section <A HREF="bashref.html#SEC91">7. Job Control</A>).
5593 The shell always postpones exiting if any jobs are stopped.
5596 <DT><CODE>checkwinsize</CODE>
5597 <DD>If set, Bash checks the window size after each command
5598 and, if necessary, updates the values of
5599 <CODE>LINES</CODE> and <CODE>COLUMNS</CODE>.
5602 <DT><CODE>cmdhist</CODE>
5604 attempts to save all lines of a multiple-line
5605 command in the same history entry. This allows
5606 easy re-editing of multi-line commands.
5609 <DT><CODE>compat31</CODE>
5611 changes its behavior to that of version 3.1 with respect to quoted
5612 arguments to the conditional command's =~ operator.
5615 <DT><CODE>dirspell</CODE>
5617 attempts spelling correction on directory names during word completion
5618 if the directory name initially supplied does not exist.
5621 <DT><CODE>dotglob</CODE>
5622 <DD>If set, Bash includes filenames beginning with a `.' in
5623 the results of filename expansion.
5626 <DT><CODE>execfail</CODE>
5627 <DD>If this is set, a non-interactive shell will not exit if
5628 it cannot execute the file specified as an argument to the <CODE>exec</CODE>
5629 builtin command. An interactive shell does not exit if <CODE>exec</CODE>
5633 <DT><CODE>expand_aliases</CODE>
5634 <DD>If set, aliases are expanded as described below under Aliases,
5635 <A HREF="bashref.html#SEC84">6.6 Aliases</A>.
5636 This option is enabled by default for interactive shells.
5639 <DT><CODE>extdebug</CODE>
5640 <DD>If set, behavior intended for use by debuggers is enabled:
5645 The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>)
5646 displays the source file name and line number corresponding to each function
5647 name supplied as an argument.
5651 If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the
5652 next command is skipped and not executed.
5656 If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the
5657 shell is executing in a subroutine (a shell function or a shell script
5658 executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to
5659 <CODE>return</CODE> is simulated.
5663 <CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their
5664 descriptions (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
5668 Function tracing is enabled: command substitution, shell functions, and
5669 subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5670 <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps.
5674 Error tracing is enabled: command substitution, shell functions, and
5675 subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5676 <CODE>ERROR</CODE> trap.
5680 <DT><CODE>extglob</CODE>
5681 <DD>If set, the extended pattern matching features described above
5682 (see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>) are enabled.
5685 <DT><CODE>extquote</CODE>
5686 <DD>If set, <CODE>$'<VAR>string</VAR>'</CODE> and <CODE>$"<VAR>string</VAR>"</CODE> quoting is
5687 performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions
5688 enclosed in double quotes. This option is enabled by default.
5691 <DT><CODE>failglob</CODE>
5692 <DD>If set, patterns which fail to match filenames during filename expansion
5693 result in an expansion error.
5696 <DT><CODE>force_fignore</CODE>
5697 <DD>If set, the suffixes specified by the <CODE>FIGNORE</CODE> shell variable
5698 cause words to be ignored when performing word completion even if
5699 the ignored words are the only possible completions.
5700 See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
5701 This option is enabled by default.
5704 <DT><CODE>globstar</CODE>
5705 <DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename expansion context will
5706 match a files and zero or more directories and subdirectories.
5707 If the pattern is followed by a <SAMP>`/'</SAMP>, only directories and
5708 subdirectories match.
5711 <DT><CODE>gnu_errfmt</CODE>
5712 <DD>If set, shell error messages are written in the standard GNU error
5716 <DT><CODE>histappend</CODE>
5717 <DD>If set, the history list is appended to the file named by the value
5718 of the <CODE>HISTFILE</CODE>
5719 variable when the shell exits, rather than overwriting the file.
5722 <DT><CODE>histreedit</CODE>
5723 <DD>If set, and Readline
5724 is being used, a user is given the opportunity to re-edit a
5725 failed history substitution.
5728 <DT><CODE>histverify</CODE>
5729 <DD>If set, and Readline
5730 is being used, the results of history substitution are not immediately
5731 passed to the shell parser. Instead, the resulting line is loaded into
5732 the Readline editing buffer, allowing further modification.
5735 <DT><CODE>hostcomplete</CODE>
5736 <DD>If set, and Readline is being used, Bash will attempt to perform
5737 hostname completion when a word containing a <SAMP>`@'</SAMP> is being
5738 completed (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>). This option is enabled
5742 <DT><CODE>huponexit</CODE>
5743 <DD>If set, Bash will send <CODE>SIGHUP</CODE> to all jobs when an interactive
5744 login shell exits (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
5747 <DT><CODE>interactive_comments</CODE>
5748 <DD>Allow a word beginning with <SAMP>`#'</SAMP>
5749 to cause that word and all remaining characters on that
5750 line to be ignored in an interactive shell.
5751 This option is enabled by default.
5754 <DT><CODE>lithist</CODE>
5755 <DD>If enabled, and the <CODE>cmdhist</CODE>
5756 option is enabled, multi-line commands are saved to the history with
5757 embedded newlines rather than using semicolon separators where possible.
5760 <DT><CODE>login_shell</CODE>
5761 <DD>The shell sets this option if it is started as a login shell
5762 (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
5763 The value may not be changed.
5766 <DT><CODE>mailwarn</CODE>
5767 <DD>If set, and a file that Bash is checking for mail has been
5768 accessed since the last time it was checked, the message
5769 <CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed.
5772 <DT><CODE>no_empty_cmd_completion</CODE>
5773 <DD>If set, and Readline is being used, Bash will not attempt to search
5774 the <CODE>PATH</CODE> for possible completions when completion is attempted
5778 <DT><CODE>nocaseglob</CODE>
5779 <DD>If set, Bash matches filenames in a case-insensitive fashion when
5780 performing filename expansion.
5783 <DT><CODE>nocasematch</CODE>
5784 <DD>If set, Bash matches patterns in a case-insensitive fashion when
5785 performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE>
5786 conditional commands.
5789 <DT><CODE>nullglob</CODE>
5790 <DD>If set, Bash allows filename patterns which match no
5791 files to expand to a null string, rather than themselves.
5794 <DT><CODE>progcomp</CODE>
5795 <DD>If set, the programmable completion facilities
5796 (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>) are enabled.
5797 This option is enabled by default.
5800 <DT><CODE>promptvars</CODE>
5801 <DD>If set, prompt strings undergo
5802 parameter expansion, command substitution, arithmetic
5803 expansion, and quote removal after being expanded
5804 as described below (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
5805 This option is enabled by default.
5808 <DT><CODE>restricted_shell</CODE>
5809 <DD>The shell sets this option if it is started in restricted mode
5810 (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
5811 The value may not be changed.
5812 This is not reset when the startup files are executed, allowing
5813 the startup files to discover whether or not a shell is restricted.
5816 <DT><CODE>shift_verbose</CODE>
5817 <DD>If this is set, the <CODE>shift</CODE>
5818 builtin prints an error message when the shift count exceeds the
5819 number of positional parameters.
5822 <DT><CODE>sourcepath</CODE>
5823 <DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE>
5824 to find the directory containing the file supplied as an argument.
5825 This option is enabled by default.
5828 <DT><CODE>xpg_echo</CODE>
5829 <DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences
5836 The return status when listing options is zero if all <VAR>optnames</VAR>
5837 are enabled, non-zero otherwise.
5838 When setting or unsetting options, the return status is zero unless an
5839 <VAR>optname</VAR> is not a valid shell option.
5845 <A NAME="Special Builtins"></A>
5847 <A NAME="SEC64"></A>
5848 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5849 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> < </A>]</TD>
5850 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> > </A>]</TD>
5851 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> << </A>]</TD>
5852 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
5853 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> >> </A>]</TD>
5854 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5855 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5856 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5857 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5859 <H2> 4.4 Special Builtins </H2>
5860 <!--docid::SEC64::-->
5863 For historical reasons, the POSIX standard has classified
5864 several builtin commands as <EM>special</EM>.
5865 When Bash is executing in POSIX mode, the special builtins
5866 differ from other builtin commands in three respects:
5871 Special builtins are found before shell functions during command lookup.
5875 If a special builtin returns an error status, a non-interactive shell exits.
5879 Assignment statements preceding the command stay in effect in the shell
5880 environment after the command completes.
5884 When Bash is not executing in POSIX mode, these builtins behave no
5885 differently than the rest of the Bash builtin commands.
5886 The Bash POSIX mode is described in <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>.
5889 These are the POSIX special builtins:
5890 <TABLE><tr><td> </td><td class=example><pre>break : . continue eval exec exit export readonly return set
5892 </pre></td></tr></table></P><P>
5894 <A NAME="Shell Variables"></A>
5896 <A NAME="SEC65"></A>
5897 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5898 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> < </A>]</TD>
5899 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> > </A>]</TD>
5900 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD>
5901 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
5902 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD>
5903 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5904 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5905 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5906 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5908 <H1> 5. Shell Variables </H1>
5909 <!--docid::SEC65::-->
5912 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
5913 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way
5914 as the Bourne Shell.</TD></TR>
5915 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR>
5916 </TABLE></BLOCKQUOTE>
5919 This chapter describes the shell variables that Bash uses.
5920 Bash automatically assigns default values to a number of variables.
5923 <A NAME="Bourne Shell Variables"></A>
5925 <A NAME="SEC66"></A>
5926 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5927 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> < </A>]</TD>
5928 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> > </A>]</TD>
5929 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD>
5930 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD>
5931 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD>
5932 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5933 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5934 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5935 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5937 <H2> 5.1 Bourne Shell Variables </H2>
5938 <!--docid::SEC66::-->
5941 Bash uses certain shell variables in the same way as the Bourne shell.
5942 In some cases, Bash assigns a default value to the variable.
5947 <A NAME="IDX112"></A>
5948 <DT><CODE>CDPATH</CODE>
5949 <DD><A NAME="IDX113"></A>
5950 A colon-separated list of directories used as a search path for
5951 the <CODE>cd</CODE> builtin command.
5954 <A NAME="IDX114"></A>
5955 <DT><CODE>HOME</CODE>
5956 <DD><A NAME="IDX115"></A>
5957 The current user's home directory; the default for the <CODE>cd</CODE> builtin
5959 The value of this variable is also used by tilde expansion
5960 (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
5963 <A NAME="IDX116"></A>
5964 <DT><CODE>IFS</CODE>
5965 <DD><A NAME="IDX117"></A>
5966 A list of characters that separate fields; used when the shell splits
5967 words as part of expansion.
5970 <A NAME="IDX118"></A>
5971 <DT><CODE>MAIL</CODE>
5972 <DD><A NAME="IDX119"></A>
5973 If this parameter is set to a filename and the <CODE>MAILPATH</CODE> variable
5974 is not set, Bash informs the user of the arrival of mail in
5978 <A NAME="IDX120"></A>
5979 <DT><CODE>MAILPATH</CODE>
5980 <DD><A NAME="IDX121"></A>
5981 A colon-separated list of filenames which the shell periodically checks
5983 Each list entry can specify the message that is printed when new mail
5984 arrives in the mail file by separating the file name from the message with
5986 When used in the text of the message, <CODE>$_</CODE> expands to the name of
5987 the current mail file.
5990 <A NAME="IDX122"></A>
5991 <DT><CODE>OPTARG</CODE>
5992 <DD><A NAME="IDX123"></A>
5993 The value of the last option argument processed by the <CODE>getopts</CODE> builtin.
5996 <A NAME="IDX124"></A>
5997 <DT><CODE>OPTIND</CODE>
5998 <DD><A NAME="IDX125"></A>
5999 The index of the last option argument processed by the <CODE>getopts</CODE> builtin.
6002 <A NAME="IDX126"></A>
6003 <DT><CODE>PATH</CODE>
6004 <DD><A NAME="IDX127"></A>
6005 A colon-separated list of directories in which the shell looks for
6007 A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the
6009 A null directory name may appear as two adjacent colons, or as an initial
6013 <A NAME="IDX128"></A>
6014 <DT><CODE>PS1</CODE>
6015 <DD><A NAME="IDX129"></A>
6016 The primary prompt string. The default value is <SAMP>`\s-\v\$ '</SAMP>.
6017 See section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for the complete list of escape
6018 sequences that are expanded before <CODE>PS1</CODE> is displayed.
6021 <A NAME="IDX130"></A>
6022 <DT><CODE>PS2</CODE>
6023 <DD><A NAME="IDX131"></A>
6024 The secondary prompt string. The default value is <SAMP>`> '</SAMP>.
6030 <A NAME="Bash Variables"></A>
6032 <A NAME="SEC67"></A>
6033 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6034 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> < </A>]</TD>
6035 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> > </A>]</TD>
6036 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> << </A>]</TD>
6037 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD>
6038 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> >> </A>]</TD>
6039 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6040 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6041 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6042 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6044 <H2> 5.2 Bash Variables </H2>
6045 <!--docid::SEC67::-->
6048 These variables are set or used by Bash, but other shells
6049 do not normally treat them specially.
6052 A few variables used by Bash are described in different chapters:
6053 variables for controlling the job control facilities
6054 (see section <A HREF="bashref.html#SEC94">7.3 Job Control Variables</A>).
6059 <A NAME="IDX132"></A>
6060 <DT><CODE>BASH</CODE>
6061 <DD><A NAME="IDX133"></A>
6062 The full pathname used to execute the current instance of Bash.
6065 <A NAME="IDX134"></A>
6066 <DT><CODE>BASHOPTS</CODE>
6067 <DD><A NAME="IDX135"></A>
6068 A colon-separated list of enabled shell options. Each word in
6069 the list is a valid argument for the <SAMP>`-s'</SAMP> option to the
6070 <CODE>shopt</CODE> builtin command (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
6071 The options appearing in <CODE>BASHOPTS</CODE> are those reported
6072 as <SAMP>`on'</SAMP> by <SAMP>`shopt'</SAMP>.
6073 If this variable is in the environment when Bash
6074 starts up, each shell option in the list will be enabled before
6075 reading any startup files. This variable is readonly.
6078 <A NAME="IDX136"></A>
6079 <DT><CODE>BASHPID</CODE>
6080 <DD><A NAME="IDX137"></A>
6081 Expands to the process id of the current Bash process.
6082 This differs from <CODE>$$</CODE> under certain circumstances, such as subshells
6083 that do not require Bash to be re-initialized.
6086 <A NAME="IDX138"></A>
6087 <DT><CODE>BASH_ALIASES</CODE>
6088 <DD><A NAME="IDX139"></A>
6089 An associative array variable whose members correspond to the internal
6090 list of aliases as maintained by the <CODE>alias</CODE> builtin
6091 (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
6092 Elements added to this array appear in the alias list; unsetting array
6093 elements cause aliases to be removed from the alias list.
6096 <A NAME="IDX140"></A>
6097 <DT><CODE>BASH_ARGC</CODE>
6098 <DD><A NAME="IDX141"></A>
6099 An array variable whose values are the number of parameters in each
6100 frame of the current bash execution call stack. The number of
6101 parameters to the current subroutine (shell function or script executed
6102 with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack. When a
6103 subroutine is executed, the number of parameters passed is pushed onto
6104 <CODE>BASH_ARGC</CODE>.
6105 The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode
6106 (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6107 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6111 <A NAME="IDX142"></A>
6112 <DT><CODE>BASH_ARGV</CODE>
6113 <DD><A NAME="IDX143"></A>
6114 An array variable containing all of the parameters in the current bash
6115 execution call stack. The final parameter of the last subroutine call
6116 is at the top of the stack; the first parameter of the initial call is
6117 at the bottom. When a subroutine is executed, the parameters supplied
6118 are pushed onto <CODE>BASH_ARGV</CODE>.
6119 The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode
6120 (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6121 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6125 <A NAME="IDX144"></A>
6126 <DT><CODE>BASH_CMDS</CODE>
6127 <DD><A NAME="IDX145"></A>
6128 An associative array variable whose members correspond to the internal
6129 hash table of commands as maintained by the <CODE>hash</CODE> builtin
6130 (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
6131 Elements added to this array appear in the hash table; unsetting array
6132 elements cause commands to be removed from the hash table.
6135 <A NAME="IDX146"></A>
6136 <DT><CODE>BASH_COMMAND</CODE>
6137 <DD><A NAME="IDX147"></A>
6138 The command currently being executed or about to be executed, unless the
6139 shell is executing a command as the result of a trap,
6140 in which case it is the command executing at the time of the trap.
6143 <A NAME="IDX148"></A>
6144 <DT><CODE>BASH_ENV</CODE>
6145 <DD><A NAME="IDX149"></A>
6146 If this variable is set when Bash is invoked to execute a shell
6147 script, its value is expanded and used as the name of a startup file
6148 to read before executing the script. See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>.
6151 <A NAME="IDX150"></A>
6152 <DT><CODE>BASH_EXECUTION_STRING</CODE>
6153 <DD><A NAME="IDX151"></A>
6154 The command argument to the <SAMP>`-c'</SAMP> invocation option.
6157 <A NAME="IDX152"></A>
6158 <DT><CODE>BASH_LINENO</CODE>
6159 <DD><A NAME="IDX153"></A>
6160 An array variable whose members are the line numbers in source files
6161 corresponding to each member of <VAR>FUNCNAME</VAR>.
6162 <CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file where
6163 <CODE>${FUNCNAME[$i]}</CODE> was called (or <CODE>${BASH_LINENO[$i-1]}</CODE> if
6164 referenced within another shell function).
6165 The corresponding source file name is <CODE>${BASH_SOURCE[$i]}</CODE>.
6166 Use <CODE>LINENO</CODE> to obtain the current line number.
6169 <A NAME="IDX154"></A>
6170 <DT><CODE>BASH_REMATCH</CODE>
6171 <DD><A NAME="IDX155"></A>
6172 An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary
6173 operator to the <CODE>[[</CODE> conditional command
6174 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
6175 The element with index 0 is the portion of the string
6176 matching the entire regular expression.
6177 The element with index <VAR>n</VAR> is the portion of the
6178 string matching the <VAR>n</VAR>th parenthesized subexpression.
6179 This variable is read-only.
6182 <A NAME="IDX156"></A>
6183 <DT><CODE>BASH_SOURCE</CODE>
6184 <DD><A NAME="IDX157"></A>
6185 An array variable whose members are the source filenames corresponding
6186 to the elements in the <CODE>FUNCNAME</CODE> array variable.
6189 <A NAME="IDX158"></A>
6190 <DT><CODE>BASH_SUBSHELL</CODE>
6191 <DD><A NAME="IDX159"></A>
6192 Incremented by one each time a subshell or subshell environment is spawned.
6193 The initial value is 0.
6196 <A NAME="IDX160"></A>
6197 <DT><CODE>BASH_VERSINFO</CODE>
6198 <DD><A NAME="IDX161"></A>
6199 A readonly array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
6200 whose members hold version information for this instance of Bash.
6201 The values assigned to the array members are as follows:
6206 <DT><CODE>BASH_VERSINFO[0]</CODE>
6207 <DD>The major version number (the <VAR>release</VAR>).
6210 <DT><CODE>BASH_VERSINFO[1]</CODE>
6211 <DD>The minor version number (the <VAR>version</VAR>).
6214 <DT><CODE>BASH_VERSINFO[2]</CODE>
6215 <DD>The patch level.
6218 <DT><CODE>BASH_VERSINFO[3]</CODE>
6219 <DD>The build version.
6222 <DT><CODE>BASH_VERSINFO[4]</CODE>
6223 <DD>The release status (e.g., <VAR>beta1</VAR>).
6226 <DT><CODE>BASH_VERSINFO[5]</CODE>
6227 <DD>The value of <CODE>MACHTYPE</CODE>.
6233 <A NAME="IDX162"></A>
6234 <DT><CODE>BASH_VERSION</CODE>
6235 <DD><A NAME="IDX163"></A>
6236 The version number of the current instance of Bash.
6239 <A NAME="IDX164"></A>
6240 <DT><CODE>BASH_XTRACEFD</CODE>
6241 <DD><A NAME="IDX165"></A>
6242 If set to an integer corresponding to a valid file descriptor, Bash
6243 will write the trace output generated when <SAMP>`set -x'</SAMP>
6244 is enabled to that file descriptor.
6245 This allows tracing output to be separated from diagnostic and error
6247 The file descriptor is closed when <CODE>BASH_XTRACEFD</CODE> is unset or assigned
6249 Unsetting <CODE>BASH_XTRACEFD</CODE> or assigning it the empty string causes the
6250 trace output to be sent to the standard error.
6251 Note that setting <CODE>BASH_XTRACEFD</CODE> to 2 (the standard error file
6252 descriptor) and then unsetting it will result in the standard error
6256 <A NAME="IDX166"></A>
6257 <DT><CODE>COLUMNS</CODE>
6258 <DD><A NAME="IDX167"></A>
6259 Used by the <CODE>select</CODE> builtin command to determine the terminal width
6260 when printing selection lists. Automatically set upon receipt of a
6261 <CODE>SIGWINCH</CODE>.
6264 <A NAME="IDX168"></A>
6265 <DT><CODE>COMP_CWORD</CODE>
6266 <DD><A NAME="IDX169"></A>
6267 An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current
6269 This variable is available only in shell functions invoked by the
6270 programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6273 <A NAME="IDX170"></A>
6274 <DT><CODE>COMP_LINE</CODE>
6275 <DD><A NAME="IDX171"></A>
6276 The current command line.
6277 This variable is available only in shell functions and external
6278 commands invoked by the
6279 programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6282 <A NAME="IDX172"></A>
6283 <DT><CODE>COMP_POINT</CODE>
6284 <DD><A NAME="IDX173"></A>
6285 The index of the current cursor position relative to the beginning of
6286 the current command.
6287 If the current cursor position is at the end of the current command,
6288 the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>.
6289 This variable is available only in shell functions and external
6290 commands invoked by the
6291 programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6294 <A NAME="IDX174"></A>
6295 <DT><CODE>COMP_TYPE</CODE>
6296 <DD><A NAME="IDX175"></A>
6297 Set to an integer value corresponding to the type of completion attempted
6298 that caused a completion function to be called:
6299 <VAR>TAB</VAR>, for normal completion,
6300 <SAMP>`?'</SAMP>, for listing completions after successive tabs,
6301 <SAMP>`!'</SAMP>, for listing alternatives on partial word completion,
6302 <SAMP>`@'</SAMP>, to list completions if the word is not unmodified,
6304 <SAMP>`%'</SAMP>, for menu completion.
6305 This variable is available only in shell functions and external
6306 commands invoked by the
6307 programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6310 <A NAME="IDX176"></A>
6311 <DT><CODE>COMP_KEY</CODE>
6312 <DD><A NAME="IDX177"></A>
6313 The key (or final key of a key sequence) used to invoke the current
6314 completion function.
6317 <A NAME="IDX178"></A>
6318 <DT><CODE>COMP_WORDBREAKS</CODE>
6319 <DD><A NAME="IDX179"></A>
6320 The set of characters that the Readline library treats as word
6321 separators when performing word completion.
6322 If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties,
6323 even if it is subsequently reset.
6326 <A NAME="IDX180"></A>
6327 <DT><CODE>COMP_WORDS</CODE>
6328 <DD><A NAME="IDX181"></A>
6329 An array variable consisting of the individual
6330 words in the current command line.
6331 The line is split into words as Readline would split it, using
6332 <CODE>COMP_WORDBREAKS</CODE> as described above.
6333 This variable is available only in shell functions invoked by the
6334 programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6337 <A NAME="IDX182"></A>
6338 <DT><CODE>COMPREPLY</CODE>
6339 <DD><A NAME="IDX183"></A>
6340 An array variable from which Bash reads the possible completions
6341 generated by a shell function invoked by the programmable completion
6342 facility (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6345 <A NAME="IDX184"></A>
6346 <DT><CODE>DIRSTACK</CODE>
6347 <DD><A NAME="IDX185"></A>
6348 An array variable containing the current contents of the directory stack.
6349 Directories appear in the stack in the order they are displayed by the
6350 <CODE>dirs</CODE> builtin.
6351 Assigning to members of this array variable may be used to modify
6352 directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE>
6353 builtins must be used to add and remove directories.
6354 Assignment to this variable will not change the current directory.
6355 If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if
6356 it is subsequently reset.
6359 <A NAME="IDX186"></A>
6360 <DT><CODE>EMACS</CODE>
6361 <DD><A NAME="IDX187"></A>
6362 If Bash finds this variable in the environment when the shell
6363 starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an
6364 emacs shell buffer and disables line editing.
6367 <A NAME="IDX188"></A>
6368 <DT><CODE>EUID</CODE>
6369 <DD><A NAME="IDX189"></A>
6370 The numeric effective user id of the current user. This variable
6374 <A NAME="IDX190"></A>
6375 <DT><CODE>FCEDIT</CODE>
6376 <DD><A NAME="IDX191"></A>
6377 The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE>
6381 <A NAME="IDX192"></A>
6382 <DT><CODE>FIGNORE</CODE>
6383 <DD><A NAME="IDX193"></A>
6384 A colon-separated list of suffixes to ignore when performing
6385 filename completion.
6386 A file name whose suffix matches one of the entries in
6387 <CODE>FIGNORE</CODE>
6388 is excluded from the list of matched file names. A sample
6389 value is <SAMP>`.o:~'</SAMP>
6392 <A NAME="IDX194"></A>
6393 <DT><CODE>FUNCNAME</CODE>
6394 <DD><A NAME="IDX195"></A>
6395 An array variable containing the names of all shell functions
6396 currently in the execution call stack.
6397 The element with index 0 is the name of any currently-executing
6399 The bottom-most element is <CODE>"main"</CODE>.
6400 This variable exists only when a shell function is executing.
6401 Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status.
6402 If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if
6403 it is subsequently reset.
6406 <A NAME="IDX196"></A>
6407 <DT><CODE>GLOBIGNORE</CODE>
6408 <DD><A NAME="IDX197"></A>
6409 A colon-separated list of patterns defining the set of filenames to
6410 be ignored by filename expansion.
6411 If a filename matched by a filename expansion pattern also matches one
6412 of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list
6416 <A NAME="IDX198"></A>
6417 <DT><CODE>GROUPS</CODE>
6418 <DD><A NAME="IDX199"></A>
6419 An array variable containing the list of groups of which the current
6421 Assignments to <CODE>GROUPS</CODE> have no effect and return an error status.
6422 If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is
6426 <A NAME="IDX200"></A>
6427 <DT><CODE>histchars</CODE>
6428 <DD><A NAME="IDX201"></A>
6429 Up to three characters which control history expansion, quick
6430 substitution, and tokenization (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
6431 The first character is the
6432 <VAR>history expansion</VAR> character, that is, the character which signifies the
6433 start of a history expansion, normally <SAMP>`!'</SAMP>. The second character is the
6434 character which signifies `quick substitution' when seen as the first
6435 character on a line, normally <SAMP>`^'</SAMP>. The optional third character is the
6436 character which indicates that the remainder of the line is a comment when
6437 found as the first character of a word, usually <SAMP>`#'</SAMP>. The history
6438 comment character causes history substitution to be skipped for the
6439 remaining words on the line. It does not necessarily cause the shell
6440 parser to treat the rest of the line as a comment.
6443 <A NAME="IDX202"></A>
6444 <DT><CODE>HISTCMD</CODE>
6445 <DD><A NAME="IDX203"></A>
6446 The history number, or index in the history list, of the current
6447 command. If <CODE>HISTCMD</CODE> is unset, it loses its special properties,
6448 even if it is subsequently reset.
6451 <A NAME="IDX204"></A>
6452 <DT><CODE>HISTCONTROL</CODE>
6453 <DD><A NAME="IDX205"></A>
6454 A colon-separated list of values controlling how commands are saved on
6456 If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin
6457 with a space character are not saved in the history list.
6458 A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous
6459 history entry to not be saved.
6460 A value of <SAMP>`ignoreboth'</SAMP> is shorthand for
6461 <SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>.
6462 A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the
6463 current line to be removed from the history list before that line
6465 Any value not in the above list is ignored.
6466 If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value,
6467 all lines read by the shell parser are saved on the history list,
6468 subject to the value of <CODE>HISTIGNORE</CODE>.
6469 The second and subsequent lines of a multi-line compound command are
6470 not tested, and are added to the history regardless of the value of
6471 <CODE>HISTCONTROL</CODE>.
6474 <A NAME="IDX206"></A>
6475 <DT><CODE>HISTFILE</CODE>
6476 <DD><A NAME="IDX207"></A>
6477 The name of the file to which the command history is saved. The
6478 default value is <TT>`~/.bash_history'</TT>.
6481 <A NAME="IDX208"></A>
6482 <DT><CODE>HISTFILESIZE</CODE>
6483 <DD><A NAME="IDX209"></A>
6484 The maximum number of lines contained in the history file. When this
6485 variable is assigned a value, the history file is truncated, if
6486 necessary, by removing the oldest entries,
6487 to contain no more than that number of lines.
6488 The history file is also truncated to this size after
6489 writing it when an interactive shell exits.
6490 The default value is 500.
6493 <A NAME="IDX210"></A>
6494 <DT><CODE>HISTIGNORE</CODE>
6495 <DD><A NAME="IDX211"></A>
6496 A colon-separated list of patterns used to decide which command
6497 lines should be saved on the history list. Each pattern is
6498 anchored at the beginning of the line and must match the complete
6499 line (no implicit <SAMP>`*'</SAMP> is appended). Each pattern is tested
6500 against the line after the checks specified by <CODE>HISTCONTROL</CODE>
6501 are applied. In addition to the normal shell pattern matching
6502 characters, <SAMP>`&'</SAMP> matches the previous history line. <SAMP>`&'</SAMP>
6503 may be escaped using a backslash; the backslash is removed
6504 before attempting a match.
6505 The second and subsequent lines of a multi-line compound command are
6506 not tested, and are added to the history regardless of the value of
6507 <CODE>HISTIGNORE</CODE>.
6510 <CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>. A
6511 pattern of <SAMP>`&'</SAMP> is identical to <CODE>ignoredups</CODE>, and a
6512 pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>.
6513 Combining these two patterns, separating them with a colon,
6514 provides the functionality of <CODE>ignoreboth</CODE>.
6517 <A NAME="IDX212"></A>
6518 <DT><CODE>HISTSIZE</CODE>
6519 <DD><A NAME="IDX213"></A>
6520 The maximum number of commands to remember on the history list.
6521 The default value is 500.
6524 <A NAME="IDX214"></A>
6525 <DT><CODE>HISTTIMEFORMAT</CODE>
6526 <DD><A NAME="IDX215"></A>
6527 If this variable is set and not null, its value is used as a format string
6528 for <VAR>strftime</VAR> to print the time stamp associated with each history
6529 entry displayed by the <CODE>history</CODE> builtin.
6530 If this variable is set, time stamps are written to the history file so
6531 they may be preserved across shell sessions.
6532 This uses the history comment character to distinguish timestamps from
6533 other history lines.
6536 <A NAME="IDX216"></A>
6537 <DT><CODE>HOSTFILE</CODE>
6538 <DD><A NAME="IDX217"></A>
6539 Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that
6540 should be read when the shell needs to complete a hostname.
6541 The list of possible hostname completions may be changed while the shell
6543 the next time hostname completion is attempted after the
6544 value is changed, Bash adds the contents of the new file to the
6546 If <CODE>HOSTFILE</CODE> is set, but has no value, or does not name a readable file,
6547 Bash attempts to read
6548 <TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions.
6549 When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared.
6552 <A NAME="IDX218"></A>
6553 <DT><CODE>HOSTNAME</CODE>
6554 <DD><A NAME="IDX219"></A>
6555 The name of the current host.
6558 <A NAME="IDX220"></A>
6559 <DT><CODE>HOSTTYPE</CODE>
6560 <DD><A NAME="IDX221"></A>
6561 A string describing the machine Bash is running on.
6564 <A NAME="IDX222"></A>
6565 <DT><CODE>IGNOREEOF</CODE>
6566 <DD><A NAME="IDX223"></A>
6567 Controls the action of the shell on receipt of an <CODE>EOF</CODE> character
6568 as the sole input. If set, the value denotes the number
6569 of consecutive <CODE>EOF</CODE> characters that can be read as the
6570 first character on an input line
6571 before the shell will exit. If the variable exists but does not
6572 have a numeric value (or has no value) then the default is 10.
6573 If the variable does not exist, then <CODE>EOF</CODE> signifies the end of
6574 input to the shell. This is only in effect for interactive shells.
6577 <A NAME="IDX224"></A>
6578 <DT><CODE>INPUTRC</CODE>
6579 <DD><A NAME="IDX225"></A>
6580 The name of the Readline initialization file, overriding the default
6581 of <TT>`~/.inputrc'</TT>.
6584 <A NAME="IDX226"></A>
6585 <DT><CODE>LANG</CODE>
6586 <DD><A NAME="IDX227"></A>
6587 Used to determine the locale category for any category not specifically
6588 selected with a variable starting with <CODE>LC_</CODE>.
6591 <A NAME="IDX228"></A>
6592 <DT><CODE>LC_ALL</CODE>
6593 <DD><A NAME="IDX229"></A>
6594 This variable overrides the value of <CODE>LANG</CODE> and any other
6595 <CODE>LC_</CODE> variable specifying a locale category.
6598 <A NAME="IDX230"></A>
6599 <DT><CODE>LC_COLLATE</CODE>
6600 <DD><A NAME="IDX231"></A>
6601 This variable determines the collation order used when sorting the
6602 results of filename expansion, and
6603 determines the behavior of range expressions, equivalence classes,
6604 and collating sequences within filename expansion and pattern matching
6605 (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
6608 <A NAME="IDX232"></A>
6609 <DT><CODE>LC_CTYPE</CODE>
6610 <DD><A NAME="IDX233"></A>
6611 This variable determines the interpretation of characters and the
6612 behavior of character classes within filename expansion and pattern
6613 matching (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
6616 <A NAME="IDX234"></A>
6617 <DT><CODE>LC_MESSAGES</CODE>
6618 <DD><A NAME="IDX235"></A>
6619 This variable determines the locale used to translate double-quoted
6620 strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
6623 <A NAME="IDX236"></A>
6624 <DT><CODE>LC_NUMERIC</CODE>
6625 <DD><A NAME="IDX237"></A>
6626 This variable determines the locale category used for number formatting.
6629 <A NAME="IDX238"></A>
6630 <DT><CODE>LINENO</CODE>
6631 <DD><A NAME="IDX239"></A>
6632 The line number in the script or shell function currently executing.
6635 <A NAME="IDX240"></A>
6636 <DT><CODE>LINES</CODE>
6637 <DD><A NAME="IDX241"></A>
6638 Used by the <CODE>select</CODE> builtin command to determine the column length
6639 for printing selection lists. Automatically set upon receipt of a
6640 <CODE>SIGWINCH</CODE>.
6643 <A NAME="IDX242"></A>
6644 <DT><CODE>MACHTYPE</CODE>
6645 <DD><A NAME="IDX243"></A>
6646 A string that fully describes the system type on which Bash
6647 is executing, in the standard GNU <VAR>cpu-company-system</VAR> format.
6650 <A NAME="IDX244"></A>
6651 <DT><CODE>MAILCHECK</CODE>
6652 <DD><A NAME="IDX245"></A>
6653 How often (in seconds) that the shell should check for mail in the
6654 files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables.
6655 The default is 60 seconds. When it is time to check
6656 for mail, the shell does so before displaying the primary prompt.
6657 If this variable is unset, or set to a value that is not a number
6658 greater than or equal to zero, the shell disables mail checking.
6661 <A NAME="IDX246"></A>
6662 <DT><CODE>OLDPWD</CODE>
6663 <DD><A NAME="IDX247"></A>
6664 The previous working directory as set by the <CODE>cd</CODE> builtin.
6667 <A NAME="IDX248"></A>
6668 <DT><CODE>OPTERR</CODE>
6669 <DD><A NAME="IDX249"></A>
6670 If set to the value 1, Bash displays error messages
6671 generated by the <CODE>getopts</CODE> builtin command.
6674 <A NAME="IDX250"></A>
6675 <DT><CODE>OSTYPE</CODE>
6676 <DD><A NAME="IDX251"></A>
6677 A string describing the operating system Bash is running on.
6680 <A NAME="IDX252"></A>
6681 <DT><CODE>PIPESTATUS</CODE>
6682 <DD><A NAME="IDX253"></A>
6683 An array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
6684 containing a list of exit status values from the processes
6685 in the most-recently-executed foreground pipeline (which may
6686 contain only a single command).
6689 <A NAME="IDX254"></A>
6690 <DT><CODE>POSIXLY_CORRECT</CODE>
6691 <DD><A NAME="IDX255"></A>
6692 If this variable is in the environment when <CODE>bash</CODE> starts, the shell
6693 enters POSIX mode (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>) before reading the
6694 startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied.
6695 If it is set while the shell is running, <CODE>bash</CODE> enables POSIX mode,
6697 <TABLE><tr><td> </td><td class=example><pre><CODE>set -o posix</CODE>
6698 </pre></td></tr></table>had been executed.
6701 <A NAME="IDX256"></A>
6702 <DT><CODE>PPID</CODE>
6703 <DD><A NAME="IDX257"></A>
6704 The process ID of the shell's parent process. This variable
6708 <A NAME="IDX258"></A>
6709 <DT><CODE>PROMPT_COMMAND</CODE>
6710 <DD><A NAME="IDX259"></A>
6711 If set, the value is interpreted as a command to execute
6712 before the printing of each primary prompt (<CODE>$PS1</CODE>).
6715 <A NAME="IDX260"></A>
6716 <DT><CODE>PROMPT_DIRTRIM</CODE>
6717 <DD><A NAME="IDX261"></A>
6718 If set to a number greater than zero, the value is used as the number of
6719 trailing directory components to retain when expanding the <CODE>\w</CODE> and
6720 <CODE>\W</CODE> prompt string escapes (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
6721 Characters removed are replaced with an ellipsis.
6724 <A NAME="IDX262"></A>
6725 <DT><CODE>PS3</CODE>
6726 <DD><A NAME="IDX263"></A>
6727 The value of this variable is used as the prompt for the
6728 <CODE>select</CODE> command. If this variable is not set, the
6729 <CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP>
6732 <A NAME="IDX264"></A>
6733 <DT><CODE>PS4</CODE>
6734 <DD><A NAME="IDX265"></A>
6735 The value is the prompt printed before the command line is echoed
6736 when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
6737 The first character of <CODE>PS4</CODE> is replicated multiple times, as
6738 necessary, to indicate multiple levels of indirection.
6739 The default is <SAMP>`+ '</SAMP>.
6742 <A NAME="IDX266"></A>
6743 <DT><CODE>PWD</CODE>
6744 <DD><A NAME="IDX267"></A>
6745 The current working directory as set by the <CODE>cd</CODE> builtin.
6748 <A NAME="IDX268"></A>
6749 <DT><CODE>RANDOM</CODE>
6750 <DD><A NAME="IDX269"></A>
6751 Each time this parameter is referenced, a random integer
6752 between 0 and 32767 is generated. Assigning a value to this
6753 variable seeds the random number generator.
6756 <A NAME="IDX270"></A>
6757 <DT><CODE>REPLY</CODE>
6758 <DD><A NAME="IDX271"></A>
6759 The default variable for the <CODE>read</CODE> builtin.
6762 <A NAME="IDX272"></A>
6763 <DT><CODE>SECONDS</CODE>
6764 <DD><A NAME="IDX273"></A>
6765 This variable expands to the number of seconds since the
6766 shell was started. Assignment to this variable resets
6767 the count to the value assigned, and the expanded value
6768 becomes the value assigned plus the number of seconds
6769 since the assignment.
6772 <A NAME="IDX274"></A>
6773 <DT><CODE>SHELL</CODE>
6774 <DD><A NAME="IDX275"></A>
6775 The full pathname to the shell is kept in this environment variable.
6776 If it is not set when the shell starts,
6777 Bash assigns to it the full pathname of the current user's login shell.
6780 <A NAME="IDX276"></A>
6781 <DT><CODE>SHELLOPTS</CODE>
6782 <DD><A NAME="IDX277"></A>
6783 A colon-separated list of enabled shell options. Each word in
6784 the list is a valid argument for the <SAMP>`-o'</SAMP> option to the
6785 <CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
6786 The options appearing in <CODE>SHELLOPTS</CODE> are those reported
6787 as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>.
6788 If this variable is in the environment when Bash
6789 starts up, each shell option in the list will be enabled before
6790 reading any startup files. This variable is readonly.
6793 <A NAME="IDX278"></A>
6794 <DT><CODE>SHLVL</CODE>
6795 <DD><A NAME="IDX279"></A>
6796 Incremented by one each time a new instance of Bash is started. This is
6797 intended to be a count of how deeply your Bash shells are nested.
6800 <A NAME="IDX280"></A>
6801 <DT><CODE>TIMEFORMAT</CODE>
6802 <DD><A NAME="IDX281"></A>
6803 The value of this parameter is used as a format string specifying
6804 how the timing information for pipelines prefixed with the <CODE>time</CODE>
6805 reserved word should be displayed.
6806 The <SAMP>`%'</SAMP> character introduces an
6807 escape sequence that is expanded to a time value or other
6809 The escape sequences and their meanings are as
6810 follows; the braces denote optional portions.
6816 <DD>A literal <SAMP>`%'</SAMP>.
6819 <DT><CODE>%[<VAR>p</VAR>][l]R</CODE>
6820 <DD>The elapsed time in seconds.
6823 <DT><CODE>%[<VAR>p</VAR>][l]U</CODE>
6824 <DD>The number of CPU seconds spent in user mode.
6827 <DT><CODE>%[<VAR>p</VAR>][l]S</CODE>
6828 <DD>The number of CPU seconds spent in system mode.
6832 <DD>The CPU percentage, computed as (%U + %S) / %R.
6836 The optional <VAR>p</VAR> is a digit specifying the precision, the number of
6837 fractional digits after a decimal point.
6838 A value of 0 causes no decimal point or fraction to be output.
6839 At most three places after the decimal point may be specified; values
6840 of <VAR>p</VAR> greater than 3 are changed to 3.
6841 If <VAR>p</VAR> is not specified, the value 3 is used.
6844 The optional <CODE>l</CODE> specifies a longer format, including minutes, of
6845 the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s.
6846 The value of <VAR>p</VAR> determines whether or not the fraction is included.
6849 If this variable is not set, Bash acts as if it had the value
6850 <TABLE><tr><td> </td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE>
6851 </pre></td></tr></table>If the value is null, no timing information is displayed.
6852 A trailing newline is added when the format string is displayed.
6855 <A NAME="IDX282"></A>
6856 <DT><CODE>TMOUT</CODE>
6857 <DD><A NAME="IDX283"></A>
6858 If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the
6859 default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
6860 The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates
6861 if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming
6865 In an interactive shell, the value is interpreted as
6866 the number of seconds to wait for input after issuing the primary
6867 prompt when the shell is interactive.
6868 Bash terminates after that number of seconds if input does
6872 <A NAME="IDX284"></A>
6873 <DT><CODE>TMPDIR</CODE>
6874 <DD><A NAME="IDX285"></A>
6875 If set, Bash uses its value as the name of a directory in which
6876 Bash creates temporary files for the shell's use.
6879 <A NAME="IDX286"></A>
6880 <DT><CODE>UID</CODE>
6881 <DD><A NAME="IDX287"></A>
6882 The numeric real user id of the current user. This variable is readonly.
6888 <A NAME="Bash Features"></A>
6890 <A NAME="SEC68"></A>
6891 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6892 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> < </A>]</TD>
6893 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> > </A>]</TD>
6894 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD>
6895 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
6896 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
6897 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6898 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6899 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6900 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6902 <H1> 6. Bash Features </H1>
6903 <!--docid::SEC68::-->
6906 This section describes features unique to Bash.
6909 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
6910 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Command line options that you can give
6912 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">When and how Bash executes scripts.</TD></TR>
6913 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What an interactive shell is.</TD></TR>
6914 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Primitives used in composing expressions for
6915 the <CODE>test</CODE> builtin.</TD></TR>
6916 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR>
6917 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR>
6918 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR>
6919 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR>
6920 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the PS1 string.</TD></TR>
6921 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR>
6922 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what
6923 the POSIX standard specifies.</TD></TR>
6924 </TABLE></BLOCKQUOTE>
6927 <A NAME="Invoking Bash"></A>
6929 <A NAME="SEC69"></A>
6930 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6931 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> < </A>]</TD>
6932 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> > </A>]</TD>
6933 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD>
6934 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
6935 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
6936 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6937 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6938 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6939 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6941 <H2> 6.1 Invoking Bash </H2>
6942 <!--docid::SEC69::-->
6945 <TABLE><tr><td> </td><td class=example><pre>bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
6946 bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>]
6947 bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
6948 </pre></td></tr></table></P><P>
6950 In addition to the single-character shell command-line options
6951 (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), there are several multi-character
6952 options that you can use. These options must appear on the command
6953 line before the single-character options to be recognized.
6957 <DT><CODE>--debugger</CODE>
6958 <DD>Arrange for the debugger profile to be executed before the shell
6959 starts. Turns on extended debugging mode (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6960 for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6961 builtin) and shell function tracing
6962 (see <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A> for a description of the <CODE>-o functrace</CODE>
6966 <DT><CODE>--dump-po-strings</CODE>
6967 <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
6968 is printed on the standard output
6969 in the GNU <CODE>gettext</CODE> PO (portable object) file format.
6970 Equivalent to <SAMP>`-D'</SAMP> except for the output format.
6973 <DT><CODE>--dump-strings</CODE>
6974 <DD>Equivalent to <SAMP>`-D'</SAMP>.
6977 <DT><CODE>--help</CODE>
6978 <DD>Display a usage message on standard output and exit successfully.
6981 <DT><CODE>--init-file <VAR>filename</VAR></CODE>
6982 <DD><DT><CODE>--rcfile <VAR>filename</VAR></CODE>
6983 <DD>Execute commands from <VAR>filename</VAR> (instead of <TT>`~/.bashrc'</TT>)
6984 in an interactive shell.
6987 <DT><CODE>--login</CODE>
6988 <DD>Equivalent to <SAMP>`-l'</SAMP>.
6991 <DT><CODE>--noediting</CODE>
6992 <DD>Do not use the GNU Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>)
6993 to read command lines when the shell is interactive.
6996 <DT><CODE>--noprofile</CODE>
6997 <DD>Don't load the system-wide startup file <TT>`/etc/profile'</TT>
6998 or any of the personal initialization files
6999 <TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT>
7000 when Bash is invoked as a login shell.
7003 <DT><CODE>--norc</CODE>
7004 <DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an
7005 interactive shell. This is on by default if the shell is
7006 invoked as <CODE>sh</CODE>.
7009 <DT><CODE>--posix</CODE>
7010 <DD>Change the behavior of Bash where the default operation differs
7011 from the POSIX standard to match the standard. This
7012 is intended to make Bash behave as a strict superset of that
7013 standard. See section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>, for a description of the Bash
7017 <DT><CODE>--restricted</CODE>
7018 <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
7021 <DT><CODE>--verbose</CODE>
7022 <DD>Equivalent to <SAMP>`-v'</SAMP>. Print shell input lines as they're read.
7025 <DT><CODE>--version</CODE>
7026 <DD>Show version information for this instance of
7027 Bash on the standard output and exit successfully.
7033 There are several single-character options that may be supplied at
7034 invocation which are not available with the <CODE>set</CODE> builtin.
7038 <DT><CODE>-c <VAR>string</VAR></CODE>
7039 <DD>Read and execute commands from <VAR>string</VAR> after processing the
7040 options, then exit. Any remaining arguments are assigned to the
7041 positional parameters, starting with <CODE>$0</CODE>.
7045 <DD>Force the shell to run interactively. Interactive shells are
7046 described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>.
7050 <DD>Make this shell act as if it had been directly invoked by login.
7051 When the shell is interactive, this is equivalent to starting a
7052 login shell with <SAMP>`exec -l bash'</SAMP>.
7053 When the shell is not interactive, the login shell startup files will
7055 <SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP>
7056 will replace the current shell with a Bash login shell.
7057 See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>, for a description of the special behavior
7062 <DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
7066 <DD>If this option is present, or if no arguments remain after option
7067 processing, then commands are read from the standard input.
7068 This option allows the positional parameters to be set
7069 when invoking an interactive shell.
7073 <DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
7074 is printed on the standard output.
7075 These are the strings that
7076 are subject to language translation when the current locale
7077 is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
7078 This implies the <SAMP>`-n'</SAMP> option; no commands will be executed.
7081 <DT><CODE>[-+]O [<VAR>shopt_option</VAR>]</CODE>
7082 <DD><VAR>shopt_option</VAR> is one of the shell options accepted by the
7083 <CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7084 If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option;
7085 <SAMP>`+O'</SAMP> unsets it.
7086 If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell
7087 options accepted by <CODE>shopt</CODE> are printed on the standard output.
7088 If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format
7089 that may be reused as input.
7093 <DD>A <CODE>--</CODE> signals the end of options and disables further option
7095 Any arguments after the <CODE>--</CODE> are treated as filenames and arguments.
7101 <A NAME="IDX288"></A>
7102 A <EM>login</EM> shell is one whose first character of argument zero is
7103 <SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option.
7106 <A NAME="IDX289"></A>
7107 An <EM>interactive</EM> shell is one started without non-option arguments,
7108 unless <SAMP>`-s'</SAMP> is specified,
7109 without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both
7110 connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one
7111 started with the <SAMP>`-i'</SAMP> option. See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for more
7115 If arguments remain after option processing, and neither the
7116 <SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP>
7117 option has been supplied, the first argument is assumed to
7118 be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>).
7119 When Bash is invoked in this fashion, <CODE>$0</CODE>
7120 is set to the name of the file, and the positional parameters
7121 are set to the remaining arguments.
7122 Bash reads and executes commands from this file, then exits.
7123 Bash's exit status is the exit status of the last command executed
7124 in the script. If no commands are executed, the exit status is 0.
7127 <A NAME="Bash Startup Files"></A>
7129 <A NAME="SEC70"></A>
7130 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7131 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> < </A>]</TD>
7132 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> > </A>]</TD>
7133 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> << </A>]</TD>
7134 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7135 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
7136 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7137 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7138 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7139 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7141 <H2> 6.2 Bash Startup Files </H2>
7142 <!--docid::SEC70::-->
7145 This section describes how Bash executes its startup files.
7146 If any of the files exist but cannot be read, Bash reports an error.
7147 Tildes are expanded in file names as described above under
7148 Tilde Expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
7151 Interactive shells are described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>.
7154 <A NAME="SEC71"></A>
7155 <H4> Invoked as an interactive login shell, or with <SAMP>`--login'</SAMP> </H4>
7156 <!--docid::SEC71::-->
7159 When Bash is invoked as an interactive login shell, or as a
7160 non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and
7161 executes commands from the file <TT>`/etc/profile'</TT>, if that file exists.
7162 After reading that file, it looks for <TT>`~/.bash_profile'</TT>,
7163 <TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads
7164 and executes commands from the first one that exists and is readable.
7165 The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to
7166 inhibit this behavior.
7169 When a login shell exits, Bash reads and executes commands from
7170 the file <TT>`~/.bash_logout'</TT>, if it exists.
7173 <A NAME="SEC72"></A>
7174 <H4> Invoked as an interactive non-login shell </H4>
7175 <!--docid::SEC72::-->
7178 When an interactive shell that is not a login shell is started, Bash
7179 reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists.
7180 This may be inhibited by using the <SAMP>`--norc'</SAMP> option.
7181 The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and
7182 execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>.
7185 So, typically, your <TT>`~/.bash_profile'</TT> contains the line
7186 <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE>
7187 </pre></td></tr></table>after (or before) any login-specific initializations.
7190 <A NAME="SEC73"></A>
7191 <H4> Invoked non-interactively </H4>
7192 <!--docid::SEC73::-->
7195 When Bash is started non-interactively, to run a shell script,
7196 for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment,
7197 expands its value if it appears there, and uses the expanded value as
7198 the name of a file to read and execute. Bash behaves as if the
7199 following command were executed:
7200 <TABLE><tr><td> </td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE>
7201 </pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the
7205 As noted above, if a non-interactive shell is invoked with the
7206 <SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the
7207 login shell startup files.
7210 <A NAME="SEC74"></A>
7211 <H4> Invoked with name <CODE>sh</CODE> </H4>
7212 <!--docid::SEC74::-->
7215 If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the
7216 startup behavior of historical versions of <CODE>sh</CODE> as closely as
7217 possible, while conforming to the POSIX standard as well.
7220 When invoked as an interactive login shell, or as a non-interactive
7221 shell with the <SAMP>`--login'</SAMP> option, it first attempts to read
7222 and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in
7224 The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior.
7225 When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash
7226 looks for the variable <CODE>ENV</CODE>, expands its value if it is defined,
7227 and uses the expanded value as the name of a file to read and execute.
7228 Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute
7229 commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has
7231 A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt
7232 to read any other startup files.
7235 When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after
7236 the startup files are read.
7239 <A NAME="SEC75"></A>
7240 <H4> Invoked in POSIX mode </H4>
7241 <!--docid::SEC75::-->
7244 When Bash is started in POSIX mode, as with the
7245 <SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard
7247 In this mode, interactive shells expand the <CODE>ENV</CODE> variable
7248 and commands are read and executed from the file whose name is the
7250 No other startup files are read.
7253 <A NAME="SEC76"></A>
7254 <H4> Invoked by remote shell daemon </H4>
7255 <!--docid::SEC76::-->
7258 Bash attempts to determine when it is being run with its standard input
7259 connected to a a network connection, as if by the remote shell
7260 daemon, usually <CODE>rshd</CODE>, or the secure shell daemon <CODE>sshd</CODE>.
7261 If Bash determines it is being run in
7262 this fashion, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that
7263 file exists and is readable.
7264 It will not do this if invoked as <CODE>sh</CODE>.
7265 The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the
7266 <SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but
7267 <CODE>rshd</CODE> does not generally invoke the shell with those options or
7268 allow them to be specified.
7271 <A NAME="SEC77"></A>
7272 <H4> Invoked with unequal effective and real UID/GIDs </H4>
7273 <!--docid::SEC77::-->
7276 If Bash is started with the effective user (group) id not equal to the
7277 real user (group) id, and the <CODE>-p</CODE> option is not supplied, no startup
7278 files are read, shell functions are not inherited from the environment,
7279 the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE>, and <CODE>GLOBIGNORE</CODE>
7280 variables, if they appear in the environment, are ignored, and the effective
7281 user id is set to the real user id.
7282 If the <CODE>-p</CODE> option is supplied at invocation, the startup behavior is
7283 the same, but the effective user id is not reset.
7286 <A NAME="Interactive Shells"></A>
7288 <A NAME="SEC78"></A>
7289 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7290 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> < </A>]</TD>
7291 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> > </A>]</TD>
7292 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD>
7293 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7294 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD>
7295 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7296 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7297 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7298 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7300 <H2> 6.3 Interactive Shells </H2>
7301 <!--docid::SEC78::-->
7304 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
7305 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What determines whether a shell is Interactive.</TD></TR>
7306 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to tell if a shell is interactive.</TD></TR>
7307 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR>
7308 </TABLE></BLOCKQUOTE>
7311 <A NAME="What is an Interactive Shell?"></A>
7313 <A NAME="SEC79"></A>
7314 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7315 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> < </A>]</TD>
7316 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> > </A>]</TD>
7317 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD>
7318 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7319 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD>
7320 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7321 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7322 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7323 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7325 <H3> 6.3.1 What is an Interactive Shell? </H3>
7326 <!--docid::SEC79::-->
7329 An interactive shell
7330 is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is
7331 specified, without specifying the <SAMP>`-c'</SAMP> option, and
7332 whose input and error output are both
7333 connected to terminals (as determined by <CODE>isatty(3)</CODE>),
7334 or one started with the <SAMP>`-i'</SAMP> option.
7337 An interactive shell generally reads from and writes to a user's
7341 The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters
7342 when an interactive shell is started.
7345 <A NAME="Is this Shell Interactive?"></A>
7347 <A NAME="SEC80"></A>
7348 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7349 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> < </A>]</TD>
7350 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> > </A>]</TD>
7351 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> << </A>]</TD>
7352 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7353 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD>
7354 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7355 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7356 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7357 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7359 <H3> 6.3.2 Is this Shell Interactive? </H3>
7360 <!--docid::SEC80::-->
7363 To determine within a startup script whether or not Bash is
7364 running interactively,
7365 test the value of the <SAMP>`-'</SAMP> special parameter.
7366 It contains <CODE>i</CODE> when the shell is interactive. For example:
7369 <TABLE><tr><td> </td><td class=example><pre>case "$-" in
7370 *i*) echo This shell is interactive ;;
7371 *) echo This shell is not interactive ;;
7373 </pre></td></tr></table></P><P>
7375 Alternatively, startup scripts may examine the variable
7376 <CODE>PS1</CODE>; it is unset in non-interactive shells, and set in
7377 interactive shells. Thus:
7380 <TABLE><tr><td> </td><td class=example><pre>if [ -z "$PS1" ]; then
7381 echo This shell is not interactive
7383 echo This shell is interactive
7385 </pre></td></tr></table></P><P>
7387 <A NAME="Interactive Shell Behavior"></A>
7389 <A NAME="SEC81"></A>
7390 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7391 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> < </A>]</TD>
7392 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> > </A>]</TD>
7393 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> << </A>]</TD>
7394 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7395 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> >> </A>]</TD>
7396 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7397 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7398 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7399 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7401 <H3> 6.3.3 Interactive Shell Behavior </H3>
7402 <!--docid::SEC81::-->
7405 When the shell is running interactively, it changes its behavior in
7411 Startup files are read and executed as described in <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>.
7415 Job Control (see section <A HREF="bashref.html#SEC91">7. Job Control</A>) is enabled by default. When job
7416 control is in effect, Bash ignores the keyboard-generated job control
7417 signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
7421 Bash expands and displays <CODE>PS1</CODE> before reading the first line
7422 of a command, and expands and displays <CODE>PS2</CODE> before reading the
7423 second and subsequent lines of a multi-line command.
7427 Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command
7428 before printing the primary prompt, <CODE>$PS1</CODE>
7429 (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7433 Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to read commands from
7434 the user's terminal.
7438 Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE>
7439 instead of exiting immediately when it receives an <CODE>EOF</CODE> on its
7440 standard input when reading a command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7444 Command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>)
7445 and history expansion (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>)
7446 are enabled by default.
7447 Bash will save the command history to the file named by <CODE>$HISTFILE</CODE>
7448 when an interactive shell exits.
7452 Alias expansion (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>) is performed by default.
7456 In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE>
7457 (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7461 In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled
7462 ((see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7463 <CODE>SIGINT</CODE> will interrupt some shell builtins.
7467 An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit
7468 if the <CODE>huponexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7472 The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has
7473 no effect (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7477 Bash will check for mail periodically, depending on the values of the
7478 <CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables
7479 (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7483 Expansion errors due to references to unbound shell variables after
7484 <SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit
7485 (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7489 The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset
7490 or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions
7491 (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
7495 Redirection errors encountered by shell builtins will not cause the
7500 When running in POSIX mode, a special builtin returning an error
7501 status will not cause the shell to exit (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
7505 A failed <CODE>exec</CODE> will not cause the shell to exit
7506 (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
7510 Parser syntax errors will not cause the shell to exit.
7514 Simple spelling correction for directory arguments to the <CODE>cd</CODE>
7515 builtin is enabled by default (see the description of the <CODE>cdspell</CODE>
7516 option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7520 The shell will check the value of the <CODE>TMOUT</CODE> variable and exit
7521 if a command is not read within the specified number of seconds after
7522 printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7528 <A NAME="Bash Conditional Expressions"></A>
7530 <A NAME="SEC82"></A>
7531 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7532 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> < </A>]</TD>
7533 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> > </A>]</TD>
7534 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> << </A>]</TD>
7535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7536 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
7537 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7538 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7539 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7540 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7542 <H2> 6.4 Bash Conditional Expressions </H2>
7543 <!--docid::SEC82::-->
7546 Conditional expressions are used by the <CODE>[[</CODE> compound command
7547 and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands.
7550 Expressions may be unary or binary.
7551 Unary expressions are often used to examine the status of a file.
7552 There are string operators and numeric comparison operators as well.
7553 If the <VAR>file</VAR> argument to one of the primaries is of the form
7554 <TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked.
7555 If the <VAR>file</VAR> argument to one of the primaries is one of
7556 <TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file
7557 descriptor 0, 1, or 2, respectively, is checked.
7560 When used with <SAMP>`[['</SAMP>, The <SAMP>`<'</SAMP> and <SAMP>`>'</SAMP> operators sort
7561 lexicographically using the current locale.
7564 Unless otherwise specified, primaries that operate on files follow symbolic
7565 links and operate on the target of the link, rather than the link itself.
7569 <DT><CODE>-a <VAR>file</VAR></CODE>
7570 <DD>True if <VAR>file</VAR> exists.
7573 <DT><CODE>-b <VAR>file</VAR></CODE>
7574 <DD>True if <VAR>file</VAR> exists and is a block special file.
7577 <DT><CODE>-c <VAR>file</VAR></CODE>
7578 <DD>True if <VAR>file</VAR> exists and is a character special file.
7581 <DT><CODE>-d <VAR>file</VAR></CODE>
7582 <DD>True if <VAR>file</VAR> exists and is a directory.
7585 <DT><CODE>-e <VAR>file</VAR></CODE>
7586 <DD>True if <VAR>file</VAR> exists.
7589 <DT><CODE>-f <VAR>file</VAR></CODE>
7590 <DD>True if <VAR>file</VAR> exists and is a regular file.
7593 <DT><CODE>-g <VAR>file</VAR></CODE>
7594 <DD>True if <VAR>file</VAR> exists and its set-group-id bit is set.
7597 <DT><CODE>-h <VAR>file</VAR></CODE>
7598 <DD>True if <VAR>file</VAR> exists and is a symbolic link.
7601 <DT><CODE>-k <VAR>file</VAR></CODE>
7602 <DD>True if <VAR>file</VAR> exists and its "sticky" bit is set.
7605 <DT><CODE>-p <VAR>file</VAR></CODE>
7606 <DD>True if <VAR>file</VAR> exists and is a named pipe (FIFO).
7609 <DT><CODE>-r <VAR>file</VAR></CODE>
7610 <DD>True if <VAR>file</VAR> exists and is readable.
7613 <DT><CODE>-s <VAR>file</VAR></CODE>
7614 <DD>True if <VAR>file</VAR> exists and has a size greater than zero.
7617 <DT><CODE>-t <VAR>fd</VAR></CODE>
7618 <DD>True if file descriptor <VAR>fd</VAR> is open and refers to a terminal.
7621 <DT><CODE>-u <VAR>file</VAR></CODE>
7622 <DD>True if <VAR>file</VAR> exists and its set-user-id bit is set.
7625 <DT><CODE>-w <VAR>file</VAR></CODE>
7626 <DD>True if <VAR>file</VAR> exists and is writable.
7629 <DT><CODE>-x <VAR>file</VAR></CODE>
7630 <DD>True if <VAR>file</VAR> exists and is executable.
7633 <DT><CODE>-O <VAR>file</VAR></CODE>
7634 <DD>True if <VAR>file</VAR> exists and is owned by the effective user id.
7637 <DT><CODE>-G <VAR>file</VAR></CODE>
7638 <DD>True if <VAR>file</VAR> exists and is owned by the effective group id.
7641 <DT><CODE>-L <VAR>file</VAR></CODE>
7642 <DD>True if <VAR>file</VAR> exists and is a symbolic link.
7645 <DT><CODE>-S <VAR>file</VAR></CODE>
7646 <DD>True if <VAR>file</VAR> exists and is a socket.
7649 <DT><CODE>-N <VAR>file</VAR></CODE>
7650 <DD>True if <VAR>file</VAR> exists and has been modified since it was last read.
7653 <DT><CODE><VAR>file1</VAR> -nt <VAR>file2</VAR></CODE>
7654 <DD>True if <VAR>file1</VAR> is newer (according to modification date)
7655 than <VAR>file2</VAR>, or if <VAR>file1</VAR> exists and <VAR>file2</VAR> does not.
7658 <DT><CODE><VAR>file1</VAR> -ot <VAR>file2</VAR></CODE>
7659 <DD>True if <VAR>file1</VAR> is older than <VAR>file2</VAR>,
7660 or if <VAR>file2</VAR> exists and <VAR>file1</VAR> does not.
7663 <DT><CODE><VAR>file1</VAR> -ef <VAR>file2</VAR></CODE>
7664 <DD>True if <VAR>file1</VAR> and <VAR>file2</VAR> refer to the same device and
7668 <DT><CODE>-o <VAR>optname</VAR></CODE>
7669 <DD>True if shell option <VAR>optname</VAR> is enabled.
7670 The list of options appears in the description of the <SAMP>`-o'</SAMP>
7671 option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7674 <DT><CODE>-z <VAR>string</VAR></CODE>
7675 <DD>True if the length of <VAR>string</VAR> is zero.
7678 <DT><CODE>-n <VAR>string</VAR></CODE>
7679 <DD><DT><CODE><VAR>string</VAR></CODE>
7680 <DD>True if the length of <VAR>string</VAR> is non-zero.
7683 <DT><CODE><VAR>string1</VAR> == <VAR>string2</VAR></CODE>
7684 <DD><DT><CODE><VAR>string1</VAR> = <VAR>string2</VAR></CODE>
7685 <DD>True if the strings are equal.
7686 <SAMP>`='</SAMP> should be used with the <CODE>test</CODE> command for POSIX conformance.
7689 <DT><CODE><VAR>string1</VAR> != <VAR>string2</VAR></CODE>
7690 <DD>True if the strings are not equal.
7693 <DT><CODE><VAR>string1</VAR> < <VAR>string2</VAR></CODE>
7694 <DD>True if <VAR>string1</VAR> sorts before <VAR>string2</VAR> lexicographically.
7697 <DT><CODE><VAR>string1</VAR> > <VAR>string2</VAR></CODE>
7698 <DD>True if <VAR>string1</VAR> sorts after <VAR>string2</VAR> lexicographically.
7701 <DT><CODE><VAR>arg1</VAR> OP <VAR>arg2</VAR></CODE>
7702 <DD><CODE>OP</CODE> is one of
7703 <SAMP>`-eq'</SAMP>, <SAMP>`-ne'</SAMP>, <SAMP>`-lt'</SAMP>, <SAMP>`-le'</SAMP>, <SAMP>`-gt'</SAMP>, or <SAMP>`-ge'</SAMP>.
7704 These arithmetic binary operators return true if <VAR>arg1</VAR>
7705 is equal to, not equal to, less than, less than or equal to,
7706 greater than, or greater than or equal to <VAR>arg2</VAR>,
7707 respectively. <VAR>Arg1</VAR> and <VAR>arg2</VAR>
7708 may be positive or negative integers.
7714 <A NAME="Shell Arithmetic"></A>
7716 <A NAME="SEC83"></A>
7717 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7718 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> < </A>]</TD>
7719 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> > </A>]</TD>
7720 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> << </A>]</TD>
7721 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7722 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
7723 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7724 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7725 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7726 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7728 <H2> 6.5 Shell Arithmetic </H2>
7729 <!--docid::SEC83::-->
7732 The shell allows arithmetic expressions to be evaluated, as one of
7733 the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option
7734 to the <CODE>declare</CODE> builtins.
7737 Evaluation is done in fixed-width integers with no check for overflow,
7738 though division by 0 is trapped and flagged as an error.
7739 The operators and their precedence, associativity, and values
7740 are the same as in the C language.
7741 The following list of operators is grouped into levels of
7742 equal-precedence operators.
7743 The levels are listed in order of decreasing precedence.
7748 <DT><CODE><VAR>id</VAR>++ <VAR>id</VAR>--</CODE>
7749 <DD>variable post-increment and post-decrement
7752 <DT><CODE>++<VAR>id</VAR> --<VAR>id</VAR></CODE>
7753 <DD>variable pre-increment and pre-decrement
7756 <DT><CODE>- +</CODE>
7757 <DD>unary minus and plus
7760 <DT><CODE>! ~</CODE>
7761 <DD>logical and bitwise negation
7768 <DT><CODE>* / %</CODE>
7769 <DD>multiplication, division, remainder
7772 <DT><CODE>+ -</CODE>
7773 <DD>addition, subtraction
7776 <DT><CODE><< >></CODE>
7777 <DD>left and right bitwise shifts
7780 <DT><CODE><= >= < ></CODE>
7784 <DT><CODE>== !=</CODE>
7785 <DD>equality and inequality
7788 <DT><CODE>&</CODE>
7793 <DD>bitwise exclusive OR
7800 <DT><CODE>&&</CODE>
7808 <DT><CODE>expr ? expr : expr</CODE>
7809 <DD>conditional operator
7812 <DT><CODE>= *= /= %= += -= <<= >>= &= ^= |=</CODE>
7816 <DT><CODE>expr1 , expr2</CODE>
7821 Shell variables are allowed as operands; parameter expansion is
7822 performed before the expression is evaluated.
7823 Within an expression, shell variables may also be referenced by name
7824 without using the parameter expansion syntax.
7825 A shell variable that is null or unset evaluates to 0 when referenced
7826 by name without using the parameter expansion syntax.
7827 The value of a variable is evaluated as an arithmetic expression
7828 when it is referenced, or when a variable which has been given the
7829 <VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value.
7830 A null value evaluates to 0.
7831 A shell variable need not have its integer attribute turned on
7832 to be used in an expression.
7835 Constants with a leading 0 are interpreted as octal numbers.
7836 A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal. Otherwise,
7837 numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where <VAR>base</VAR>
7838 is a decimal number between 2 and 64 representing the arithmetic
7839 base, and <VAR>n</VAR> is a number in that base. If <VAR>base</VAR><CODE>#</CODE> is
7840 omitted, then base 10 is used.
7841 The digits greater than 9 are represented by the lowercase letters,
7842 the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order.
7843 If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase
7844 letters may be used interchangeably to represent numbers between 10
7848 Operators are evaluated in order of precedence. Sub-expressions in
7849 parentheses are evaluated first and may override the precedence
7853 <A NAME="Aliases"></A>
7855 <A NAME="SEC84"></A>
7856 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7857 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> < </A>]</TD>
7858 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> > </A>]</TD>
7859 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> << </A>]</TD>
7860 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7861 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
7862 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7863 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7864 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7865 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7867 <H2> 6.6 Aliases </H2>
7868 <!--docid::SEC84::-->
7871 <VAR>Aliases</VAR> allow a string to be substituted for a word when it is used
7872 as the first word of a simple command.
7873 The shell maintains a list of aliases that may be set and unset with
7874 the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands.
7877 The first word of each simple command, if unquoted, is checked to see
7879 If so, that word is replaced by the text of the alias.
7880 The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the
7881 shell metacharacters or quoting characters listed above may not appear
7883 The replacement text may contain any valid
7884 shell input, including shell metacharacters.
7885 The first word of the replacement text is tested for
7886 aliases, but a word that is identical to an alias being expanded
7887 is not expanded a second time.
7888 This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>,
7889 for instance, and Bash does not try to recursively expand the
7890 replacement text. If the last character of the alias value is a
7891 space or tab character, then the next command word following the
7892 alias is also checked for alias expansion.
7895 Aliases are created and listed with the <CODE>alias</CODE>
7896 command, and removed with the <CODE>unalias</CODE> command.
7899 There is no mechanism for using arguments in the replacement text,
7900 as in <CODE>csh</CODE>.
7901 If arguments are needed, a shell function should be used
7902 (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
7905 Aliases are not expanded when the shell is not interactive,
7906 unless the <CODE>expand_aliases</CODE> shell option is set using
7907 <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7910 The rules concerning the definition and use of aliases are
7911 somewhat confusing. Bash
7912 always reads at least one complete line
7913 of input before executing any
7914 of the commands on that line. Aliases are expanded when a
7915 command is read, not when it is executed. Therefore, an
7916 alias definition appearing on the same line as another
7917 command does not take effect until the next line of input is read.
7918 The commands following the alias definition
7919 on that line are not affected by the new alias.
7920 This behavior is also an issue when functions are executed.
7921 Aliases are expanded when a function definition is read,
7922 not when the function is executed, because a function definition
7923 is itself a compound command. As a consequence, aliases
7924 defined in a function are not available until after that
7925 function is executed. To be safe, always put
7926 alias definitions on a separate line, and do not use <CODE>alias</CODE>
7927 in compound commands.
7930 For almost every purpose, shell functions are preferred over aliases.
7933 <A NAME="Arrays"></A>
7935 <A NAME="SEC85"></A>
7936 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7937 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> < </A>]</TD>
7938 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> > </A>]</TD>
7939 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> << </A>]</TD>
7940 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7941 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
7942 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7943 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7944 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7945 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7947 <H2> 6.7 Arrays </H2>
7948 <!--docid::SEC85::-->
7951 Bash provides one-dimensional indexed and associative array variables.
7952 Any variable may be used as an indexed array;
7953 the <CODE>declare</CODE> builtin will explicitly declare an array.
7955 limit on the size of an array, nor any requirement that members
7956 be indexed or assigned contiguously.
7957 Indexed arrays are referenced using integers (including arithmetic
7958 expressions (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) and are zero-based;
7959 associative arrays use arbitrary strings.
7962 An indexed array is created automatically if any variable is assigned to
7964 <TABLE><tr><td> </td><td class=example><pre>name[<VAR>subscript</VAR>]=<VAR>value</VAR>
7965 </pre></td></tr></table></P><P>
7967 The <VAR>subscript</VAR>
7968 is treated as an arithmetic expression that must evaluate to a number
7969 greater than or equal to zero. To explicitly declare an array, use
7970 <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR>
7971 </pre></td></tr></table>The syntax
7972 <TABLE><tr><td> </td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>]
7973 </pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored.
7976 Associative arrays are created using
7977 <TABLE><tr><td> </td><td class=example><pre>declare -A <VAR>name</VAR>.
7978 </pre></td></tr></table></P><P>
7981 specified for an array variable using the <CODE>declare</CODE> and
7982 <CODE>readonly</CODE> builtins. Each attribute applies to all members of
7986 Arrays are assigned to using compound assignments of the form
7987 <TABLE><tr><td> </td><td class=example><pre>name=(value<VAR>1</VAR> <small>...</small> value<VAR>n</VAR>)
7988 </pre></td></tr></table>where each
7989 <VAR>value</VAR> is of the form <CODE>[<VAR>subscript</VAR>]=</CODE><VAR>string</VAR>.
7990 Indexed array assignments do not require the bracket and subscript.
7991 When assigning to indexed arrays, if
7992 the optional subscript is supplied, that index is assigned to;
7993 otherwise the index of the element assigned is the last index assigned
7994 to by the statement plus one. Indexing starts at zero.
7997 When assigning to an associative array, the subscript is required.
8000 This syntax is also accepted by the <CODE>declare</CODE>
8001 builtin. Individual array elements may be assigned to using the
8002 <CODE>name[</CODE><VAR>subscript</VAR><CODE>]=</CODE><VAR>value</VAR> syntax introduced above.
8005 Any element of an array may be referenced using
8006 <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
8007 The braces are required to avoid
8008 conflicts with the shell's filename expansion operators. If the
8009 <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members
8010 of the array <VAR>name</VAR>. These subscripts differ only when the word
8011 appears within double quotes.
8012 If the word is double-quoted,
8013 <CODE>${name[*]}</CODE> expands to a single word with
8014 the value of each array member separated by the first character of the
8015 <CODE>IFS</CODE> variable, and <CODE>${name[@]}</CODE> expands each element of
8016 <VAR>name</VAR> to a separate word. When there are no array members,
8017 <CODE>${name[@]}</CODE> expands to nothing.
8018 If the double-quoted expansion occurs within a word, the expansion of
8019 the first parameter is joined with the beginning part of the original
8020 word, and the expansion of the last parameter is joined with the last
8021 part of the original word.
8022 This is analogous to the
8023 expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>.
8024 <CODE>${#name[</CODE><VAR>subscript</VAR><CODE>]}</CODE> expands to the length of
8025 <CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
8026 If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or
8027 <SAMP>`*'</SAMP>, the expansion is the number of elements in the array.
8028 Referencing an array variable without a subscript is equivalent to
8029 referencing with a subscript of 0.
8032 An array variable is considered set if a subscript has been assigned a
8033 value. The null string is a valid value.
8036 The <CODE>unset</CODE> builtin is used to destroy arrays.
8037 <CODE>unset</CODE> <VAR>name</VAR>[<VAR>subscript</VAR>]
8038 destroys the array element at index <VAR>subscript</VAR>.
8039 Care must be taken to avoid unwanted side effects caused by filename
8041 <CODE>unset</CODE> <VAR>name</VAR>, where <VAR>name</VAR> is an array, removes the
8042 entire array. A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the
8046 The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE>
8047 builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed
8048 array and a <SAMP>`-A'</SAMP> option to specify an associative array.
8049 The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP>
8050 option to assign a list of words read from the standard input
8051 to an array, and can read values from the standard input into
8052 individual array elements. The <CODE>set</CODE> and <CODE>declare</CODE>
8053 builtins display array values in a way that allows them to be
8057 <A NAME="The Directory Stack"></A>
8059 <A NAME="SEC86"></A>
8060 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8061 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> < </A>]</TD>
8062 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> > </A>]</TD>
8063 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> << </A>]</TD>
8064 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8065 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> >> </A>]</TD>
8066 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8067 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8068 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8069 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8071 <H2> 6.8 The Directory Stack </H2>
8072 <!--docid::SEC86::-->
8075 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8076 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate
8077 the directory stack.</TD></TR>
8078 </TABLE></BLOCKQUOTE>
8081 The directory stack is a list of recently-visited directories. The
8082 <CODE>pushd</CODE> builtin adds directories to the stack as it changes
8083 the current directory, and the <CODE>popd</CODE> builtin removes specified
8084 directories from the stack and changes the current directory to
8085 the directory removed. The <CODE>dirs</CODE> builtin displays the contents
8086 of the directory stack.
8089 The contents of the directory stack are also visible
8090 as the value of the <CODE>DIRSTACK</CODE> shell variable.
8093 <A NAME="Directory Stack Builtins"></A>
8095 <A NAME="SEC87"></A>
8096 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8097 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> < </A>]</TD>
8098 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> > </A>]</TD>
8099 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> << </A>]</TD>
8100 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> Up </A>]</TD>
8101 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> >> </A>]</TD>
8102 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8103 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8104 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8105 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8107 <H3> 6.8.1 Directory Stack Builtins </H3>
8108 <!--docid::SEC87::-->
8113 <DT><CODE>dirs</CODE>
8114 <DD><A NAME="IDX290"></A>
8115 <TABLE><tr><td> </td><td class=example><pre>dirs [+<VAR>N</VAR> | -<VAR>N</VAR>] [-clpv]
8116 </pre></td></tr></table>Display the list of currently remembered directories. Directories
8117 are added to the list with the <CODE>pushd</CODE> command; the
8118 <CODE>popd</CODE> command removes directories from the list.
8120 <DT><CODE>+<VAR>N</VAR></CODE>
8121 <DD>Displays the <VAR>N</VAR>th directory (counting from the left of the
8122 list printed by <CODE>dirs</CODE> when invoked without options), starting
8124 <DT><CODE>-<VAR>N</VAR></CODE>
8125 <DD>Displays the <VAR>N</VAR>th directory (counting from the right of the
8126 list printed by <CODE>dirs</CODE> when invoked without options), starting
8129 <DD>Clears the directory stack by deleting all of the elements.
8131 <DD>Produces a longer listing; the default listing format uses a
8132 tilde to denote the home directory.
8134 <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8137 <DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8138 line, prefixing each entry with its index in the stack.
8142 <DT><CODE>popd</CODE>
8143 <DD><A NAME="IDX291"></A>
8144 <TABLE><tr><td> </td><td class=example><pre>popd [+<VAR>N</VAR> | -<VAR>N</VAR>] [-n]
8145 </pre></td></tr></table><P>
8147 Remove the top entry from the directory stack, and <CODE>cd</CODE>
8148 to the new top directory.
8149 When no arguments are given, <CODE>popd</CODE>
8150 removes the top directory from the stack and
8151 performs a <CODE>cd</CODE> to the new top directory. The
8152 elements are numbered from 0 starting at the first directory listed with
8153 <CODE>dirs</CODE>; i.e., <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>.
8155 <DT><CODE>+<VAR>N</VAR></CODE>
8156 <DD>Removes the <VAR>N</VAR>th directory (counting from the left of the
8157 list printed by <CODE>dirs</CODE>), starting with zero.
8158 <DT><CODE>-<VAR>N</VAR></CODE>
8159 <DD>Removes the <VAR>N</VAR>th directory (counting from the right of the
8160 list printed by <CODE>dirs</CODE>), starting with zero.
8162 <DD>Suppresses the normal change of directory when removing directories
8163 from the stack, so that only the stack is manipulated.
8167 <A NAME="IDX292"></A>
8168 <DT><CODE>pushd</CODE>
8169 <DD><TABLE><tr><td> </td><td class=example><pre>pushd [-n] [<VAR>+N</VAR> | <VAR>-N</VAR> | <VAR>dir</VAR> ]
8170 </pre></td></tr></table><P>
8172 Save the current directory on the top of the directory stack
8173 and then <CODE>cd</CODE> to <VAR>dir</VAR>.
8174 With no arguments, <CODE>pushd</CODE> exchanges the top two directories.
8179 <DD>Suppresses the normal change of directory when adding directories
8180 to the stack, so that only the stack is manipulated.
8181 <DT><CODE>+<VAR>N</VAR></CODE>
8182 <DD>Brings the <VAR>N</VAR>th directory (counting from the left of the
8183 list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8184 the list by rotating the stack.
8185 <DT><CODE>-<VAR>N</VAR></CODE>
8186 <DD>Brings the <VAR>N</VAR>th directory (counting from the right of the
8187 list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8188 the list by rotating the stack.
8189 <DT><CODE><VAR>dir</VAR></CODE>
8190 <DD>Makes the current working directory be the top of the stack, and then
8191 executes the equivalent of `<CODE>cd</CODE> <VAR>dir</VAR>'.
8192 <CODE>cd</CODE>s to <VAR>dir</VAR>.
8199 <A NAME="Printing a Prompt"></A>
8201 <A NAME="SEC88"></A>
8202 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8203 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> < </A>]</TD>
8204 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> > </A>]</TD>
8205 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> << </A>]</TD>
8206 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8207 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
8208 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8209 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8210 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8211 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8213 <H2> 6.9 Controlling the Prompt </H2>
8214 <!--docid::SEC88::-->
8217 The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before
8218 Bash prints each primary prompt. If <CODE>PROMPT_COMMAND</CODE> is set and
8219 has a non-null value, then the
8220 value is executed just as if it had been typed on the command line.
8223 In addition, the following table describes the special characters which
8224 can appear in the prompt variables:
8229 <DD>A bell character.
8231 <DD>The date, in "Weekday Month Date" format (e.g., "Tue May 26").
8232 <DT><CODE>\D{<VAR>format</VAR>}</CODE>
8233 <DD>The <VAR>format</VAR> is passed to <CODE>strftime</CODE>(3) and the result is inserted
8234 into the prompt string; an empty <VAR>format</VAR> results in a locale-specific
8235 time representation. The braces are required.
8237 <DD>An escape character.
8239 <DD>The hostname, up to the first `.'.
8243 <DD>The number of jobs currently managed by the shell.
8245 <DD>The basename of the shell's terminal device name.
8249 <DD>A carriage return.
8251 <DD>The name of the shell, the basename of <CODE>$0</CODE> (the portion
8252 following the final slash).
8254 <DD>The time, in 24-hour HH:MM:SS format.
8256 <DD>The time, in 12-hour HH:MM:SS format.
8258 <DD>The time, in 12-hour am/pm format.
8260 <DD>The time, in 24-hour HH:MM format.
8262 <DD>The username of the current user.
8264 <DD>The version of Bash (e.g., 2.00)
8266 <DD>The release of Bash, version + patchlevel (e.g., 2.00.0)
8268 <DD>The current working directory, with <CODE>$HOME</CODE> abbreviated with a tilde
8269 (uses the <CODE>$PROMPT_DIRTRIM</CODE> variable).
8271 <DD>The basename of <CODE>$PWD</CODE>, with <CODE>$HOME</CODE> abbreviated with a tilde.
8273 <DD>The history number of this command.
8275 <DD>The command number of this command.
8277 <DD>If the effective uid is 0, <CODE>#</CODE>, otherwise <CODE>$</CODE>.
8278 <DT><CODE>\<VAR>nnn</VAR></CODE>
8279 <DD>The character whose ASCII code is the octal value <VAR>nnn</VAR>.
8283 <DD>Begin a sequence of non-printing characters. This could be used to
8284 embed a terminal control sequence into the prompt.
8286 <DD>End a sequence of non-printing characters.
8290 The command number and the history number are usually different:
8291 the history number of a command is its position in the history
8292 list, which may include commands restored from the history file
8293 (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>), while the command number is
8294 the position in the sequence of commands executed during the current
8298 After the string is decoded, it is expanded via
8299 parameter expansion, command substitution, arithmetic
8300 expansion, and quote removal, subject to the value of the
8301 <CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
8304 <A NAME="The Restricted Shell"></A>
8306 <A NAME="SEC89"></A>
8307 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8308 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> < </A>]</TD>
8309 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> > </A>]</TD>
8310 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> << </A>]</TD>
8311 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8312 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
8313 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8314 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8315 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8316 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8318 <H2> 6.10 The Restricted Shell </H2>
8319 <!--docid::SEC89::-->
8322 If Bash is started with the name <CODE>rbash</CODE>, or the
8323 <SAMP>`--restricted'</SAMP>
8326 option is supplied at invocation, the shell becomes restricted.
8327 A restricted shell is used to
8328 set up an environment more controlled than the standard shell.
8329 A restricted shell behaves identically to <CODE>bash</CODE>
8330 with the exception that the following are disallowed or not performed:
8335 Changing directories with the <CODE>cd</CODE> builtin.
8337 Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>,
8338 <CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables.
8340 Specifying command names containing slashes.
8342 Specifying a filename containing a slash as an argument to the <CODE>.</CODE>
8345 Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP>
8346 option to the <CODE>hash</CODE> builtin command.
8348 Importing function definitions from the shell environment at startup.
8350 Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup.
8352 Redirecting output using the <SAMP>`>'</SAMP>, <SAMP>`>|'</SAMP>, <SAMP>`<>'</SAMP>, <SAMP>`>&'</SAMP>,
8353 <SAMP>`&>'</SAMP>, and <SAMP>`>>'</SAMP> redirection operators.
8355 Using the <CODE>exec</CODE> builtin to replace the shell with another command.
8357 Adding or deleting builtin commands with the
8358 <SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin.
8360 Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins.
8362 Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin.
8364 Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>.
8368 These restrictions are enforced after any startup files are read.
8371 When a command that is found to be a shell script is executed
8372 (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in
8373 the shell spawned to execute the script.
8376 <A NAME="Bash POSIX Mode"></A>
8378 <A NAME="SEC90"></A>
8379 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8380 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> < </A>]</TD>
8381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> > </A>]</TD>
8382 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> << </A>]</TD>
8383 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> >> </A>]</TD>
8385 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8386 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8387 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8388 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8390 <H2> 6.11 Bash POSIX Mode </H2>
8391 <!--docid::SEC90::-->
8394 Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing
8395 <SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more
8396 closely to the POSIX standard by changing the behavior to
8397 match that specified by POSIX in areas where the Bash default differs.
8400 When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the
8404 The following list is what's changed when `POSIX mode' is in effect:
8409 When a command in the hash table no longer exists, Bash will re-search
8410 <CODE>$PATH</CODE> to find the new location. This is also available with
8411 <SAMP>`shopt -s checkhash'</SAMP>.
8415 The message printed by the job control code and builtins when a job
8416 exits with a non-zero status is `Done(status)'.
8420 The message printed by the job control code and builtins when a job
8421 is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for
8422 example, <CODE>SIGTSTP</CODE>.
8426 The <CODE>bg</CODE> builtin uses the required format to describe each job placed
8427 in the background, which does not include an indication of whether the job
8428 is the current or previous job.
8432 Reserved words appearing in a context where reserved words are recognized
8433 do not undergo alias expansion.
8437 The POSIX <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to
8438 the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled,
8439 and parameter expansion is performed on the values of <CODE>PS1</CODE> and
8440 <CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option.
8444 The POSIX startup files are executed (<CODE>$ENV</CODE>) rather than
8445 the normal Bash files.
8449 Tilde expansion is only performed on assignments preceding a command
8450 name, rather than on all assignment statements on the line.
8454 The default history file is <TT>`~/.sh_history'</TT> (this is the
8455 default value of <CODE>$HISTFILE</CODE>).
8459 The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line,
8460 separated by spaces, without the <SAMP>`SIG'</SAMP> prefix.
8464 The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP>
8469 Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR>
8474 Non-interactive shells exit if a syntax error in an arithmetic expansion
8475 results in an invalid expression.
8479 Redirection operators do not perform filename expansion on the word
8480 in the redirection unless the shell is interactive.
8484 Redirection operators do not perform word splitting on the word in the
8489 Function names must be valid shell <CODE>name</CODE>s. That is, they may not
8490 contain characters other than letters, digits, and underscores, and
8491 may not start with a digit. Declaring a function with an invalid name
8492 causes a fatal syntax error in non-interactive shells.
8496 POSIX special builtins are found before shell functions
8497 during command lookup.
8501 If a POSIX special builtin returns an error status, a
8502 non-interactive shell exits. The fatal errors are those listed in
8503 the POSIX standard, and include things like passing incorrect options,
8504 redirection errors, variable assignment errors for assignments preceding
8505 the command name, and so on.
8509 If <CODE>CDPATH</CODE> is set, the <CODE>cd</CODE> builtin will not implicitly
8510 append the current directory to it. This means that <CODE>cd</CODE> will
8511 fail if no valid directory name can be constructed from
8512 any of the entries in <CODE>$CDPATH</CODE>, even if the a directory with
8513 the same name as the name given as an argument to <CODE>cd</CODE> exists
8514 in the current directory.
8518 A non-interactive shell exits with an error status if a variable
8519 assignment error occurs when no command name follows the assignment
8521 A variable assignment error occurs, for example, when trying to assign
8522 a value to a readonly variable.
8526 A non-interactive shell exits with an error status if the iteration
8527 variable in a <CODE>for</CODE> statement or the selection variable in a
8528 <CODE>select</CODE> statement is a readonly variable.
8532 Process substitution is not available.
8536 Assignment statements preceding POSIX special builtins
8537 persist in the shell environment after the builtin completes.
8541 Assignment statements preceding shell function calls persist in the
8542 shell environment after the function returns, as if a POSIX
8543 special builtin command had been executed.
8547 The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their
8548 output in the format required by POSIX.
8552 The <CODE>trap</CODE> builtin displays signal names without the leading
8557 The <CODE>trap</CODE> builtin doesn't check the first argument for a possible
8558 signal specification and revert the signal handling to the original
8559 disposition if it is, unless that argument consists solely of digits and
8560 is a valid signal number. If users want to reset the handler for a given
8561 signal to the original disposition, they should use <SAMP>`-'</SAMP> as the
8566 The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory
8567 for the filename argument if it is not found by searching <CODE>PATH</CODE>.
8571 Subshells spawned to execute command substitutions inherit the value of
8572 the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
8573 Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
8577 Alias expansion is always enabled, even in non-interactive shells.
8581 When the <CODE>alias</CODE> builtin displays alias definitions, it does not
8582 display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option
8587 When the <CODE>set</CODE> builtin is invoked without options, it does not display
8588 shell function names and definitions.
8592 When the <CODE>set</CODE> builtin is invoked without options, it displays
8593 variable values without quotes, unless they contain shell metacharacters,
8594 even if the result contains nonprinting characters.
8598 When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname
8599 constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument
8600 does not refer to an existing directory, <CODE>cd</CODE> will fail instead of
8601 falling back to <VAR>physical</VAR> mode.
8605 When the <CODE>pwd</CODE> builtin is supplied the <SAMP>`-P'</SAMP> option, it resets
8606 <CODE>$PWD</CODE> to a pathname containing no symlinks.
8610 The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the
8611 current directory, even if it is not asked to check the file system with the
8612 <SAMP>`-P'</SAMP> option.
8616 When listing the history, the <CODE>fc</CODE> builtin does not include an
8617 indication of whether or not a history entry has been modified.
8621 The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>.
8625 The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable
8626 file as having been found, though the shell will attempt to execute such a
8627 file if it is the only so-named file found in <CODE>$PATH</CODE>.
8631 The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when
8632 the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$VISUAL</CODE> and
8633 <CODE>$EDITOR</CODE>.
8637 When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret
8638 any arguments to <CODE>echo</CODE> as options. Each argument is displayed, after
8639 escape characters are converted.
8643 The <CODE>ulimit</CODE> builtin uses a block size of 512 bytes for the <SAMP>`-c'</SAMP>
8644 and <SAMP>`-f'</SAMP> options.
8648 The arrival of <CODE>SIGCHLD</CODE> when a trap is set on <CODE>SIGCHLD</CODE> does
8649 not interrupt the <CODE>wait</CODE> builtin and cause it to return immediately.
8650 The trap command is run once for each child that exits.
8656 There is other POSIX behavior that Bash does not implement by
8657 default even when in POSIX mode.
8664 The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history
8665 entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to
8666 <CODE>ed</CODE>. <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset.
8670 As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for
8671 the <CODE>echo</CODE> builtin to be fully conformant.
8677 Bash can be configured to be POSIX-conformant by default, by specifying
8678 the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building
8679 (see section <A HREF="bashref.html#SEC134">10.8 Optional Features</A>).
8682 <A NAME="Job Control"></A>
8684 <A NAME="SEC91"></A>
8685 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8686 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> < </A>]</TD>
8687 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> > </A>]</TD>
8688 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD>
8689 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
8690 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD>
8691 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8692 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8693 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8694 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8696 <H1> 7. Job Control </H1>
8697 <!--docid::SEC91::-->
8700 This chapter discusses what job control is, how it works, and how
8701 Bash allows you to access its facilities.
8704 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8705 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR>
8706 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact
8707 with job control.</TD></TR>
8708 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job
8710 </TABLE></BLOCKQUOTE>
8713 <A NAME="Job Control Basics"></A>
8715 <A NAME="SEC92"></A>
8716 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8717 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> < </A>]</TD>
8718 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> > </A>]</TD>
8719 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD>
8720 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8721 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD>
8722 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8723 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8724 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8725 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8727 <H2> 7.1 Job Control Basics </H2>
8728 <!--docid::SEC92::-->
8732 refers to the ability to selectively stop (suspend)
8733 the execution of processes and continue (resume)
8734 their execution at a later point. A user typically employs
8735 this facility via an interactive interface supplied jointly
8736 by the operating system kernel's terminal driver and Bash.
8739 The shell associates a <VAR>job</VAR> with each pipeline. It keeps a
8740 table of currently executing jobs, which may be listed with the
8741 <CODE>jobs</CODE> command. When Bash starts a job
8742 asynchronously, it prints a line that looks
8744 <TABLE><tr><td> </td><td class=example><pre>[1] 25647
8745 </pre></td></tr></table>indicating that this job is job number 1 and that the process ID
8746 of the last process in the pipeline associated with this job is
8747 25647. All of the processes in a single pipeline are members of
8748 the same job. Bash uses the <VAR>job</VAR> abstraction as the
8749 basis for job control.
8752 To facilitate the implementation of the user interface to job
8753 control, the operating system maintains the notion of a current terminal
8754 process group ID. Members of this process group (processes whose
8755 process group ID is equal to the current terminal process group
8756 ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>.
8757 These processes are said to be in the foreground. Background
8758 processes are those whose process group ID differs from the
8759 terminal's; such processes are immune to keyboard-generated
8760 signals. Only foreground processes are allowed to read from or, if
8761 the user so specifies with <CODE>stty tostop</CODE>, write to the terminal.
8762 Background processes which attempt to
8763 read from (write to when <CODE>stty tostop</CODE> is in effect) the
8764 terminal are sent a <CODE>SIGTTIN</CODE> (<CODE>SIGTTOU</CODE>)
8765 signal by the kernel's terminal driver,
8766 which, unless caught, suspends the process.
8769 If the operating system on which Bash is running supports
8770 job control, Bash contains facilities to use it. Typing the
8771 <VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a
8772 process is running causes that process to be stopped and returns
8773 control to Bash. Typing the <VAR>delayed suspend</VAR> character
8774 (typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped
8775 when it attempts to read input from the terminal, and control to
8776 be returned to Bash. The user then manipulates the state of
8777 this job, using the <CODE>bg</CODE> command to continue it in the
8778 background, the <CODE>fg</CODE> command to continue it in the
8779 foreground, or the <CODE>kill</CODE> command to kill it. A <SAMP>`^Z'</SAMP>
8780 takes effect immediately, and has the additional side effect of
8781 causing pending output and typeahead to be discarded.
8784 There are a number of ways to refer to a job in the shell. The
8785 character <SAMP>`%'</SAMP> introduces a job specification (<VAR>jobspec</VAR>).
8788 Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>.
8789 The symbols <SAMP>`%%'</SAMP> and <SAMP>`%+'</SAMP> refer to the shell's notion of the
8790 current job, which is the last job stopped while it was in the foreground
8791 or started in the background.
8792 A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers
8794 The previous job may be referenced using <SAMP>`%-'</SAMP>.
8795 If there is only a single job, <SAMP>`%+'</SAMP> and <SAMP>`%-'</SAMP> can both be used
8796 to refer to that job.
8797 In output pertaining to jobs (e.g., the output of the <CODE>jobs</CODE>
8798 command), the current job is always flagged with a <SAMP>`+'</SAMP>, and the
8799 previous job with a <SAMP>`-'</SAMP>.
8802 A job may also be referred to
8803 using a prefix of the name used to start it, or using a substring
8804 that appears in its command line. For example, <SAMP>`%ce'</SAMP> refers
8805 to a stopped <CODE>ce</CODE> job. Using <SAMP>`%?ce'</SAMP>, on the
8806 other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in
8807 its command line. If the prefix or substring matches more than one job,
8808 Bash reports an error.
8811 Simply naming a job can be used to bring it into the foreground:
8812 <SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the
8813 background into the foreground. Similarly, <SAMP>`%1 &'</SAMP> resumes
8814 job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP>
8817 The shell learns immediately whenever a job changes state.
8818 Normally, Bash waits until it is about to print a prompt
8819 before reporting changes in a job's status so as to not interrupt
8821 If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled,
8822 Bash reports such changes immediately (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
8823 Any trap on <CODE>SIGCHLD</CODE> is executed for each child process
8827 If an attempt to exit Bash is made while jobs are stopped, (or running, if
8828 the <CODE>checkjobs</CODE> option is enabled -- see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the
8829 shell prints a warning message, and if the <CODE>checkjobs</CODE> option is
8830 enabled, lists the jobs and their statuses.
8831 The <CODE>jobs</CODE> command may then be used to inspect their status.
8832 If a second attempt to exit is made without an intervening command,
8833 Bash does not print another warning, and any stopped jobs are terminated.
8836 <A NAME="Job Control Builtins"></A>
8838 <A NAME="SEC93"></A>
8839 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8840 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> < </A>]</TD>
8841 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> > </A>]</TD>
8842 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> << </A>]</TD>
8843 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8844 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD>
8845 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8846 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8847 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8848 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8850 <H2> 7.2 Job Control Builtins </H2>
8851 <!--docid::SEC93::-->
8857 <DD><A NAME="IDX293"></A>
8858 <TABLE><tr><td> </td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>]
8859 </pre></td></tr></table>Resume each suspended job <VAR>jobspec</VAR> in the background, as if it
8860 had been started with <SAMP>`&'</SAMP>.
8861 If <VAR>jobspec</VAR> is not supplied, the current job is used.
8862 The return status is zero unless it is run when job control is not
8863 enabled, or, when run with job control enabled, any
8864 <VAR>jobspec</VAR> was not found or specifies a job
8865 that was started without job control.
8869 <DD><A NAME="IDX294"></A>
8870 <TABLE><tr><td> </td><td class=example><pre>fg [<VAR>jobspec</VAR>]
8871 </pre></td></tr></table>Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job.
8872 If <VAR>jobspec</VAR> is not supplied, the current job is used.
8873 The return status is that of the command placed into the foreground,
8874 or non-zero if run when job control is disabled or, when run with
8875 job control enabled, <VAR>jobspec</VAR> does not specify a valid job or
8876 <VAR>jobspec</VAR> specifies a job that was started without job control.
8879 <DT><CODE>jobs</CODE>
8880 <DD><A NAME="IDX295"></A>
8881 <TABLE><tr><td> </td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>]
8882 jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>]
8883 </pre></td></tr></table><P>
8885 The first form lists the active jobs. The options have the
8891 <DD>List process IDs in addition to the normal information.
8895 <DD>Display information only about jobs that have changed status since
8896 the user was last notified of their status.
8900 <DD>List only the process ID of the job's process group leader.
8904 <DD>Restrict output to running jobs.
8908 <DD>Restrict output to stopped jobs.
8912 If <VAR>jobspec</VAR> is given,
8913 output is restricted to information about that job.
8914 If <VAR>jobspec</VAR> is not supplied, the status of all jobs is
8918 If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any
8919 <VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the
8920 corresponding process group ID, and executes <VAR>command</VAR>,
8921 passing it <VAR>argument</VAR>s, returning its exit status.
8924 <DT><CODE>kill</CODE>
8925 <DD><A NAME="IDX296"></A>
8926 <TABLE><tr><td> </td><td class=example><pre>kill [-s <VAR>sigspec</VAR>] [-n <VAR>signum</VAR>] [-<VAR>sigspec</VAR>] <VAR>jobspec</VAR> or <VAR>pid</VAR>
8927 kill -l [<VAR>exit_status</VAR>]
8928 </pre></td></tr></table>Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process
8929 named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>.
8930 <VAR>sigspec</VAR> is either a case-insensitive signal name such as
8931 <CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix)
8932 or a signal number; <VAR>signum</VAR> is a signal number.
8933 If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used.
8934 The <SAMP>`-l'</SAMP> option lists the signal names.
8935 If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the
8936 signals corresponding to the arguments are listed, and the return status
8938 <VAR>exit_status</VAR> is a number specifying a signal number or the exit
8939 status of a process terminated by a signal.
8940 The return status is zero if at least one signal was successfully sent,
8941 or non-zero if an error occurs or an invalid option is encountered.
8944 <DT><CODE>wait</CODE>
8945 <DD><A NAME="IDX297"></A>
8946 <TABLE><tr><td> </td><td class=example><pre>wait [<VAR>jobspec</VAR> or <VAR>pid</VAR> ...]
8947 </pre></td></tr></table>Wait until the child process specified by each process ID <VAR>pid</VAR>
8948 or job specification <VAR>jobspec</VAR> exits and return the exit status of the
8949 last command waited for.
8950 If a job spec is given, all processes in the job are waited for.
8951 If no arguments are given, all currently active child processes are
8952 waited for, and the return status is zero.
8953 If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process
8954 of the shell, the return status is 127.
8957 <DT><CODE>disown</CODE>
8958 <DD><A NAME="IDX298"></A>
8959 <TABLE><tr><td> </td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>]
8960 </pre></td></tr></table>Without options, each <VAR>jobspec</VAR> is removed from the table of
8962 If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table,
8963 but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell
8964 receives a <CODE>SIGHUP</CODE>.
8965 If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor <SAMP>`-r'</SAMP>
8966 option is supplied, the current job is used.
8967 If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or
8968 mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR>
8969 argument restricts operation to running jobs.
8972 <DT><CODE>suspend</CODE>
8973 <DD><A NAME="IDX299"></A>
8974 <TABLE><tr><td> </td><td class=example><pre>suspend [-f]
8975 </pre></td></tr></table>Suspend the execution of this shell until it receives a
8976 <CODE>SIGCONT</CODE> signal.
8977 A login shell cannot be suspended; the <SAMP>`-f'</SAMP>
8978 option can be used to override this and force the suspension.
8984 When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE>
8985 builtins do not accept <VAR>jobspec</VAR> arguments. They must be
8986 supplied process IDs.
8989 <A NAME="Job Control Variables"></A>
8991 <A NAME="SEC94"></A>
8992 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8993 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> < </A>]</TD>
8994 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> > </A>]</TD>
8995 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> << </A>]</TD>
8996 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8997 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> >> </A>]</TD>
8998 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8999 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9000 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9001 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9003 <H2> 7.3 Job Control Variables </H2>
9004 <!--docid::SEC94::-->
9009 <A NAME="IDX300"></A>
9010 <DT><CODE>auto_resume</CODE>
9011 <DD><A NAME="IDX301"></A>
9012 This variable controls how the shell interacts with the user and
9013 job control. If this variable exists then single word simple
9014 commands without redirections are treated as candidates for resumption
9015 of an existing job. There is no ambiguity allowed; if there is
9016 more than one job beginning with the string typed, then
9017 the most recently accessed job will be selected.
9018 The name of a stopped job, in this context, is the command line
9019 used to start it. If this variable is set to the value <SAMP>`exact'</SAMP>,
9020 the string supplied must match the name of a stopped job exactly;
9021 if set to <SAMP>`substring'</SAMP>,
9022 the string supplied needs to match a substring of the name of a
9023 stopped job. The <SAMP>`substring'</SAMP> value provides functionality
9024 analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC92">7.1 Job Control Basics</A>).
9025 If set to any other value, the supplied string must
9026 be a prefix of a stopped job's name; this provides functionality
9027 analogous to the <SAMP>`%'</SAMP> job ID.
9033 <A NAME="IDX302"></A>
9036 <A NAME="Command Line Editing"></A>
9038 <A NAME="SEC95"></A>
9039 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9040 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> < </A>]</TD>
9041 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> > </A>]</TD>
9042 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> << </A>]</TD>
9043 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
9044 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD>
9045 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9046 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9047 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9048 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9050 <H1> 8. Command Line Editing </H1>
9051 <!--docid::SEC95::-->
9054 This chapter describes the basic features of the GNU
9055 command line editing interface.
9056 Command line editing is provided by the Readline library, which is
9057 used by several different programs, including Bash.
9058 Command line editing is enabled by default when using an interactive shell,
9059 unless the <SAMP>`--noediting'</SAMP> option is supplied at shell invocation.
9060 Line editing is also used when using the <SAMP>`-e'</SAMP> option to the
9061 <CODE>read</CODE> builtin command (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
9062 By default, the line editing commands are similar to those of emacs.
9063 A vi-style line editing interface is also available.
9064 Line editing can be enabled at any time using the <SAMP>`-o emacs'</SAMP> or
9065 <SAMP>`-o vi'</SAMP> options to the <CODE>set</CODE> builtin command
9066 (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), or disabled using the <SAMP>`+o emacs'</SAMP> or
9067 <SAMP>`+o vi'</SAMP> options to <CODE>set</CODE>.
9070 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9071 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR>
9072 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR>
9073 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR>
9074 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands
9075 available for binding</TD></TR>
9076 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">8.5 Readline vi Mode</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline
9077 behave like the vi editor.</TD></TR>
9078 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for
9079 a specific command.</TD></TR>
9080 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to
9081 complete arguments for a particular command.</TD></TR>
9082 </TABLE></BLOCKQUOTE>
9085 <A NAME="Introduction and Notation"></A>
9087 <A NAME="SEC96"></A>
9088 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9089 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> < </A>]</TD>
9090 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> > </A>]</TD>
9091 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD>
9092 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9093 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD>
9094 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9095 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9096 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9097 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9099 <H2> 8.1 Introduction to Line Editing </H2>
9100 <!--docid::SEC96::-->
9103 The following paragraphs describe the notation used to represent
9107 The text <KBD>C-k</KBD> is read as `Control-K' and describes the character
9108 produced when the <KBD>k</KBD> key is pressed while the Control key
9112 The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character
9113 produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD>
9115 The Meta key is labeled <KBD>ALT</KBD> on many keyboards.
9116 On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of
9117 the space bar), the <KBD>ALT</KBD> on the left side is generally set to
9119 The <KBD>ALT</KBD> key on the right may also be configured to work as a
9120 Meta key or may be configured as some other modifier, such as a
9121 Compose key for typing accented characters.
9124 If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as
9125 a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD>
9126 <EM>first</EM>, and then typing <KBD>k</KBD>.
9127 Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key.
9130 The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the
9131 character produced by <EM>metafying</EM> <KBD>C-k</KBD>.
9134 In addition, several keys have their own names. Specifically,
9135 <KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all
9136 stand for themselves when seen in this text, or in an init file
9137 (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>).
9138 If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will
9139 produce the desired character.
9140 The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on
9144 <A NAME="Readline Interaction"></A>
9146 <A NAME="SEC97"></A>
9147 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9148 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> < </A>]</TD>
9149 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> > </A>]</TD>
9150 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD>
9151 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9152 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD>
9153 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9154 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9155 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9156 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9158 <H2> 8.2 Readline Interaction </H2>
9159 <!--docid::SEC97::-->
9162 Often during an interactive session you type in a long line of text,
9163 only to notice that the first word on the line is misspelled. The
9164 Readline library gives you a set of commands for manipulating the text
9165 as you type it in, allowing you to just fix your typo, and not forcing
9166 you to retype the majority of the line. Using these editing commands,
9167 you move the cursor to the place that needs correction, and delete or
9168 insert the text of the corrections. Then, when you are satisfied with
9169 the line, you simply press <KBD>RET</KBD>. You do not have to be at the
9170 end of the line to press <KBD>RET</KBD>; the entire line is accepted
9171 regardless of the location of the cursor within the line.
9174 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9175 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The least you need to know about Readline.</TD></TR>
9176 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR>
9177 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to delete text, and how to get it back!</TD></TR>
9178 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR>
9179 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR>
9180 </TABLE></BLOCKQUOTE>
9183 <A NAME="Readline Bare Essentials"></A>
9185 <A NAME="SEC98"></A>
9186 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9187 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> < </A>]</TD>
9188 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> > </A>]</TD>
9189 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD>
9190 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9191 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD>
9192 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9193 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9194 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9195 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9197 <H3> 8.2.1 Readline Bare Essentials </H3>
9198 <!--docid::SEC98::-->
9201 In order to enter characters into the line, simply type them. The typed
9202 character appears where the cursor was, and then the cursor moves one
9203 space to the right. If you mistype a character, you can use your
9204 erase character to back up and delete the mistyped character.
9207 Sometimes you may mistype a character, and
9208 not notice the error until you have typed several other characters. In
9209 that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then
9210 correct your mistake. Afterwards, you can move the cursor to the right
9211 with <KBD>C-f</KBD>.
9214 When you add text in the middle of a line, you will notice that characters
9215 to the right of the cursor are `pushed over' to make room for the text
9216 that you have inserted. Likewise, when you delete text behind the cursor,
9217 characters to the right of the cursor are `pulled back' to fill in the
9218 blank space created by the removal of the text. A list of the bare
9219 essentials for editing the text of an input line follows.
9224 <DD>Move back one character.
9226 <DD>Move forward one character.
9227 <DT><KBD>DEL</KBD> or <KBD>Backspace</KBD>
9228 <DD>Delete the character to the left of the cursor.
9230 <DD>Delete the character underneath the cursor.
9231 <DT>Printing characters
9232 <DD>Insert the character into the line at the cursor.
9233 <DT><KBD>C-_</KBD> or <KBD>C-x C-u</KBD>
9234 <DD>Undo the last editing command. You can undo all the way back to an
9239 (Depending on your configuration, the <KBD>Backspace</KBD> key be set to
9240 delete the character to the left of the cursor and the <KBD>DEL</KBD> key set
9241 to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather
9242 than the character to the left of the cursor.)
9245 <A NAME="Readline Movement Commands"></A>
9247 <A NAME="SEC99"></A>
9248 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9249 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> < </A>]</TD>
9250 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> > </A>]</TD>
9251 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> << </A>]</TD>
9252 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9253 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD>
9254 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9255 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9256 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9257 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9259 <H3> 8.2.2 Readline Movement Commands </H3>
9260 <!--docid::SEC99::-->
9263 The above table describes the most basic keystrokes that you need
9264 in order to do editing of the input line. For your convenience, many
9265 other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>,
9266 <KBD>C-d</KBD>, and <KBD>DEL</KBD>. Here are some commands for moving more rapidly
9272 <DD>Move to the start of the line.
9274 <DD>Move to the end of the line.
9276 <DD>Move forward a word, where a word is composed of letters and digits.
9278 <DD>Move backward a word.
9280 <DD>Clear the screen, reprinting the current line at the top.
9284 Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves
9285 forward a word. It is a loose convention that control keystrokes
9286 operate on characters while meta keystrokes operate on words.
9289 <A NAME="Readline Killing Commands"></A>
9291 <A NAME="SEC100"></A>
9292 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9293 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> < </A>]</TD>
9294 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> > </A>]</TD>
9295 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> << </A>]</TD>
9296 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9297 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD>
9298 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9299 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9300 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9301 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9303 <H3> 8.2.3 Readline Killing Commands </H3>
9304 <!--docid::SEC100::-->
9307 <A NAME="IDX303"></A>
9308 <A NAME="IDX304"></A>
9311 <EM>Killing</EM> text means to delete the text from the line, but to save
9312 it away for later use, usually by <EM>yanking</EM> (re-inserting)
9313 it back into the line.
9314 (`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
9317 If the description for a command says that it `kills' text, then you can
9318 be sure that you can get the text back in a different (or the same)
9322 When you use a kill command, the text is saved in a <EM>kill-ring</EM>.
9323 Any number of consecutive kills save all of the killed text together, so
9324 that when you yank it back, you get it all. The kill
9325 ring is not line specific; the text that you killed on a previously
9326 typed line is available to be yanked back later, when you are typing
9328 <A NAME="IDX305"></A>
9331 Here is the list of commands for killing text.
9336 <DD>Kill the text from the current cursor position to the end of the line.
9340 <DD>Kill from the cursor to the end of the current word, or, if between
9341 words, to the end of the next word.
9342 Word boundaries are the same as those used by <KBD>M-f</KBD>.
9345 <DT><KBD>M-<KBD>DEL</KBD></KBD>
9346 <DD>Kill from the cursor the start of the current word, or, if between
9347 words, to the start of the previous word.
9348 Word boundaries are the same as those used by <KBD>M-b</KBD>.
9352 <DD>Kill from the cursor to the previous whitespace. This is different than
9353 <KBD>M-<KBD>DEL</KBD></KBD> because the word boundaries differ.
9359 Here is how to <EM>yank</EM> the text back into the line. Yanking
9360 means to copy the most-recently-killed text from the kill buffer.
9365 <DD>Yank the most recently killed text back into the buffer at the cursor.
9369 <DD>Rotate the kill-ring, and yank the new top. You can only do this if
9370 the prior command is <KBD>C-y</KBD> or <KBD>M-y</KBD>.
9374 <A NAME="Readline Arguments"></A>
9376 <A NAME="SEC101"></A>
9377 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9378 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> < </A>]</TD>
9379 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> > </A>]</TD>
9380 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> << </A>]</TD>
9381 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9382 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD>
9383 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9384 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9386 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9388 <H3> 8.2.4 Readline Arguments </H3>
9389 <!--docid::SEC101::-->
9392 You can pass numeric arguments to Readline commands. Sometimes the
9393 argument acts as a repeat count, other times it is the <I>sign</I> of the
9394 argument that is significant. If you pass a negative argument to a
9395 command which normally acts in a forward direction, that command will
9396 act in a backward direction. For example, to kill text back to the
9397 start of the line, you might type <SAMP>`M-- C-k'</SAMP>.
9400 The general way to pass numeric arguments to a command is to type meta
9401 digits before the command. If the first `digit' typed is a minus
9402 sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative. Once
9403 you have typed one meta digit to get the argument started, you can type
9404 the remainder of the digits, and then the command. For example, to give
9405 the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>,
9406 which will delete the next ten characters on the input line.
9409 <A NAME="Searching"></A>
9411 <A NAME="SEC102"></A>
9412 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9413 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> < </A>]</TD>
9414 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> > </A>]</TD>
9415 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> << </A>]</TD>
9416 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9417 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> >> </A>]</TD>
9418 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9419 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9420 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9421 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9423 <H3> 8.2.5 Searching for Commands in the History </H3>
9424 <!--docid::SEC102::-->
9427 Readline provides commands for searching through the command history
9428 (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>)
9429 for lines containing a specified string.
9430 There are two search modes: <EM>incremental</EM> and <EM>non-incremental</EM>.
9433 Incremental searches begin before the user has finished typing the
9435 As each character of the search string is typed, Readline displays
9436 the next entry from the history matching the string typed so far.
9437 An incremental search requires only as many characters as needed to
9438 find the desired history entry.
9439 To search backward in the history for a particular string, type
9440 <KBD>C-r</KBD>. Typing <KBD>C-s</KBD> searches forward through the history.
9441 The characters present in the value of the <CODE>isearch-terminators</CODE> variable
9442 are used to terminate an incremental search.
9443 If that variable has not been assigned a value, the <KBD>ESC</KBD> and
9444 <KBD>C-J</KBD> characters will terminate an incremental search.
9445 <KBD>C-g</KBD> will abort an incremental search and restore the original line.
9446 When the search is terminated, the history entry containing the
9447 search string becomes the current line.
9450 To find other matching entries in the history list, type <KBD>C-r</KBD> or
9451 <KBD>C-s</KBD> as appropriate.
9452 This will search backward or forward in the history for the next
9453 entry matching the search string typed so far.
9454 Any other key sequence bound to a Readline command will terminate
9455 the search and execute that command.
9456 For instance, a <KBD>RET</KBD> will terminate the search and accept
9457 the line, thereby executing the command from the history list.
9458 A movement command will terminate the search, make the last line found
9459 the current line, and begin editing.
9462 Readline remembers the last incremental search string. If two
9463 <KBD>C-r</KBD>s are typed without any intervening characters defining a new
9464 search string, any remembered search string is used.
9467 Non-incremental searches read the entire search string before starting
9468 to search for matching history lines. The search string may be
9469 typed by the user or be part of the contents of the current line.
9472 <A NAME="Readline Init File"></A>
9474 <A NAME="SEC103"></A>
9475 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9476 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> < </A>]</TD>
9477 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> > </A>]</TD>
9478 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD>
9479 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9480 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD>
9481 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9482 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9483 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9484 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9486 <H2> 8.3 Readline Init File </H2>
9487 <!--docid::SEC103::-->
9490 Although the Readline library comes with a set of Emacs-like
9491 keybindings installed by default, it is possible to use a different set
9493 Any user can customize programs that use Readline by putting
9494 commands in an <EM>inputrc</EM> file, conventionally in his home directory.
9496 file is taken from the value of the shell variable <CODE>INPUTRC</CODE>. If
9497 that variable is unset, the default is <TT>`~/.inputrc'</TT>. If that
9498 file does not exist or cannot be read, the ultimate default is
9499 <TT>`/etc/inputrc'</TT>.
9502 When a program which uses the Readline library starts up, the
9503 init file is read, and the key bindings are set.
9506 In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus
9507 incorporating any changes that you might have made to it.
9510 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9511 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Syntax for the commands in the inputrc file.</TD></TR>
9515 <TABLE BORDER=0 CELLSPACING=0>
9516 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Conditional key bindings in the inputrc file.</TD></TR>
9520 <TABLE BORDER=0 CELLSPACING=0>
9521 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC106">8.3.3 Sample Init File</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">An example inputrc file.</TD></TR>
9522 </TABLE></BLOCKQUOTE>
9525 <A NAME="Readline Init File Syntax"></A>
9527 <A NAME="SEC104"></A>
9528 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9529 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> < </A>]</TD>
9530 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> > </A>]</TD>
9531 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD>
9532 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
9533 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD>
9534 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9535 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9536 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9537 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9539 <H3> 8.3.1 Readline Init File Syntax </H3>
9540 <!--docid::SEC104::-->
9543 There are only a few basic constructs allowed in the
9544 Readline init file. Blank lines are ignored.
9545 Lines beginning with a <SAMP>`#'</SAMP> are comments.
9546 Lines beginning with a <SAMP>`$'</SAMP> indicate conditional
9547 constructs (see section <A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>). Other lines
9548 denote variable settings and key bindings.
9552 <DT>Variable Settings
9553 <DD>You can modify the run-time behavior of Readline by
9554 altering the values of variables in Readline
9555 using the <CODE>set</CODE> command within the init file.
9556 The syntax is simple:
9559 <TABLE><tr><td> </td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR>
9560 </pre></td></tr></table></P><P>
9562 Here, for example, is how to
9563 change from the default Emacs-like key binding to use
9564 <CODE>vi</CODE> line editing commands:
9567 <TABLE><tr><td> </td><td class=example><pre>set editing-mode vi
9568 </pre></td></tr></table></P><P>
9570 Variable names and values, where appropriate, are recognized without regard
9571 to case. Unrecognized variable names are ignored.
9574 Boolean variables (those that can be set to on or off) are set to on if
9575 the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1. Any other
9576 value results in the variable being set to off.
9579 The <CODE>bind -V</CODE> command lists the current Readline variable names
9580 and values. See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.
9583 A great deal of run-time behavior is changeable with the following
9587 <A NAME="IDX306"></A>
9590 <DT><CODE>bell-style</CODE>
9591 <DD><A NAME="IDX307"></A>
9592 Controls what happens when Readline wants to ring the terminal bell.
9593 If set to <SAMP>`none'</SAMP>, Readline never rings the bell. If set to
9594 <SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available.
9595 If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring
9596 the terminal's bell.
9599 <DT><CODE>bind-tty-special-chars</CODE>
9600 <DD><A NAME="IDX308"></A>
9601 If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters
9602 treated specially by the kernel's terminal driver to their Readline
9606 <DT><CODE>comment-begin</CODE>
9607 <DD><A NAME="IDX309"></A>
9608 The string to insert at the beginning of the line when the
9609 <CODE>insert-comment</CODE> command is executed. The default value
9610 is <CODE>"#"</CODE>.
9613 <DT><CODE>completion-ignore-case</CODE>
9614 <DD>If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion
9615 in a case-insensitive fashion.
9616 The default value is <SAMP>`off'</SAMP>.
9619 <DT><CODE>completion-prefix-display-length</CODE>
9620 <DD><A NAME="IDX310"></A>
9621 The length in characters of the common prefix of a list of possible
9622 completions that is displayed without modification. When set to a
9623 value greater than zero, common prefixes longer than this value are
9624 replaced with an ellipsis when displaying possible completions.
9627 <DT><CODE>completion-query-items</CODE>
9628 <DD><A NAME="IDX311"></A>
9629 The number of possible completions that determines when the user is
9630 asked whether the list of possibilities should be displayed.
9631 If the number of possible completions is greater than this value,
9632 Readline will ask the user whether or not he wishes to view
9633 them; otherwise, they are simply listed.
9634 This variable must be set to an integer value greater than or equal to 0.
9635 A negative value means Readline should never ask.
9636 The default limit is <CODE>100</CODE>.
9639 <DT><CODE>convert-meta</CODE>
9640 <DD><A NAME="IDX312"></A>
9641 If set to <SAMP>`on'</SAMP>, Readline will convert characters with the
9642 eighth bit set to an ASCII key sequence by stripping the eighth
9643 bit and prefixing an <KBD>ESC</KBD> character, converting them to a
9644 meta-prefixed key sequence. The default value is <SAMP>`on'</SAMP>.
9647 <DT><CODE>disable-completion</CODE>
9648 <DD><A NAME="IDX313"></A>
9649 If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion.
9650 Completion characters will be inserted into the line as if they had
9651 been mapped to <CODE>self-insert</CODE>. The default is <SAMP>`off'</SAMP>.
9654 <DT><CODE>editing-mode</CODE>
9655 <DD><A NAME="IDX314"></A>
9656 The <CODE>editing-mode</CODE> variable controls which default set of
9657 key bindings is used. By default, Readline starts up in Emacs editing
9658 mode, where the keystrokes are most similar to Emacs. This variable can be
9659 set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>.
9662 <DT><CODE>echo-control-characters</CODE>
9663 <DD>When set to <SAMP>`on'</SAMP>, on operating systems that indicate they support it,
9664 readline echoes a character corresponding to a signal generated from the
9665 keyboard. The default is <SAMP>`on'</SAMP>.
9668 <DT><CODE>enable-keypad</CODE>
9669 <DD><A NAME="IDX315"></A>
9670 When set to <SAMP>`on'</SAMP>, Readline will try to enable the application
9671 keypad when it is called. Some systems need this to enable the
9672 arrow keys. The default is <SAMP>`off'</SAMP>.
9675 <DT><CODE>enable-meta-key</CODE>
9676 <DD>When set to <SAMP>`on'</SAMP>, Readline will try to enable any meta modifier
9677 key the terminal claims to support when it is called. On many terminals,
9678 the meta key is used to send eight-bit characters.
9679 The default is <SAMP>`on'</SAMP>.
9682 <DT><CODE>expand-tilde</CODE>
9683 <DD><A NAME="IDX316"></A>
9684 If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline
9685 attempts word completion. The default is <SAMP>`off'</SAMP>.
9688 <DT><CODE>history-preserve-point</CODE>
9689 <DD><A NAME="IDX317"></A>
9690 If set to <SAMP>`on'</SAMP>, the history code attempts to place the point (the
9691 current cursor position) at the
9692 same location on each history line retrieved with <CODE>previous-history</CODE>
9693 or <CODE>next-history</CODE>. The default is <SAMP>`off'</SAMP>.
9696 <DT><CODE>history-size</CODE>
9697 <DD><A NAME="IDX318"></A>
9698 Set the maximum number of history entries saved in the history list. If
9699 set to zero, the number of entries in the history list is not limited.
9702 <DT><CODE>horizontal-scroll-mode</CODE>
9703 <DD><A NAME="IDX319"></A>
9704 This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>. Setting it
9705 to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll
9706 horizontally on a single screen line when they are longer than the width
9707 of the screen, instead of wrapping onto a new screen line. By default,
9708 this variable is set to <SAMP>`off'</SAMP>.
9711 <DT><CODE>input-meta</CODE>
9712 <DD><A NAME="IDX320"></A>
9713 <A NAME="IDX321"></A>
9714 If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it
9715 will not clear the eighth bit in the characters it reads),
9716 regardless of what the terminal claims it can support. The
9717 default value is <SAMP>`off'</SAMP>. The name <CODE>meta-flag</CODE> is a
9718 synonym for this variable.
9721 <DT><CODE>isearch-terminators</CODE>
9722 <DD><A NAME="IDX322"></A>
9723 The string of characters that should terminate an incremental search without
9724 subsequently executing the character as a command (see section <A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>).
9725 If this variable has not been given a value, the characters <KBD>ESC</KBD> and
9726 <KBD>C-J</KBD> will terminate an incremental search.
9729 <DT><CODE>keymap</CODE>
9730 <DD><A NAME="IDX323"></A>
9731 Sets Readline's idea of the current keymap for key binding commands.
9732 Acceptable <CODE>keymap</CODE> names are
9734 <CODE>emacs-standard</CODE>,
9735 <CODE>emacs-meta</CODE>,
9736 <CODE>emacs-ctlx</CODE>,
9738 <CODE>vi-move</CODE>,
9739 <CODE>vi-command</CODE>, and
9740 <CODE>vi-insert</CODE>.
9741 <CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; <CODE>emacs</CODE> is
9742 equivalent to <CODE>emacs-standard</CODE>. The default value is <CODE>emacs</CODE>.
9743 The value of the <CODE>editing-mode</CODE> variable also affects the
9747 <DT><CODE>mark-directories</CODE>
9748 <DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash
9749 appended. The default is <SAMP>`on'</SAMP>.
9752 <DT><CODE>mark-modified-lines</CODE>
9753 <DD><A NAME="IDX324"></A>
9754 This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an
9755 asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified.
9756 This variable is <SAMP>`off'</SAMP> by default.
9759 <DT><CODE>mark-symlinked-directories</CODE>
9760 <DD><A NAME="IDX325"></A>
9761 If set to <SAMP>`on'</SAMP>, completed names which are symbolic links
9762 to directories have a slash appended (subject to the value of
9763 <CODE>mark-directories</CODE>).
9764 The default is <SAMP>`off'</SAMP>.
9767 <DT><CODE>match-hidden-files</CODE>
9768 <DD><A NAME="IDX326"></A>
9769 This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose
9770 names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename
9771 completion, unless the leading <SAMP>`.'</SAMP> is
9772 supplied by the user in the filename to be completed.
9773 This variable is <SAMP>`on'</SAMP> by default.
9776 <DT><CODE>output-meta</CODE>
9777 <DD><A NAME="IDX327"></A>
9778 If set to <SAMP>`on'</SAMP>, Readline will display characters with the
9779 eighth bit set directly rather than as a meta-prefixed escape
9780 sequence. The default is <SAMP>`off'</SAMP>.
9783 <DT><CODE>page-completions</CODE>
9784 <DD><A NAME="IDX328"></A>
9785 If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager
9786 to display a screenful of possible completions at a time.
9787 This variable is <SAMP>`on'</SAMP> by default.
9790 <DT><CODE>print-completions-horizontally</CODE>
9791 <DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches
9792 sorted horizontally in alphabetical order, rather than down the screen.
9793 The default is <SAMP>`off'</SAMP>.
9796 <DT><CODE>revert-all-at-newline</CODE>
9797 <DD><A NAME="IDX329"></A>
9798 If set to <SAMP>`on'</SAMP>, Readline will undo all changes to history lines
9799 before returning when <CODE>accept-line</CODE> is executed. By default,
9800 history lines may be modified and retain individual undo lists across
9801 calls to <CODE>readline</CODE>. The default is <SAMP>`off'</SAMP>.
9804 <DT><CODE>show-all-if-ambiguous</CODE>
9805 <DD><A NAME="IDX330"></A>
9806 This alters the default behavior of the completion functions. If
9807 set to <SAMP>`on'</SAMP>,
9808 words which have more than one possible completion cause the
9809 matches to be listed immediately instead of ringing the bell.
9810 The default value is <SAMP>`off'</SAMP>.
9813 <DT><CODE>show-all-if-unmodified</CODE>
9814 <DD><A NAME="IDX331"></A>
9815 This alters the default behavior of the completion functions in
9816 a fashion similar to <VAR>show-all-if-ambiguous</VAR>.
9817 If set to <SAMP>`on'</SAMP>,
9818 words which have more than one possible completion without any
9819 possible partial completion (the possible completions don't share
9820 a common prefix) cause the matches to be listed immediately instead
9821 of ringing the bell.
9822 The default value is <SAMP>`off'</SAMP>.
9825 <DT><CODE>skip-completed-text</CODE>
9826 <DD><A NAME="IDX332"></A>
9827 If set to <SAMP>`on'</SAMP>, this alters the default completion behavior when
9828 inserting a single match into the line. It's only active when
9829 performing completion in the middle of a word. If enabled, readline
9830 does not insert characters from the completion that match characters
9831 after point in the word being completed, so portions of the word
9832 following the cursor are not duplicated.
9833 For instance, if this is enabled, attempting completion when the cursor
9834 is after the <SAMP>`e'</SAMP> in <SAMP>`Makefile'</SAMP> will result in <SAMP>`Makefile'</SAMP>
9835 rather than <SAMP>`Makefilefile'</SAMP>, assuming there is a single possible
9837 The default value is <SAMP>`off'</SAMP>.
9840 <DT><CODE>visible-stats</CODE>
9841 <DD><A NAME="IDX333"></A>
9842 If set to <SAMP>`on'</SAMP>, a character denoting a file's type
9843 is appended to the filename when listing possible
9844 completions. The default is <SAMP>`off'</SAMP>.
9851 <DD>The syntax for controlling key bindings in the init file is
9852 simple. First you need to find the name of the command that you
9853 want to change. The following sections contain tables of the command
9854 name, the default keybinding, if any, and a short description of what
9858 Once you know the name of the command, simply place on a line
9859 in the init file the name of the key
9860 you wish to bind the command to, a colon, and then the name of the
9862 There can be no space between the key name and the colon -- that will be
9863 interpreted as part of the key name.
9864 The name of the key can be expressed in different ways, depending on
9865 what you find most comfortable.
9868 In addition to command names, readline allows keys to be bound
9869 to a string that is inserted when the key is pressed (a <VAR>macro</VAR>).
9872 The <CODE>bind -p</CODE> command displays Readline function names and
9873 bindings in a format that can put directly into an initialization file.
9874 See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.
9878 <DT><VAR>keyname</VAR>: <VAR>function-name</VAR> or <VAR>macro</VAR>
9879 <DD><VAR>keyname</VAR> is the name of a key spelled out in English. For example:
9880 <TABLE><tr><td> </td><td class=example><pre>Control-u: universal-argument
9881 Meta-Rubout: backward-kill-word
9882 Control-o: "> output"
9883 </pre></td></tr></table><P>
9885 In the above example, <KBD>C-u</KBD> is bound to the function
9886 <CODE>universal-argument</CODE>,
9887 <KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and
9888 <KBD>C-o</KBD> is bound to run the macro
9889 expressed on the right hand side (that is, to insert the text
9890 <SAMP>`> output'</SAMP> into the line).
9893 A number of symbolic character names are recognized while
9894 processing this key binding syntax:
9909 <DT>"<VAR>keyseq</VAR>": <VAR>function-name</VAR> or <VAR>macro</VAR>
9910 <DD><VAR>keyseq</VAR> differs from <VAR>keyname</VAR> above in that strings
9911 denoting an entire key sequence can be specified, by placing
9912 the key sequence in double quotes. Some GNU Emacs style key
9913 escapes can be used, as in the following example, but the
9914 special character names are not recognized.
9917 <TABLE><tr><td> </td><td class=example><pre>"\C-u": universal-argument
9918 "\C-x\C-r": re-read-init-file
9919 "\e[11~": "Function Key 1"
9920 </pre></td></tr></table></P><P>
9922 In the above example, <KBD>C-u</KBD> is again bound to the function
9923 <CODE>universal-argument</CODE> (just as it was in the first example),
9924 <SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>,
9925 and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert
9926 the text <SAMP>`Function Key 1'</SAMP>.
9932 The following GNU Emacs style escape sequences are available when
9933 specifying key sequences:
9937 <DT><CODE><KBD>\C-</KBD></CODE>
9939 <DT><CODE><KBD>\M-</KBD></CODE>
9941 <DT><CODE><KBD>\e</KBD></CODE>
9942 <DD>an escape character
9943 <DT><CODE><KBD>\\</KBD></CODE>
9945 <DT><CODE><KBD>\"</KBD></CODE>
9946 <DD><KBD>"</KBD>, a double quotation mark
9947 <DT><CODE><KBD>\'</KBD></CODE>
9948 <DD><KBD>'</KBD>, a single quote or apostrophe
9952 In addition to the GNU Emacs style escape sequences, a second
9953 set of backslash escapes is available:
9973 <DT><CODE>\<VAR>nnn</VAR></CODE>
9974 <DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
9975 (one to three digits)
9976 <DT><CODE>\x<VAR>HH</VAR></CODE>
9977 <DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
9978 (one or two hex digits)
9982 When entering the text of a macro, single or double quotes must
9983 be used to indicate a macro definition.
9984 Unquoted text is assumed to be a function name.
9985 In the macro body, the backslash escapes described above are expanded.
9986 Backslash will quote any other character in the macro text,
9987 including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>.
9988 For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP>
9989 insert a single <SAMP>`\'</SAMP> into the line:
9990 <TABLE><tr><td> </td><td class=example><pre>"\C-x\\": "\\"
9991 </pre></td></tr></table></P><P>
9996 <A NAME="Conditional Init Constructs"></A>
9998 <A NAME="SEC105"></A>
9999 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10000 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> < </A>]</TD>
10001 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> > </A>]</TD>
10002 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> << </A>]</TD>
10003 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
10004 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD>
10005 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10006 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10007 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10008 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10010 <H3> 8.3.2 Conditional Init Constructs </H3>
10011 <!--docid::SEC105::-->
10014 Readline implements a facility similar in spirit to the conditional
10015 compilation features of the C preprocessor which allows key
10016 bindings and variable settings to be performed as the result
10017 of tests. There are four parser directives used.
10021 <DT><CODE>$if</CODE>
10022 <DD>The <CODE>$if</CODE> construct allows bindings to be made based on the
10023 editing mode, the terminal being used, or the application using
10024 Readline. The text of the test extends to the end of the line;
10025 no characters are required to isolate it.
10029 <DT><CODE>mode</CODE>
10030 <DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test
10031 whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode.
10032 This may be used in conjunction
10033 with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in
10034 the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if
10035 Readline is starting out in <CODE>emacs</CODE> mode.
10038 <DT><CODE>term</CODE>
10039 <DD>The <CODE>term=</CODE> form may be used to include terminal-specific
10040 key bindings, perhaps to bind the key sequences output by the
10041 terminal's function keys. The word on the right side of the
10042 <SAMP>`='</SAMP> is tested against both the full name of the terminal and
10043 the portion of the terminal name before the first <SAMP>`-'</SAMP>. This
10044 allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>,
10048 <DT><CODE>application</CODE>
10049 <DD>The <VAR>application</VAR> construct is used to include
10050 application-specific settings. Each program using the Readline
10051 library sets the <VAR>application name</VAR>, and you can test for
10052 a particular value.
10053 This could be used to bind key sequences to functions useful for
10054 a specific program. For instance, the following command adds a
10055 key sequence that quotes the current or previous word in Bash:
10056 <TABLE><tr><td> </td><td class=example><pre>$if Bash
10057 # Quote the current or previous word
10058 "\C-xq": "\eb\"\ef\""
10060 </pre></td></tr></table></DL>
10063 <DT><CODE>$endif</CODE>
10064 <DD>This command, as seen in the previous example, terminates an
10065 <CODE>$if</CODE> command.
10068 <DT><CODE>$else</CODE>
10069 <DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if
10073 <DT><CODE>$include</CODE>
10074 <DD>This directive takes a single filename as an argument and reads commands
10075 and bindings from that file.
10076 For example, the following directive reads from <TT>`/etc/inputrc'</TT>:
10077 <TABLE><tr><td> </td><td class=example><pre>$include /etc/inputrc
10078 </pre></td></tr></table></DL>
10081 <A NAME="Sample Init File"></A>
10083 <A NAME="SEC106"></A>
10084 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10085 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> < </A>]</TD>
10086 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> > </A>]</TD>
10087 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> << </A>]</TD>
10088 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
10089 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> >> </A>]</TD>
10090 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10091 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10092 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10093 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10095 <H3> 8.3.3 Sample Init File </H3>
10096 <!--docid::SEC106::-->
10099 Here is an example of an <VAR>inputrc</VAR> file. This illustrates key
10100 binding, variable assignment, and conditional syntax.
10103 <TABLE><tr><td> </td><td class=example><pre># This file controls the behaviour of line input editing for
10104 # programs that use the GNU Readline library. Existing
10105 # programs include FTP, Bash, and GDB.
10107 # You can re-read the inputrc file with C-x C-r.
10108 # Lines beginning with '#' are comments.
10110 # First, include any systemwide bindings and variable
10111 # assignments from /etc/Inputrc
10112 $include /etc/Inputrc
10115 # Set various bindings for emacs mode.
10117 set editing-mode emacs
10121 Meta-Control-h: backward-kill-word Text after the function name is ignored
10124 # Arrow keys in keypad mode
10126 #"\M-OD": backward-char
10127 #"\M-OC": forward-char
10128 #"\M-OA": previous-history
10129 #"\M-OB": next-history
10131 # Arrow keys in ANSI mode
10133 "\M-[D": backward-char
10134 "\M-[C": forward-char
10135 "\M-[A": previous-history
10136 "\M-[B": next-history
10138 # Arrow keys in 8 bit keypad mode
10140 #"\M-\C-OD": backward-char
10141 #"\M-\C-OC": forward-char
10142 #"\M-\C-OA": previous-history
10143 #"\M-\C-OB": next-history
10145 # Arrow keys in 8 bit ANSI mode
10147 #"\M-\C-[D": backward-char
10148 #"\M-\C-[C": forward-char
10149 #"\M-\C-[A": previous-history
10150 #"\M-\C-[B": next-history
10156 # An old-style binding. This happens to be the default.
10159 # Macros that are convenient for shell interaction
10162 "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
10163 # prepare to type a quoted word --
10164 # insert open and close double quotes
10165 # and move to just after the open quote
10166 "\C-x\"": "\"\"\C-b"
10167 # insert a backslash (testing backslash escapes
10168 # in sequences and macros)
10170 # Quote the current or previous word
10171 "\C-xq": "\eb\"\ef\""
10172 # Add a binding to refresh the line, which is unbound
10173 "\C-xr": redraw-current-line
10174 # Edit variable on current line.
10175 "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
10178 # use a visible bell if one is available
10179 set bell-style visible
10181 # don't strip characters to 7 bits when reading
10184 # allow iso-latin1 characters to be inserted rather
10185 # than converted to prefix-meta sequences
10186 set convert-meta off
10188 # display characters with the eighth bit set directly
10189 # rather than as meta-prefixed characters
10192 # if there are more than 150 possible completions for
10193 # a word, ask the user if he wants to see all of them
10194 set completion-query-items 150
10198 "\C-xg": "get \M-?"
10199 "\C-xt": "put \M-?"
10200 "\M-.": yank-last-arg
10202 </pre></td></tr></table></P><P>
10204 <A NAME="Bindable Readline Commands"></A>
10206 <A NAME="SEC107"></A>
10207 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10208 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> < </A>]</TD>
10209 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> > </A>]</TD>
10210 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD>
10211 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
10212 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10213 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10214 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10215 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10216 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10218 <H2> 8.4 Bindable Readline Commands </H2>
10219 <!--docid::SEC107::-->
10222 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
10223 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR>
10224 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR>
10225 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR>
10226 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR>
10227 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR>
10228 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Getting Readline to do the typing for you.</TD></TR>
10229 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR>
10230 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR>
10231 </TABLE></BLOCKQUOTE>
10234 This section describes Readline commands that may be bound to key
10236 You can list your key bindings by executing
10237 <CODE>bind -P</CODE> or, for a more terse format, suitable for an
10238 <VAR>inputrc</VAR> file, <CODE>bind -p</CODE>. (See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.)
10239 Command names without an accompanying key sequence are unbound by default.
10242 In the following descriptions, <EM>point</EM> refers to the current cursor
10243 position, and <EM>mark</EM> refers to a cursor position saved by the
10244 <CODE>set-mark</CODE> command.
10245 The text between the point and mark is referred to as the <EM>region</EM>.
10248 <A NAME="Commands For Moving"></A>
10250 <A NAME="SEC108"></A>
10251 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10252 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> < </A>]</TD>
10253 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> > </A>]</TD>
10254 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD>
10255 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10256 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10257 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10258 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10259 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10260 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10262 <H3> 8.4.1 Commands For Moving </H3>
10263 <!--docid::SEC108::-->
10265 <A NAME="IDX334"></A>
10266 <DT><CODE>beginning-of-line (C-a)</CODE>
10267 <DD><A NAME="IDX335"></A>
10268 Move to the start of the current line.
10271 <A NAME="IDX336"></A>
10272 <DT><CODE>end-of-line (C-e)</CODE>
10273 <DD><A NAME="IDX337"></A>
10274 Move to the end of the line.
10277 <A NAME="IDX338"></A>
10278 <DT><CODE>forward-char (C-f)</CODE>
10279 <DD><A NAME="IDX339"></A>
10280 Move forward a character.
10283 <A NAME="IDX340"></A>
10284 <DT><CODE>backward-char (C-b)</CODE>
10285 <DD><A NAME="IDX341"></A>
10286 Move back a character.
10289 <A NAME="IDX342"></A>
10290 <DT><CODE>forward-word (M-f)</CODE>
10291 <DD><A NAME="IDX343"></A>
10292 Move forward to the end of the next word.
10293 Words are composed of letters and digits.
10296 <A NAME="IDX344"></A>
10297 <DT><CODE>backward-word (M-b)</CODE>
10298 <DD><A NAME="IDX345"></A>
10299 Move back to the start of the current or previous word.
10300 Words are composed of letters and digits.
10303 <A NAME="IDX346"></A>
10304 <DT><CODE>shell-forward-word ()</CODE>
10305 <DD><A NAME="IDX347"></A>
10306 Move forward to the end of the next word.
10307 Words are delimited by non-quoted shell metacharacters.
10310 <A NAME="IDX348"></A>
10311 <DT><CODE>shell-backward-word ()</CODE>
10312 <DD><A NAME="IDX349"></A>
10313 Move back to the start of the current or previous word.
10314 Words are delimited by non-quoted shell metacharacters.
10317 <A NAME="IDX350"></A>
10318 <DT><CODE>clear-screen (C-l)</CODE>
10319 <DD><A NAME="IDX351"></A>
10320 Clear the screen and redraw the current line,
10321 leaving the current line at the top of the screen.
10324 <A NAME="IDX352"></A>
10325 <DT><CODE>redraw-current-line ()</CODE>
10326 <DD><A NAME="IDX353"></A>
10327 Refresh the current line. By default, this is unbound.
10333 <A NAME="Commands For History"></A>
10335 <A NAME="SEC109"></A>
10336 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10337 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> < </A>]</TD>
10338 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> > </A>]</TD>
10339 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> << </A>]</TD>
10340 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10341 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10342 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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#SEC140">Index</A>]</TD>
10345 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10347 <H3> 8.4.2 Commands For Manipulating The History </H3>
10348 <!--docid::SEC109::-->
10352 <A NAME="IDX354"></A>
10353 <DT><CODE>accept-line (Newline or Return)</CODE>
10354 <DD><A NAME="IDX355"></A>
10355 Accept the line regardless of where the cursor is.
10357 non-empty, add it to the history list according to the setting of
10358 the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables.
10359 If this line is a modified history line, then restore the history line
10360 to its original state.
10363 <A NAME="IDX356"></A>
10364 <DT><CODE>previous-history (C-p)</CODE>
10365 <DD><A NAME="IDX357"></A>
10366 Move `back' through the history list, fetching the previous command.
10369 <A NAME="IDX358"></A>
10370 <DT><CODE>next-history (C-n)</CODE>
10371 <DD><A NAME="IDX359"></A>
10372 Move `forward' through the history list, fetching the next command.
10375 <A NAME="IDX360"></A>
10376 <DT><CODE>beginning-of-history (M-<)</CODE>
10377 <DD><A NAME="IDX361"></A>
10378 Move to the first line in the history.
10381 <A NAME="IDX362"></A>
10382 <DT><CODE>end-of-history (M->)</CODE>
10383 <DD><A NAME="IDX363"></A>
10384 Move to the end of the input history, i.e., the line currently
10388 <A NAME="IDX364"></A>
10389 <DT><CODE>reverse-search-history (C-r)</CODE>
10390 <DD><A NAME="IDX365"></A>
10391 Search backward starting at the current line and moving `up' through
10392 the history as necessary. This is an incremental search.
10395 <A NAME="IDX366"></A>
10396 <DT><CODE>forward-search-history (C-s)</CODE>
10397 <DD><A NAME="IDX367"></A>
10398 Search forward starting at the current line and moving `down' through
10399 the the history as necessary. This is an incremental search.
10402 <A NAME="IDX368"></A>
10403 <DT><CODE>non-incremental-reverse-search-history (M-p)</CODE>
10404 <DD><A NAME="IDX369"></A>
10405 Search backward starting at the current line and moving `up'
10406 through the history as necessary using a non-incremental search
10407 for a string supplied by the user.
10410 <A NAME="IDX370"></A>
10411 <DT><CODE>non-incremental-forward-search-history (M-n)</CODE>
10412 <DD><A NAME="IDX371"></A>
10413 Search forward starting at the current line and moving `down'
10414 through the the history as necessary using a non-incremental search
10415 for a string supplied by the user.
10418 <A NAME="IDX372"></A>
10419 <DT><CODE>history-search-forward ()</CODE>
10420 <DD><A NAME="IDX373"></A>
10421 Search forward through the history for the string of characters
10422 between the start of the current line and the point.
10423 This is a non-incremental search.
10424 By default, this command is unbound.
10427 <A NAME="IDX374"></A>
10428 <DT><CODE>history-search-backward ()</CODE>
10429 <DD><A NAME="IDX375"></A>
10430 Search backward through the history for the string of characters
10431 between the start of the current line and the point. This
10432 is a non-incremental search. By default, this command is unbound.
10435 <A NAME="IDX376"></A>
10436 <DT><CODE>yank-nth-arg (M-C-y)</CODE>
10437 <DD><A NAME="IDX377"></A>
10438 Insert the first argument to the previous command (usually
10439 the second word on the previous line) at point.
10440 With an argument <VAR>n</VAR>,
10441 insert the <VAR>n</VAR>th word from the previous command (the words
10442 in the previous command begin with word 0). A negative argument
10443 inserts the <VAR>n</VAR>th word from the end of the previous command.
10444 Once the argument <VAR>n</VAR> is computed, the argument is extracted
10445 as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified.
10448 <A NAME="IDX378"></A>
10449 <DT><CODE>yank-last-arg (M-. or M-_)</CODE>
10450 <DD><A NAME="IDX379"></A>
10451 Insert last argument to the previous command (the last word of the
10452 previous history entry). With an
10453 argument, behave exactly like <CODE>yank-nth-arg</CODE>.
10454 Successive calls to <CODE>yank-last-arg</CODE> move back through the history
10455 list, inserting the last argument of each line in turn.
10456 The history expansion facilities are used to extract the last argument,
10457 as if the <SAMP>`!$'</SAMP> history expansion had been specified.
10463 <A NAME="Commands For Text"></A>
10465 <A NAME="SEC110"></A>
10466 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10467 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> < </A>]</TD>
10468 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> > </A>]</TD>
10469 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> << </A>]</TD>
10470 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10471 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10472 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10473 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10474 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10475 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10477 <H3> 8.4.3 Commands For Changing Text </H3>
10478 <!--docid::SEC110::-->
10482 <A NAME="IDX380"></A>
10483 <DT><CODE>delete-char (C-d)</CODE>
10484 <DD><A NAME="IDX381"></A>
10485 Delete the character at point. If point is at the
10486 beginning of the line, there are no characters in the line, and
10487 the last character typed was not bound to <CODE>delete-char</CODE>, then
10491 <A NAME="IDX382"></A>
10492 <DT><CODE>backward-delete-char (Rubout)</CODE>
10493 <DD><A NAME="IDX383"></A>
10494 Delete the character behind the cursor. A numeric argument means
10495 to kill the characters instead of deleting them.
10498 <A NAME="IDX384"></A>
10499 <DT><CODE>forward-backward-delete-char ()</CODE>
10500 <DD><A NAME="IDX385"></A>
10501 Delete the character under the cursor, unless the cursor is at the
10502 end of the line, in which case the character behind the cursor is
10503 deleted. By default, this is not bound to a key.
10506 <A NAME="IDX386"></A>
10507 <DT><CODE>quoted-insert (C-q or C-v)</CODE>
10508 <DD><A NAME="IDX387"></A>
10509 Add the next character typed to the line verbatim. This is
10510 how to insert key sequences like <KBD>C-q</KBD>, for example.
10513 <A NAME="IDX388"></A>
10514 <DT><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE>
10515 <DD><A NAME="IDX389"></A>
10519 <A NAME="IDX390"></A>
10520 <DT><CODE>transpose-chars (C-t)</CODE>
10521 <DD><A NAME="IDX391"></A>
10522 Drag the character before the cursor forward over
10523 the character at the cursor, moving the
10524 cursor forward as well. If the insertion point
10525 is at the end of the line, then this
10526 transposes the last two characters of the line.
10527 Negative arguments have no effect.
10530 <A NAME="IDX392"></A>
10531 <DT><CODE>transpose-words (M-t)</CODE>
10532 <DD><A NAME="IDX393"></A>
10533 Drag the word before point past the word after point,
10534 moving point past that word as well.
10535 If the insertion point is at the end of the line, this transposes
10536 the last two words on the line.
10539 <A NAME="IDX394"></A>
10540 <DT><CODE>upcase-word (M-u)</CODE>
10541 <DD><A NAME="IDX395"></A>
10542 Uppercase the current (or following) word. With a negative argument,
10543 uppercase the previous word, but do not move the cursor.
10546 <A NAME="IDX396"></A>
10547 <DT><CODE>downcase-word (M-l)</CODE>
10548 <DD><A NAME="IDX397"></A>
10549 Lowercase the current (or following) word. With a negative argument,
10550 lowercase the previous word, but do not move the cursor.
10553 <A NAME="IDX398"></A>
10554 <DT><CODE>capitalize-word (M-c)</CODE>
10555 <DD><A NAME="IDX399"></A>
10556 Capitalize the current (or following) word. With a negative argument,
10557 capitalize the previous word, but do not move the cursor.
10560 <A NAME="IDX400"></A>
10561 <DT><CODE>overwrite-mode ()</CODE>
10562 <DD><A NAME="IDX401"></A>
10563 Toggle overwrite mode. With an explicit positive numeric argument,
10564 switches to overwrite mode. With an explicit non-positive numeric
10565 argument, switches to insert mode. This command affects only
10566 <CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently.
10567 Each call to <CODE>readline()</CODE> starts in insert mode.
10570 In overwrite mode, characters bound to <CODE>self-insert</CODE> replace
10571 the text at point rather than pushing the text to the right.
10572 Characters bound to <CODE>backward-delete-char</CODE> replace the character
10573 before point with a space.
10576 By default, this command is unbound.
10582 <A NAME="Commands For Killing"></A>
10584 <A NAME="SEC111"></A>
10585 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10586 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> < </A>]</TD>
10587 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> > </A>]</TD>
10588 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> << </A>]</TD>
10589 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10590 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10591 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10592 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10593 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10594 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10596 <H3> 8.4.4 Killing And Yanking </H3>
10597 <!--docid::SEC111::-->
10602 <A NAME="IDX402"></A>
10603 <DT><CODE>kill-line (C-k)</CODE>
10604 <DD><A NAME="IDX403"></A>
10605 Kill the text from point to the end of the line.
10608 <A NAME="IDX404"></A>
10609 <DT><CODE>backward-kill-line (C-x Rubout)</CODE>
10610 <DD><A NAME="IDX405"></A>
10611 Kill backward to the beginning of the line.
10614 <A NAME="IDX406"></A>
10615 <DT><CODE>unix-line-discard (C-u)</CODE>
10616 <DD><A NAME="IDX407"></A>
10617 Kill backward from the cursor to the beginning of the current line.
10620 <A NAME="IDX408"></A>
10621 <DT><CODE>kill-whole-line ()</CODE>
10622 <DD><A NAME="IDX409"></A>
10623 Kill all characters on the current line, no matter where point is.
10624 By default, this is unbound.
10627 <A NAME="IDX410"></A>
10628 <DT><CODE>kill-word (M-d)</CODE>
10629 <DD><A NAME="IDX411"></A>
10630 Kill from point to the end of the current word, or if between
10631 words, to the end of the next word.
10632 Word boundaries are the same as <CODE>forward-word</CODE>.
10635 <A NAME="IDX412"></A>
10636 <DT><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE>
10637 <DD><A NAME="IDX413"></A>
10638 Kill the word behind point.
10639 Word boundaries are the same as <CODE>backward-word</CODE>.
10642 <A NAME="IDX414"></A>
10643 <DT><CODE>shell-kill-word ()</CODE>
10644 <DD><A NAME="IDX415"></A>
10645 Kill from point to the end of the current word, or if between
10646 words, to the end of the next word.
10647 Word boundaries are the same as <CODE>shell-forward-word</CODE>.
10650 <A NAME="IDX416"></A>
10651 <DT><CODE>backward-kill-word ()</CODE>
10652 <DD><A NAME="IDX417"></A>
10653 Kill the word behind point.
10654 Word boundaries are the same as <CODE>shell-backward-word</CODE>.
10657 <A NAME="IDX418"></A>
10658 <DT><CODE>unix-word-rubout (C-w)</CODE>
10659 <DD><A NAME="IDX419"></A>
10660 Kill the word behind point, using white space as a word boundary.
10661 The killed text is saved on the kill-ring.
10664 <A NAME="IDX420"></A>
10665 <DT><CODE>unix-filename-rubout ()</CODE>
10666 <DD><A NAME="IDX421"></A>
10667 Kill the word behind point, using white space and the slash character
10668 as the word boundaries.
10669 The killed text is saved on the kill-ring.
10672 <A NAME="IDX422"></A>
10673 <DT><CODE>delete-horizontal-space ()</CODE>
10674 <DD><A NAME="IDX423"></A>
10675 Delete all spaces and tabs around point. By default, this is unbound.
10678 <A NAME="IDX424"></A>
10679 <DT><CODE>kill-region ()</CODE>
10680 <DD><A NAME="IDX425"></A>
10681 Kill the text in the current region.
10682 By default, this command is unbound.
10685 <A NAME="IDX426"></A>
10686 <DT><CODE>copy-region-as-kill ()</CODE>
10687 <DD><A NAME="IDX427"></A>
10688 Copy the text in the region to the kill buffer, so it can be yanked
10689 right away. By default, this command is unbound.
10692 <A NAME="IDX428"></A>
10693 <DT><CODE>copy-backward-word ()</CODE>
10694 <DD><A NAME="IDX429"></A>
10695 Copy the word before point to the kill buffer.
10696 The word boundaries are the same as <CODE>backward-word</CODE>.
10697 By default, this command is unbound.
10700 <A NAME="IDX430"></A>
10701 <DT><CODE>copy-forward-word ()</CODE>
10702 <DD><A NAME="IDX431"></A>
10703 Copy the word following point to the kill buffer.
10704 The word boundaries are the same as <CODE>forward-word</CODE>.
10705 By default, this command is unbound.
10708 <A NAME="IDX432"></A>
10709 <DT><CODE>yank (C-y)</CODE>
10710 <DD><A NAME="IDX433"></A>
10711 Yank the top of the kill ring into the buffer at point.
10714 <A NAME="IDX434"></A>
10715 <DT><CODE>yank-pop (M-y)</CODE>
10716 <DD><A NAME="IDX435"></A>
10717 Rotate the kill-ring, and yank the new top. You can only do this if
10718 the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>.
10722 <A NAME="Numeric Arguments"></A>
10724 <A NAME="SEC112"></A>
10725 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10726 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> < </A>]</TD>
10727 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> > </A>]</TD>
10728 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> << </A>]</TD>
10729 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10730 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10731 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10732 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10733 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10734 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10736 <H3> 8.4.5 Specifying Numeric Arguments </H3>
10737 <!--docid::SEC112::-->
10740 <A NAME="IDX436"></A>
10741 <DT><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE>
10742 <DD><A NAME="IDX437"></A>
10743 Add this digit to the argument already accumulating, or start a new
10744 argument. <KBD>M--</KBD> starts a negative argument.
10747 <A NAME="IDX438"></A>
10748 <DT><CODE>universal-argument ()</CODE>
10749 <DD><A NAME="IDX439"></A>
10750 This is another way to specify an argument.
10751 If this command is followed by one or more digits, optionally with a
10752 leading minus sign, those digits define the argument.
10753 If the command is followed by digits, executing <CODE>universal-argument</CODE>
10754 again ends the numeric argument, but is otherwise ignored.
10755 As a special case, if this command is immediately followed by a
10756 character that is neither a digit or minus sign, the argument count
10757 for the next command is multiplied by four.
10758 The argument count is initially one, so executing this function the
10759 first time makes the argument count four, a second time makes the
10760 argument count sixteen, and so on.
10761 By default, this is not bound to a key.
10765 <A NAME="Commands For Completion"></A>
10767 <A NAME="SEC113"></A>
10768 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10769 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> < </A>]</TD>
10770 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> > </A>]</TD>
10771 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> << </A>]</TD>
10772 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10773 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10774 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10775 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10776 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10777 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10779 <H3> 8.4.6 Letting Readline Type For You </H3>
10780 <!--docid::SEC113::-->
10784 <A NAME="IDX440"></A>
10785 <DT><CODE>complete (<KBD>TAB</KBD>)</CODE>
10786 <DD><A NAME="IDX441"></A>
10787 Attempt to perform completion on the text before point.
10788 The actual completion performed is application-specific.
10789 Bash attempts completion treating the text as a variable (if the
10790 text begins with <SAMP>`$'</SAMP>), username (if the text begins with
10791 <SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or
10792 command (including aliases and functions) in turn. If none
10793 of these produces a match, filename completion is attempted.
10796 <A NAME="IDX442"></A>
10797 <DT><CODE>possible-completions (M-?)</CODE>
10798 <DD><A NAME="IDX443"></A>
10799 List the possible completions of the text before point.
10802 <A NAME="IDX444"></A>
10803 <DT><CODE>insert-completions (M-*)</CODE>
10804 <DD><A NAME="IDX445"></A>
10805 Insert all completions of the text before point that would have
10806 been generated by <CODE>possible-completions</CODE>.
10809 <A NAME="IDX446"></A>
10810 <DT><CODE>menu-complete ()</CODE>
10811 <DD><A NAME="IDX447"></A>
10812 Similar to <CODE>complete</CODE>, but replaces the word to be completed
10813 with a single match from the list of possible completions.
10814 Repeated execution of <CODE>menu-complete</CODE> steps through the list
10815 of possible completions, inserting each match in turn.
10816 At the end of the list of completions, the bell is rung
10817 (subject to the setting of <CODE>bell-style</CODE>)
10818 and the original text is restored.
10819 An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list
10820 of matches; a negative argument may be used to move backward
10822 This command is intended to be bound to <KBD>TAB</KBD>, but is unbound
10826 <A NAME="IDX448"></A>
10827 <DT><CODE>menu-complete-backward ()</CODE>
10828 <DD><A NAME="IDX449"></A>
10829 Identical to <CODE>menu-complete</CODE>, but moves backward through the list
10830 of possible completions, as if <CODE>menu-complete</CODE> had been given a
10834 <A NAME="IDX450"></A>
10835 <DT><CODE>delete-char-or-list ()</CODE>
10836 <DD><A NAME="IDX451"></A>
10837 Deletes the character under the cursor if not at the beginning or
10838 end of the line (like <CODE>delete-char</CODE>).
10839 If at the end of the line, behaves identically to
10840 <CODE>possible-completions</CODE>.
10841 This command is unbound by default.
10844 <A NAME="IDX452"></A>
10845 <DT><CODE>complete-filename (M-/)</CODE>
10846 <DD><A NAME="IDX453"></A>
10847 Attempt filename completion on the text before point.
10850 <A NAME="IDX454"></A>
10851 <DT><CODE>possible-filename-completions (C-x /)</CODE>
10852 <DD><A NAME="IDX455"></A>
10853 List the possible completions of the text before point,
10854 treating it as a filename.
10857 <A NAME="IDX456"></A>
10858 <DT><CODE>complete-username (M-~)</CODE>
10859 <DD><A NAME="IDX457"></A>
10860 Attempt completion on the text before point, treating
10864 <A NAME="IDX458"></A>
10865 <DT><CODE>possible-username-completions (C-x ~)</CODE>
10866 <DD><A NAME="IDX459"></A>
10867 List the possible completions of the text before point,
10868 treating it as a username.
10871 <A NAME="IDX460"></A>
10872 <DT><CODE>complete-variable (M-$)</CODE>
10873 <DD><A NAME="IDX461"></A>
10874 Attempt completion on the text before point, treating
10875 it as a shell variable.
10878 <A NAME="IDX462"></A>
10879 <DT><CODE>possible-variable-completions (C-x $)</CODE>
10880 <DD><A NAME="IDX463"></A>
10881 List the possible completions of the text before point,
10882 treating it as a shell variable.
10885 <A NAME="IDX464"></A>
10886 <DT><CODE>complete-hostname (M-@)</CODE>
10887 <DD><A NAME="IDX465"></A>
10888 Attempt completion on the text before point, treating
10892 <A NAME="IDX466"></A>
10893 <DT><CODE>possible-hostname-completions (C-x @)</CODE>
10894 <DD><A NAME="IDX467"></A>
10895 List the possible completions of the text before point,
10896 treating it as a hostname.
10899 <A NAME="IDX468"></A>
10900 <DT><CODE>complete-command (M-!)</CODE>
10901 <DD><A NAME="IDX469"></A>
10902 Attempt completion on the text before point, treating
10903 it as a command name. Command completion attempts to
10904 match the text against aliases, reserved words, shell
10905 functions, shell builtins, and finally executable filenames,
10909 <A NAME="IDX470"></A>
10910 <DT><CODE>possible-command-completions (C-x !)</CODE>
10911 <DD><A NAME="IDX471"></A>
10912 List the possible completions of the text before point,
10913 treating it as a command name.
10916 <A NAME="IDX472"></A>
10917 <DT><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE>
10918 <DD><A NAME="IDX473"></A>
10919 Attempt completion on the text before point, comparing
10920 the text against lines from the history list for possible
10921 completion matches.
10924 <A NAME="IDX474"></A>
10925 <DT><CODE>dabbrev-expand ()</CODE>
10926 <DD><A NAME="IDX475"></A>
10927 Attempt menu completion on the text before point, comparing
10928 the text against lines from the history list for possible
10929 completion matches.
10932 <A NAME="IDX476"></A>
10933 <DT><CODE>complete-into-braces (M-{)</CODE>
10934 <DD><A NAME="IDX477"></A>
10935 Perform filename completion and insert the list of possible completions
10936 enclosed within braces so the list is available to the shell
10937 (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>).
10943 <A NAME="Keyboard Macros"></A>
10945 <A NAME="SEC114"></A>
10946 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10947 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> < </A>]</TD>
10948 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> > </A>]</TD>
10949 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> << </A>]</TD>
10950 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10951 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10952 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10953 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10954 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10955 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10957 <H3> 8.4.7 Keyboard Macros </H3>
10958 <!--docid::SEC114::-->
10961 <A NAME="IDX478"></A>
10962 <DT><CODE>start-kbd-macro (C-x ()</CODE>
10963 <DD><A NAME="IDX479"></A>
10964 Begin saving the characters typed into the current keyboard macro.
10967 <A NAME="IDX480"></A>
10968 <DT><CODE>end-kbd-macro (C-x ))</CODE>
10969 <DD><A NAME="IDX481"></A>
10970 Stop saving the characters typed into the current keyboard macro
10971 and save the definition.
10974 <A NAME="IDX482"></A>
10975 <DT><CODE>call-last-kbd-macro (C-x e)</CODE>
10976 <DD><A NAME="IDX483"></A>
10977 Re-execute the last keyboard macro defined, by making the characters
10978 in the macro appear as if typed at the keyboard.
10984 <A NAME="Miscellaneous Commands"></A>
10986 <A NAME="SEC115"></A>
10987 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10988 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> < </A>]</TD>
10989 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> > </A>]</TD>
10990 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> << </A>]</TD>
10991 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10992 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> >> </A>]</TD>
10993 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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#SEC140">Index</A>]</TD>
10996 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10998 <H3> 8.4.8 Some Miscellaneous Commands </H3>
10999 <!--docid::SEC115::-->
11002 <A NAME="IDX484"></A>
11003 <DT><CODE>re-read-init-file (C-x C-r)</CODE>
11004 <DD><A NAME="IDX485"></A>
11005 Read in the contents of the <VAR>inputrc</VAR> file, and incorporate
11006 any bindings or variable assignments found there.
11009 <A NAME="IDX486"></A>
11010 <DT><CODE>abort (C-g)</CODE>
11011 <DD><A NAME="IDX487"></A>
11012 Abort the current editing command and
11013 ring the terminal's bell (subject to the setting of
11014 <CODE>bell-style</CODE>).
11017 <A NAME="IDX488"></A>
11018 <DT><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE>
11019 <DD><A NAME="IDX489"></A>
11020 If the metafied character <VAR>x</VAR> is lowercase, run the command
11021 that is bound to the corresponding uppercase character.
11024 <A NAME="IDX490"></A>
11025 <DT><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE>
11026 <DD><A NAME="IDX491"></A>
11027 Metafy the next character typed. This is for keyboards
11028 without a meta key. Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing
11032 <A NAME="IDX492"></A>
11033 <DT><CODE>undo (C-_ or C-x C-u)</CODE>
11034 <DD><A NAME="IDX493"></A>
11035 Incremental undo, separately remembered for each line.
11038 <A NAME="IDX494"></A>
11039 <DT><CODE>revert-line (M-r)</CODE>
11040 <DD><A NAME="IDX495"></A>
11041 Undo all changes made to this line. This is like executing the <CODE>undo</CODE>
11042 command enough times to get back to the beginning.
11045 <A NAME="IDX496"></A>
11046 <DT><CODE>tilde-expand (M-&)</CODE>
11047 <DD><A NAME="IDX497"></A>
11048 Perform tilde expansion on the current word.
11051 <A NAME="IDX498"></A>
11052 <DT><CODE>set-mark (C-@)</CODE>
11053 <DD><A NAME="IDX499"></A>
11054 Set the mark to the point. If a
11055 numeric argument is supplied, the mark is set to that position.
11058 <A NAME="IDX500"></A>
11059 <DT><CODE>exchange-point-and-mark (C-x C-x)</CODE>
11060 <DD><A NAME="IDX501"></A>
11061 Swap the point with the mark. The current cursor position is set to
11062 the saved position, and the old cursor position is saved as the mark.
11065 <A NAME="IDX502"></A>
11066 <DT><CODE>character-search (C-])</CODE>
11067 <DD><A NAME="IDX503"></A>
11068 A character is read and point is moved to the next occurrence of that
11069 character. A negative count searches for previous occurrences.
11072 <A NAME="IDX504"></A>
11073 <DT><CODE>character-search-backward (M-C-])</CODE>
11074 <DD><A NAME="IDX505"></A>
11075 A character is read and point is moved to the previous occurrence
11076 of that character. A negative count searches for subsequent
11080 <A NAME="IDX506"></A>
11081 <DT><CODE>skip-csi-sequence ()</CODE>
11082 <DD><A NAME="IDX507"></A>
11083 Read enough characters to consume a multi-key sequence such as those
11084 defined for keys like Home and End. Such sequences begin with a
11085 Control Sequence Indicator (CSI), usually ESC-[. If this sequence is
11086 bound to "\e[", keys producing such sequences will have no effect
11087 unless explicitly bound to a readline command, instead of inserting
11088 stray characters into the editing buffer. This is unbound by default,
11089 but usually bound to ESC-[.
11092 <A NAME="IDX508"></A>
11093 <DT><CODE>insert-comment (M-#)</CODE>
11094 <DD><A NAME="IDX509"></A>
11095 Without a numeric argument, the value of the <CODE>comment-begin</CODE>
11096 variable is inserted at the beginning of the current line.
11097 If a numeric argument is supplied, this command acts as a toggle: if
11098 the characters at the beginning of the line do not match the value
11099 of <CODE>comment-begin</CODE>, the value is inserted, otherwise
11100 the characters in <CODE>comment-begin</CODE> are deleted from the beginning of
11102 In either case, the line is accepted as if a newline had been typed.
11103 The default value of <CODE>comment-begin</CODE> causes this command
11104 to make the current line a shell comment.
11105 If a numeric argument causes the comment character to be removed, the line
11106 will be executed by the shell.
11109 <A NAME="IDX510"></A>
11110 <DT><CODE>dump-functions ()</CODE>
11111 <DD><A NAME="IDX511"></A>
11112 Print all of the functions and their key bindings to the
11113 Readline output stream. If a numeric argument is supplied,
11114 the output is formatted in such a way that it can be made part
11115 of an <VAR>inputrc</VAR> file. This command is unbound by default.
11118 <A NAME="IDX512"></A>
11119 <DT><CODE>dump-variables ()</CODE>
11120 <DD><A NAME="IDX513"></A>
11121 Print all of the settable variables and their values to the
11122 Readline output stream. If a numeric argument is supplied,
11123 the output is formatted in such a way that it can be made part
11124 of an <VAR>inputrc</VAR> file. This command is unbound by default.
11127 <A NAME="IDX514"></A>
11128 <DT><CODE>dump-macros ()</CODE>
11129 <DD><A NAME="IDX515"></A>
11130 Print all of the Readline key sequences bound to macros and the
11131 strings they output. If a numeric argument is supplied,
11132 the output is formatted in such a way that it can be made part
11133 of an <VAR>inputrc</VAR> file. This command is unbound by default.
11136 <A NAME="IDX516"></A>
11137 <DT><CODE>glob-complete-word (M-g)</CODE>
11138 <DD><A NAME="IDX517"></A>
11139 The word before point is treated as a pattern for pathname expansion,
11140 with an asterisk implicitly appended. This pattern is used to
11141 generate a list of matching file names for possible completions.
11144 <A NAME="IDX518"></A>
11145 <DT><CODE>glob-expand-word (C-x *)</CODE>
11146 <DD><A NAME="IDX519"></A>
11147 The word before point is treated as a pattern for pathname expansion,
11148 and the list of matching file names is inserted, replacing the word.
11149 If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11150 pathname expansion.
11153 <A NAME="IDX520"></A>
11154 <DT><CODE>glob-list-expansions (C-x g)</CODE>
11155 <DD><A NAME="IDX521"></A>
11156 The list of expansions that would have been generated by
11157 <CODE>glob-expand-word</CODE> is displayed, and the line is redrawn.
11158 If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11159 pathname expansion.
11162 <A NAME="IDX522"></A>
11163 <DT><CODE>display-shell-version (C-x C-v)</CODE>
11164 <DD><A NAME="IDX523"></A>
11165 Display version information about the current instance of Bash.
11168 <A NAME="IDX524"></A>
11169 <DT><CODE>shell-expand-line (M-C-e)</CODE>
11170 <DD><A NAME="IDX525"></A>
11171 Expand the line as the shell does.
11172 This performs alias and history expansion as well as all of the shell
11173 word expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
11176 <A NAME="IDX526"></A>
11177 <DT><CODE>history-expand-line (M-^)</CODE>
11178 <DD><A NAME="IDX527"></A>
11179 Perform history expansion on the current line.
11182 <A NAME="IDX528"></A>
11183 <DT><CODE>magic-space ()</CODE>
11184 <DD><A NAME="IDX529"></A>
11185 Perform history expansion on the current line and insert a space
11186 (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
11189 <A NAME="IDX530"></A>
11190 <DT><CODE>alias-expand-line ()</CODE>
11191 <DD><A NAME="IDX531"></A>
11192 Perform alias expansion on the current line (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
11195 <A NAME="IDX532"></A>
11196 <DT><CODE>history-and-alias-expand-line ()</CODE>
11197 <DD><A NAME="IDX533"></A>
11198 Perform history and alias expansion on the current line.
11201 <A NAME="IDX534"></A>
11202 <DT><CODE>insert-last-argument (M-. or M-_)</CODE>
11203 <DD><A NAME="IDX535"></A>
11204 A synonym for <CODE>yank-last-arg</CODE>.
11207 <A NAME="IDX536"></A>
11208 <DT><CODE>operate-and-get-next (C-o)</CODE>
11209 <DD><A NAME="IDX537"></A>
11210 Accept the current line for execution and fetch the next line
11211 relative to the current line from the history for editing. Any
11212 argument is ignored.
11215 <A NAME="IDX538"></A>
11216 <DT><CODE>edit-and-execute-command (C-xC-e)</CODE>
11217 <DD><A NAME="IDX539"></A>
11218 Invoke an editor on the current command line, and execute the result as shell
11220 Bash attempts to invoke
11221 <CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE>
11222 as the editor, in that order.
11228 <A NAME="Readline vi Mode"></A>
11230 <A NAME="SEC116"></A>
11231 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11232 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> < </A>]</TD>
11233 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> > </A>]</TD>
11234 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> << </A>]</TD>
11235 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11236 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD>
11237 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11238 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11239 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11240 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11242 <H2> 8.5 Readline vi Mode </H2>
11243 <!--docid::SEC116::-->
11246 While the Readline library does not have a full set of <CODE>vi</CODE>
11247 editing functions, it does contain enough to allow simple editing
11248 of the line. The Readline <CODE>vi</CODE> mode behaves as specified in
11249 the POSIX 1003.2 standard.
11252 In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE>
11253 editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP>
11254 commands (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
11255 The Readline default is <CODE>emacs</CODE> mode.
11258 When you enter a line in <CODE>vi</CODE> mode, you are already placed in
11259 `insertion' mode, as if you had typed an <SAMP>`i'</SAMP>. Pressing <KBD>ESC</KBD>
11260 switches you into `command' mode, where you can edit the text of the
11261 line with the standard <CODE>vi</CODE> movement keys, move to previous
11262 history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and
11266 <A NAME="Programmable Completion"></A>
11268 <A NAME="SEC117"></A>
11269 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11270 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> < </A>]</TD>
11271 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> > </A>]</TD>
11272 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> << </A>]</TD>
11273 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11274 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD>
11275 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11276 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11277 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11278 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11280 <H2> 8.6 Programmable Completion </H2>
11281 <!--docid::SEC117::-->
11284 When word completion is attempted for an argument to a command for
11285 which a completion specification (a <VAR>compspec</VAR>) has been defined
11286 using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>),
11287 the programmable completion facilities are invoked.
11290 First, the command name is identified.
11291 If a compspec has been defined for that command, the
11292 compspec is used to generate the list of possible completions for the word.
11293 If the command word is the empty string (completion attempted at the
11294 beginning of an empty line), any compspec defined with
11295 the <SAMP>`-E'</SAMP> option to <CODE>complete</CODE> is used.
11296 If the command word is a full pathname, a compspec for the full
11297 pathname is searched for first.
11298 If no compspec is found for the full pathname, an attempt is made to
11299 find a compspec for the portion following the final slash.
11300 If those searches do not result in a compspec, any compspec defined with
11301 the <SAMP>`-D'</SAMP> option to <CODE>complete</CODE> is used as the default.
11304 Once a compspec has been found, it is used to generate the list of
11306 If a compspec is not found, the default Bash completion
11307 described above (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>) is performed.
11310 First, the actions specified by the compspec are used.
11311 Only matches which are prefixed by the word being completed are
11313 When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or
11314 directory name completion, the shell variable <CODE>FIGNORE</CODE> is
11315 used to filter the matches.
11316 See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
11319 Any completions specified by a filename expansion pattern to the
11320 <SAMP>`-G'</SAMP> option are generated next.
11321 The words generated by the pattern need not match the word being completed.
11322 The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches,
11323 but the <CODE>FIGNORE</CODE> shell variable is used.
11326 Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option
11328 The string is first split using the characters in the <CODE>IFS</CODE>
11329 special variable as delimiters.
11330 Shell quoting is honored.
11331 Each word is then expanded using
11332 brace expansion, tilde expansion, parameter and variable expansion,
11333 command substitution, and arithmetic expansion,
11334 as described above (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
11335 The results are split using the rules described above
11336 (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>).
11337 The results of the expansion are prefix-matched against the word being
11338 completed, and the matching words become the possible completions.
11341 After these matches have been generated, any shell function or command
11342 specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked.
11343 When the command or function is invoked, the <CODE>COMP_LINE</CODE>,
11344 <CODE>COMP_POINT</CODE>, <CODE>COMP_KEY</CODE>, and <CODE>COMP_TYPE</CODE> variables are
11345 assigned values as described above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
11346 If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and
11347 <CODE>COMP_CWORD</CODE> variables are also set.
11348 When the function or command is invoked, the first argument is the
11349 name of the command whose arguments are being completed, the
11350 second argument is the word being completed, and the third argument
11351 is the word preceding the word being completed on the current command line.
11352 No filtering of the generated completions against the word being completed
11353 is performed; the function or command has complete freedom in generating
11357 Any function specified with <SAMP>`-F'</SAMP> is invoked first.
11358 The function may use any of the shell facilities, including the
11359 <CODE>compgen</CODE> and <CODE>compopt</CODE> builtins described below
11360 (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>), to generate the matches.
11361 It must put the possible completions in the <CODE>COMPREPLY</CODE> array
11365 Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked
11366 in an environment equivalent to command substitution.
11367 It should print a list of completions, one per line, to
11368 the standard output.
11369 Backslash may be used to escape a newline, if necessary.
11372 After all of the possible completions are generated, any filter
11373 specified with the <SAMP>`-X'</SAMP> option is applied to the list.
11374 The filter is a pattern as used for pathname expansion; a <SAMP>`&'</SAMP>
11375 in the pattern is replaced with the text of the word being completed.
11376 A literal <SAMP>`&'</SAMP> may be escaped with a backslash; the backslash
11377 is removed before attempting a match.
11378 Any completion that matches the pattern will be removed from the list.
11379 A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion
11380 not matching the pattern will be removed.
11383 Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP>
11384 options are added to each member of the completion list, and the result is
11385 returned to the Readline completion code as the list of possible
11389 If the previously-applied actions do not generate any matches, and the
11390 <SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the
11391 compspec was defined, directory name completion is attempted.
11394 If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when
11395 the compspec was defined, directory name completion is attempted and any
11396 matches are added to the results of the other actions.
11399 By default, if a compspec is found, whatever it generates is returned to
11400 the completion code as the full set of possible completions.
11401 The default Bash completions are not attempted, and the Readline default
11402 of filename completion is disabled.
11403 If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when
11404 the compspec was defined, the default Bash completions are attempted
11405 if the compspec generates no matches.
11406 If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the
11407 compspec was defined, Readline's default completion will be performed
11408 if the compspec (and, if attempted, the default Bash completions)
11409 generate no matches.
11412 When a compspec indicates that directory name completion is desired,
11413 the programmable completion functions force Readline to append a slash
11414 to completed names which are symbolic links to directories, subject to
11415 the value of the <VAR>mark-directories</VAR> Readline variable, regardless
11416 of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable.
11419 There is some support for dynamically modifying completions. This is
11420 most useful when used in combination with a default completion specified
11421 with <SAMP>`-D'</SAMP>. It's possible for shell functions executed as completion
11422 handlers to indicate that completion should be retried by returning an
11423 exit status of 124. If a shell function returns 124, and changes
11424 the compspec associated with the command on which completion is being
11425 attempted (supplied as the first argument when the function is executed),
11426 programmable completion restarts from the beginning, with an
11427 attempt to find a compspec for that command. This allows a set of
11428 completions to be built dynamically as completion is attempted, rather than
11429 being loaded all at once.
11432 For instance, assuming that there is a library of compspecs, each kept in a
11433 file corresponding to the name of the command, the following default
11434 completion function would load completions dynamically:
11437 <TABLE><tr><td> </td><td class=example><pre>_completion_loader()
11439 . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
11441 complete -D -F _completion_loader
11442 </pre></td></tr></table></P><P>
11444 <A NAME="Programmable Completion Builtins"></A>
11446 <A NAME="SEC118"></A>
11447 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11448 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> < </A>]</TD>
11449 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> > </A>]</TD>
11450 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> << </A>]</TD>
11451 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11452 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> >> </A>]</TD>
11453 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11454 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11455 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11456 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11458 <H2> 8.7 Programmable Completion Builtins </H2>
11459 <!--docid::SEC118::-->
11462 Two builtin commands are available to manipulate the programmable completion
11467 <DT><CODE>compgen</CODE>
11468 <DD><A NAME="IDX540"></A>
11469 <TABLE><tr><td> </td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE>
11470 </pre></td></tr></table><P>
11472 Generate possible completion matches for <VAR>word</VAR> according to
11473 the <VAR>option</VAR>s, which may be any option accepted by the
11474 <CODE>complete</CODE>
11475 builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write
11476 the matches to the standard output.
11477 When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables
11478 set by the programmable completion facilities, while available, will not
11479 have useful values.
11482 The matches will be generated in the same way as if the programmable
11483 completion code had generated them directly from a completion specification
11484 with the same flags.
11485 If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR>
11489 The return value is true unless an invalid option is supplied, or no
11490 matches were generated.
11493 <DT><CODE>complete</CODE>
11494 <DD><A NAME="IDX541"></A>
11495 <TABLE><tr><td> </td><td class=example><pre><CODE>complete [-abcdefgjksuv] [-o <VAR>comp-option</VAR>] [-DE] [-A <VAR>action</VAR>] [-G <VAR>globpat</VAR>] [-W <VAR>wordlist</VAR>]
11496 [-F <VAR>function</VAR>] [-C <VAR>command</VAR>] [-X <VAR>filterpat</VAR>]
11497 [-P <VAR>prefix</VAR>] [-S <VAR>suffix</VAR>] <VAR>name</VAR> [<VAR>name</VAR> <small>...</small>]</CODE>
11498 <CODE>complete -pr [-DE] [<VAR>name</VAR> <small>...</small>]</CODE>
11499 </pre></td></tr></table><P>
11501 Specify how arguments to each <VAR>name</VAR> should be completed.
11502 If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing
11503 completion specifications are printed in a way that allows them to be
11505 The <SAMP>`-r'</SAMP> option removes a completion specification for
11506 each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all
11507 completion specifications.
11508 The <SAMP>`-D'</SAMP> option indicates that the remaining options and actions should
11509 apply to the "default" command completion; that is, completion attempted
11510 on a command for which no completion has previously been defined.
11511 The <SAMP>`-E'</SAMP> option indicates that the remaining options and actions should
11512 apply to "empty" command completion; that is, completion attempted on a
11516 The process of applying these completion specifications when word completion
11517 is attempted is described above (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). The
11518 <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
11521 Other options, if specified, have the following meanings.
11522 The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options
11523 (and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options)
11524 should be quoted to protect them from expansion before the
11525 <CODE>complete</CODE> builtin is invoked.
11529 <DT><CODE>-o <VAR>comp-option</VAR></CODE>
11530 <DD>The <VAR>comp-option</VAR> controls several aspects of the compspec's behavior
11531 beyond the simple generation of completions.
11532 <VAR>comp-option</VAR> may be one of:
11537 <DT><CODE>bashdefault</CODE>
11538 <DD>Perform the rest of the default Bash completions if the compspec
11539 generates no matches.
11542 <DT><CODE>default</CODE>
11543 <DD>Use Readline's default filename completion if the compspec generates
11547 <DT><CODE>dirnames</CODE>
11548 <DD>Perform directory name completion if the compspec generates no matches.
11551 <DT><CODE>filenames</CODE>
11552 <DD>Tell Readline that the compspec generates filenames, so it can perform any
11553 filename-specific processing (like adding a slash to directory names
11554 quoting special characters, or suppressing trailing spaces).
11555 This option is intended to be used with shell functions specified
11556 with <SAMP>`-F'</SAMP>.
11559 <DT><CODE>nospace</CODE>
11560 <DD>Tell Readline not to append a space (the default) to words completed at
11561 the end of the line.
11564 <DT><CODE>plusdirs</CODE>
11565 <DD>After any matches defined by the compspec are generated,
11566 directory name completion is attempted and any
11567 matches are added to the results of the other actions.
11573 <DT><CODE>-A <VAR>action</VAR></CODE>
11574 <DD>The <VAR>action</VAR> may be one of the following to generate a list of possible
11579 <DT><CODE>alias</CODE>
11580 <DD>Alias names. May also be specified as <SAMP>`-a'</SAMP>.
11583 <DT><CODE>arrayvar</CODE>
11584 <DD>Array variable names.
11587 <DT><CODE>binding</CODE>
11588 <DD>Readline key binding names (see section <A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A>).
11591 <DT><CODE>builtin</CODE>
11592 <DD>Names of shell builtin commands. May also be specified as <SAMP>`-b'</SAMP>.
11595 <DT><CODE>command</CODE>
11596 <DD>Command names. May also be specified as <SAMP>`-c'</SAMP>.
11599 <DT><CODE>directory</CODE>
11600 <DD>Directory names. May also be specified as <SAMP>`-d'</SAMP>.
11603 <DT><CODE>disabled</CODE>
11604 <DD>Names of disabled shell builtins.
11607 <DT><CODE>enabled</CODE>
11608 <DD>Names of enabled shell builtins.
11611 <DT><CODE>export</CODE>
11612 <DD>Names of exported shell variables. May also be specified as <SAMP>`-e'</SAMP>.
11615 <DT><CODE>file</CODE>
11616 <DD>File names. May also be specified as <SAMP>`-f'</SAMP>.
11619 <DT><CODE>function</CODE>
11620 <DD>Names of shell functions.
11623 <DT><CODE>group</CODE>
11624 <DD>Group names. May also be specified as <SAMP>`-g'</SAMP>.
11627 <DT><CODE>helptopic</CODE>
11628 <DD>Help topics as accepted by the <CODE>help</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
11631 <DT><CODE>hostname</CODE>
11632 <DD>Hostnames, as taken from the file specified by the
11633 <CODE>HOSTFILE</CODE> shell variable (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
11636 <DT><CODE>job</CODE>
11637 <DD>Job names, if job control is active. May also be specified as <SAMP>`-j'</SAMP>.
11640 <DT><CODE>keyword</CODE>
11641 <DD>Shell reserved words. May also be specified as <SAMP>`-k'</SAMP>.
11644 <DT><CODE>running</CODE>
11645 <DD>Names of running jobs, if job control is active.
11648 <DT><CODE>service</CODE>
11649 <DD>Service names. May also be specified as <SAMP>`-s'</SAMP>.
11652 <DT><CODE>setopt</CODE>
11653 <DD>Valid arguments for the <SAMP>`-o'</SAMP> option to the <CODE>set</CODE> builtin
11654 (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
11657 <DT><CODE>shopt</CODE>
11658 <DD>Shell option names as accepted by the <CODE>shopt</CODE> builtin
11659 (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
11662 <DT><CODE>signal</CODE>
11666 <DT><CODE>stopped</CODE>
11667 <DD>Names of stopped jobs, if job control is active.
11670 <DT><CODE>user</CODE>
11671 <DD>User names. May also be specified as <SAMP>`-u'</SAMP>.
11674 <DT><CODE>variable</CODE>
11675 <DD>Names of all shell variables. May also be specified as <SAMP>`-v'</SAMP>.
11679 <DT><CODE>-G <VAR>globpat</VAR></CODE>
11680 <DD>The filename expansion pattern <VAR>globpat</VAR> is expanded to generate
11681 the possible completions.
11684 <DT><CODE>-W <VAR>wordlist</VAR></CODE>
11685 <DD>The <VAR>wordlist</VAR> is split using the characters in the
11686 <CODE>IFS</CODE> special variable as delimiters, and each resultant word
11688 The possible completions are the members of the resultant list which
11689 match the word being completed.
11692 <DT><CODE>-C <VAR>command</VAR></CODE>
11693 <DD><VAR>command</VAR> is executed in a subshell environment, and its output is
11694 used as the possible completions.
11697 <DT><CODE>-F <VAR>function</VAR></CODE>
11698 <DD>The shell function <VAR>function</VAR> is executed in the current shell
11700 When it finishes, the possible completions are retrieved from the value
11701 of the <CODE>COMPREPLY</CODE> array variable.
11704 <DT><CODE>-X <VAR>filterpat</VAR></CODE>
11705 <DD><VAR>filterpat</VAR> is a pattern as used for filename expansion.
11706 It is applied to the list of possible completions generated by the
11707 preceding options and arguments, and each completion matching
11708 <VAR>filterpat</VAR> is removed from the list.
11709 A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this
11710 case, any completion not matching <VAR>filterpat</VAR> is removed.
11713 <DT><CODE>-P <VAR>prefix</VAR></CODE>
11714 <DD><VAR>prefix</VAR> is added at the beginning of each possible completion
11715 after all other options have been applied.
11718 <DT><CODE>-S <VAR>suffix</VAR></CODE>
11719 <DD><VAR>suffix</VAR> is appended to each possible completion
11720 after all other options have been applied.
11724 The return value is true unless an invalid option is supplied, an option
11725 other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR>
11726 argument, an attempt is made to remove a completion specification for
11727 a <VAR>name</VAR> for which no specification exists, or
11728 an error occurs adding a completion specification.
11731 <DT><CODE>compopt</CODE>
11732 <DD><A NAME="IDX542"></A>
11733 <TABLE><tr><td> </td><td class=example><pre><CODE>compopt</CODE> [-o <VAR>option</VAR>] [-DE] [+o <VAR>option</VAR>] [<VAR>name</VAR>]
11734 </pre></td></tr></table>Modify completion options for each <VAR>name</VAR> according to the
11735 <VAR>option</VAR>s, or for the currently-execution completion if no <VAR>name</VAR>s
11737 If no <VAR>option</VAR>s are given, display the completion options for each
11738 <VAR>name</VAR> or the current completion.
11739 The possible values of <VAR>option</VAR> are those valid for the <CODE>complete</CODE>
11740 builtin described above.
11741 The <SAMP>`-D'</SAMP> option indicates that the remaining options should
11742 apply to the "default" command completion; that is, completion attempted
11743 on a command for which no completion has previously been defined.
11744 The <SAMP>`-E'</SAMP> option indicates that the remaining options should
11745 apply to "empty" command completion; that is, completion attempted on a
11749 The <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
11752 The return value is true unless an invalid option is supplied, an attempt
11753 is made to modify the options for a <VAR>name</VAR> for which no completion
11754 specification exists, or an output error occurs.
11760 <A NAME="IDX543"></A>
11763 <A NAME="Using History Interactively"></A>
11765 <A NAME="SEC119"></A>
11766 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11767 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> < </A>]</TD>
11768 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> > </A>]</TD>
11769 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
11770 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
11771 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD>
11772 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11773 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11774 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11775 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11777 <H1> 9. Using History Interactively </H1>
11778 <!--docid::SEC119::-->
11781 This chapter describes how to use the GNU History Library
11782 interactively, from a user's standpoint.
11783 It should be considered a user's guide.
11784 For information on using the GNU History Library in other programs,
11785 see the GNU Readline Library Manual.
11788 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
11789 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How Bash lets you manipulate your command
11791 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">The Bash builtin commands that manipulate
11792 the command history.</TD></TR>
11793 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR>
11794 </TABLE></BLOCKQUOTE>
11797 <A NAME="Bash History Facilities"></A>
11799 <A NAME="SEC120"></A>
11800 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11801 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> < </A>]</TD>
11802 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> > </A>]</TD>
11803 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
11804 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
11805 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD>
11806 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11807 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11808 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11809 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11811 <H2> 9.1 Bash History Facilities </H2>
11812 <!--docid::SEC120::-->
11815 When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin
11816 is enabled (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>),
11817 the shell provides access to the <EM>command history</EM>,
11818 the list of commands previously typed.
11819 The value of the <CODE>HISTSIZE</CODE> shell variable is used as the
11820 number of commands to save in a history list.
11821 The text of the last <CODE>$HISTSIZE</CODE>
11822 commands (default 500) is saved.
11823 The shell stores each command in the history list prior to
11824 parameter and variable expansion
11825 but after history expansion is performed, subject to the
11826 values of the shell variables
11827 <CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>.
11830 When the shell starts up, the history is initialized from the
11831 file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>).
11832 The file named by the value of <CODE>HISTFILE</CODE> is truncated, if
11833 necessary, to contain no more than the number of lines specified by
11834 the value of the <CODE>HISTFILESIZE</CODE> variable.
11835 When an interactive shell exits, the last
11836 <CODE>$HISTSIZE</CODE> lines are copied from the history list to the file
11837 named by <CODE>$HISTFILE</CODE>.
11838 If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>),
11839 the lines are appended to the history file,
11840 otherwise the history file is overwritten.
11841 If <CODE>HISTFILE</CODE>
11842 is unset, or if the history file is unwritable, the history is
11843 not saved. After saving the history, the history file is truncated
11844 to contain no more than <CODE>$HISTFILESIZE</CODE>
11845 lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed.
11848 If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information
11849 associated with each history entry is written to the history file,
11850 marked with the history comment character.
11851 When the history file is read, lines beginning with the history
11852 comment character followed immediately by a digit are interpreted
11853 as timestamps for the previous history line.
11856 The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute
11857 a portion of the history list.
11858 The <CODE>history</CODE> builtin may be used to display or modify the history
11859 list and manipulate the history file.
11860 When using command-line editing, search commands
11861 are available in each editing mode that provide access to the
11862 history list (see section <A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>).
11865 The shell allows control over which commands are saved on the history
11866 list. The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE>
11867 variables may be set to cause the shell to save only a subset of the
11869 The <CODE>cmdhist</CODE>
11870 shell option, if enabled, causes the shell to attempt to save each
11871 line of a multi-line command in the same history entry, adding
11872 semicolons where necessary to preserve syntactic correctness.
11873 The <CODE>lithist</CODE>
11874 shell option causes the shell to save the command with embedded newlines
11875 instead of semicolons.
11876 The <CODE>shopt</CODE> builtin is used to set these options.
11877 See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>.
11880 <A NAME="Bash History Builtins"></A>
11882 <A NAME="SEC121"></A>
11883 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11884 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> < </A>]</TD>
11885 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> > </A>]</TD>
11886 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> << </A>]</TD>
11887 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
11888 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD>
11889 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11890 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11891 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11892 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11894 <H2> 9.2 Bash History Builtins </H2>
11895 <!--docid::SEC121::-->
11898 Bash provides two builtin commands which manipulate the
11899 history list and history file.
11904 <DT><CODE>fc</CODE>
11905 <DD><A NAME="IDX544"></A>
11906 <TABLE><tr><td> </td><td class=example><pre><CODE>fc [-e <VAR>ename</VAR>] [-lnr] [<VAR>first</VAR>] [<VAR>last</VAR>]</CODE>
11907 <CODE>fc -s [<VAR>pat</VAR>=<VAR>rep</VAR>] [<VAR>command</VAR>]</CODE>
11908 </pre></td></tr></table><P>
11910 Fix Command. In the first form, a range of commands from <VAR>first</VAR> to
11911 <VAR>last</VAR> is selected from the history list. Both <VAR>first</VAR> and
11912 <VAR>last</VAR> may be specified as a string (to locate the most recent
11913 command beginning with that string) or as a number (an index into the
11914 history list, where a negative number is used as an offset from the
11915 current command number). If <VAR>last</VAR> is not specified it is set to
11916 <VAR>first</VAR>. If <VAR>first</VAR> is not specified it is set to the previous
11917 command for editing and -16 for listing. If the <SAMP>`-l'</SAMP> flag is
11918 given, the commands are listed on standard output. The <SAMP>`-n'</SAMP> flag
11919 suppresses the command numbers when listing. The <SAMP>`-r'</SAMP> flag
11920 reverses the order of the listing. Otherwise, the editor given by
11921 <VAR>ename</VAR> is invoked on a file containing those commands. If
11922 <VAR>ename</VAR> is not given, the value of the following variable expansion
11923 is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>. This says to use the
11924 value of the <CODE>FCEDIT</CODE> variable if set, or the value of the
11925 <CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set.
11926 When editing is complete, the edited commands are echoed and executed.
11929 In the second form, <VAR>command</VAR> is re-executed after each instance
11930 of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>.
11933 A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so
11934 that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE>
11935 and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
11938 <DT><CODE>history</CODE>
11939 <DD><A NAME="IDX545"></A>
11940 <TABLE><tr><td> </td><td class=example><pre>history [<VAR>n</VAR>]
11942 history -d <VAR>offset</VAR>
11943 history [-anrw] [<VAR>filename</VAR>]
11944 history -ps <VAR>arg</VAR>
11945 </pre></td></tr></table><P>
11947 With no options, display the history list with line numbers.
11948 Lines prefixed with a <SAMP>`*'</SAMP> have been modified.
11949 An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines.
11950 If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null,
11951 it is used as a format string for <VAR>strftime</VAR> to display
11952 the time stamp associated with each displayed history entry.
11953 No intervening blank is printed between the formatted time stamp
11954 and the history line.
11957 Options, if supplied, have the following meanings:
11961 <DT><CODE>-c</CODE>
11962 <DD>Clear the history list. This may be combined
11963 with the other options to replace the history list completely.
11966 <DT><CODE>-d <VAR>offset</VAR></CODE>
11967 <DD>Delete the history entry at position <VAR>offset</VAR>.
11968 <VAR>offset</VAR> should be specified as it appears when the history is
11972 <DT><CODE>-a</CODE>
11974 history lines (history lines entered since the beginning of the
11975 current Bash session) to the history file.
11978 <DT><CODE>-n</CODE>
11979 <DD>Append the history lines not already read from the history file
11980 to the current history list. These are lines appended to the history
11981 file since the beginning of the current Bash session.
11984 <DT><CODE>-r</CODE>
11985 <DD>Read the current history file and append its contents to
11989 <DT><CODE>-w</CODE>
11990 <DD>Write out the current history to the history file.
11993 <DT><CODE>-p</CODE>
11994 <DD>Perform history substitution on the <VAR>arg</VAR>s and display the result
11995 on the standard output, without storing the results in the history list.
11998 <DT><CODE>-s</CODE>
11999 <DD>The <VAR>arg</VAR>s are added to the end of
12000 the history list as a single entry.
12006 When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is
12007 used, if <VAR>filename</VAR>
12008 is given, then it is used as the history file. If not, then
12009 the value of the <CODE>HISTFILE</CODE> variable is used.
12015 <A NAME="History Interaction"></A>
12017 <A NAME="SEC122"></A>
12018 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12019 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> < </A>]</TD>
12020 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> > </A>]</TD>
12021 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12022 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
12023 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD>
12024 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12025 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12026 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12027 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12029 <H2> 9.3 History Expansion </H2>
12030 <!--docid::SEC122::-->
12033 The History library provides a history expansion feature that is similar
12034 to the history expansion provided by <CODE>csh</CODE>. This section
12035 describes the syntax used to manipulate the history information.
12038 History expansions introduce words from the history list into
12039 the input stream, making it easy to repeat commands, insert the
12040 arguments to a previous command into the current input line, or
12041 fix errors in previous commands quickly.
12044 History expansion takes place in two parts. The first is to determine
12045 which line from the history list should be used during substitution.
12046 The second is to select portions of that line for inclusion into the
12047 current one. The line selected from the history is called the
12048 <EM>event</EM>, and the portions of that line that are acted upon are
12049 called <EM>words</EM>. Various <EM>modifiers</EM> are available to manipulate
12050 the selected words. The line is broken into words in the same fashion
12051 that Bash does, so that several words
12052 surrounded by quotes are considered one word.
12053 History expansions are introduced by the appearance of the
12054 history expansion character, which is <SAMP>`!'</SAMP> by default.
12055 Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion
12059 Several shell options settable with the <CODE>shopt</CODE>
12060 builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) may be used to tailor
12061 the behavior of history expansion. If the
12062 <CODE>histverify</CODE> shell option is enabled, and Readline
12063 is being used, history substitutions are not immediately passed to
12065 Instead, the expanded line is reloaded into the Readline
12066 editing buffer for further modification.
12067 If Readline is being used, and the <CODE>histreedit</CODE>
12068 shell option is enabled, a failed history expansion will be
12069 reloaded into the Readline editing buffer for correction.
12070 The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command
12071 may be used to see what a history expansion will do before using it.
12072 The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to
12073 add commands to the end of the history list without actually executing
12074 them, so that they are available for subsequent recall.
12075 This is most useful in conjunction with Readline.
12078 The shell allows control of the various characters used by the
12079 history expansion mechanism with the <CODE>histchars</CODE> variable,
12080 as explained above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). The shell uses
12081 the history comment character to mark history timestamps when
12082 writing the history file.
12085 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12086 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR>
12087 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">9.3.2 Word Designators</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR>
12088 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">9.3.3 Modifiers</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR>
12089 </TABLE></BLOCKQUOTE>
12092 <A NAME="Event Designators"></A>
12094 <A NAME="SEC123"></A>
12095 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12096 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> < </A>]</TD>
12097 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> > </A>]</TD>
12098 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12099 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
12100 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD>
12101 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12102 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12103 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12104 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12106 <H3> 9.3.1 Event Designators </H3>
12107 <!--docid::SEC123::-->
12110 An event designator is a reference to a command line entry in the
12112 <A NAME="IDX546"></A>
12118 <DD>Start a history substitution, except when followed by a space, tab,
12119 the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the
12120 <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin).
12123 <DT><CODE>!<VAR>n</VAR></CODE>
12124 <DD>Refer to command line <VAR>n</VAR>.
12127 <DT><CODE>!-<VAR>n</VAR></CODE>
12128 <DD>Refer to the command <VAR>n</VAR> lines back.
12131 <DT><CODE>!!</CODE>
12132 <DD>Refer to the previous command. This is a synonym for <SAMP>`!-1'</SAMP>.
12135 <DT><CODE>!<VAR>string</VAR></CODE>
12136 <DD>Refer to the most recent command starting with <VAR>string</VAR>.
12139 <DT><CODE>!?<VAR>string</VAR>[?]</CODE>
12140 <DD>Refer to the most recent command containing <VAR>string</VAR>. The trailing
12141 <SAMP>`?'</SAMP> may be omitted if the <VAR>string</VAR> is followed immediately by
12145 <DT><CODE>^<VAR>string1</VAR>^<VAR>string2</VAR>^</CODE>
12146 <DD>Quick Substitution. Repeat the last command, replacing <VAR>string1</VAR>
12147 with <VAR>string2</VAR>. Equivalent to
12148 <CODE>!!:s/<VAR>string1</VAR>/<VAR>string2</VAR>/</CODE>.
12151 <DT><CODE>!#</CODE>
12152 <DD>The entire command line typed so far.
12158 <A NAME="Word Designators"></A>
12160 <A NAME="SEC124"></A>
12161 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12162 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> < </A>]</TD>
12163 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> > </A>]</TD>
12164 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> << </A>]</TD>
12165 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
12166 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD>
12167 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12168 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12169 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12170 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12172 <H3> 9.3.2 Word Designators </H3>
12173 <!--docid::SEC124::-->
12176 Word designators are used to select desired words from the event.
12177 A <SAMP>`:'</SAMP> separates the event specification from the word designator. It
12178 may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>,
12179 <SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>. Words are numbered from the beginning
12180 of the line, with the first word being denoted by 0 (zero). Words are
12181 inserted into the current line separated by single spaces.
12188 <DT><CODE>!!</CODE>
12189 <DD>designates the preceding command. When you type this, the preceding
12190 command is repeated in toto.
12193 <DT><CODE>!!:$</CODE>
12194 <DD>designates the last argument of the preceding command. This may be
12195 shortened to <CODE>!$</CODE>.
12198 <DT><CODE>!fi:2</CODE>
12199 <DD>designates the second argument of the most recent command starting with
12200 the letters <CODE>fi</CODE>.
12204 Here are the word designators:
12208 <DT><CODE>0 (zero)</CODE>
12209 <DD>The <CODE>0</CODE>th word. For many applications, this is the command word.
12212 <DT><CODE><VAR>n</VAR></CODE>
12213 <DD>The <VAR>n</VAR>th word.
12217 <DD>The first argument; that is, word 1.
12221 <DD>The last argument.
12225 <DD>The word matched by the most recent <SAMP>`?<VAR>string</VAR>?'</SAMP> search.
12228 <DT><CODE><VAR>x</VAR>-<VAR>y</VAR></CODE>
12229 <DD>A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>.
12233 <DD>All of the words, except the <CODE>0</CODE>th. This is a synonym for <SAMP>`1-$'</SAMP>.
12234 It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event;
12235 the empty string is returned in that case.
12238 <DT><CODE><VAR>x</VAR>*</CODE>
12239 <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP>
12242 <DT><CODE><VAR>x</VAR>-</CODE>
12243 <DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omits the last word.
12249 If a word designator is supplied without an event specification, the
12250 previous command is used as the event.
12253 <A NAME="Modifiers"></A>
12255 <A NAME="SEC125"></A>
12256 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12257 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> < </A>]</TD>
12258 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> > </A>]</TD>
12259 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
12260 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
12261 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> >> </A>]</TD>
12262 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12263 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12264 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12265 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12267 <H3> 9.3.3 Modifiers </H3>
12268 <!--docid::SEC125::-->
12271 After the optional word designator, you can add a sequence of one or more
12272 of the following modifiers, each preceded by a <SAMP>`:'</SAMP>.
12278 <DD>Remove a trailing pathname component, leaving only the head.
12282 <DD>Remove all leading pathname components, leaving the tail.
12286 <DD>Remove a trailing suffix of the form <SAMP>`.<VAR>suffix</VAR>'</SAMP>, leaving
12291 <DD>Remove all but the trailing suffix.
12295 <DD>Print the new command but do not execute it.
12299 <DD>Quote the substituted words, escaping further substitutions.
12303 <DD>Quote the substituted words as with <SAMP>`q'</SAMP>,
12304 but break into words at spaces, tabs, and newlines.
12307 <DT><CODE>s/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>
12308 <DD>Substitute <VAR>new</VAR> for the first occurrence of <VAR>old</VAR> in the
12309 event line. Any delimiter may be used in place of <SAMP>`/'</SAMP>.
12310 The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR>
12311 with a single backslash. If <SAMP>`&'</SAMP> appears in <VAR>new</VAR>,
12312 it is replaced by <VAR>old</VAR>. A single backslash will quote
12313 the <SAMP>`&'</SAMP>. The final delimiter is optional if it is the last
12314 character on the input line.
12317 <DT><CODE>&</CODE>
12318 <DD>Repeat the previous substitution.
12322 <DD><DT><CODE>a</CODE>
12323 <DD>Cause changes to be applied over the entire event line. Used in
12324 conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>,
12325 or with <SAMP>`&'</SAMP>.
12329 <DD>Apply the following <SAMP>`s'</SAMP> modifier once to each word in the event.
12335 <A NAME="Installing Bash"></A>
12337 <A NAME="SEC126"></A>
12338 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12339 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> < </A>]</TD>
12340 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> > </A>]</TD>
12341 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> << </A>]</TD>
12342 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12343 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12344 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12345 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12346 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12347 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12349 <H1> 10. Installing Bash </H1>
12350 <!--docid::SEC126::-->
12353 This chapter provides basic instructions for installing Bash on
12354 the various supported platforms. The distribution supports the
12355 GNU operating systems, nearly every version of Unix, and several
12356 non-Unix systems such as BeOS and Interix.
12357 Other independent ports exist for
12358 MS-DOS, OS/2, and Windows platforms.
12361 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12362 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR>
12363 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10.2 Compilers and Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various
12365 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC129">10.3 Compiling For Multiple Architectures</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to compile Bash for more
12366 than one kind of system from
12367 the same source tree.</TD></TR>
12368 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.4 Installation Names</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to set the various paths used by the installation.</TD></TR>
12369 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC131">10.5 Specifying the System Type</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to configure Bash for a particular system.</TD></TR>
12370 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC132">10.6 Sharing Defaults</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU
12371 programs.</TD></TR>
12372 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC133">10.7 Operation Controls</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR>
12373 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC134">10.8 Optional Features</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when
12374 building Bash.</TD></TR>
12375 </TABLE></BLOCKQUOTE>
12378 <A NAME="Basic Installation"></A>
12380 <A NAME="SEC127"></A>
12381 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12382 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> < </A>]</TD>
12383 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> > </A>]</TD>
12384 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD>
12385 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12386 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12387 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12388 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12389 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12390 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12392 <H2> 10.1 Basic Installation </H2>
12393 <!--docid::SEC127::-->
12396 These are installation instructions for Bash.
12399 The simplest way to compile Bash is:
12404 <CODE>cd</CODE> to the directory containing the source code and type
12405 <SAMP>`./configure'</SAMP> to configure Bash for your system. If you're
12406 using <CODE>csh</CODE> on an old version of System V, you might need to
12407 type <SAMP>`sh ./configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying
12408 to execute <CODE>configure</CODE> itself.
12411 Running <CODE>configure</CODE> takes some time.
12412 While running, it prints messages telling which features it is
12417 Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug
12422 Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite.
12426 Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>.
12427 This will also install the manual pages and Info file.
12433 The <CODE>configure</CODE> shell script attempts to guess correct
12434 values for various system-dependent variables used during
12435 compilation. It uses those values to create a <TT>`Makefile'</TT> in
12436 each directory of the package (the top directory, the
12437 <TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories,
12438 each directory under <TT>`lib'</TT>, and several others). It also creates a
12439 <TT>`config.h'</TT> file containing system-dependent definitions.
12440 Finally, it creates a shell script named <CODE>config.status</CODE> that you
12441 can run in the future to recreate the current configuration, a
12442 file <TT>`config.cache'</TT> that saves the results of its tests to
12443 speed up reconfiguring, and a file <TT>`config.log'</TT> containing
12444 compiler output (useful mainly for debugging <CODE>configure</CODE>).
12446 <TT>`config.cache'</TT> contains results you don't want to keep, you
12447 may remove or edit it.
12450 To find out more about the options and arguments that the
12451 <CODE>configure</CODE> script understands, type
12454 <TABLE><tr><td> </td><td class=example><pre>bash-2.04$ ./configure --help
12455 </pre></td></tr></table></P><P>
12457 at the Bash prompt in your Bash source directory.
12460 If you need to do unusual things to compile Bash, please
12461 try to figure out how <CODE>configure</CODE> could check whether or not
12462 to do them, and mail diffs or instructions to
12463 <A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be
12464 considered for the next release.
12467 The file <TT>`configure.in'</TT> is used to create <CODE>configure</CODE>
12468 by a program called Autoconf. You only need
12469 <TT>`configure.in'</TT> if you want to change it or regenerate
12470 <CODE>configure</CODE> using a newer version of Autoconf. If
12471 you do this, make sure you are using Autoconf version 2.50 or
12475 You can remove the program binaries and object files from the
12476 source code directory by typing <SAMP>`make clean'</SAMP>. To also remove the
12477 files that <CODE>configure</CODE> created (so you can compile Bash for
12478 a different kind of computer), type <SAMP>`make distclean'</SAMP>.
12481 <A NAME="Compilers and Options"></A>
12483 <A NAME="SEC128"></A>
12484 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12485 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> < </A>]</TD>
12486 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> > </A>]</TD>
12487 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> << </A>]</TD>
12488 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12489 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12490 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12491 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12492 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12493 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12495 <H2> 10.2 Compilers and Options </H2>
12496 <!--docid::SEC128::-->
12499 Some systems require unusual options for compilation or linking
12500 that the <CODE>configure</CODE> script does not know about. You can
12501 give <CODE>configure</CODE> initial values for variables by setting
12502 them in the environment. Using a Bourne-compatible shell, you
12503 can do that on the command line like this:
12506 <TABLE><tr><td> </td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
12507 </pre></td></tr></table></P><P>
12509 On systems that have the <CODE>env</CODE> program, you can do it like this:
12512 <TABLE><tr><td> </td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
12513 </pre></td></tr></table></P><P>
12515 The configuration process uses GCC to build Bash if it
12519 <A NAME="Compiling For Multiple Architectures"></A>
12521 <A NAME="SEC129"></A>
12522 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12523 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> < </A>]</TD>
12524 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> > </A>]</TD>
12525 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> << </A>]</TD>
12526 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12527 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12528 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12529 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12530 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12531 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12533 <H2> 10.3 Compiling For Multiple Architectures </H2>
12534 <!--docid::SEC129::-->
12537 You can compile Bash for more than one kind of computer at the
12538 same time, by placing the object files for each architecture in their
12539 own directory. To do this, you must use a version of <CODE>make</CODE> that
12540 supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>.
12541 <CODE>cd</CODE> to the
12542 directory where you want the object files and executables to go and run
12543 the <CODE>configure</CODE> script from the source directory. You may need to
12544 supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the
12545 source files are. <CODE>configure</CODE> automatically checks for the
12546 source code in the directory that <CODE>configure</CODE> is in and in `..'.
12549 If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE>
12550 variable, you can compile Bash for one architecture at a
12551 time in the source code directory. After you have installed
12552 Bash for one architecture, use <SAMP>`make distclean'</SAMP> before
12553 reconfiguring for another architecture.
12556 Alternatively, if your system supports symbolic links, you can use the
12557 <TT>`support/mkclone'</TT> script to create a build tree which has
12558 symbolic links back to each file in the source directory. Here's an
12559 example that creates a build directory in the current directory from a
12560 source directory <TT>`/usr/gnu/src/bash-2.0'</TT>:
12563 <TABLE><tr><td> </td><td class=example><pre>bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
12564 </pre></td></tr></table></P><P>
12566 The <CODE>mkclone</CODE> script requires Bash, so you must have already built
12567 Bash for at least one architecture before you can create build
12568 directories for other architectures.
12571 <A NAME="Installation Names"></A>
12573 <A NAME="SEC130"></A>
12574 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12575 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> < </A>]</TD>
12576 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> > </A>]</TD>
12577 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> << </A>]</TD>
12578 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12579 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12580 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12581 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12582 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12583 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12585 <H2> 10.4 Installation Names </H2>
12586 <!--docid::SEC130::-->
12589 By default, <SAMP>`make install'</SAMP> will install into
12590 <TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc. You can
12591 specify an installation prefix other than <TT>`/usr/local'</TT> by
12592 giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>,
12593 or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP>
12594 variable when running <SAMP>`make install'</SAMP>.
12597 You can specify separate installation prefixes for
12598 architecture-specific files and architecture-independent files.
12599 If you give <CODE>configure</CODE> the option
12600 <SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use
12601 <VAR>PATH</VAR> as the prefix for installing programs and libraries.
12602 Documentation and other data files will still use the regular prefix.
12605 <A NAME="Specifying the System Type"></A>
12607 <A NAME="SEC131"></A>
12608 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12609 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> < </A>]</TD>
12610 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> > </A>]</TD>
12611 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> << </A>]</TD>
12612 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12613 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12614 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12615 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12616 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12617 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12619 <H2> 10.5 Specifying the System Type </H2>
12620 <!--docid::SEC131::-->
12623 There may be some features <CODE>configure</CODE> can not figure out
12624 automatically, but need to determine by the type of host Bash
12625 will run on. Usually <CODE>configure</CODE> can figure that
12626 out, but if it prints a message saying it can not guess the host
12627 type, give it the <SAMP>`--host=TYPE'</SAMP> option. <SAMP>`TYPE'</SAMP> can
12628 either be a short name for the system type, such as <SAMP>`sun4'</SAMP>,
12629 or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP>
12630 (e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>).
12633 See the file <TT>`support/config.sub'</TT> for the possible
12634 values of each field.
12637 <A NAME="Sharing Defaults"></A>
12639 <A NAME="SEC132"></A>
12640 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12641 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> < </A>]</TD>
12642 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> > </A>]</TD>
12643 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> << </A>]</TD>
12644 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12645 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12646 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12647 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12648 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12649 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12651 <H2> 10.6 Sharing Defaults </H2>
12652 <!--docid::SEC132::-->
12655 If you want to set default values for <CODE>configure</CODE> scripts to
12656 share, you can create a site shell script called
12657 <CODE>config.site</CODE> that gives default values for variables like
12658 <CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>. <CODE>configure</CODE>
12659 looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then
12660 <TT>`PREFIX/etc/config.site'</TT> if it exists. Or, you can set the
12661 <CODE>CONFIG_SITE</CODE> environment variable to the location of the site
12662 script. A warning: the Bash <CODE>configure</CODE> looks for a site script,
12663 but not all <CODE>configure</CODE> scripts do.
12666 <A NAME="Operation Controls"></A>
12668 <A NAME="SEC133"></A>
12669 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12670 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> < </A>]</TD>
12671 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> > </A>]</TD>
12672 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> << </A>]</TD>
12673 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12674 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12675 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12676 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12677 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12678 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12680 <H2> 10.7 Operation Controls </H2>
12681 <!--docid::SEC133::-->
12684 <CODE>configure</CODE> recognizes the following options to control how it
12690 <DT><CODE>--cache-file=<VAR>file</VAR></CODE>
12691 <DD>Use and save the results of the tests in
12692 <VAR>file</VAR> instead of <TT>`./config.cache'</TT>. Set <VAR>file</VAR> to
12693 <TT>`/dev/null'</TT> to disable caching, for debugging
12694 <CODE>configure</CODE>.
12697 <DT><CODE>--help</CODE>
12698 <DD>Print a summary of the options to <CODE>configure</CODE>, and exit.
12701 <DT><CODE>--quiet</CODE>
12702 <DD><DT><CODE>--silent</CODE>
12703 <DD><DT><CODE>-q</CODE>
12704 <DD>Do not print messages saying which checks are being made.
12707 <DT><CODE>--srcdir=<VAR>dir</VAR></CODE>
12708 <DD>Look for the Bash source code in directory <VAR>dir</VAR>. Usually
12709 <CODE>configure</CODE> can determine that directory automatically.
12712 <DT><CODE>--version</CODE>
12713 <DD>Print the version of Autoconf used to generate the <CODE>configure</CODE>
12718 <CODE>configure</CODE> also accepts some other, not widely used, boilerplate
12719 options. <SAMP>`configure --help'</SAMP> prints the complete list.
12722 <A NAME="Optional Features"></A>
12724 <A NAME="SEC134"></A>
12725 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12726 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> < </A>]</TD>
12727 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> > </A>]</TD>
12728 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD>
12729 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12730 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> >> </A>]</TD>
12731 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12732 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12733 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12734 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12736 <H2> 10.8 Optional Features </H2>
12737 <!--docid::SEC134::-->
12740 The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP>
12741 options, where <VAR>feature</VAR> indicates an optional part of Bash.
12742 There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options,
12743 where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>.
12744 To turn off the default use of a package, use
12745 <SAMP>`--without-<VAR>package</VAR>'</SAMP>. To configure Bash without a feature
12746 that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>.
12749 Here is a complete list of the <SAMP>`--enable-'</SAMP> and
12750 <SAMP>`--with-'</SAMP> options that the Bash <CODE>configure</CODE> recognizes.
12754 <DT><CODE>--with-afs</CODE>
12755 <DD>Define if you are using the Andrew File System from Transarc.
12758 <DT><CODE>--with-bash-malloc</CODE>
12759 <DD>Use the Bash version of
12760 <CODE>malloc</CODE> in the directory <TT>`lib/malloc'</TT>. This is not the same
12761 <CODE>malloc</CODE> that appears in GNU libc, but an older version
12762 originally derived from the 4.2 BSD <CODE>malloc</CODE>. This <CODE>malloc</CODE>
12763 is very fast, but wastes some space on each allocation.
12764 This option is enabled by default.
12765 The <TT>`NOTES'</TT> file contains a list of systems for
12766 which this should be turned off, and <CODE>configure</CODE> disables this
12767 option automatically for a number of systems.
12770 <DT><CODE>--with-curses</CODE>
12771 <DD>Use the curses library instead of the termcap library. This should
12772 be supplied if your system has an inadequate or incomplete termcap
12776 <DT><CODE>--with-gnu-malloc</CODE>
12777 <DD>A synonym for <CODE>--with-bash-malloc</CODE>.
12780 <DT><CODE>--with-installed-readline[=<VAR>PREFIX</VAR>]</CODE>
12781 <DD>Define this to make Bash link with a locally-installed version of Readline
12782 rather than the version in <TT>`lib/readline'</TT>. This works only with
12783 Readline 5.0 and later versions. If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not
12784 supplied, <CODE>configure</CODE> uses the values of the make variables
12785 <CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE>
12786 by default, to find the installed version of Readline if it is not in
12787 the standard system include and library directories.
12788 If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in
12789 <TT>`lib/readline'</TT>.
12790 If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as
12791 a directory pathname and looks for
12792 the installed version of Readline in subdirectories of that directory
12793 (include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in
12794 <VAR>PREFIX</VAR>/<CODE>lib</CODE>).
12797 <DT><CODE>--with-purify</CODE>
12798 <DD>Define this to use the Purify memory allocation checker from Rational
12802 <DT><CODE>--enable-minimal-config</CODE>
12803 <DD>This produces a shell with minimal features, close to the historical
12808 There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is
12809 compiled and linked, rather than changing run-time features.
12813 <DT><CODE>--enable-largefile</CODE>
12814 <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
12815 to build programs which can access large files. This is enabled by
12816 default, if the operating system provides large file support.
12819 <DT><CODE>--enable-profiling</CODE>
12820 <DD>This builds a Bash binary that produces profiling information to be
12821 processed by <CODE>gprof</CODE> each time it is executed.
12824 <DT><CODE>--enable-static-link</CODE>
12825 <DD>This causes Bash to be linked statically, if <CODE>gcc</CODE> is being used.
12826 This could be used to build a version to use as root's shell.
12830 The <SAMP>`minimal-config'</SAMP> option can be used to disable all of
12831 the following options, but it is processed first, so individual
12832 options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>.
12835 All of the following options except for <SAMP>`disabled-builtins'</SAMP> and
12836 <SAMP>`xpg-echo-default'</SAMP> are
12837 enabled by default, unless the operating system does not provide the
12842 <DT><CODE>--enable-alias</CODE>
12843 <DD>Allow alias expansion and include the <CODE>alias</CODE> and <CODE>unalias</CODE>
12844 builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
12847 <DT><CODE>--enable-arith-for-command</CODE>
12848 <DD>Include support for the alternate form of the <CODE>for</CODE> command
12849 that behaves like the C language <CODE>for</CODE> statement
12850 (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
12853 <DT><CODE>--enable-array-variables</CODE>
12854 <DD>Include support for one-dimensional array shell variables
12855 (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
12858 <DT><CODE>--enable-bang-history</CODE>
12859 <DD>Include support for <CODE>csh</CODE>-like history substitution
12860 (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
12863 <DT><CODE>--enable-brace-expansion</CODE>
12864 <DD>Include <CODE>csh</CODE>-like brace expansion
12865 ( <CODE>b{a,b}c</CODE> ==> <CODE>bac bbc</CODE> ).
12866 See <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>, for a complete description.
12869 <DT><CODE>--enable-casemod-attributes</CODE>
12870 <DD>Include support for case-modifying attributes in the <CODE>declare</CODE> builtin
12871 and assignment statements. Variables with the <VAR>uppercase</VAR> attribute,
12872 for example, will have their values converted to uppercase upon assignment.
12875 <DT><CODE>--enable-casemod-expansion</CODE>
12876 <DD>Include support for case-modifying word expansions.
12879 <DT><CODE>--enable-command-timing</CODE>
12880 <DD>Include support for recognizing <CODE>time</CODE> as a reserved word and for
12881 displaying timing statistics for the pipeline following <CODE>time</CODE>
12882 (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12883 This allows pipelines as well as shell builtins and functions to be timed.
12886 <DT><CODE>--enable-cond-command</CODE>
12887 <DD>Include support for the <CODE>[[</CODE> conditional command.
12888 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12891 <DT><CODE>--enable-cond-regexp</CODE>
12892 <DD>Include support for matching POSIX regular expressions using the
12893 <SAMP>`=~'</SAMP> binary operator in the <CODE>[[</CODE> conditional command.
12894 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12897 <DT><CODE>--enable-coprocesses</CODE>
12898 <DD>Include support for coprocesses and the <CODE>coproc</CODE> reserved word
12899 (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12902 <DT><CODE>--enable-debugger</CODE>
12903 <DD>Include support for the bash debugger (distributed separately).
12906 <DT><CODE>--enable-directory-stack</CODE>
12907 <DD>Include support for a <CODE>csh</CODE>-like directory stack and the
12908 <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins
12909 (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
12912 <DT><CODE>--enable-disabled-builtins</CODE>
12913 <DD>Allow builtin commands to be invoked via <SAMP>`builtin xxx'</SAMP>
12914 even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>.
12915 See <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and
12916 <CODE>enable</CODE> builtin commands.
12919 <DT><CODE>--enable-dparen-arithmetic</CODE>
12920 <DD>Include support for the <CODE>((<small>...</small>))</CODE> command
12921 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12924 <DT><CODE>--enable-extended-glob</CODE>
12925 <DD>Include support for the extended pattern matching features described
12926 above under <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>.
12929 <DT><CODE>--enable-extended-glob-default</CODE>
12930 <DD>Set the default value of the <VAR>extglob</VAR> shell option described
12931 above under <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> to be enabled.
12934 <DT><CODE>--enable-help-builtin</CODE>
12935 <DD>Include the <CODE>help</CODE> builtin, which displays help on shell builtins and
12936 variables (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
12939 <DT><CODE>--enable-history</CODE>
12940 <DD>Include command history and the <CODE>fc</CODE> and <CODE>history</CODE>
12941 builtin commands (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>).
12944 <DT><CODE>--enable-job-control</CODE>
12945 <DD>This enables the job control features (see section <A HREF="bashref.html#SEC91">7. Job Control</A>),
12946 if the operating system supports them.
12949 <DT><CODE>--enable-multibyte</CODE>
12950 <DD>This enables support for multibyte characters if the operating
12951 system provides the necessary support.
12954 <DT><CODE>--enable-net-redirections</CODE>
12955 <DD>This enables the special handling of filenames of the form
12956 <CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> and
12957 <CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
12958 when used in redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
12961 <DT><CODE>--enable-process-substitution</CODE>
12962 <DD>This enables process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>) if
12963 the operating system provides the necessary support.
12966 <DT><CODE>--enable-progcomp</CODE>
12967 <DD>Enable the programmable completion facilities
12968 (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
12969 If Readline is not enabled, this option has no effect.
12972 <DT><CODE>--enable-prompt-string-decoding</CODE>
12973 <DD>Turn on the interpretation of a number of backslash-escaped characters
12974 in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt
12975 strings. See <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for a complete list of prompt
12976 string escape sequences.
12979 <DT><CODE>--enable-readline</CODE>
12980 <DD>Include support for command-line editing and history with the Bash
12981 version of the Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>).
12984 <DT><CODE>--enable-restricted</CODE>
12985 <DD>Include support for a <EM>restricted shell</EM>. If this is enabled, Bash,
12986 when called as <CODE>rbash</CODE>, enters a restricted mode. See
12987 <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>, for a description of restricted mode.
12990 <DT><CODE>--enable-select</CODE>
12991 <DD>Include the <CODE>select</CODE> builtin, which allows the generation of simple
12992 menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12995 <DT><CODE>--enable-separate-helpfiles</CODE>
12996 <DD>Use external files for the documentation displayed by the <CODE>help</CODE> builtin
12997 instead of storing the text internally.
13000 <DT><CODE>--enable-single-help-strings</CODE>
13001 <DD>Store the text displayed by the <CODE>help</CODE> builtin as a single string for
13002 each help topic. This aids in translating the text to different languages.
13003 You may need to disable this if your compiler cannot handle very long string
13007 <DT><CODE>--enable-strict-posix-default</CODE>
13008 <DD>Make Bash POSIX-conformant by default (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
13011 <DT><CODE>--enable-usg-echo-default</CODE>
13012 <DD>A synonym for <CODE>--enable-xpg-echo-default</CODE>.
13015 <DT><CODE>--enable-xpg-echo-default</CODE>
13016 <DD>Make the <CODE>echo</CODE> builtin expand backslash-escaped characters by default,
13017 without requiring the <SAMP>`-e'</SAMP> option.
13018 This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>,
13019 which makes the Bash <CODE>echo</CODE> behave more like the version specified in
13020 the Single Unix Specification, version 3.
13021 See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that
13022 <CODE>echo</CODE> recognizes.
13028 The file <TT>`config-top.h'</TT> contains C Preprocessor
13029 <SAMP>`#define'</SAMP> statements for options which are not settable from
13030 <CODE>configure</CODE>.
13031 Some of these are not meant to be changed; beware of the consequences if
13033 Read the comments associated with each definition for more
13034 information about its effect.
13037 <A NAME="Reporting Bugs"></A>
13039 <A NAME="SEC135"></A>
13040 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13041 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> < </A>]</TD>
13042 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> > </A>]</TD>
13043 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> << </A>]</TD>
13044 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13045 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> >> </A>]</TD>
13046 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13047 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13048 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13049 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13051 <H1> A. Reporting Bugs </H1>
13052 <!--docid::SEC135::-->
13055 Please report all bugs you find in Bash.
13056 But first, you should
13057 make sure that it really is a bug, and that it appears in the latest
13059 The latest version of Bash is always available for FTP from
13060 <A HREF="ftp://ftp.gnu.org/pub/gnu/bash/">ftp://ftp.gnu.org/pub/gnu/bash/</A>.
13063 Once you have determined that a bug actually exists, use the
13064 <CODE>bashbug</CODE> command to submit a bug report.
13065 If you have a fix, you are encouraged to mail that as well!
13066 Suggestions and `philosophical' bug reports may be mailed
13067 to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet
13068 newsgroup <CODE>gnu.bash.bug</CODE>.
13071 All bug reports should include:
13074 The version number of Bash.
13076 The hardware and operating system.
13078 The compiler used to compile Bash.
13080 A description of the bug behaviour.
13082 A short script or `recipe' which exercises the bug and may be used
13087 <CODE>bashbug</CODE> inserts the first three items automatically into
13088 the template it provides for filing a bug report.
13091 Please send all reports concerning this manual to
13092 <A HREF="mailto:chet.ramey@case.edu">chet.ramey@case.edu</A>.
13095 <A NAME="Major Differences From The Bourne Shell"></A>
13097 <A NAME="SEC136"></A>
13098 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13099 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> < </A>]</TD>
13100 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> > </A>]</TD>
13101 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> << </A>]</TD>
13102 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13103 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> >> </A>]</TD>
13104 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13105 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13106 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13107 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13109 <H1> B. Major Differences From The Bourne Shell </H1>
13110 <!--docid::SEC136::-->
13113 Bash implements essentially the same grammar, parameter and
13114 variable expansion, redirection, and quoting as the Bourne Shell.
13115 Bash uses the POSIX standard as the specification of
13116 how these features are to be implemented. There are some
13117 differences between the traditional Bourne shell and Bash; this
13118 section quickly details the differences of significance. A
13119 number of these differences are explained in greater depth in
13121 This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the
13122 last version of the historical Bourne shell) as the baseline reference.
13128 Bash is POSIX-conformant, even where the POSIX specification
13129 differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
13133 Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
13137 Bash has command-line editing (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) and
13138 the <CODE>bind</CODE> builtin.
13142 Bash provides a programmable word completion mechanism
13143 (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>), and builtin commands
13144 <CODE>complete</CODE>, <CODE>compgen</CODE>, and <CODE>compopt</CODE>, to
13149 Bash has command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) and the
13150 <CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it.
13151 The Bash history list maintains timestamp information and uses the
13152 value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it.
13156 Bash implements <CODE>csh</CODE>-like history expansion
13157 (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
13161 Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), and the
13162 appropriate variable expansions and assignment syntax to use them.
13163 Several of the Bash builtins take options to act on arrays.
13164 Bash provides a number of built-in array variables.
13168 The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C
13169 backslash-escaped characters in the text between the single quotes,
13170 is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>).
13174 Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do
13175 locale-specific translation of the characters between the double
13176 quotes. The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP>
13177 invocation options list the translatable strings found in a script
13178 (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
13182 Bash implements the <CODE>!</CODE> keyword to negate the return value of
13183 a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13184 Very useful when an <CODE>if</CODE> statement needs to act only if a test fails.
13185 The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to
13186 return a failure status if any command fails.
13190 Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13191 The display of the timing statistics may be controlled with the
13192 <CODE>TIMEFORMAT</CODE> variable.
13196 Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE>
13197 arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
13201 Bash includes the <CODE>select</CODE> compound command, which allows the
13202 generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13206 Bash includes the <CODE>[[</CODE> compound command, which makes conditional
13207 testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including
13208 optional regular expression matching.
13212 Bash provides optional case-insensitive matching for the <CODE>case</CODE> and
13213 <CODE>[[</CODE> constructs.
13217 Bash includes brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>) and tilde
13218 expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
13222 Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE>
13223 builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
13227 Bash provides shell arithmetic, the <CODE>((</CODE> compound command
13228 (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>),
13229 and arithmetic expansion (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
13233 Variables present in the shell's initial environment are automatically
13234 exported to child processes. The Bourne shell does not normally do
13235 this unless the variables are explicitly marked using the <CODE>export</CODE>
13240 Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value
13241 of the variable named on the left hand side.
13245 Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP>
13246 and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from
13247 variable values (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13251 The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>,
13252 is supported (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13256 The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>,
13257 which expands to the substring of <CODE>var</CODE>'s value of length
13258 <VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present
13259 (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13264 <CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>,
13265 which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in
13266 the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13270 The expansion <CODE>${!<VAR>prefix}*</VAR></CODE> expansion, which expands to
13271 the names of all shell variables whose names begin with <VAR>prefix</VAR>,
13272 is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13276 Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE>
13277 (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13281 Bash can expand positional parameters beyond <CODE>$9</CODE> using
13282 <CODE>${<VAR>num</VAR>}</CODE>.
13286 The POSIX <CODE>$()</CODE> form of command substitution
13287 is implemented (see section <A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>),
13288 and preferred to the Bourne shell's <CODE>"</CODE> (which
13289 is also implemented for backwards compatibility).
13293 Bash has process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>).
13297 Bash automatically assigns variables that provide information about the
13298 current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host
13299 (<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>),
13300 and the instance of Bash that is running (<CODE>BASH</CODE>,
13301 <CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>). See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>,
13306 The <CODE>IFS</CODE> variable is used to split only the results of expansion,
13307 not all words (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>).
13308 This closes a longstanding shell security hole.
13312 Bash implements the full set of POSIX filename expansion operators,
13313 including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and
13314 <VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
13318 Bash implements extended pattern matching features when the <CODE>extglob</CODE>
13319 shell option is enabled (see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>).
13323 It is possible to have a variable and a function with the same name;
13324 <CODE>sh</CODE> does not separate the two name spaces.
13328 Bash functions are permitted to have local variables using the
13329 <CODE>local</CODE> builtin, and thus useful recursive functions may be written
13330 (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13334 Variable assignments preceding commands affect only that command, even
13335 builtins and functions (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>).
13336 In <CODE>sh</CODE>, all variable assignments
13337 preceding commands are global unless the command is executed from the
13342 Bash performs filename expansion on filenames specified as operands
13343 to input and output redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13347 Bash contains the <SAMP>`<>'</SAMP> redirection operator, allowing a file to be
13348 opened for both reading and writing, and the <SAMP>`&>'</SAMP> redirection
13349 operator, for directing standard output and standard error to the same
13350 file (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13354 Bash includes the <SAMP>`<<<'</SAMP> redirection operator, allowing a string to
13355 be used as the standard input to a command.
13359 Bash implements the <SAMP>`[n]<&<VAR>word</VAR>'</SAMP> and <SAMP>`[n]>&<VAR>word</VAR>'</SAMP>
13360 redirection operators, which move one file descriptor to another.
13364 Bash treats a number of filenames specially when they are
13365 used in redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13369 Bash can open network connections to arbitrary machines and services
13370 with the redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13374 The <CODE>noclobber</CODE> option is available to avoid overwriting existing
13375 files with output redirection (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13376 The <SAMP>`>|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>.
13380 The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
13381 each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and
13386 Bash allows a function to override a builtin with the same name, and provides
13387 access to that builtin's functionality within the function via the
13388 <CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13392 The <CODE>command</CODE> builtin allows selective disabling of functions
13393 when command lookup is performed (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13397 Individual builtins may be enabled or disabled using the <CODE>enable</CODE>
13398 builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13402 The Bash <CODE>exec</CODE> builtin takes additional options that allow users
13403 to control the contents of the environment passed to the executed
13404 command, and what the zeroth argument to the command is to be
13405 (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13409 Shell functions may be exported to children via the environment
13410 using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
13414 The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can
13415 take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to
13416 display variables with various attributes set in a format that can be
13417 used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable
13418 attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes
13419 and values simultaneously.
13423 The Bash <CODE>hash</CODE> builtin allows a name to be associated with
13424 an arbitrary filename, even when that filename cannot be found by
13425 searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP>
13426 (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13430 Bash includes a <CODE>help</CODE> builtin for quick reference to shell
13431 facilities (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13435 The <CODE>printf</CODE> builtin is available to display formatted output
13436 (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13440 The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>)
13441 will read a line ending in <SAMP>`\'</SAMP> with
13442 the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a
13443 default if no non-option arguments are supplied.
13444 The Bash <CODE>read</CODE> builtin
13445 also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use
13446 Readline to obtain the line when given the <SAMP>`-e'</SAMP> option.
13447 The <CODE>read</CODE> builtin also has additional options to control input:
13448 the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as
13449 they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out
13450 if input does not arrive within a specified number of seconds, the
13451 <SAMP>`-n'</SAMP> option will allow reading only a specified number of
13452 characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read
13453 until a particular character rather than newline.
13457 The <CODE>return</CODE> builtin may be used to abort execution of scripts
13458 executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins
13459 (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13463 Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell
13464 optional capabilities (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), and allows these options
13465 to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
13469 Bash has much more optional behavior controllable with the <CODE>set</CODE>
13470 builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13474 The <SAMP>`-x'</SAMP> (<CODE>xtrace</CODE>) option displays commands other than
13475 simple commands when performing an execution trace
13476 (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13480 The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
13481 is slightly different, as it implements the POSIX algorithm,
13482 which specifies the behavior based on the number of arguments.
13486 Bash includes the <CODE>caller</CODE> builtin, which displays the context of
13487 any active subroutine call (a shell function or a script executed with
13488 the <CODE>.</CODE> or <CODE>source</CODE> builtins). This supports the bash
13493 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a
13494 <CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>.
13495 Commands specified with a <CODE>DEBUG</CODE> trap are executed before every
13496 simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
13497 <CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
13498 the first command executes in a shell function.
13499 The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the
13500 function has been given the <CODE>trace</CODE> attribute or the
13501 <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13502 The <CODE>extdebug</CODE> shell option has additional effects on the
13503 <CODE>DEBUG</CODE> trap.
13506 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows an
13507 <CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13508 Commands specified with an <CODE>ERR</CODE> trap are executed after a simple
13509 command fails, with a few exceptions.
13510 The <CODE>ERR</CODE> trap is not inherited by shell functions unless the
13511 <CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled.
13514 The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a
13515 <CODE>RETURN</CODE> pseudo-signal specification, similar to
13516 <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13517 Commands specified with an <CODE>RETURN</CODE> trap are executed before
13518 execution resumes after a shell function or a shell script executed with
13519 <CODE>.</CODE> or <CODE>source</CODE> returns.
13520 The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the
13521 function has been given the <CODE>trace</CODE> attribute or the
13522 <CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13526 The Bash <CODE>type</CODE> builtin is more extensive and gives more information
13527 about the names it finds (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13531 The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause
13532 the output to be displayed in the form of a <CODE>umask</CODE> command
13533 that may be reused as input (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13537 Bash implements a <CODE>csh</CODE>-like directory stack, and provides the
13538 <CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it
13539 (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
13540 Bash also makes the directory stack visible as the value of the
13541 <CODE>DIRSTACK</CODE> shell variable.
13545 Bash interprets special backslash-escaped characters in the prompt
13546 strings when interactive (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
13550 The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>);
13551 the SVR4.2 shell restricted mode is too limited.
13555 The <CODE>disown</CODE> builtin can remove a job from the internal shell
13556 job table (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or suppress the sending
13557 of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a
13558 <CODE>SIGHUP</CODE>.
13562 Bash includes a number of features to support a separate debugger for
13567 The SVR4.2 shell has two privilege-related builtins
13568 (<CODE>mldmode</CODE> and <CODE>priv</CODE>) not present in Bash.
13572 Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins.
13576 Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting.
13580 The SVR4.2 <CODE>sh</CODE> uses a <CODE>TIMEOUT</CODE> variable like Bash uses
13581 <CODE>TMOUT</CODE>.
13587 More features unique to Bash may be found in <A HREF="bashref.html#SEC68">6. Bash Features</A>.
13591 <A NAME="SEC137"></A>
13592 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13593 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> < </A>]</TD>
13594 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> > </A>]</TD>
13595 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> << </A>]</TD>
13596 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> Up </A>]</TD>
13597 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> >> </A>]</TD>
13598 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13599 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13600 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13601 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13603 <H2> B.1 Implementation Differences From The SVR4.2 Shell </H2>
13604 <!--docid::SEC137::-->
13607 Since Bash is a completely new implementation, it does not suffer from
13608 many of the limitations of the SVR4.2 shell. For instance:
13614 Bash does not fork a subshell when redirecting into or out of
13615 a shell control structure such as an <CODE>if</CODE> or <CODE>while</CODE>
13620 Bash does not allow unbalanced quotes. The SVR4.2 shell will silently
13621 insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances.
13622 This can be the cause of some hard-to-find errors.
13626 The SVR4.2 shell uses a baroque memory management scheme based on
13627 trapping <CODE>SIGSEGV</CODE>. If the shell is started from a process with
13628 <CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library
13629 function call), it misbehaves badly.
13633 In a questionable attempt at security, the SVR4.2 shell,
13634 when invoked without the <SAMP>`-p'</SAMP> option, will alter its real
13635 and effective UID and GID if they are less than some
13636 magic threshold value, commonly 100.
13637 This can lead to unexpected results.
13641 The SVR4.2 shell does not allow users to trap <CODE>SIGSEGV</CODE>,
13642 <CODE>SIGALRM</CODE>, or <CODE>SIGCHLD</CODE>.
13646 The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>,
13647 <CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset.
13651 The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of
13656 Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>);
13657 the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>). In
13658 fact, some versions of the shell dump core if the second argument begins
13659 with a <SAMP>`-'</SAMP>.
13663 The SVR4.2 shell exits a script if any builtin fails; Bash exits
13664 a script only if one of the POSIX special builtins fails, and
13665 only for certain failures, as enumerated in the POSIX standard.
13669 The SVR4.2 shell behaves differently when invoked as <CODE>jsh</CODE>
13670 (it turns on job control).
13674 <A NAME="GNU Free Documentation License"></A>
13676 <A NAME="SEC138"></A>
13677 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13678 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> < </A>]</TD>
13679 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> > </A>]</TD>
13680 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> << </A>]</TD>
13681 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13682 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> >> </A>]</TD>
13683 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13684 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13685 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13686 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13688 <H1> C. GNU Free Documentation License </H1>
13689 <!--docid::SEC138::-->
13693 Version 1.3, 3 November 2008
13697 <TABLE><tr><td> </td><td class=display><pre style="font-family: serif">Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
13698 <A HREF="http://fsf.org/">http://fsf.org/</A>
13700 Everyone is permitted to copy and distribute verbatim copies
13701 of this license document, but changing it is not allowed.
13702 </pre></td></tr></table></P><P>
13709 The purpose of this License is to make a manual, textbook, or other
13710 functional and useful document <EM>free</EM> in the sense of freedom: to
13711 assure everyone the effective freedom to copy and redistribute it,
13712 with or without modifying it, either commercially or noncommercially.
13713 Secondarily, this License preserves for the author and publisher a way
13714 to get credit for their work, while not being considered responsible
13715 for modifications made by others.
13718 This License is a kind of "copyleft", which means that derivative
13719 works of the document must themselves be free in the same sense. It
13720 complements the GNU General Public License, which is a copyleft
13721 license designed for free software.
13724 We have designed this License in order to use it for manuals for free
13725 software, because free software needs free documentation: a free
13726 program should come with manuals providing the same freedoms that the
13727 software does. But this License is not limited to software manuals;
13728 it can be used for any textual work, regardless of subject matter or
13729 whether it is published as a printed book. We recommend this License
13730 principally for works whose purpose is instruction or reference.
13734 APPLICABILITY AND DEFINITIONS
13737 This License applies to any manual or other work, in any medium, that
13738 contains a notice placed by the copyright holder saying it can be
13739 distributed under the terms of this License. Such a notice grants a
13740 world-wide, royalty-free license, unlimited in duration, to use that
13741 work under the conditions stated herein. The "Document", below,
13742 refers to any such manual or work. Any member of the public is a
13743 licensee, and is addressed as "you". You accept the license if you
13744 copy, modify or distribute the work in a way requiring permission
13745 under copyright law.
13748 A "Modified Version" of the Document means any work containing the
13749 Document or a portion of it, either copied verbatim, or with
13750 modifications and/or translated into another language.
13753 A "Secondary Section" is a named appendix or a front-matter section
13754 of the Document that deals exclusively with the relationship of the
13755 publishers or authors of the Document to the Document's overall
13756 subject (or to related matters) and contains nothing that could fall
13757 directly within that overall subject. (Thus, if the Document is in
13758 part a textbook of mathematics, a Secondary Section may not explain
13759 any mathematics.) The relationship could be a matter of historical
13760 connection with the subject or with related matters, or of legal,
13761 commercial, philosophical, ethical or political position regarding
13765 The "Invariant Sections" are certain Secondary Sections whose titles
13766 are designated, as being those of Invariant Sections, in the notice
13767 that says that the Document is released under this License. If a
13768 section does not fit the above definition of Secondary then it is not
13769 allowed to be designated as Invariant. The Document may contain zero
13770 Invariant Sections. If the Document does not identify any Invariant
13771 Sections then there are none.
13774 The "Cover Texts" are certain short passages of text that are listed,
13775 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
13776 the Document is released under this License. A Front-Cover Text may
13777 be at most 5 words, and a Back-Cover Text may be at most 25 words.
13780 A "Transparent" copy of the Document means a machine-readable copy,
13781 represented in a format whose specification is available to the
13782 general public, that is suitable for revising the document
13783 straightforwardly with generic text editors or (for images composed of
13784 pixels) generic paint programs or (for drawings) some widely available
13785 drawing editor, and that is suitable for input to text formatters or
13786 for automatic translation to a variety of formats suitable for input
13787 to text formatters. A copy made in an otherwise Transparent file
13788 format whose markup, or absence of markup, has been arranged to thwart
13789 or discourage subsequent modification by readers is not Transparent.
13790 An image format is not Transparent if used for any substantial amount
13791 of text. A copy that is not "Transparent" is called "Opaque".
13794 Examples of suitable formats for Transparent copies include plain
13795 ASCII without markup, Texinfo input format, LaTeX input
13796 format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available
13797 <FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>,
13798 PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification. Examples
13799 of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and
13800 <FONT SIZE="-1">JPG</FONT>. Opaque formats include proprietary formats that can be
13801 read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or
13802 <FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are
13803 not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>,
13804 PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for
13805 output purposes only.
13808 The "Title Page" means, for a printed book, the title page itself,
13809 plus such following pages as are needed to hold, legibly, the material
13810 this License requires to appear in the title page. For works in
13811 formats which do not have any title page as such, "Title Page" means
13812 the text near the most prominent appearance of the work's title,
13813 preceding the beginning of the body of the text.
13816 The "publisher" means any person or entity that distributes copies
13817 of the Document to the public.
13820 A section "Entitled XYZ" means a named subunit of the Document whose
13821 title either is precisely XYZ or contains XYZ in parentheses following
13822 text that translates XYZ in another language. (Here XYZ stands for a
13823 specific section name mentioned below, such as "Acknowledgements",
13824 "Dedications", "Endorsements", or "History".) To "Preserve the Title"
13825 of such a section when you modify the Document means that it remains a
13826 section "Entitled XYZ" according to this definition.
13829 The Document may include Warranty Disclaimers next to the notice which
13830 states that this License applies to the Document. These Warranty
13831 Disclaimers are considered to be included by reference in this
13832 License, but only as regards disclaiming warranties: any other
13833 implication that these Warranty Disclaimers may have is void and has
13834 no effect on the meaning of this License.
13841 You may copy and distribute the Document in any medium, either
13842 commercially or noncommercially, provided that this License, the
13843 copyright notices, and the license notice saying this License applies
13844 to the Document are reproduced in all copies, and that you add no other
13845 conditions whatsoever to those of this License. You may not use
13846 technical measures to obstruct or control the reading or further
13847 copying of the copies you make or distribute. However, you may accept
13848 compensation in exchange for copies. If you distribute a large enough
13849 number of copies you must also follow the conditions in section 3.
13852 You may also lend copies, under the same conditions stated above, and
13853 you may publicly display copies.
13857 COPYING IN QUANTITY
13860 If you publish printed copies (or copies in media that commonly have
13861 printed covers) of the Document, numbering more than 100, and the
13862 Document's license notice requires Cover Texts, you must enclose the
13863 copies in covers that carry, clearly and legibly, all these Cover
13864 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
13865 the back cover. Both covers must also clearly and legibly identify
13866 you as the publisher of these copies. The front cover must present
13867 the full title with all words of the title equally prominent and
13868 visible. You may add other material on the covers in addition.
13869 Copying with changes limited to the covers, as long as they preserve
13870 the title of the Document and satisfy these conditions, can be treated
13871 as verbatim copying in other respects.
13874 If the required texts for either cover are too voluminous to fit
13875 legibly, you should put the first ones listed (as many as fit
13876 reasonably) on the actual cover, and continue the rest onto adjacent
13880 If you publish or distribute Opaque copies of the Document numbering
13881 more than 100, you must either include a machine-readable Transparent
13882 copy along with each Opaque copy, or state in or with each Opaque copy
13883 a computer-network location from which the general network-using
13884 public has access to download using public-standard network protocols
13885 a complete Transparent copy of the Document, free of added material.
13886 If you use the latter option, you must take reasonably prudent steps,
13887 when you begin distribution of Opaque copies in quantity, to ensure
13888 that this Transparent copy will remain thus accessible at the stated
13889 location until at least one year after the last time you distribute an
13890 Opaque copy (directly or through your agents or retailers) of that
13891 edition to the public.
13894 It is requested, but not required, that you contact the authors of the
13895 Document well before redistributing any large number of copies, to give
13896 them a chance to provide you with an updated version of the Document.
13903 You may copy and distribute a Modified Version of the Document under
13904 the conditions of sections 2 and 3 above, provided that you release
13905 the Modified Version under precisely this License, with the Modified
13906 Version filling the role of the Document, thus licensing distribution
13907 and modification of the Modified Version to whoever possesses a copy
13908 of it. In addition, you must do these things in the Modified Version:
13913 Use in the Title Page (and on the covers, if any) a title distinct
13914 from that of the Document, and from those of previous versions
13915 (which should, if there were any, be listed in the History section
13916 of the Document). You may use the same title as a previous version
13917 if the original publisher of that version gives permission.
13921 List on the Title Page, as authors, one or more persons or entities
13922 responsible for authorship of the modifications in the Modified
13923 Version, together with at least five of the principal authors of the
13924 Document (all of its principal authors, if it has fewer than five),
13925 unless they release you from this requirement.
13929 State on the Title page the name of the publisher of the
13930 Modified Version, as the publisher.
13934 Preserve all the copyright notices of the Document.
13938 Add an appropriate copyright notice for your modifications
13939 adjacent to the other copyright notices.
13943 Include, immediately after the copyright notices, a license notice
13944 giving the public permission to use the Modified Version under the
13945 terms of this License, in the form shown in the Addendum below.
13949 Preserve in that license notice the full lists of Invariant Sections
13950 and required Cover Texts given in the Document's license notice.
13954 Include an unaltered copy of this License.
13958 Preserve the section Entitled "History", Preserve its Title, and add
13959 to it an item stating at least the title, year, new authors, and
13960 publisher of the Modified Version as given on the Title Page. If
13961 there is no section Entitled "History" in the Document, create one
13962 stating the title, year, authors, and publisher of the Document as
13963 given on its Title Page, then add an item describing the Modified
13964 Version as stated in the previous sentence.
13968 Preserve the network location, if any, given in the Document for
13969 public access to a Transparent copy of the Document, and likewise
13970 the network locations given in the Document for previous versions
13971 it was based on. These may be placed in the "History" section.
13972 You may omit a network location for a work that was published at
13973 least four years before the Document itself, or if the original
13974 publisher of the version it refers to gives permission.
13978 For any section Entitled "Acknowledgements" or "Dedications", Preserve
13979 the Title of the section, and preserve in the section all the
13980 substance and tone of each of the contributor acknowledgements and/or
13981 dedications given therein.
13985 Preserve all the Invariant Sections of the Document,
13986 unaltered in their text and in their titles. Section numbers
13987 or the equivalent are not considered part of the section titles.
13991 Delete any section Entitled "Endorsements". Such a section
13992 may not be included in the Modified Version.
13996 Do not retitle any existing section to be Entitled "Endorsements" or
13997 to conflict in title with any Invariant Section.
14001 Preserve any Warranty Disclaimers.
14005 If the Modified Version includes new front-matter sections or
14006 appendices that qualify as Secondary Sections and contain no material
14007 copied from the Document, you may at your option designate some or all
14008 of these sections as invariant. To do this, add their titles to the
14009 list of Invariant Sections in the Modified Version's license notice.
14010 These titles must be distinct from any other section titles.
14013 You may add a section Entitled "Endorsements", provided it contains
14014 nothing but endorsements of your Modified Version by various
14015 parties--for example, statements of peer review or that the text has
14016 been approved by an organization as the authoritative definition of a
14020 You may add a passage of up to five words as a Front-Cover Text, and a
14021 passage of up to 25 words as a Back-Cover Text, to the end of the list
14022 of Cover Texts in the Modified Version. Only one passage of
14023 Front-Cover Text and one of Back-Cover Text may be added by (or
14024 through arrangements made by) any one entity. If the Document already
14025 includes a cover text for the same cover, previously added by you or
14026 by arrangement made by the same entity you are acting on behalf of,
14027 you may not add another; but you may replace the old one, on explicit
14028 permission from the previous publisher that added the old one.
14031 The author(s) and publisher(s) of the Document do not by this License
14032 give permission to use their names for publicity for or to assert or
14033 imply endorsement of any Modified Version.
14037 COMBINING DOCUMENTS
14040 You may combine the Document with other documents released under this
14041 License, under the terms defined in section 4 above for modified
14042 versions, provided that you include in the combination all of the
14043 Invariant Sections of all of the original documents, unmodified, and
14044 list them all as Invariant Sections of your combined work in its
14045 license notice, and that you preserve all their Warranty Disclaimers.
14048 The combined work need only contain one copy of this License, and
14049 multiple identical Invariant Sections may be replaced with a single
14050 copy. If there are multiple Invariant Sections with the same name but
14051 different contents, make the title of each such section unique by
14052 adding at the end of it, in parentheses, the name of the original
14053 author or publisher of that section if known, or else a unique number.
14054 Make the same adjustment to the section titles in the list of
14055 Invariant Sections in the license notice of the combined work.
14058 In the combination, you must combine any sections Entitled "History"
14059 in the various original documents, forming one section Entitled
14060 "History"; likewise combine any sections Entitled "Acknowledgements",
14061 and any sections Entitled "Dedications". You must delete all
14062 sections Entitled "Endorsements."
14066 COLLECTIONS OF DOCUMENTS
14069 You may make a collection consisting of the Document and other documents
14070 released under this License, and replace the individual copies of this
14071 License in the various documents with a single copy that is included in
14072 the collection, provided that you follow the rules of this License for
14073 verbatim copying of each of the documents in all other respects.
14076 You may extract a single document from such a collection, and distribute
14077 it individually under this License, provided you insert a copy of this
14078 License into the extracted document, and follow this License in all
14079 other respects regarding verbatim copying of that document.
14083 AGGREGATION WITH INDEPENDENT WORKS
14086 A compilation of the Document or its derivatives with other separate
14087 and independent documents or works, in or on a volume of a storage or
14088 distribution medium, is called an "aggregate" if the copyright
14089 resulting from the compilation is not used to limit the legal rights
14090 of the compilation's users beyond what the individual works permit.
14091 When the Document is included in an aggregate, this License does not
14092 apply to the other works in the aggregate which are not themselves
14093 derivative works of the Document.
14096 If the Cover Text requirement of section 3 is applicable to these
14097 copies of the Document, then if the Document is less than one half of
14098 the entire aggregate, the Document's Cover Texts may be placed on
14099 covers that bracket the Document within the aggregate, or the
14100 electronic equivalent of covers if the Document is in electronic form.
14101 Otherwise they must appear on printed covers that bracket the whole
14109 Translation is considered a kind of modification, so you may
14110 distribute translations of the Document under the terms of section 4.
14111 Replacing Invariant Sections with translations requires special
14112 permission from their copyright holders, but you may include
14113 translations of some or all Invariant Sections in addition to the
14114 original versions of these Invariant Sections. You may include a
14115 translation of this License, and all the license notices in the
14116 Document, and any Warranty Disclaimers, provided that you also include
14117 the original English version of this License and the original versions
14118 of those notices and disclaimers. In case of a disagreement between
14119 the translation and the original version of this License or a notice
14120 or disclaimer, the original version will prevail.
14123 If a section in the Document is Entitled "Acknowledgements",
14124 "Dedications", or "History", the requirement (section 4) to Preserve
14125 its Title (section 1) will typically require changing the actual
14133 You may not copy, modify, sublicense, or distribute the Document
14134 except as expressly provided under this License. Any attempt
14135 otherwise to copy, modify, sublicense, or distribute it is void, and
14136 will automatically terminate your rights under this License.
14139 However, if you cease all violation of this License, then your license
14140 from a particular copyright holder is reinstated (a) provisionally,
14141 unless and until the copyright holder explicitly and finally
14142 terminates your license, and (b) permanently, if the copyright holder
14143 fails to notify you of the violation by some reasonable means prior to
14144 60 days after the cessation.
14147 Moreover, your license from a particular copyright holder is
14148 reinstated permanently if the copyright holder notifies you of the
14149 violation by some reasonable means, this is the first time you have
14150 received notice of violation of this License (for any work) from that
14151 copyright holder, and you cure the violation prior to 30 days after
14152 your receipt of the notice.
14155 Termination of your rights under this section does not terminate the
14156 licenses of parties who have received copies or rights from you under
14157 this License. If your rights have been terminated and not permanently
14158 reinstated, receipt of a copy of some or all of the same material does
14159 not give you any rights to use it.
14163 FUTURE REVISIONS OF THIS LICENSE
14166 The Free Software Foundation may publish new, revised versions
14167 of the GNU Free Documentation License from time to time. Such new
14168 versions will be similar in spirit to the present version, but may
14169 differ in detail to address new problems or concerns. See
14170 <A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>.
14173 Each version of the License is given a distinguishing version number.
14174 If the Document specifies that a particular numbered version of this
14175 License "or any later version" applies to it, you have the option of
14176 following the terms and conditions either of that specified version or
14177 of any later version that has been published (not as a draft) by the
14178 Free Software Foundation. If the Document does not specify a version
14179 number of this License, you may choose any version ever published (not
14180 as a draft) by the Free Software Foundation. If the Document
14181 specifies that a proxy can decide which future versions of this
14182 License can be used, that proxy's public statement of acceptance of a
14183 version permanently authorizes you to choose that version for the
14191 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
14192 World Wide Web server that publishes copyrightable works and also
14193 provides prominent facilities for anybody to edit those works. A
14194 public wiki that anybody can edit is an example of such a server. A
14195 "Massive Multiauthor Collaboration" (or "MMC") contained in the
14196 site means any set of copyrightable works thus published on the MMC
14200 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
14201 license published by Creative Commons Corporation, a not-for-profit
14202 corporation with a principal place of business in San Francisco,
14203 California, as well as future copyleft versions of that license
14204 published by that same organization.
14207 "Incorporate" means to publish or republish a Document, in whole or
14208 in part, as part of another Document.
14211 An MMC is "eligible for relicensing" if it is licensed under this
14212 License, and if all works that were first published under this License
14213 somewhere other than this MMC, and subsequently incorporated in whole
14214 or in part into the MMC, (1) had no cover texts or invariant sections,
14215 and (2) were thus incorporated prior to November 1, 2008.
14218 The operator of an MMC Site may republish an MMC contained in the site
14219 under CC-BY-SA on the same site at any time before August 1, 2009,
14220 provided the MMC is eligible for relicensing.
14226 <A NAME="SEC139"></A>
14227 <H2> ADDENDUM: How to use this License for your documents </H2>
14228 <!--docid::SEC139::-->
14231 To use this License in a document you have written, include a copy of
14232 the License in the document and put the following copyright and
14233 license notices just after the title page:
14236 <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> Copyright (C) <VAR>year</VAR> <VAR>your name</VAR>.
14237 Permission is granted to copy, distribute and/or modify this document
14238 under the terms of the GNU Free Documentation License, Version 1.3
14239 or any later version published by the Free Software Foundation;
14240 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
14241 Texts. A copy of the license is included in the section entitled ``GNU
14242 Free Documentation License''.
14243 </FONT></pre></td></tr></table></P><P>
14245 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
14246 replace the "with<small>...</small>Texts." line with this:
14249 <TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> with the Invariant Sections being <VAR>list their titles</VAR>, with
14250 the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts
14251 being <VAR>list</VAR>.
14252 </FONT></pre></td></tr></table></P><P>
14254 If you have Invariant Sections without Cover Texts, or some other
14255 combination of the three, merge those two alternatives to suit the
14259 If your document contains nontrivial examples of program code, we
14260 recommend releasing these examples in parallel under your choice of
14261 free software license, such as the GNU General Public License,
14262 to permit their use in free software.
14265 <A NAME="Indexes"></A>
14267 <A NAME="SEC140"></A>
14268 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14269 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> < </A>]</TD>
14270 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> > </A>]</TD>
14271 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
14272 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
14273 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14274 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14275 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14276 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14277 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14279 <H1> D. Indexes </H1>
14280 <!--docid::SEC140::-->
14283 <BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
14284 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR>
14285 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR>
14286 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the
14287 variable you want.</TD></TR>
14288 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC144">D.4 Function Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR>
14289 <TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC145">D.5 Concept Index</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in
14290 this manual.</TD></TR>
14291 </TABLE></BLOCKQUOTE>
14294 <A NAME="Builtin Index"></A>
14296 <A NAME="SEC141"></A>
14297 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14298 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> < </A>]</TD>
14299 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> > </A>]</TD>
14300 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
14301 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14302 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14303 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14304 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14305 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14306 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14308 <H2> D.1 Index of Shell Builtin Commands </H2>
14309 <!--docid::SEC141::-->
14310 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
14312 <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14314 <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14317 <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14319 <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14321 <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14323 <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14325 <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14327 <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14329 <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14331 <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14333 <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14335 <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14337 <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14339 <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14341 <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14343 <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14345 <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14347 <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14349 <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14351 <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14353 </td></tr></table><br><P></P>
14355 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14356 <TR><TD COLSPAN=3> <HR></TD></TR>
14357 <TR><TH><A NAME="bt_."></A>.</TH><TD></TD><TD></TD></TR>
14358 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX69"><CODE>.</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14359 <TR><TD COLSPAN=3> <HR></TD></TR>
14360 <TR><TH><A NAME="bt_:"></A>:</TH><TD></TD><TD></TD></TR>
14361 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX68"><CODE>:</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14362 <TR><TD COLSPAN=3> <HR></TD></TR>
14363 <TR><TH><A NAME="bt_["></A>[</TH><TD></TD><TD></TD></TR>
14364 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX84"><CODE>[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14365 <TR><TD COLSPAN=3> <HR></TD></TR>
14366 <TR><TH><A NAME="bt_A"></A>A</TH><TD></TD><TD></TD></TR>
14367 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX89"><CODE>alias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14368 <TR><TD COLSPAN=3> <HR></TD></TR>
14369 <TR><TH><A NAME="bt_B"></A>B</TH><TD></TD><TD></TD></TR>
14370 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX293"><CODE>bg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14371 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX90"><CODE>bind</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14372 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX70"><CODE>break</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14373 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX91"><CODE>builtin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14374 <TR><TD COLSPAN=3> <HR></TD></TR>
14375 <TR><TH><A NAME="bt_C"></A>C</TH><TD></TD><TD></TD></TR>
14376 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX92"><CODE>caller</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14377 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX71"><CODE>cd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14378 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX93"><CODE>command</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14379 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX540"><CODE>compgen</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14380 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX541"><CODE>complete</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14381 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX542"><CODE>compopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14382 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX72"><CODE>continue</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14383 <TR><TD COLSPAN=3> <HR></TD></TR>
14384 <TR><TH><A NAME="bt_D"></A>D</TH><TD></TD><TD></TD></TR>
14385 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX94"><CODE>declare</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14386 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX290"><CODE>dirs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
14387 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX298"><CODE>disown</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14388 <TR><TD COLSPAN=3> <HR></TD></TR>
14389 <TR><TH><A NAME="bt_E"></A>E</TH><TD></TD><TD></TD></TR>
14390 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX95"><CODE>echo</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14391 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX96"><CODE>enable</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14392 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX73"><CODE>eval</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14393 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX74"><CODE>exec</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14394 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX75"><CODE>exit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14395 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX76"><CODE>export</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14396 <TR><TD COLSPAN=3> <HR></TD></TR>
14397 <TR><TH><A NAME="bt_F"></A>F</TH><TD></TD><TD></TD></TR>
14398 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX544"><CODE>fc</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
14399 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX294"><CODE>fg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14400 <TR><TD COLSPAN=3> <HR></TD></TR>
14401 <TR><TH><A NAME="bt_G"></A>G</TH><TD></TD><TD></TD></TR>
14402 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX77"><CODE>getopts</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14403 <TR><TD COLSPAN=3> <HR></TD></TR>
14404 <TR><TH><A NAME="bt_H"></A>H</TH><TD></TD><TD></TD></TR>
14405 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX78"><CODE>hash</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14406 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX97"><CODE>help</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14407 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX545"><CODE>history</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
14408 <TR><TD COLSPAN=3> <HR></TD></TR>
14409 <TR><TH><A NAME="bt_J"></A>J</TH><TD></TD><TD></TD></TR>
14410 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX295"><CODE>jobs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14411 <TR><TD COLSPAN=3> <HR></TD></TR>
14412 <TR><TH><A NAME="bt_K"></A>K</TH><TD></TD><TD></TD></TR>
14413 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX296"><CODE>kill</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14414 <TR><TD COLSPAN=3> <HR></TD></TR>
14415 <TR><TH><A NAME="bt_L"></A>L</TH><TD></TD><TD></TD></TR>
14416 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX98"><CODE>let</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14417 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX99"><CODE>local</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14418 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX100"><CODE>logout</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14419 <TR><TD COLSPAN=3> <HR></TD></TR>
14420 <TR><TH><A NAME="bt_M"></A>M</TH><TD></TD><TD></TD></TR>
14421 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX101"><CODE>mapfile</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14422 <TR><TD COLSPAN=3> <HR></TD></TR>
14423 <TR><TH><A NAME="bt_P"></A>P</TH><TD></TD><TD></TD></TR>
14424 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX291"><CODE>popd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
14425 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX102"><CODE>printf</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14426 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX292"><CODE>pushd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
14427 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX79"><CODE>pwd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14428 <TR><TD COLSPAN=3> <HR></TD></TR>
14429 <TR><TH><A NAME="bt_R"></A>R</TH><TD></TD><TD></TD></TR>
14430 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX103"><CODE>read</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14431 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX104"><CODE>readarray</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14432 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX80"><CODE>readonly</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14433 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX81"><CODE>return</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14434 <TR><TD COLSPAN=3> <HR></TD></TR>
14435 <TR><TH><A NAME="bt_S"></A>S</TH><TD></TD><TD></TD></TR>
14436 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX110"><CODE>set</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A></TD></TR>
14437 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX82"><CODE>shift</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14438 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX111"><CODE>shopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD></TR>
14439 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX105"><CODE>source</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14440 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX299"><CODE>suspend</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14441 <TR><TD COLSPAN=3> <HR></TD></TR>
14442 <TR><TH><A NAME="bt_T"></A>T</TH><TD></TD><TD></TD></TR>
14443 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX83"><CODE>test</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14444 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX85"><CODE>times</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14445 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX86"><CODE>trap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14446 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX106"><CODE>type</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14447 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX107"><CODE>typeset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14448 <TR><TD COLSPAN=3> <HR></TD></TR>
14449 <TR><TH><A NAME="bt_U"></A>U</TH><TD></TD><TD></TD></TR>
14450 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX108"><CODE>ulimit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14451 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX87"><CODE>umask</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14452 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX109"><CODE>unalias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14453 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX88"><CODE>unset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14454 <TR><TD COLSPAN=3> <HR></TD></TR>
14455 <TR><TH><A NAME="bt_W"></A>W</TH><TD></TD><TD></TD></TR>
14456 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX297"><CODE>wait</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14457 <TR><TD COLSPAN=3> <HR></TD></TR>
14458 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
14460 <A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14462 <A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14465 <A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14467 <A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14469 <A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14471 <A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14473 <A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14475 <A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14477 <A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14479 <A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14481 <A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14483 <A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14485 <A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14487 <A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14489 <A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14491 <A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14493 <A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14495 <A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14497 <A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14499 <A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14501 </td></tr></table><br><P>
14503 <A NAME="Reserved Word Index"></A>
14505 <A NAME="SEC142"></A>
14506 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14507 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> < </A>]</TD>
14508 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> > </A>]</TD>
14509 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> << </A>]</TD>
14510 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14511 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14512 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14513 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14514 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14515 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14517 <H2> D.2 Index of Shell Reserved Words </H2>
14518 <!--docid::SEC142::-->
14519 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14521 <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14523 <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14525 <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14527 <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14530 <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14532 <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14534 <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14536 <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14538 <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14540 <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14542 <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14544 <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14546 <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14548 </td></tr></table><br><P></P>
14550 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14551 <TR><TD COLSPAN=3> <HR></TD></TR>
14552 <TR><TH><A NAME="rw_!"></A>!</TH><TD></TD><TD></TD></TR>
14553 <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>
14554 <TR><TD COLSPAN=3> <HR></TD></TR>
14555 <TR><TH><A NAME="rw_["></A>[</TH><TD></TD><TD></TD></TR>
14556 <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>
14557 <TR><TD COLSPAN=3> <HR></TD></TR>
14558 <TR><TH><A NAME="rw_]"></A>]</TH><TD></TD><TD></TD></TR>
14559 <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>
14560 <TR><TD COLSPAN=3> <HR></TD></TR>
14561 <TR><TH><A NAME="rw_{"></A>{</TH><TD></TD><TD></TD></TR>
14562 <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>
14563 <TR><TD COLSPAN=3> <HR></TD></TR>
14564 <TR><TH><A NAME="rw_}"></A>}</TH><TD></TD><TD></TD></TR>
14565 <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>
14566 <TR><TD COLSPAN=3> <HR></TD></TR>
14567 <TR><TH><A NAME="rw_C"></A>C</TH><TD></TD><TD></TD></TR>
14568 <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>
14569 <TR><TD COLSPAN=3> <HR></TD></TR>
14570 <TR><TH><A NAME="rw_D"></A>D</TH><TD></TD><TD></TD></TR>
14571 <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>
14572 <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>
14573 <TR><TD COLSPAN=3> <HR></TD></TR>
14574 <TR><TH><A NAME="rw_E"></A>E</TH><TD></TD><TD></TD></TR>
14575 <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>
14576 <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>
14577 <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>
14578 <TR><TD COLSPAN=3> <HR></TD></TR>
14579 <TR><TH><A NAME="rw_F"></A>F</TH><TD></TD><TD></TD></TR>
14580 <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>
14581 <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>
14582 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX45"><CODE>function</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR>
14583 <TR><TD COLSPAN=3> <HR></TD></TR>
14584 <TR><TH><A NAME="rw_I"></A>I</TH><TD></TD><TD></TD></TR>
14585 <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>
14586 <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>
14587 <TR><TD COLSPAN=3> <HR></TD></TR>
14588 <TR><TH><A NAME="rw_S"></A>S</TH><TD></TD><TD></TD></TR>
14589 <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>
14590 <TR><TD COLSPAN=3> <HR></TD></TR>
14591 <TR><TH><A NAME="rw_T"></A>T</TH><TD></TD><TD></TD></TR>
14592 <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>
14593 <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>
14594 <TR><TD COLSPAN=3> <HR></TD></TR>
14595 <TR><TH><A NAME="rw_U"></A>U</TH><TD></TD><TD></TD></TR>
14596 <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>
14597 <TR><TD COLSPAN=3> <HR></TD></TR>
14598 <TR><TH><A NAME="rw_W"></A>W</TH><TD></TD><TD></TD></TR>
14599 <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>
14600 <TR><TD COLSPAN=3> <HR></TD></TR>
14601 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14603 <A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14605 <A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14607 <A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14609 <A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14612 <A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14614 <A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14616 <A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14618 <A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14620 <A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14622 <A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14624 <A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14626 <A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14628 <A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14630 </td></tr></table><br><P>
14632 <A NAME="Variable Index"></A>
14634 <A NAME="SEC143"></A>
14635 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14636 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> < </A>]</TD>
14637 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> > </A>]</TD>
14638 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> << </A>]</TD>
14639 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14640 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
14641 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14642 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14643 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14644 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14646 <H2> D.3 Parameter and Variable Index </H2>
14647 <!--docid::SEC143::-->
14648 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
14650 <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
14652 <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
14654 <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
14656 <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
14658 <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
14660 <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
14662 <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
14664 <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
14667 <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
14669 <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
14671 <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
14673 <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
14675 <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
14677 <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
14679 <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
14681 <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
14683 <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
14685 <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
14687 <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
14689 <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
14691 <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
14693 <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
14695 <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
14697 <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
14699 <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
14701 <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
14703 <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
14705 </td></tr></table><br><P></P>
14707 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14708 <TR><TD COLSPAN=3> <HR></TD></TR>
14709 <TR><TH><A NAME="vr_!"></A>!</TH><TD></TD><TD></TD></TR>
14710 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX58"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14711 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX59"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14712 <TR><TD COLSPAN=3> <HR></TD></TR>
14713 <TR><TH><A NAME="vr_#"></A>#</TH><TD></TD><TD></TD></TR>
14714 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX50"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14715 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX51"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14716 <TR><TD COLSPAN=3> <HR></TD></TR>
14717 <TR><TH><A NAME="vr_$"></A>$</TH><TD></TD><TD></TD></TR>
14718 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX56"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14719 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX57"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14720 <TR><TD COLSPAN=3> <HR></TD></TR>
14721 <TR><TH><A NAME="vr_*"></A>*</TH><TD></TD><TD></TD></TR>
14722 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX46"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14723 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX47"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14724 <TR><TD COLSPAN=3> <HR></TD></TR>
14725 <TR><TH><A NAME="vr_-"></A>-</TH><TD></TD><TD></TD></TR>
14726 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX54"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14727 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX55"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14728 <TR><TD COLSPAN=3> <HR></TD></TR>
14729 <TR><TH><A NAME="vr_0"></A>0</TH><TD></TD><TD></TD></TR>
14730 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX60"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14731 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX61"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14732 <TR><TD COLSPAN=3> <HR></TD></TR>
14733 <TR><TH><A NAME="vr_?"></A>?</TH><TD></TD><TD></TD></TR>
14734 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX52"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14735 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX53"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14736 <TR><TD COLSPAN=3> <HR></TD></TR>
14737 <TR><TH><A NAME="vr_@"></A>@</TH><TD></TD><TD></TD></TR>
14738 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX48"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14739 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX49"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14740 <TR><TD COLSPAN=3> <HR></TD></TR>
14741 <TR><TH><A NAME="vr__"></A>_</TH><TD></TD><TD></TD></TR>
14742 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX62"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14743 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX63"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14744 <TR><TD COLSPAN=3> <HR></TD></TR>
14745 <TR><TH><A NAME="vr_A"></A>A</TH><TD></TD><TD></TD></TR>
14746 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX300"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
14747 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX301"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
14748 <TR><TD COLSPAN=3> <HR></TD></TR>
14749 <TR><TH><A NAME="vr_B"></A>B</TH><TD></TD><TD></TD></TR>
14750 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX132"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14751 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX133"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14752 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX138"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14753 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX139"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14754 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX140"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14755 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX141"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14756 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX142"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14757 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX143"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14758 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX144"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14759 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX145"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14760 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX146"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14761 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX147"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14762 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX148"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14763 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX149"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14764 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX150"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14765 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX151"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14766 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX152"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14767 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX153"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14768 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX154"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14769 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX155"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14770 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX156"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14771 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX157"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14772 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX158"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14773 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX159"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14774 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX160"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14775 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX161"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14776 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX162"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14777 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX163"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14778 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX164"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14779 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX165"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14780 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX134"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14781 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX135"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14782 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX136"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14783 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX137"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14784 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX307"><CODE>bell-style</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14785 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX308"><CODE>bind-tty-special-chars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14786 <TR><TD COLSPAN=3> <HR></TD></TR>
14787 <TR><TH><A NAME="vr_C"></A>C</TH><TD></TD><TD></TD></TR>
14788 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX112"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14789 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX113"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14790 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX166"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14791 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX167"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14792 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX309"><CODE>comment-begin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14793 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX168"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14794 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX169"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14795 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX176"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14796 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX177"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14797 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX170"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14798 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX171"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14799 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX172"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14800 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX173"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14801 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX174"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14802 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX175"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14803 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX178"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14804 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX179"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14805 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX180"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14806 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX181"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14807 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX310"><CODE>completion-prefix-display-length</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14808 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX311"><CODE>completion-query-items</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14809 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX182"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14810 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX183"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14811 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX312"><CODE>convert-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14812 <TR><TD COLSPAN=3> <HR></TD></TR>
14813 <TR><TH><A NAME="vr_D"></A>D</TH><TD></TD><TD></TD></TR>
14814 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX184"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14815 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX185"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14816 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX313"><CODE>disable-completion</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14817 <TR><TD COLSPAN=3> <HR></TD></TR>
14818 <TR><TH><A NAME="vr_E"></A>E</TH><TD></TD><TD></TD></TR>
14819 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX314"><CODE>editing-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14820 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX186"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14821 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX187"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14822 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX315"><CODE>enable-keypad</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14823 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX188"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14824 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX189"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14825 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX316"><CODE>expand-tilde</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14826 <TR><TD COLSPAN=3> <HR></TD></TR>
14827 <TR><TH><A NAME="vr_F"></A>F</TH><TD></TD><TD></TD></TR>
14828 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX190"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14829 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX191"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14830 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX192"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14831 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX193"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14832 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX194"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14833 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX195"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14834 <TR><TD COLSPAN=3> <HR></TD></TR>
14835 <TR><TH><A NAME="vr_G"></A>G</TH><TD></TD><TD></TD></TR>
14836 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX196"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14837 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX197"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14838 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX198"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14839 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX199"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14840 <TR><TD COLSPAN=3> <HR></TD></TR>
14841 <TR><TH><A NAME="vr_H"></A>H</TH><TD></TD><TD></TD></TR>
14842 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX200"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14843 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX201"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14844 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX202"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14845 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX203"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14846 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX204"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14847 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX205"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14848 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX206"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14849 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX207"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14850 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX208"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14851 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX209"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14852 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX210"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14853 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX211"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14854 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX317"><CODE>history-preserve-point</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14855 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX318"><CODE>history-size</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14856 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX212"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14857 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX213"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14858 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX214"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14859 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX215"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14860 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX114"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14861 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX115"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14862 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX319"><CODE>horizontal-scroll-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14863 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX216"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14864 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX217"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14865 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX218"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14866 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX219"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14867 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX220"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14868 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX221"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14869 <TR><TD COLSPAN=3> <HR></TD></TR>
14870 <TR><TH><A NAME="vr_I"></A>I</TH><TD></TD><TD></TD></TR>
14871 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX116"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14872 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX117"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14873 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX222"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14874 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX223"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14875 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX320"><CODE>input-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14876 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX224"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14877 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX225"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14878 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX322"><CODE>isearch-terminators</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14879 <TR><TD COLSPAN=3> <HR></TD></TR>
14880 <TR><TH><A NAME="vr_K"></A>K</TH><TD></TD><TD></TD></TR>
14881 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX323"><CODE>keymap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14882 <TR><TD COLSPAN=3> <HR></TD></TR>
14883 <TR><TH><A NAME="vr_L"></A>L</TH><TD></TD><TD></TD></TR>
14884 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX226"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14885 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX227"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14886 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX228"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14887 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX229"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14888 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX230"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14889 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX231"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14890 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX232"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14891 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX233"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14892 <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>
14893 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX234"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14894 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX235"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14895 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX236"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14896 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX237"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14897 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX238"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14898 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX239"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14899 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX240"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14900 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX241"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14901 <TR><TD COLSPAN=3> <HR></TD></TR>
14902 <TR><TH><A NAME="vr_M"></A>M</TH><TD></TD><TD></TD></TR>
14903 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX242"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14904 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX243"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14905 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX118"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14906 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX119"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14907 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX244"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14908 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX245"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14909 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX120"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14910 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX121"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14911 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX324"><CODE>mark-modified-lines</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14912 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX325"><CODE>mark-symlinked-directories</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14913 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX326"><CODE>match-hidden-files</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14914 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX321"><CODE>meta-flag</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14915 <TR><TD COLSPAN=3> <HR></TD></TR>
14916 <TR><TH><A NAME="vr_O"></A>O</TH><TD></TD><TD></TD></TR>
14917 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX246"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14918 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX247"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14919 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX122"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14920 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX123"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14921 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX248"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14922 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX249"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14923 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX124"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14924 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX125"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14925 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX250"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14926 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX251"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14927 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX327"><CODE>output-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14928 <TR><TD COLSPAN=3> <HR></TD></TR>
14929 <TR><TH><A NAME="vr_P"></A>P</TH><TD></TD><TD></TD></TR>
14930 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX328"><CODE>page-completions</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14931 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX126"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14932 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX127"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14933 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX252"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14934 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX253"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14935 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX254"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14936 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX255"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14937 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX256"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14938 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX257"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14939 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX258"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14940 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX259"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14941 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX260"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14942 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX261"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14943 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX128"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14944 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX129"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14945 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX130"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14946 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX131"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14947 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX262"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14948 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX263"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14949 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX264"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14950 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX265"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14951 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX266"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14952 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX267"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14953 <TR><TD COLSPAN=3> <HR></TD></TR>
14954 <TR><TH><A NAME="vr_R"></A>R</TH><TD></TD><TD></TD></TR>
14955 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX268"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14956 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX269"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14957 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX270"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14958 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX271"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14959 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX329"><CODE>revert-all-at-newline</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14960 <TR><TD COLSPAN=3> <HR></TD></TR>
14961 <TR><TH><A NAME="vr_S"></A>S</TH><TD></TD><TD></TD></TR>
14962 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX272"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14963 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX273"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14964 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX274"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14965 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX275"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14966 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX276"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14967 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX277"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14968 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX278"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14969 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX279"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14970 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX330"><CODE>show-all-if-ambiguous</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14971 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX331"><CODE>show-all-if-unmodified</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14972 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX332"><CODE>skip-completed-text</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14973 <TR><TD COLSPAN=3> <HR></TD></TR>
14974 <TR><TH><A NAME="vr_T"></A>T</TH><TD></TD><TD></TD></TR>
14975 <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>
14976 <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>
14977 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX280"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14978 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX281"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14979 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX282"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14980 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX283"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14981 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX284"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14982 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX285"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14983 <TR><TD COLSPAN=3> <HR></TD></TR>
14984 <TR><TH><A NAME="vr_U"></A>U</TH><TD></TD><TD></TD></TR>
14985 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX286"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14986 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX287"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14987 <TR><TD COLSPAN=3> <HR></TD></TR>
14988 <TR><TH><A NAME="vr_V"></A>V</TH><TD></TD><TD></TD></TR>
14989 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX333"><CODE>visible-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14990 <TR><TD COLSPAN=3> <HR></TD></TR>
14991 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
14993 <A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
14995 <A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
14997 <A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
14999 <A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
15001 <A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
15003 <A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
15005 <A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
15007 <A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
15010 <A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
15012 <A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
15014 <A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
15016 <A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
15018 <A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
15020 <A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
15022 <A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
15024 <A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
15026 <A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
15028 <A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
15030 <A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
15032 <A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
15034 <A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
15036 <A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
15038 <A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
15040 <A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
15042 <A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
15044 <A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
15046 <A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
15048 </td></tr></table><br><P>
15050 <A NAME="Function Index"></A>
15052 <A NAME="SEC144"></A>
15053 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15054 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> < </A>]</TD>
15055 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> > </A>]</TD>
15056 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> << </A>]</TD>
15057 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
15058 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
15059 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15060 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15061 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15062 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15064 <H2> D.4 Function Index </H2>
15065 <!--docid::SEC144::-->
15066 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
15068 <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
15070 <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
15072 <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
15074 <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
15076 <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
15078 <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
15080 <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
15082 <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
15084 <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
15086 <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
15088 <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
15090 <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
15092 <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
15094 <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
15096 <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
15098 <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
15100 <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
15102 <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
15104 <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
15106 </td></tr></table><br><P></P>
15108 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15109 <TR><TD COLSPAN=3> <HR></TD></TR>
15110 <TR><TH><A NAME="fn_A"></A>A</TH><TD></TD><TD></TD></TR>
15111 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX486"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15112 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX487"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15113 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX354"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15114 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX355"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15115 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX530"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15116 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX531"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15117 <TR><TD COLSPAN=3> <HR></TD></TR>
15118 <TR><TH><A NAME="fn_B"></A>B</TH><TD></TD><TD></TD></TR>
15119 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX340"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15120 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX341"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15121 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX382"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15122 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX383"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15123 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX404"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15124 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX405"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15125 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX416"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15126 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX417"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15127 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX412"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15128 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX413"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15129 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX344"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15130 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX345"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15131 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX360"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15132 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><CODE>beginning-of-history (M-&#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15133 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15134 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15135 <TR><TD COLSPAN=3> <HR></TD></TR>
15136 <TR><TH><A NAME="fn_C"></A>C</TH><TD></TD><TD></TD></TR>
15137 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX482"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15138 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX483"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15139 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX398"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15140 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX399"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15141 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX502"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15142 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX503"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15143 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX504"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15144 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX505"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15145 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX350"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15146 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX351"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15147 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX440"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15148 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX441"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15149 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX468"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15150 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX469"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15151 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX452"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15152 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX453"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15153 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX464"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15154 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX465"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15155 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX476"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15156 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX477"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15157 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX456"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15158 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX457"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15159 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX460"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15160 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX461"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15161 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX428"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15162 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX429"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15163 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX430"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15164 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX431"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15165 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX426"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15166 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX427"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15167 <TR><TD COLSPAN=3> <HR></TD></TR>
15168 <TR><TH><A NAME="fn_D"></A>D</TH><TD></TD><TD></TD></TR>
15169 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX474"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15170 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX475"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15171 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX380"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15172 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX381"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15173 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX450"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15174 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX451"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15175 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX422"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15176 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX423"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15177 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX436"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15178 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15179 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX522"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15180 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX523"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15181 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15182 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15183 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15184 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15185 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15186 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX511"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15187 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX514"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15188 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX515"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15189 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX512"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15190 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX513"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15191 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15192 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15193 <TR><TD COLSPAN=3> <HR></TD></TR>
15194 <TR><TH><A NAME="fn_E"></A>E</TH><TD></TD><TD></TD></TR>
15195 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX538"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15196 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX539"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15197 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX480"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15198 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX481"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15199 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX362"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15200 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><CODE>end-of-history (M-&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15201 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15202 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15203 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15204 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15205 <TR><TD COLSPAN=3> <HR></TD></TR>
15206 <TR><TH><A NAME="fn_F"></A>F</TH><TD></TD><TD></TD></TR>
15207 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX384"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15208 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX385"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15209 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX338"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15210 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX339"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15211 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX366"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15212 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX367"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15213 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX342"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15214 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX343"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15215 <TR><TD COLSPAN=3> <HR></TD></TR>
15216 <TR><TH><A NAME="fn_G"></A>G</TH><TD></TD><TD></TD></TR>
15217 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX516"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15218 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX517"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15219 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX518"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15220 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX519"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15221 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX520"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15222 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX521"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15223 <TR><TD COLSPAN=3> <HR></TD></TR>
15224 <TR><TH><A NAME="fn_H"></A>H</TH><TD></TD><TD></TD></TR>
15225 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX532"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15226 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX533"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15227 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX526"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15228 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX527"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15229 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX374"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15230 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX375"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15231 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX372"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15232 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX373"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15233 <TR><TD COLSPAN=3> <HR></TD></TR>
15234 <TR><TH><A NAME="fn_I"></A>I</TH><TD></TD><TD></TD></TR>
15235 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX508"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15236 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX509"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15237 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX444"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15238 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX445"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15239 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX534"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15240 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX535"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15241 <TR><TD COLSPAN=3> <HR></TD></TR>
15242 <TR><TH><A NAME="fn_K"></A>K</TH><TD></TD><TD></TD></TR>
15243 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX402"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15244 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX403"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15245 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX424"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15246 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX425"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15247 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX408"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15248 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX409"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15249 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX410"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15250 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX411"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15251 <TR><TD COLSPAN=3> <HR></TD></TR>
15252 <TR><TH><A NAME="fn_M"></A>M</TH><TD></TD><TD></TD></TR>
15253 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX528"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15254 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX529"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15255 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX446"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15256 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX447"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15257 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX448"><CODE>menu-complete-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15258 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX449"><CODE>menu-complete-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15259 <TR><TD COLSPAN=3> <HR></TD></TR>
15260 <TR><TH><A NAME="fn_N"></A>N</TH><TD></TD><TD></TD></TR>
15261 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX358"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15262 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX359"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15263 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX370"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15264 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX371"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15265 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX368"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15266 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX369"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15267 <TR><TD COLSPAN=3> <HR></TD></TR>
15268 <TR><TH><A NAME="fn_O"></A>O</TH><TD></TD><TD></TD></TR>
15269 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX536"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15270 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX537"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15271 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX400"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15272 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX401"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15273 <TR><TD COLSPAN=3> <HR></TD></TR>
15274 <TR><TH><A NAME="fn_P"></A>P</TH><TD></TD><TD></TD></TR>
15275 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX470"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15276 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX471"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15277 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX442"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15278 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX443"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15279 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX454"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15280 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX455"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15281 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX466"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15282 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX467"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15283 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX458"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15284 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX459"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15285 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX462"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15286 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX463"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15287 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX490"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15288 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX491"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15289 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX356"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15290 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX357"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15291 <TR><TD COLSPAN=3> <HR></TD></TR>
15292 <TR><TH><A NAME="fn_Q"></A>Q</TH><TD></TD><TD></TD></TR>
15293 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX386"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15294 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX387"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15295 <TR><TD COLSPAN=3> <HR></TD></TR>
15296 <TR><TH><A NAME="fn_R"></A>R</TH><TD></TD><TD></TD></TR>
15297 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX484"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15298 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX485"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15299 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX352"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15300 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX353"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15301 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX364"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15302 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX365"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15303 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX494"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15304 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX495"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15305 <TR><TD COLSPAN=3> <HR></TD></TR>
15306 <TR><TH><A NAME="fn_S"></A>S</TH><TD></TD><TD></TD></TR>
15307 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX388"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15308 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15309 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15310 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15311 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15312 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15313 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX524"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15314 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX525"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15315 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15316 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15317 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15318 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15319 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15320 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15321 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15322 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15323 <TR><TD COLSPAN=3> <HR></TD></TR>
15324 <TR><TH><A NAME="fn_T"></A>T</TH><TD></TD><TD></TD></TR>
15325 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX496"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15326 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><CODE>tilde-expand (M-&#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15327 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15328 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15329 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15330 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15331 <TR><TD COLSPAN=3> <HR></TD></TR>
15332 <TR><TH><A NAME="fn_U"></A>U</TH><TD></TD><TD></TD></TR>
15333 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX492"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15334 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX493"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15335 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX438"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15336 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX439"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15337 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX420"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15338 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX421"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15339 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX406"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15340 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX407"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15341 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX418"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15342 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX419"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15343 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX394"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15344 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX395"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15345 <TR><TD COLSPAN=3> <HR></TD></TR>
15346 <TR><TH><A NAME="fn_Y"></A>Y</TH><TD></TD><TD></TD></TR>
15347 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX432"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15348 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX433"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15349 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX378"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15350 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX379"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15351 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX376"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15352 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX377"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15353 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX434"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15354 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX435"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15355 <TR><TD COLSPAN=3> <HR></TD></TR>
15356 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
15358 <A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
15360 <A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
15362 <A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
15364 <A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
15366 <A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
15368 <A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
15370 <A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
15372 <A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
15374 <A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
15376 <A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
15378 <A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
15380 <A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
15382 <A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
15384 <A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
15386 <A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
15388 <A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
15390 <A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
15392 <A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
15394 <A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
15396 </td></tr></table><br><P>
15398 <A NAME="Concept Index"></A>
15400 <A NAME="SEC145"></A>
15401 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15402 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> < </A>]</TD>
15403 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ > ]</TD>
15404 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[ << ]</TD>
15405 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
15406 <TD VALIGN="MIDDLE" ALIGN="LEFT">[ >> ]</TD>
15407 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15408 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15409 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15410 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15412 <H2> D.5 Concept Index </H2>
15413 <!--docid::SEC145::-->
15414 <table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
15416 <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15418 <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15420 <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15422 <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15424 <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15426 <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15428 <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15430 <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15432 <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15434 <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15436 <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15438 <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15440 <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15442 <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15444 <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15446 <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15448 <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15450 <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15452 <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15454 <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15456 <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15458 </td></tr></table><br><P></P>
15460 <TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15461 <TR><TD COLSPAN=3> <HR></TD></TR>
15462 <TR><TH><A NAME="cp_A"></A>A</TH><TD></TD><TD></TD></TR>
15463 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">alias expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD></TR>
15464 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">arithmetic evaluation</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15465 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">arithmetic expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD></TR>
15466 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">arithmetic, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15467 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC85">arrays</A></TD><TD valign=top><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD></TR>
15468 <TR><TD COLSPAN=3> <HR></TD></TR>
15469 <TR><TH><A NAME="cp_B"></A>B</TH><TD></TD><TD></TD></TR>
15470 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">background</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15471 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">Bash configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15472 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">Bash installation</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15473 <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>
15474 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">brace expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD></TR>
15475 <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>
15476 <TR><TD COLSPAN=3> <HR></TD></TR>
15477 <TR><TH><A NAME="cp_C"></A>C</TH><TD></TD><TD></TD></TR>
15478 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">command editing</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR>
15479 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">command execution</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD></TR>
15480 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC51">command expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A></TD></TR>
15481 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC120">command history</A></TD><TD valign=top><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD></TR>
15482 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">command search</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD></TR>
15483 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC32">command substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD></TR>
15484 <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>
15485 <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>
15486 <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>
15487 <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>
15488 <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>
15489 <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>
15490 <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>
15491 <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>
15492 <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>
15493 <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>
15494 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC118">completion builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
15495 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15496 <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>
15497 <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>
15498 <TR><TD COLSPAN=3> <HR></TD></TR>
15499 <TR><TH><A NAME="cp_D"></A>D</TH><TD></TD><TD></TD></TR>
15500 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC86">directory stack</A></TD><TD valign=top><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD></TR>
15501 <TR><TD COLSPAN=3> <HR></TD></TR>
15502 <TR><TH><A NAME="cp_E"></A>E</TH><TD></TD><TD></TD></TR>
15503 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">editing command lines</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR>
15504 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC54">environment</A></TD><TD valign=top><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD></TR>
15505 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">evaluation, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15506 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">event designators</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD></TR>
15507 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC53">execution environment</A></TD><TD valign=top><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD></TR>
15508 <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>
15509 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC55">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD></TR>
15510 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC28">expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.5 Shell Expansions</A></TD></TR>
15511 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">expansion, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD></TR>
15512 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">expansion, brace</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD></TR>
15513 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX64">expansion, filename</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15514 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">expansion, parameter</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD></TR>
15515 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX65">expansion, pathname</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15516 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">expansion, tilde</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD></TR>
15517 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">expressions, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15518 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC82">expressions, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A></TD></TR>
15519 <TR><TD COLSPAN=3> <HR></TD></TR>
15520 <TR><TH><A NAME="cp_F"></A>F</TH><TD></TD><TD></TD></TR>
15521 <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>
15522 <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>
15523 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX66">filename expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15524 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">foreground</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15525 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">functions, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR>
15526 <TR><TD COLSPAN=3> <HR></TD></TR>
15527 <TR><TH><A NAME="cp_H"></A>H</TH><TD></TD><TD></TD></TR>
15528 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC121">history builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
15529 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX546">history events</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD></TR>
15530 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC122">history expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD></TR>
15531 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC120">history list</A></TD><TD valign=top><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD></TR>
15532 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX543">History, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
15533 <TR><TD COLSPAN=3> <HR></TD></TR>
15534 <TR><TH><A NAME="cp_I"></A>I</TH><TD></TD><TD></TD></TR>
15535 <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>
15536 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC103">initialization file, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD></TR>
15537 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">installation</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15538 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC97">interaction, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD></TR>
15539 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX289">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR>
15540 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC78">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD></TR>
15541 <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>
15542 <TR><TD COLSPAN=3> <HR></TD></TR>
15543 <TR><TH><A NAME="cp_J"></A>J</TH><TD></TD><TD></TD></TR>
15544 <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>
15545 <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>
15546 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15547 <TR><TD COLSPAN=3> <HR></TD></TR>
15548 <TR><TH><A NAME="cp_K"></A>K</TH><TD></TD><TD></TD></TR>
15549 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX305">kill ring</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
15550 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX303">killing text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
15551 <TR><TD COLSPAN=3> <HR></TD></TR>
15552 <TR><TH><A NAME="cp_L"></A>L</TH><TD></TD><TD></TD></TR>
15553 <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>
15554 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX288">login shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR>
15555 <TR><TD COLSPAN=3> <HR></TD></TR>
15556 <TR><TH><A NAME="cp_M"></A>M</TH><TD></TD><TD></TD></TR>
15557 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC37">matching, pattern</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD></TR>
15558 <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>
15559 <TR><TD COLSPAN=3> <HR></TD></TR>
15560 <TR><TH><A NAME="cp_N"></A>N</TH><TD></TD><TD></TD></TR>
15561 <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>
15562 <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>
15563 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">notation, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR>
15564 <TR><TD COLSPAN=3> <HR></TD></TR>
15565 <TR><TH><A NAME="cp_O"></A>O</TH><TD></TD><TD></TD></TR>
15566 <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>
15567 <TR><TD COLSPAN=3> <HR></TD></TR>
15568 <TR><TH><A NAME="cp_P"></A>P</TH><TD></TD><TD></TD></TR>
15569 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">parameter expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD></TR>
15570 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">parameters</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR>
15571 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC26">parameters, positional</A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A></TD></TR>
15572 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC27">parameters, special</A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
15573 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX67">pathname expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15574 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC37">pattern matching</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD></TR>
15575 <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>
15576 <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>
15577 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC90">POSIX Mode</A></TD><TD valign=top><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD></TR>
15578 <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>
15579 <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>
15580 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC34">process substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD></TR>
15581 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC117">programmable completion</A></TD><TD valign=top><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD></TR>
15582 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC88">prompting</A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD></TR>
15583 <TR><TD COLSPAN=3> <HR></TD></TR>
15584 <TR><TH><A NAME="cp_Q"></A>Q</TH><TD></TD><TD></TD></TR>
15585 <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>
15586 <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>
15587 <TR><TD COLSPAN=3> <HR></TD></TR>
15588 <TR><TH><A NAME="cp_R"></A>R</TH><TD></TD><TD></TD></TR>
15589 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX302">Readline, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
15590 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC39">redirection</A></TD><TD valign=top><A HREF="bashref.html#SEC39">3.6 Redirections</A></TD></TR>
15591 <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>
15592 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC89">restricted shell</A></TD><TD valign=top><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD></TR>
15593 <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>
15594 <TR><TD COLSPAN=3> <HR></TD></TR>
15595 <TR><TH><A NAME="cp_S"></A>S</TH><TD></TD><TD></TD></TR>
15596 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">shell arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15597 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">shell function</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR>
15598 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC57">shell script</A></TD><TD valign=top><A HREF="bashref.html#SEC57">3.8 Shell Scripts</A></TD></TR>
15599 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">shell variable</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR>
15600 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC78">shell, interactive</A></TD><TD valign=top><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD></TR>
15601 <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>
15602 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC56">signal handling</A></TD><TD valign=top><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD></TR>
15603 <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>
15604 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC64">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC64">4.4 Special Builtins</A></TD></TR>
15605 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC70">startup files</A></TD><TD valign=top><A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A></TD></TR>
15606 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">suspending jobs</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15607 <TR><TD COLSPAN=3> <HR></TD></TR>
15608 <TR><TH><A NAME="cp_T"></A>T</TH><TD></TD><TD></TD></TR>
15609 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">tilde expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD></TR>
15610 <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>
15611 <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>
15612 <TR><TD COLSPAN=3> <HR></TD></TR>
15613 <TR><TH><A NAME="cp_V"></A>V</TH><TD></TD><TD></TD></TR>
15614 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">variable, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR>
15615 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX306">variables, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
15616 <TR><TD COLSPAN=3> <HR></TD></TR>
15617 <TR><TH><A NAME="cp_W"></A>W</TH><TD></TD><TD></TD></TR>
15618 <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>
15619 <TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC35">word splitting</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A></TD></TR>
15620 <TR><TD COLSPAN=3> <HR></TD></TR>
15621 <TR><TH><A NAME="cp_Y"></A>Y</TH><TD></TD><TD></TD></TR>
15622 <TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX304">yanking text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
15623 <TR><TD COLSPAN=3> <HR></TD></TR>
15624 </TABLE><P></P><table><tr><th valign=top>Jump to: </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
15626 <A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15628 <A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15630 <A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15632 <A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15634 <A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15636 <A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15638 <A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15640 <A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15642 <A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15644 <A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15646 <A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15648 <A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15650 <A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15652 <A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15654 <A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15656 <A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15658 <A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15660 <A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15662 <A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15664 <A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15666 <A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15668 </td></tr></table><br><P>
15671 <A NAME="SEC_Contents"></A>
15672 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15673 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15674 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15675 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15676 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15678 <H1>Table of Contents</H1>
15680 <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
15683 <A NAME="TOC2" HREF="bashref.html#SEC2">1.1 What is Bash?</A>
15685 <A NAME="TOC3" HREF="bashref.html#SEC3">1.2 What is a shell?</A>
15688 <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
15690 <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
15693 <A NAME="TOC6" HREF="bashref.html#SEC6">3.1 Shell Syntax</A>
15696 <A NAME="TOC7" HREF="bashref.html#SEC7">3.1.1 Shell Operation</A>
15698 <A NAME="TOC8" HREF="bashref.html#SEC8">3.1.2 Quoting</A>
15701 <A NAME="TOC9" HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A>
15703 <A NAME="TOC10" HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A>
15705 <A NAME="TOC11" HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A>
15707 <A NAME="TOC12" HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>
15709 <A NAME="TOC13" HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>
15712 <A NAME="TOC14" HREF="bashref.html#SEC14">3.1.3 Comments</A>
15715 <A NAME="TOC15" HREF="bashref.html#SEC15">3.2 Shell Commands</A>
15718 <A NAME="TOC16" HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>
15720 <A NAME="TOC17" HREF="bashref.html#SEC17">3.2.2 Pipelines</A>
15722 <A NAME="TOC18" HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>
15724 <A NAME="TOC19" HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>
15727 <A NAME="TOC20" HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>
15729 <A NAME="TOC21" HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>
15731 <A NAME="TOC22" HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>
15734 <A NAME="TOC23" HREF="bashref.html#SEC23">3.2.5 Coprocesses</A>
15737 <A NAME="TOC24" HREF="bashref.html#SEC24">3.3 Shell Functions</A>
15739 <A NAME="TOC25" HREF="bashref.html#SEC25">3.4 Shell Parameters</A>
15742 <A NAME="TOC26" HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>
15744 <A NAME="TOC27" HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>
15747 <A NAME="TOC28" HREF="bashref.html#SEC28">3.5 Shell Expansions</A>
15750 <A NAME="TOC29" HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>
15752 <A NAME="TOC30" HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>
15754 <A NAME="TOC31" HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>
15756 <A NAME="TOC32" HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>
15758 <A NAME="TOC33" HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>
15760 <A NAME="TOC34" HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>
15762 <A NAME="TOC35" HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>
15764 <A NAME="TOC36" HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>
15767 <A NAME="TOC37" HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>
15770 <A NAME="TOC38" HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>
15773 <A NAME="TOC39" HREF="bashref.html#SEC39">3.6 Redirections</A>
15776 <A NAME="TOC40" HREF="bashref.html#SEC40">3.6.1 Redirecting Input</A>
15778 <A NAME="TOC41" HREF="bashref.html#SEC41">3.6.2 Redirecting Output</A>
15780 <A NAME="TOC42" HREF="bashref.html#SEC42">3.6.3 Appending Redirected Output</A>
15782 <A NAME="TOC43" HREF="bashref.html#SEC43">3.6.4 Redirecting Standard Output and Standard Error</A>
15784 <A NAME="TOC44" HREF="bashref.html#SEC44">3.6.5 Appending Standard Output and Standard Error</A>
15786 <A NAME="TOC45" HREF="bashref.html#SEC45">3.6.6 Here Documents</A>
15788 <A NAME="TOC46" HREF="bashref.html#SEC46">3.6.7 Here Strings</A>
15790 <A NAME="TOC47" HREF="bashref.html#SEC47">3.6.8 Duplicating File Descriptors</A>
15792 <A NAME="TOC48" HREF="bashref.html#SEC48">3.6.9 Moving File Descriptors</A>
15794 <A NAME="TOC49" HREF="bashref.html#SEC49">3.6.10 Opening File Descriptors for Reading and Writing</A>
15797 <A NAME="TOC50" HREF="bashref.html#SEC50">3.7 Executing Commands</A>
15800 <A NAME="TOC51" HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A>
15802 <A NAME="TOC52" HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A>
15804 <A NAME="TOC53" HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>
15806 <A NAME="TOC54" HREF="bashref.html#SEC54">3.7.4 Environment</A>
15808 <A NAME="TOC55" HREF="bashref.html#SEC55">3.7.5 Exit Status</A>
15810 <A NAME="TOC56" HREF="bashref.html#SEC56">3.7.6 Signals</A>
15813 <A NAME="TOC57" HREF="bashref.html#SEC57">3.8 Shell Scripts</A>
15816 <A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>
15819 <A NAME="TOC59" HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>
15821 <A NAME="TOC60" HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>
15823 <A NAME="TOC61" HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A>
15826 <A NAME="TOC62" HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>
15828 <A NAME="TOC63" HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
15831 <A NAME="TOC64" HREF="bashref.html#SEC64">4.4 Special Builtins</A>
15834 <A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A>
15837 <A NAME="TOC66" HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A>
15839 <A NAME="TOC67" HREF="bashref.html#SEC67">5.2 Bash Variables</A>
15842 <A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A>
15845 <A NAME="TOC69" HREF="bashref.html#SEC69">6.1 Invoking Bash</A>
15847 <A NAME="TOC70" HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>
15849 <A NAME="TOC78" HREF="bashref.html#SEC78">6.3 Interactive Shells</A>
15852 <A NAME="TOC79" HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A>
15854 <A NAME="TOC80" HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A>
15856 <A NAME="TOC81" HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A>
15859 <A NAME="TOC82" HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>
15861 <A NAME="TOC83" HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>
15863 <A NAME="TOC84" HREF="bashref.html#SEC84">6.6 Aliases</A>
15865 <A NAME="TOC85" HREF="bashref.html#SEC85">6.7 Arrays</A>
15867 <A NAME="TOC86" HREF="bashref.html#SEC86">6.8 The Directory Stack</A>
15870 <A NAME="TOC87" HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>
15873 <A NAME="TOC88" HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>
15875 <A NAME="TOC89" HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>
15877 <A NAME="TOC90" HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>
15880 <A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A>
15883 <A NAME="TOC92" HREF="bashref.html#SEC92">7.1 Job Control Basics</A>
15885 <A NAME="TOC93" HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>
15887 <A NAME="TOC94" HREF="bashref.html#SEC94">7.3 Job Control Variables</A>
15890 <A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A>
15893 <A NAME="TOC96" HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A>
15895 <A NAME="TOC97" HREF="bashref.html#SEC97">8.2 Readline Interaction</A>
15898 <A NAME="TOC98" HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A>
15900 <A NAME="TOC99" HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A>
15902 <A NAME="TOC100" HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A>
15904 <A NAME="TOC101" HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A>
15906 <A NAME="TOC102" HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>
15909 <A NAME="TOC103" HREF="bashref.html#SEC103">8.3 Readline Init File</A>
15912 <A NAME="TOC104" HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A>
15914 <A NAME="TOC105" HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>
15916 <A NAME="TOC106" HREF="bashref.html#SEC106">8.3.3 Sample Init File</A>
15919 <A NAME="TOC107" HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A>
15922 <A NAME="TOC108" HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A>
15924 <A NAME="TOC109" HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>
15926 <A NAME="TOC110" HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A>
15928 <A NAME="TOC111" HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A>
15930 <A NAME="TOC112" HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A>
15932 <A NAME="TOC113" HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>
15934 <A NAME="TOC114" HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A>
15936 <A NAME="TOC115" HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A>
15939 <A NAME="TOC116" HREF="bashref.html#SEC116">8.5 Readline vi Mode</A>
15941 <A NAME="TOC117" HREF="bashref.html#SEC117">8.6 Programmable Completion</A>
15943 <A NAME="TOC118" HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>
15946 <A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A>
15949 <A NAME="TOC120" HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>
15951 <A NAME="TOC121" HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>
15953 <A NAME="TOC122" HREF="bashref.html#SEC122">9.3 History Expansion</A>
15956 <A NAME="TOC123" HREF="bashref.html#SEC123">9.3.1 Event Designators</A>
15958 <A NAME="TOC124" HREF="bashref.html#SEC124">9.3.2 Word Designators</A>
15960 <A NAME="TOC125" HREF="bashref.html#SEC125">9.3.3 Modifiers</A>
15964 <A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A>
15967 <A NAME="TOC127" HREF="bashref.html#SEC127">10.1 Basic Installation</A>
15969 <A NAME="TOC128" HREF="bashref.html#SEC128">10.2 Compilers and Options</A>
15971 <A NAME="TOC129" HREF="bashref.html#SEC129">10.3 Compiling For Multiple Architectures</A>
15973 <A NAME="TOC130" HREF="bashref.html#SEC130">10.4 Installation Names</A>
15975 <A NAME="TOC131" HREF="bashref.html#SEC131">10.5 Specifying the System Type</A>
15977 <A NAME="TOC132" HREF="bashref.html#SEC132">10.6 Sharing Defaults</A>
15979 <A NAME="TOC133" HREF="bashref.html#SEC133">10.7 Operation Controls</A>
15981 <A NAME="TOC134" HREF="bashref.html#SEC134">10.8 Optional Features</A>
15984 <A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A>
15986 <A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A>
15989 <A NAME="TOC137" HREF="bashref.html#SEC137">B.1 Implementation Differences From The SVR4.2 Shell</A>
15992 <A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A>
15994 <A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A>
15997 <A NAME="TOC141" HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A>
15999 <A NAME="TOC142" HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A>
16001 <A NAME="TOC143" HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A>
16003 <A NAME="TOC144" HREF="bashref.html#SEC144">D.4 Function Index</A>
16005 <A NAME="TOC145" HREF="bashref.html#SEC145">D.5 Concept Index</A>
16010 <A NAME="SEC_OVERVIEW"></A>
16011 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16012 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16013 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16014 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
16015 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16017 <H1>Short Table of Contents</H1>
16019 <A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
16021 <A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
16023 <A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
16025 <A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>
16027 <A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A>
16029 <A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A>
16031 <A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A>
16033 <A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A>
16035 <A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A>
16037 <A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A>
16039 <A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A>
16041 <A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A>
16043 <A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A>
16045 <A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A>
16050 <A NAME="SEC_About"></A>
16051 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16052 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16053 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16054 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
16055 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16057 <H1>About this document</H1>
16058 This document was generated by <I>Chet Ramey</I> on <I>December, 29 2009</I>
16059 using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
16060 "><I>texi2html</I></A>
16062 The buttons in the navigation panels have the following meaning:
16064 <table border = "1">
16069 <TH> From 1.2.3 go to</TH>
16072 <TD ALIGN="CENTER">
16074 <TD ALIGN="CENTER">
16078 previous section in reading order
16085 <TD ALIGN="CENTER">
16087 <TD ALIGN="CENTER">
16091 next section in reading order
16098 <TD ALIGN="CENTER">
16100 <TD ALIGN="CENTER">
16104 previous or up-and-previous section
16111 <TD ALIGN="CENTER">
16113 <TD ALIGN="CENTER">
16124 <TD ALIGN="CENTER">
16126 <TD ALIGN="CENTER">
16130 next or up-and-next section
16137 <TD ALIGN="CENTER">
16139 <TD ALIGN="CENTER">
16143 cover (top) of document
16150 <TD ALIGN="CENTER">
16152 <TD ALIGN="CENTER">
16163 <TD ALIGN="CENTER">
16165 <TD ALIGN="CENTER">
16176 <TD ALIGN="CENTER">
16178 <TD ALIGN="CENTER">
16190 where the <STRONG> Example </STRONG> assumes that the current position
16191 is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
16192 the following structure:
16194 <LI> 1. Section One </LI>
16196 <LI>1.1 Subsection One-One</LI>
16200 <LI>1.2 Subsection One-Two</LI>
16202 <LI>1.2.1 Subsubsection One-Two-One
16203 </LI><LI>1.2.2 Subsubsection One-Two-Two
16204 </LI><LI>1.2.3 Subsubsection One-Two-Three <STRONG>
16205 <== Current Position </STRONG>
16206 </LI><LI>1.2.4 Subsubsection One-Two-Four
16208 <LI>1.3 Subsection One-Three</LI>
16212 <LI>1.4 Subsection One-Four</LI>
16219 This document was generated
16220 by <I>Chet Ramey</I> on <I>December, 29 2009</I>
16221 using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
16222 "><I>texi2html</I></A>