]> git.ipfire.org Git - thirdparty/bash.git/blame - doc/bashref.html
Imported from ../bash-4.0.tar.gz.
[thirdparty/bash.git] / doc / bashref.html
CommitLineData
17345e5a
JA
1<HTML>
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3<!-- Created on February, 5 2009 by texi2html 1.64 -->
4<!--
5Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
8 and many others.
9Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
11
12-->
13<HEAD>
14<TITLE>Bash Reference Manual: </TITLE>
15
16<META NAME="description" CONTENT="Bash Reference Manual: ">
17<META NAME="keywords" CONTENT="Bash Reference Manual: ">
18<META NAME="resource-type" CONTENT="document">
19<META NAME="distribution" CONTENT="global">
20<META NAME="Generator" CONTENT="texi2html 1.64">
21
22</HEAD>
23
24<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
25
26<A NAME="SEC_Top"></A>
27<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
28<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
29<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
30<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
31<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
32</TR></TABLE>
33<H1>Bash Reference Manual</H1></P><P>
34
35This text is a brief description of the features that are present in
36the Bash shell (version 4.0, 29 December 2008).
37</P><P>
38
39This is Edition 4.0, last updated 29 December 2008,
40of <CITE>The GNU Bash Reference Manual</CITE>,
41for <CODE>Bash</CODE>, Version 4.0.
42</P><P>
43
44Bash contains features that appear in other popular shells, and some
45features that only appear in Bash. Some of the shells that Bash has
46borrowed 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
49categories based upon which one of these other shells inspired the
50feature.
51</P><P>
52
53This manual is meant as a brief introduction to features found in
54Bash. The Bash manual page should be used as the definitive
55reference on shell behavior.
56</P><P>
57
58<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
59<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC1">1. Introduction</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">An introduction to the shell.</TD></TR>
60<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC4">2. Definitions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Some definitions used in the rest of this
61 manual.</TD></TR>
62<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The shell "building blocks".</TD></TR>
63<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands that are a part of the shell.</TD></TR>
64<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC65">5. Shell Variables</A></TD><TD>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What job control is and how Bash allows you
67 to use it.</TD></TR>
68<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC95">8. Command Line Editing</A></TD><TD>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Various indexes for this manual.</TD></TR>
78</TABLE></BLOCKQUOTE>
79<P>
80
81<HR SIZE=1>
82<A NAME="SEC1"></A>
83<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
84<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> &lt; </A>]</TD>
85<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> &gt; </A>]</TD>
86<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</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"> &gt;&gt; </A>]</TD>
89<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
93</TR></TABLE>
94<A NAME="Introduction"></A>
95<H1> 1. Introduction </H1>
96<!--docid::SEC1::-->
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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A brief introduction to shells.</TD></TR>
100</TABLE></BLOCKQUOTE>
101<P>
102
103<A NAME="What is Bash?"></A>
104<HR SIZE="6">
105<A NAME="SEC2"></A>
106<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
107<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC1"> &lt; </A>]</TD>
108<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> &gt; </A>]</TD>
109<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</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"> &gt;&gt; </A>]</TD>
112<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
116</TR></TABLE>
117<H2> 1.1 What is Bash? </H2>
118<!--docid::SEC2::-->
119<P>
120
121Bash is the shell, or command language interpreter,
122for the GNU operating system.
123The name is an acronym for the <SAMP>`Bourne-Again SHell'</SAMP>,
124a pun on Stephen Bourne, the author of the direct ancestor of
125the current Unix shell <CODE>sh</CODE>,
126which appeared in the Seventh Edition Bell Labs Research version
127of Unix.
128</P><P>
129
130Bash is largely compatible with <CODE>sh</CODE> and incorporates useful
131features from the Korn shell <CODE>ksh</CODE> and the C shell <CODE>csh</CODE>.
132It is intended to be a conformant implementation of the IEEE
133POSIX Shell and Tools portion of the IEEE POSIX
134specification (IEEE Standard 1003.1).
135It offers functional improvements over <CODE>sh</CODE> for both interactive and
136programming use.
137</P><P>
138
139While the GNU operating system provides other shells, including
140a version of <CODE>csh</CODE>, Bash is the default shell.
141Like other GNU software, Bash is quite portable. It currently runs
142on nearly every version of Unix and a few other operating systems -
143independently-supported ports exist for MS-DOS, OS/2,
144and Windows platforms.
145</P><P>
146
147<A NAME="What is a shell?"></A>
148<HR SIZE="6">
149<A NAME="SEC3"></A>
150<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
151<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC2"> &lt; </A>]</TD>
152<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &gt; </A>]</TD>
153<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</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"> &gt;&gt; </A>]</TD>
156<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
160</TR></TABLE>
161<H2> 1.2 What is a shell? </H2>
162<!--docid::SEC3::-->
163<P>
164
165At its base, a shell is simply a macro processor that executes
166commands. The term macro processor means functionality where text
167and symbols are expanded to create larger expressions.
168</P><P>
169
170A Unix shell is both a command interpreter and a programming
171language. As a command interpreter, the shell provides the user
172interface to the rich set of GNU utilities. The programming
173language features allow these utilities to be combined.
174Files containing commands can be created, and become
175commands themselves. These new commands have the same status as
176system commands in directories such as <TT>`/bin'</TT>, allowing users
177or groups to establish custom environments to automate their common
178tasks.
179</P><P>
180
181Shells may be used interactively or non-interactively. In
182interactive mode, they accept input typed from the keyboard.
183When executing non-interactively, shells execute commands read
184from a file.
185</P><P>
186
187A shell allows execution of GNU commands, both synchronously and
188asynchronously.
189The shell waits for synchronous commands to complete before accepting
190more input; asynchronous commands continue to execute in parallel
191with the shell while it reads and executes additional commands.
192The <EM>redirection</EM> constructs permit
193fine-grained control of the input and output of those commands.
194Moreover, the shell allows control over the contents of commands'
195environments.
196</P><P>
197
198Shells also provide a small set of built-in
199commands (<EM>builtins</EM>) implementing functionality impossible
200or inconvenient to obtain via separate utilities.
201For example, <CODE>cd</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, and
202<CODE>exec</CODE>) cannot be implemented outside of the shell because
203they directly manipulate the shell itself.
204The <CODE>history</CODE>, <CODE>getopts</CODE>, <CODE>kill</CODE>, or <CODE>pwd</CODE>
205builtins, among others, could be implemented in separate utilities,
206but they are more convenient to use as builtin commands.
207All of the shell builtins are described in
208subsequent sections.
209</P><P>
210
211While executing commands is essential, most of the power (and
212complexity) of shells is due to their embedded programming
213languages. Like any high-level language, the shell provides
214variables, flow control constructs, quoting, and functions.
215</P><P>
216
217Shells offer features geared specifically for
218interactive use rather than to augment the programming language.
219These interactive features include job control, command line
220editing, command history and aliases. Each of these features is
221described in this manual.
222</P><P>
223
224<A NAME="Definitions"></A>
225<HR SIZE="6">
226<A NAME="SEC4"></A>
227<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
228<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC3"> &lt; </A>]</TD>
229<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &gt; </A>]</TD>
230<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
233<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
237</TR></TABLE>
238<H1> 2. Definitions </H1>
239<!--docid::SEC4::-->
240These definitions are used throughout the remainder of this manual.
241<P>
242
243<DL COMPACT>
244
245<DT><CODE>POSIX</CODE>
246<DD><A NAME="IDX1"></A>
247A family of open system standards based on Unix. Bash
248is primarily concerned with the Shell and Utilities portion of the
249POSIX 1003.1 standard.
250<P>
251
252<DT><CODE>blank</CODE>
253<DD>A space or tab character.
254<P>
255
256<DT><CODE>builtin</CODE>
257<DD><A NAME="IDX2"></A>
258A command that is implemented internally by the shell itself, rather
259than by an executable program somewhere in the file system.
260<P>
261
262<DT><CODE>control operator</CODE>
263<DD><A NAME="IDX3"></A>
264A <CODE>token</CODE> that performs a control function. It is a <CODE>newline</CODE>
265or one of the following:
266<SAMP>`||'</SAMP>, <SAMP>`&#38;&#38;'</SAMP>, <SAMP>`&#38;'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`;;'</SAMP>,
267<SAMP>`|'</SAMP>, <SAMP>`|&#38;'</SAMP>, <SAMP>`('</SAMP>, or <SAMP>`)'</SAMP>.
268<P>
269
270<DT><CODE>exit status</CODE>
271<DD><A NAME="IDX4"></A>
272The value returned by a command to its caller. The value is restricted
273to eight bits, so the maximum value is 255.
274<P>
275
276<DT><CODE>field</CODE>
277<DD><A NAME="IDX5"></A>
278A unit of text that is the result of one of the shell expansions. After
279expansion, when executing a command, the resulting fields are used as
280the command name and arguments.
281<P>
282
283<DT><CODE>filename</CODE>
284<DD><A NAME="IDX6"></A>
285A string of characters used to identify a file.
286<P>
287
288<DT><CODE>job</CODE>
289<DD><A NAME="IDX7"></A>
290A set of processes comprising a pipeline, and any processes descended
291from it, that are all in the same process group.
292<P>
293
294<DT><CODE>job control</CODE>
295<DD><A NAME="IDX8"></A>
296A mechanism by which users can selectively stop (suspend) and restart
297(resume) execution of processes.
298<P>
299
300<DT><CODE>metacharacter</CODE>
301<DD><A NAME="IDX9"></A>
302A character that, when unquoted, separates words. A metacharacter is
303a <CODE>blank</CODE> or one of the following characters:
304<SAMP>`|'</SAMP>, <SAMP>`&#38;'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`('</SAMP>, <SAMP>`)'</SAMP>, <SAMP>`&#60;'</SAMP>, or
305<SAMP>`&#62;'</SAMP>.
306<P>
307
308<DT><CODE>name</CODE>
309<DD><A NAME="IDX10"></A>
310<A NAME="IDX11"></A>
311A <CODE>word</CODE> consisting solely of letters, numbers, and underscores,
312and beginning with a letter or underscore. <CODE>Name</CODE>s are used as
313shell variable and function names.
314Also referred to as an <CODE>identifier</CODE>.
315<P>
316
317<DT><CODE>operator</CODE>
318<DD><A NAME="IDX12"></A>
319A <CODE>control operator</CODE> or a <CODE>redirection operator</CODE>.
320See section <A HREF="bashref.html#SEC39">3.6 Redirections</A>, for a list of redirection operators.
321Operators contain at least one unquoted <CODE>metacharacter</CODE>.
322<P>
323
324<DT><CODE>process group</CODE>
325<DD><A NAME="IDX13"></A>
326A collection of related processes each having the same process
327group ID.
328<P>
329
330<DT><CODE>process group ID</CODE>
331<DD><A NAME="IDX14"></A>
332A unique identifier that represents a <CODE>process group</CODE>
333during its lifetime.
334<P>
335
336<DT><CODE>reserved word</CODE>
337<DD><A NAME="IDX15"></A>
338A <CODE>word</CODE> that has a special meaning to the shell. Most reserved
339words introduce shell flow control constructs, such as <CODE>for</CODE> and
340<CODE>while</CODE>.
341<P>
342
343<DT><CODE>return status</CODE>
344<DD><A NAME="IDX16"></A>
345A synonym for <CODE>exit status</CODE>.
346<P>
347
348<DT><CODE>signal</CODE>
349<DD><A NAME="IDX17"></A>
350A mechanism by which a process may be notified by the kernel
351of an event occurring in the system.
352<P>
353
354<DT><CODE>special builtin</CODE>
355<DD><A NAME="IDX18"></A>
356A shell builtin command that has been classified as special by the
357POSIX standard.
358<P>
359
360<DT><CODE>token</CODE>
361<DD><A NAME="IDX19"></A>
362A sequence of characters considered a single unit by the shell.
363It is either a <CODE>word</CODE> or an <CODE>operator</CODE>.
364<P>
365
366<DT><CODE>word</CODE>
367<DD><A NAME="IDX20"></A>
368A sequence of characters treated as a unit by the shell.
369Words may not include unquoted <CODE>metacharacters</CODE>.
370</DL>
371<P>
372
373<A NAME="Basic Shell Features"></A>
374<HR SIZE="6">
375<A NAME="SEC5"></A>
376<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
377<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &lt; </A>]</TD>
378<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> &gt; </A>]</TD>
379<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
382<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
386</TR></TABLE>
387<H1> 3. Basic Shell Features </H1>
388<!--docid::SEC5::-->
389<P>
390
391Bash is an acronym for <SAMP>`Bourne-Again SHell'</SAMP>.
392The Bourne shell is
393the traditional Unix shell originally written by Stephen Bourne.
394All of the Bourne shell builtin commands are available in Bash,
395The rules for evaluation and quoting are taken from the POSIX
396specification for the `standard' Unix shell.
397</P><P>
398
399This chapter briefly summarizes the shell's `building blocks':
400commands, control structures, shell functions, shell <I>parameters</I>,
401shell expansions,
402<I>redirections</I>, which are a way to direct input and output from
403and to named files, and how the shell executes commands.
404</P><P>
405
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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Executing files of shell commands.</TD></TR>
416</TABLE></BLOCKQUOTE>
417<P>
418
419<A NAME="Shell Syntax"></A>
420<HR SIZE="6">
421<A NAME="SEC6"></A>
422<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
423<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt; </A>]</TD>
424<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> &gt; </A>]</TD>
425<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
428<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
432</TR></TABLE>
433<H2> 3.1 Shell Syntax </H2>
434<!--docid::SEC6::-->
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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify comments.</TD></TR>
439</TABLE></BLOCKQUOTE>
440<P>
441
442When the shell reads input, it proceeds through a
443sequence of operations. If the input indicates the beginning of a
444comment, the shell ignores the comment symbol (<SAMP>`#'</SAMP>), and the rest
445of that line.
446
447Otherwise, roughly speaking, the shell reads its input and
448divides the input into words and operators, employing the quoting rules
449to select which meanings to assign various words and characters.
450</P><P>
451
452The shell then parses these tokens into commands and other constructs,
453removes the special meaning of certain words or characters, expands
454others, redirects input and output as needed, executes the specified
455command, waits for the command's exit status, and makes that exit status
456available for further inspection or processing.
457</P><P>
458
459<A NAME="Shell Operation"></A>
460<HR SIZE="6">
461<A NAME="SEC7"></A>
462<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
463<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> &lt; </A>]</TD>
464<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> &gt; </A>]</TD>
465<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
468<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
472</TR></TABLE>
473<H3> 3.1.1 Shell Operation </H3>
474<!--docid::SEC7::-->
475<P>
476
477The following is a brief description of the shell's operation when it
478reads and executes a command. Basically, the shell does the
479following:
480</P><P>
481
482<OL>
483<LI>
484Reads its input from a file (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), from a string
485supplied 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.
487<P>
488
489<LI>
490Breaks the input into words and operators, obeying the quoting rules
491described 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>).
494<P>
495
496<LI>
497Parses the tokens into simple and compound commands
498(see section <A HREF="bashref.html#SEC15">3.2 Shell Commands</A>).
499<P>
500
501<LI>
502Performs the various shell expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>), breaking
503the expanded tokens into lists of filenames (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>)
504and commands and arguments.
505<P>
506
507<LI>
508Performs any necessary redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) and removes
509the redirection operators and their operands from the argument list.
510<P>
511
512<LI>
513Executes the command (see section <A HREF="bashref.html#SEC50">3.7 Executing Commands</A>).
514<P>
515
516<LI>
517Optionally waits for the command to complete and collects its exit
518status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>).
519<P>
520
521</OL>
522<P>
523
524<A NAME="Quoting"></A>
525<HR SIZE="6">
526<A NAME="SEC8"></A>
527<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
528<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC7"> &lt; </A>]</TD>
529<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> &gt; </A>]</TD>
530<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
533<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
537</TR></TABLE>
538<H3> 3.1.2 Quoting </H3>
539<!--docid::SEC8::-->
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>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to remove the special meaning from a single
542 character.</TD></TR>
543<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to inhibit all interpretation of a sequence
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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to translate strings into different languages.</TD></TR>
549</TABLE></BLOCKQUOTE>
550<P>
551
552Quoting is used to remove the special meaning of certain
553characters or words to the shell. Quoting can be used to
554disable special treatment for special characters, to prevent
555reserved words from being recognized as such, and to prevent
556parameter expansion.
557</P><P>
558
559Each of the shell metacharacters (see section <A HREF="bashref.html#SEC4">2. Definitions</A>)
560has special meaning to the shell and must be quoted if it is to
561represent itself.
562When 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
565to prevent history expansion. See section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>, for
566more details concerning history expansion.
567</P><P>
568
569There are three quoting mechanisms: the
570<VAR>escape character</VAR>, single quotes, and double quotes.
571</P><P>
572
573<A NAME="Escape Character"></A>
574<HR SIZE="6">
575<A NAME="SEC9"></A>
576<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
577<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> &lt; </A>]</TD>
578<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> &gt; </A>]</TD>
579<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
582<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
586</TR></TABLE>
587<H4> 3.1.2.1 Escape Character </H4>
588<!--docid::SEC9::-->
589A non-quoted backslash <SAMP>`\'</SAMP> is the Bash escape character.
590It preserves the literal value of the next character that follows,
591with the exception of <CODE>newline</CODE>. If a <CODE>\newline</CODE> pair
592appears, and the backslash itself is not quoted, the <CODE>\newline</CODE>
593is treated as a line continuation (that is, it is removed from
594the input stream and effectively ignored).
595<P>
596
597<A NAME="Single Quotes"></A>
598<HR SIZE="6">
599<A NAME="SEC10"></A>
600<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
601<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC9"> &lt; </A>]</TD>
602<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> &gt; </A>]</TD>
603<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
606<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
610</TR></TABLE>
611<H4> 3.1.2.2 Single Quotes </H4>
612<!--docid::SEC10::-->
613<P>
614
615Enclosing characters in single quotes (<SAMP>`''</SAMP>) preserves the literal value
616of each character within the quotes. A single quote may not occur
617between single quotes, even when preceded by a backslash.
618</P><P>
619
620<A NAME="Double Quotes"></A>
621<HR SIZE="6">
622<A NAME="SEC11"></A>
623<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
624<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC10"> &lt; </A>]</TD>
625<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> &gt; </A>]</TD>
626<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
629<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
633</TR></TABLE>
634<H4> 3.1.2.3 Double Quotes </H4>
635<!--docid::SEC11::-->
636<P>
637
638Enclosing characters in double quotes (<SAMP>`"'</SAMP>) preserves the literal value
639of all characters within the quotes, with the exception of
640<SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`\'</SAMP>,
641and, when history expansion is enabled, <SAMP>`!'</SAMP>.
642The characters <SAMP>`$'</SAMP> and <SAMP>``'</SAMP>
643retain their special meaning within double quotes (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
644The backslash retains its special meaning only when followed by one of
645the following characters:
646<SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`"'</SAMP>, <SAMP>`\'</SAMP>, or <CODE>newline</CODE>.
647Within double quotes, backslashes that are followed by one of these
648characters are removed. Backslashes preceding characters without a
649special meaning are left unmodified.
650A double quote may be quoted within double quotes by preceding it with
651a backslash.
652If enabled, history expansion will be performed unless an <SAMP>`!'</SAMP>
653appearing in double quotes is escaped using a backslash.
654The backslash preceding the <SAMP>`!'</SAMP> is not removed.
655</P><P>
656
657The special parameters <SAMP>`*'</SAMP> and <SAMP>`@'</SAMP> have special meaning
658when in double quotes (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
659</P><P>
660
661<A NAME="ANSI-C Quoting"></A>
662<HR SIZE="6">
663<A NAME="SEC12"></A>
664<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
665<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC11"> &lt; </A>]</TD>
666<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> &gt; </A>]</TD>
667<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> &lt;&lt; </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"> &gt;&gt; </A>]</TD>
670<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
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>
674</TR></TABLE>
675<H4> 3.1.2.4 ANSI-C Quoting </H4>
676<!--docid::SEC12::-->
677<P>
678
679Words of the form <CODE>$'<VAR>string</VAR>'</CODE> are treated specially. The
680word expands to <VAR>string</VAR>, with backslash-escaped characters replaced
681as specified by the ANSI C standard. Backslash escape sequences, if
682present, are decoded as follows:
683</P><P>
684
685<DL COMPACT>
686<DT><CODE>\a</CODE>
687<DD>alert (bell)
688<DT><CODE>\b</CODE>
689<DD>backspace
690<DT><CODE>\e</CODE>
691<DD>an escape character (not ANSI C)
692<DT><CODE>\f</CODE>
693<DD>form feed
694<DT><CODE>\n</CODE>
695<DD>newline
696<DT><CODE>\r</CODE>
697<DD>carriage return
698<DT><CODE>\t</CODE>
699<DD>horizontal tab
700<DT><CODE>\v</CODE>
701<DD>vertical tab
702<DT><CODE>\\</CODE>
703<DD>backslash
704<DT><CODE>\'</CODE>
705<DD>single quote
706<DT><CODE>\<VAR>nnn</VAR></CODE>
707<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
708(one to three digits)
709<DT><CODE>\x<VAR>HH</VAR></CODE>
710<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
711(one or two hex digits)
712<DT><CODE>\c<VAR>x</VAR></CODE>
713<DD>a control-<VAR>x</VAR> character
714</DL>
715<P>
716
717The expanded result is single-quoted, as if the dollar sign had not
718been present.
719</P><P>
720
721<A NAME="Locale Translation"></A>
722<HR SIZE="6">
723<A NAME="SEC13"></A>
724<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
725<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> &lt; </A>]</TD>
726<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt; </A>]</TD>
727<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt;&lt; </A>]</TD>
728<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
729<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
730<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
731<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
732<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
733<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
734</TR></TABLE>
735<H4> 3.1.2.5 Locale-Specific Translation </H4>
736<!--docid::SEC13::-->
737<P>
738
739A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause
740the string to be translated according to the current locale.
741If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign
742is ignored.
743If the string is translated and replaced, the replacement is
744double-quoted.
745</P><P>
746
747<A NAME="IDX21"></A>
748<A NAME="IDX22"></A>
749<A NAME="IDX23"></A>
750Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE>
751shell variable. Others create the name of the message catalog from the
752value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a
753suffix of <SAMP>`.mo'</SAMP>. If you use the <CODE>TEXTDOMAIN</CODE> variable, you
754may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of
755the message catalog files. Still others use both variables in this
756fashion:
757<CODE>TEXTDOMAINDIR</CODE>/<CODE>LC_MESSAGES</CODE>/LC_MESSAGES/<CODE>TEXTDOMAIN</CODE>.mo.
758</P><P>
759
760<A NAME="Comments"></A>
761<HR SIZE="6">
762<A NAME="SEC14"></A>
763<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
764<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> &lt; </A>]</TD>
765<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt; </A>]</TD>
766<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
767<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
768<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt;&gt; </A>]</TD>
769<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
771<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
772<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
773</TR></TABLE>
774<H3> 3.1.3 Comments </H3>
775<!--docid::SEC14::-->
776<P>
777
778In a non-interactive shell, or an interactive shell in which the
779<CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE>
780builtin is enabled (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>),
781a word beginning with <SAMP>`#'</SAMP>
782causes that word and all remaining characters on that line to
783be ignored. An interactive shell without the <CODE>interactive_comments</CODE>
784option enabled does not allow comments. The <CODE>interactive_comments</CODE>
785option is on by default in interactive shells.
786See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for a description of what makes
787a shell interactive.
788</P><P>
789
790<A NAME="Shell Commands"></A>
791<HR SIZE="6">
792<A NAME="SEC15"></A>
793<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
794<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt; </A>]</TD>
795<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> &gt; </A>]</TD>
796<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt;&lt; </A>]</TD>
797<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
798<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
799<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
800<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
801<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
802<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
803</TR></TABLE>
804<H2> 3.2 Shell Commands </H2>
805<!--docid::SEC15::-->
806<P>
807
808A simple shell command such as <CODE>echo a b c</CODE> consists of the command
809itself followed by arguments, separated by spaces.
810</P><P>
811
812More complex shell commands are composed of simple commands arranged together
813in a variety of ways: in a pipeline in which the output of one command
814becomes the input of a second, in a loop or conditional construct, or in
815some other grouping.
816</P><P>
817
818<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
819<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The most common type of command.</TD></TR>
820<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Connecting the input and output of several
821 commands.</TD></TR>
822<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to execute commands sequentially.</TD></TR>
823<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for control flow.</TD></TR>
824<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Two-way communication between commands.</TD></TR>
825</TABLE></BLOCKQUOTE>
826<P>
827
828<A NAME="Simple Commands"></A>
829<HR SIZE="6">
830<A NAME="SEC16"></A>
831<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
832<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &lt; </A>]</TD>
833<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> &gt; </A>]</TD>
834<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt;&lt; </A>]</TD>
835<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
836<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
837<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
838<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
839<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
840<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
841</TR></TABLE>
842<H3> 3.2.1 Simple Commands </H3>
843<!--docid::SEC16::-->
844<P>
845
846A simple command is the kind of command encountered most often.
847It's just a sequence of words separated by <CODE>blank</CODE>s, terminated
848by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>). The
849first word generally specifies a command to be executed, with the
850rest of the words being that command's arguments.
851</P><P>
852
853The return status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>) of a simple command is
854its exit status as provided
855by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if
856the command was terminated by signal <VAR>n</VAR>.
857</P><P>
858
859<A NAME="Pipelines"></A>
860<HR SIZE="6">
861<A NAME="SEC17"></A>
862<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
863<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> &lt; </A>]</TD>
864<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &gt; </A>]</TD>
865<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &lt;&lt; </A>]</TD>
866<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
867<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
868<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
869<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
870<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
871<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
872</TR></TABLE>
873<H3> 3.2.2 Pipelines </H3>
874<!--docid::SEC17::-->
875<P>
876
877A <CODE>pipeline</CODE> is a sequence of simple commands separated by one of
878the control operators <SAMP>`|'</SAMP> or <SAMP>`|&#38;'</SAMP>.
879</P><P>
880
881<A NAME="IDX24"></A>
882<A NAME="IDX25"></A>
883<A NAME="IDX26"></A>
884The format for a pipeline is
885<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<CODE>time</CODE> [<CODE>-p</CODE>]] [<CODE>!</CODE>] <VAR>command1</VAR> [ [<CODE>|</CODE> or <CODE>|&#38;</CODE>] <VAR>command2</VAR> <small>...</small>]
886</pre></td></tr></table></P><P>
887
888The output of each command in the pipeline is connected via a pipe
889to the input of the next command.
890That is, each command reads the previous command's output. This
891connection is performed before any redirections specified by the
892command.
893</P><P>
894
895If <SAMP>`|&#38;'</SAMP> is used, the standard error of <VAR>command1</VAR> is connected to
896<VAR>command2</VAR>'s standard input through the pipe; it is shorthand for
897<CODE>2&#62;&#38;1 |</CODE>. This implicit redirection of the standard error is
898performed after any redirections specified by the command.
899</P><P>
900
901The reserved word <CODE>time</CODE> causes timing statistics
902to be printed for the pipeline once it finishes.
903The statistics currently consist of elapsed (wall-clock) time and
904user and system time consumed by the command's execution.
905The <SAMP>`-p'</SAMP> option changes the output format to that specified
906by POSIX.
907The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that
908specifies how the timing information should be displayed.
909See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of the available formats.
910The use of <CODE>time</CODE> as a reserved word permits the timing of
911shell builtins, shell functions, and pipelines. An external
912<CODE>time</CODE> command cannot time these easily.
913</P><P>
914
915If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the
916shell waits for all commands in the pipeline to complete.
917</P><P>
918
919Each command in a pipeline is executed in its own subshell
920(see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>). The exit
921status of a pipeline is the exit status of the last command in the
922pipeline, unless the <CODE>pipefail</CODE> option is enabled
923(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
924If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the
925value of the last (rightmost) command to exit with a non-zero status,
926or zero if all commands exit successfully.
927If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the
928exit status is the logical negation of the exit status as described
929above.
930The shell waits for all commands in the pipeline to terminate before
931returning a value.
932</P><P>
933
934<A NAME="Lists"></A>
935<HR SIZE="6">
936<A NAME="SEC18"></A>
937<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
938<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> &lt; </A>]</TD>
939<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &gt; </A>]</TD>
940<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &lt;&lt; </A>]</TD>
941<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
942<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
943<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
944<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
945<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
946<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
947</TR></TABLE>
948<H3> 3.2.3 Lists of Commands </H3>
949<!--docid::SEC18::-->
950<P>
951
952A <CODE>list</CODE> is a sequence of one or more pipelines separated by one
953of the operators <SAMP>`;'</SAMP>, <SAMP>`&#38;'</SAMP>, <SAMP>`&#38;&#38;'</SAMP>, or <SAMP>`||'</SAMP>,
954and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&#38;'</SAMP>, or a
955<CODE>newline</CODE>.
956</P><P>
957
958Of these list operators, <SAMP>`&#38;&#38;'</SAMP> and <SAMP>`||'</SAMP>
959have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&#38;'</SAMP>,
960which have equal precedence.
961</P><P>
962
963A sequence of one or more newlines may appear in a <CODE>list</CODE>
964to delimit commands, equivalent to a semicolon.
965</P><P>
966
967If a command is terminated by the control operator <SAMP>`&#38;'</SAMP>,
968the shell executes the command asynchronously in a subshell.
969This is known as executing the command in the <VAR>background</VAR>.
970The shell does not wait for the command to finish, and the return
971status is 0 (true).
972When job control is not active (see section <A HREF="bashref.html#SEC91">7. Job Control</A>),
973the standard input for asynchronous commands, in the absence of any
974explicit redirections, is redirected from <CODE>/dev/null</CODE>.
975</P><P>
976
977Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell
978waits for each command to terminate in turn. The return status is the
979exit status of the last command executed.
980</P><P>
981
982AND and OR lists are sequences of one or more pipelines
983separated by the control operators <SAMP>`&#38;&#38;'</SAMP> and <SAMP>`||'</SAMP>,
984respectively. AND and OR lists are executed with left
985associativity.
986</P><P>
987
988An AND list has the form
989<TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>command1</VAR> &#38;&#38; <VAR>command2</VAR>
990</pre></td></tr></table></P><P>
991
992<VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
993returns an exit status of zero.
994</P><P>
995
996An OR list has the form
997<TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR>
998</pre></td></tr></table></P><P>
999
1000<VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
1001returns a non-zero exit status.
1002</P><P>
1003
1004The return status of
1005AND and OR lists is the exit status of the last command
1006executed in the list.
1007</P><P>
1008
1009<A NAME="Compound Commands"></A>
1010<HR SIZE="6">
1011<A NAME="SEC19"></A>
1012<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1013<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &lt; </A>]</TD>
1014<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> &gt; </A>]</TD>
1015<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1016<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1017<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1018<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1019<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1020<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1021<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1022</TR></TABLE>
1023<H3> 3.2.4 Compound Commands </H3>
1024<!--docid::SEC19::-->
1025<P>
1026
1027<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1028<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for iterative action.</TD></TR>
1029<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for conditional execution.</TD></TR>
1030<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Ways to group commands.</TD></TR>
1031</TABLE></BLOCKQUOTE>
1032<P>
1033
1034Compound commands are the shell programming constructs.
1035Each construct begins with a reserved word or control operator and is
1036terminated by a corresponding reserved word or operator.
1037Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with a compound command
1038apply to all commands within that compound command unless explicitly overridden.
1039</P><P>
1040
1041Bash provides looping constructs, conditional commands, and mechanisms
1042to group commands and execute them as a unit.
1043</P><P>
1044
1045<A NAME="Looping Constructs"></A>
1046<HR SIZE="6">
1047<A NAME="SEC20"></A>
1048<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1049<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &lt; </A>]</TD>
1050<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> &gt; </A>]</TD>
1051<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1052<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1053<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1054<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1055<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1056<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1057<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1058</TR></TABLE>
1059<H4> 3.2.4.1 Looping Constructs </H4>
1060<!--docid::SEC20::-->
1061<P>
1062
1063Bash supports the following looping constructs.
1064</P><P>
1065
1066Note that wherever a <SAMP>`;'</SAMP> appears in the description of a
1067command's syntax, it may be replaced with one or more newlines.
1068</P><P>
1069
1070<DL COMPACT>
1071<DT><CODE>until</CODE>
1072<DD><A NAME="IDX27"></A>
1073<A NAME="IDX28"></A>
1074<A NAME="IDX29"></A>
1075The syntax of the <CODE>until</CODE> command is:
1076<TABLE><tr><td>&nbsp;</td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1077</pre></td></tr></table>Execute <VAR>consequent-commands</VAR> as long as
1078<VAR>test-commands</VAR> has an exit status which is not zero.
1079The return status is the exit status of the last command executed
1080in <VAR>consequent-commands</VAR>, or zero if none was executed.
1081<P>
1082
1083<DT><CODE>while</CODE>
1084<DD><A NAME="IDX30"></A>
1085The syntax of the <CODE>while</CODE> command is:
1086<TABLE><tr><td>&nbsp;</td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1087</pre></td></tr></table><P>
1088
1089Execute <VAR>consequent-commands</VAR> as long as
1090<VAR>test-commands</VAR> has an exit status of zero.
1091The return status is the exit status of the last command executed
1092in <VAR>consequent-commands</VAR>, or zero if none was executed.
1093</P><P>
1094
1095<DT><CODE>for</CODE>
1096<DD><A NAME="IDX31"></A>
1097The syntax of the <CODE>for</CODE> command is:
1098<P>
1099
1100<TABLE><tr><td>&nbsp;</td><td class=example><pre>for <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done
1101</pre></td></tr></table>Expand <VAR>words</VAR>, and execute <VAR>commands</VAR> once for each member
1102in the resultant list, with <VAR>name</VAR> bound to the current member.
1103If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command
1104executes the <VAR>commands</VAR> once for each positional parameter that is
1105set, as if <SAMP>`in "$@"'</SAMP> had been specified
1106(see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>).
1107The return status is the exit status of the last command that executes.
1108If there are no items in the expansion of <VAR>words</VAR>, no commands are
1109executed, and the return status is zero.
1110</P><P>
1111
1112An alternate form of the <CODE>for</CODE> command is also supported:
1113</P><P>
1114
1115<TABLE><tr><td>&nbsp;</td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done
1116</pre></td></tr></table>First, the arithmetic expression <VAR>expr1</VAR> is evaluated according
1117to the rules described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
1118The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly
1119until it evaluates to zero.
1120Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are
1121executed and the arithmetic expression <VAR>expr3</VAR> is evaluated.
1122If any expression is omitted, it behaves as if it evaluates to 1.
1123The return value is the exit status of the last command in <VAR>list</VAR>
1124that is executed, or false if any of the expressions is invalid.
1125</P><P>
1126
1127</DL>
1128<P>
1129
1130The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
1131may be used to control loop execution.
1132</P><P>
1133
1134<A NAME="Conditional Constructs"></A>
1135<HR SIZE="6">
1136<A NAME="SEC21"></A>
1137<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1138<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> &lt; </A>]</TD>
1139<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &gt; </A>]</TD>
1140<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &lt;&lt; </A>]</TD>
1141<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1142<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1143<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1144<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1145<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1146<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1147</TR></TABLE>
1148<H4> 3.2.4.2 Conditional Constructs </H4>
1149<!--docid::SEC21::-->
1150<P>
1151
1152<DL COMPACT>
1153<DT><CODE>if</CODE>
1154<DD><A NAME="IDX32"></A>
1155<A NAME="IDX33"></A>
1156<A NAME="IDX34"></A>
1157<A NAME="IDX35"></A>
1158<A NAME="IDX36"></A>
1159The syntax of the <CODE>if</CODE> command is:
1160<P>
1161
1162<TABLE><tr><td>&nbsp;</td><td class=example><pre>if <VAR>test-commands</VAR>; then
1163 <VAR>consequent-commands</VAR>;
1164[elif <VAR>more-test-commands</VAR>; then
1165 <VAR>more-consequents</VAR>;]
1166[else <VAR>alternate-consequents</VAR>;]
1167fi
1168</pre></td></tr></table></P><P>
1169
1170The <VAR>test-commands</VAR> list is executed, and if its return status is zero,
1171the <VAR>consequent-commands</VAR> list is executed.
1172If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list
1173is executed in turn, and if its exit status is zero,
1174the corresponding <VAR>more-consequents</VAR> is executed and the
1175command completes.
1176If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and
1177the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause
1178has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed.
1179The return status is the exit status of the last command executed, or
1180zero if no condition tested true.
1181</P><P>
1182
1183<DT><CODE>case</CODE>
1184<DD><A NAME="IDX37"></A>
1185<A NAME="IDX38"></A>
1186<A NAME="IDX39"></A>
1187The syntax of the <CODE>case</CODE> command is:
1188<P>
1189
1190<TABLE><tr><td>&nbsp;</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>
1191</pre></td></tr></table></P><P>
1192
1193<CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to
1194the first <VAR>pattern</VAR> that matches <VAR>word</VAR>.
1195If the shell option <CODE>nocasematch</CODE>
1196(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1197is enabled, the match is performed without regard to the case
1198of alphabetic characters.
1199The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP>
1200operator terminates a pattern list.
1201A list of patterns and an associated command-list is known
1202as a <VAR>clause</VAR>.
1203</P><P>
1204
1205Each clause must be terminated with <SAMP>`;;'</SAMP>, <SAMP>`,&#38;'</SAMP>, or <SAMP>`;;&#38;'</SAMP>.
1206The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command
1207substitution, arithmetic expansion, and quote removal before matching is
1208attempted. Each <VAR>pattern</VAR> undergoes tilde expansion, parameter
1209expansion, command substitution, and arithmetic expansion.
1210</P><P>
1211
1212There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated
1213by a <SAMP>`;;'</SAMP>, <SAMP>`;&#38;'</SAMP>, or <SAMP>`;;&#38;'</SAMP>.
1214The first pattern that matches determines the
1215command-list that is executed.
1216</P><P>
1217
1218Here is an example using <CODE>case</CODE> in a script that could be used to
1219describe one interesting feature of an animal:
1220</P><P>
1221
1222<TABLE><tr><td>&nbsp;</td><td class=example><pre>echo -n "Enter the name of an animal: "
1223read ANIMAL
1224echo -n "The $ANIMAL has "
1225case $ANIMAL in
1226 horse | dog | cat) echo -n "four";;
1227 man | kangaroo ) echo -n "two";;
1228 *) echo -n "an unknown number of";;
1229esac
1230echo " legs."
1231</pre></td></tr></table></P><P>
1232
1233</P><P>
1234
1235If the <SAMP>`;;'</SAMP> operator is used, no subsequent matches are attempted after
1236the first pattern match.
1237Using <SAMP>`;&#38;'</SAMP> in place of <SAMP>`;;'</SAMP> causes execution to continue with
1238the <VAR>command-list</VAR> associated with the next clause, if any.
1239Using <SAMP>`;;&#38;'</SAMP> in place of <SAMP>`;;'</SAMP> causes the shell to test the patterns
1240in the next clause, if any, and execute any associated <VAR>command-list</VAR>
1241on a successful match.
1242</P><P>
1243
1244The return status is zero if no <VAR>pattern</VAR> is matched. Otherwise, the
1245return status is the exit status of the <VAR>command-list</VAR> executed.
1246</P><P>
1247
1248<DT><CODE>select</CODE>
1249<DD><A NAME="IDX40"></A>
1250<P>
1251
1252The <CODE>select</CODE> construct allows the easy generation of menus.
1253It has almost the same syntax as the <CODE>for</CODE> command:
1254</P><P>
1255
1256<TABLE><tr><td>&nbsp;</td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done
1257</pre></td></tr></table></P><P>
1258
1259The list of words following <CODE>in</CODE> is expanded, generating a list
1260of items. The set of expanded words is printed on the standard
1261error output stream, each preceded by a number. If the
1262<SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed,
1263as if <SAMP>`in "$@"'</SAMP> had been specified.
1264The <CODE>PS3</CODE> prompt is then displayed and a line is read from the
1265standard input.
1266If the line consists of a number corresponding to one of the displayed
1267words, then the value of <VAR>name</VAR> is set to that word.
1268If the line is empty, the words and prompt are displayed again.
1269If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes.
1270Any other value read causes <VAR>name</VAR> to be set to null.
1271The line read is saved in the variable <CODE>REPLY</CODE>.
1272</P><P>
1273
1274The <VAR>commands</VAR> are executed after each selection until a
1275<CODE>break</CODE> command is executed, at which
1276point the <CODE>select</CODE> command completes.
1277</P><P>
1278
1279Here is an example that allows the user to pick a filename from the
1280current directory, and displays the name and index of the file
1281selected.
1282</P><P>
1283
1284<TABLE><tr><td>&nbsp;</td><td class=example><pre>select fname in *;
1285do
1286 echo you picked $fname \($REPLY\)
1287 break;
1288done
1289</pre></td></tr></table></P><P>
1290
1291<DT><CODE>((<small>...</small>))</CODE>
1292<DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>(( <VAR>expression</VAR> ))
1293</pre></td></tr></table><P>
1294
1295The arithmetic <VAR>expression</VAR> is evaluated according to the rules
1296described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
1297If the value of the expression is non-zero, the return status is 0;
1298otherwise the return status is 1. This is exactly equivalent to
1299<TABLE><tr><td>&nbsp;</td><td class=example><pre>let "<VAR>expression</VAR>"
1300</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.
1301</P><P>
1302
1303<DT><CODE>[[<small>...</small>]]</CODE>
1304<DD><A NAME="IDX41"></A>
1305<A NAME="IDX42"></A>
1306<TABLE><tr><td>&nbsp;</td><td class=example><pre>[[ <VAR>expression</VAR> ]]
1307</pre></td></tr></table><P>
1308
1309Return a status of 0 or 1 depending on the evaluation of
1310the conditional expression <VAR>expression</VAR>.
1311Expressions are composed of the primaries described below in
1312<A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>.
1313Word splitting and filename expansion are not performed on the words
1314between the <SAMP>`[['</SAMP> and <SAMP>`]]'</SAMP>; tilde expansion, parameter and
1315variable expansion, arithmetic expansion, command substitution, process
1316substitution, and quote removal are performed.
1317Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized
1318as primaries.
1319</P><P>
1320
1321When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the
1322right of the operator is considered a pattern and matched according
1323to the rules described below in <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>.
1324If the shell option <CODE>nocasematch</CODE>
1325(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1326is enabled, the match is performed without regard to the case
1327of alphabetic characters.
1328The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not
1329match (<SAMP>`!='</SAMP>)the pattern, and 1 otherwise.
1330Any part of the pattern may be quoted to force it to be matched as a
1331string.
1332</P><P>
1333
1334An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same
1335precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>.
1336When it is used, the string to the right of the operator is considered
1337an extended regular expression and matched accordingly (as in <I>regex</I>3)).
1338The return value is 0 if the string matches
1339the pattern, and 1 otherwise.
1340If the regular expression is syntactically incorrect, the conditional
1341expression's return value is 2.
1342If the shell option <CODE>nocasematch</CODE>
1343(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1344is enabled, the match is performed without regard to the case
1345of alphabetic characters.
1346Any part of the pattern may be quoted to force it to be matched as a
1347string.
1348Substrings matched by parenthesized subexpressions within the regular
1349expression are saved in the array variable <CODE>BASH_REMATCH</CODE>.
1350The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string
1351matching the entire regular expression.
1352The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the
1353string matching the <VAR>n</VAR>th parenthesized subexpression.
1354</P><P>
1355
1356Expressions may be combined using the following operators, listed
1357in decreasing order of precedence:
1358</P><P>
1359
1360<DL COMPACT>
1361<DT><CODE>( <VAR>expression</VAR> )</CODE>
1362<DD>Returns the value of <VAR>expression</VAR>.
1363This may be used to override the normal precedence of operators.
1364<P>
1365
1366<DT><CODE>! <VAR>expression</VAR></CODE>
1367<DD>True if <VAR>expression</VAR> is false.
1368<P>
1369
1370<DT><CODE><VAR>expression1</VAR> &#38;&#38; <VAR>expression2</VAR></CODE>
1371<DD>True if both <VAR>expression1</VAR> and <VAR>expression2</VAR> are true.
1372<P>
1373
1374<DT><CODE><VAR>expression1</VAR> || <VAR>expression2</VAR></CODE>
1375<DD>True if either <VAR>expression1</VAR> or <VAR>expression2</VAR> is true.
1376</DL>
1377The <CODE>&#38;&#38;</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the
1378value of <VAR>expression1</VAR> is sufficient to determine the return
1379value of the entire conditional expression.
1380<P>
1381
1382</DL>
1383<P>
1384
1385<A NAME="Command Grouping"></A>
1386<HR SIZE="6">
1387<A NAME="SEC22"></A>
1388<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1389<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> &lt; </A>]</TD>
1390<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt; </A>]</TD>
1391<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1392<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1393<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1394<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1395<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1396<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1397<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1398</TR></TABLE>
1399<H4> 3.2.4.3 Grouping Commands </H4>
1400<!--docid::SEC22::-->
1401<P>
1402
1403Bash provides two ways to group a list of commands to be executed
1404as a unit. When commands are grouped, redirections may be applied
1405to the entire command list. For example, the output of all the
1406commands in the list may be redirected to a single stream.
1407</P><P>
1408
1409<DL COMPACT>
1410<DT><CODE>()</CODE>
1411<DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>( <VAR>list</VAR> )
1412</pre></td></tr></table><P>
1413
1414Placing a list of commands between parentheses causes a subshell
1415environment to be created (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and each
1416of the commands in <VAR>list</VAR> to be executed in that subshell. Since the
1417<VAR>list</VAR> is executed in a subshell, variable assignments do not remain in
1418effect after the subshell completes.
1419</P><P>
1420
1421<DT><CODE>{}</CODE>
1422<DD><A NAME="IDX43"></A>
1423<A NAME="IDX44"></A>
1424<TABLE><tr><td>&nbsp;</td><td class=example><pre>{ <VAR>list</VAR>; }
1425</pre></td></tr></table><P>
1426
1427Placing a list of commands between curly braces causes the list to
1428be executed in the current shell context. No subshell is created.
1429The semicolon (or newline) following <VAR>list</VAR> is required.
1430</DL>
1431<P>
1432
1433In addition to the creation of a subshell, there is a subtle difference
1434between these two constructs due to historical reasons. The braces
1435are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR>
1436by <CODE>blank</CODE>s or other shell metacharacters.
1437The parentheses are <CODE>operators</CODE>, and are
1438recognized as separate tokens by the shell even if they are not separated
1439from the <VAR>list</VAR> by whitespace.
1440</P><P>
1441
1442The exit status of both of these constructs is the exit status of
1443<VAR>list</VAR>.
1444</P><P>
1445
1446<A NAME="Coprocesses"></A>
1447<HR SIZE="6">
1448<A NAME="SEC23"></A>
1449<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1450<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &lt; </A>]</TD>
1451<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt; </A>]</TD>
1452<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt;&lt; </A>]</TD>
1453<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1454<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
1455<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1456<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1457<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1458<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1459</TR></TABLE>
1460<H3> 3.2.5 Coprocesses </H3>
1461<!--docid::SEC23::-->
1462<P>
1463
1464A <CODE>coprocess</CODE> is a shell command preceded by the <CODE>coproc</CODE>
1465reserved word.
1466A coprocess is executed asynchronously in a subshell, as if the command
1467had been terminated with the <SAMP>`&#38;'</SAMP> control operator, with a two-way pipe
1468established between the executing shell and the coprocess.
1469</P><P>
1470
1471The format for a coprocess is:
1472<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>coproc</CODE> [<VAR>NAME</VAR>] <VAR>command</VAR> [<VAR>redirections</VAR>]
1473</pre></td></tr></table></P><P>
1474
1475This creates a coprocess named <VAR>NAME</VAR>.
1476If <VAR>NAME</VAR> is not supplied, the default name is <VAR>COPROC</VAR>.
1477<VAR>NAME</VAR> must not be supplied if <VAR>command</VAR> is a simple
1478command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>); otherwise, it is interpreted as
1479the first word of the simple command.
1480</P><P>
1481
1482When the coproc is executed, the shell creates an array variable
1483(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
1484named <VAR>NAME</VAR> in the context of the executing shell.
1485The standard output of <VAR>command</VAR>
1486is connected via a pipe to a file descriptor in the executing shell,
1487and that file descriptor is assigned to <VAR>NAME</VAR>[0].
1488The standard input of <VAR>command</VAR>
1489is connected via a pipe to a file descriptor in the executing shell,
1490and that file descriptor is assigned to <VAR>NAME</VAR>[1].
1491This pipe is established before any redirections specified by the
1492command (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
1493The file descriptors can be utilized as arguments to shell commands
1494and redirections using standard word expansions.
1495</P><P>
1496
1497The process id of the shell spawned to execute the coprocess is
1498available as the value of the variable <VAR>NAME</VAR>_PID.
1499The <CODE>wait</CODE>
1500builtin command may be used to wait for the coprocess to terminate.
1501</P><P>
1502
1503The return status of a coprocess is the exit status of <VAR>command</VAR>.
1504</P><P>
1505
1506<A NAME="Shell Functions"></A>
1507<HR SIZE="6">
1508<A NAME="SEC24"></A>
1509<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1510<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt; </A>]</TD>
1511<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt; </A>]</TD>
1512<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt;&lt; </A>]</TD>
1513<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1514<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
1515<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1516<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1517<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1518<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1519</TR></TABLE>
1520<H2> 3.3 Shell Functions </H2>
1521<!--docid::SEC24::-->
1522<P>
1523
1524Shell functions are a way to group commands for later execution
1525using a single name for the group. They are executed just like
1526a "regular" command.
1527When the name of a shell function is used as a simple command name,
1528the list of commands associated with that function name is executed.
1529Shell functions are executed in the current
1530shell context; no new process is created to interpret them.
1531</P><P>
1532
1533Functions are declared using this syntax:
1534<A NAME="IDX45"></A>
1535<TABLE><tr><td>&nbsp;</td><td class=example><pre>[ <CODE>function</CODE> ] <VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ]
1536</pre></td></tr></table></P><P>
1537
1538This defines a shell function named <VAR>name</VAR>. The reserved
1539word <CODE>function</CODE> is optional.
1540If the <CODE>function</CODE> reserved
1541word is supplied, the parentheses are optional.
1542The <VAR>body</VAR> of the function is the compound command
1543<VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>).
1544That command is usually a <VAR>list</VAR> enclosed between { and }, but
1545may be any compound command listed above.
1546<VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the
1547name of a command.
1548Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with the shell function
1549are performed when the function is executed.
1550</P><P>
1551
1552A function definition may be deleted using the <SAMP>`-f'</SAMP> option to the
1553<CODE>unset</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
1554</P><P>
1555
1556The exit status of a function definition is zero unless a syntax error
1557occurs or a readonly function with the same name already exists.
1558When executed, the exit status of a function is the exit status of the
1559last command executed in the body.
1560</P><P>
1561
1562Note that for historical reasons, in the most common usage the curly braces
1563that surround the body of the function must be separated from the body by
1564<CODE>blank</CODE>s or newlines.
1565This is because the braces are reserved words and are only recognized
1566as such when they are separated from the command list
1567by whitespace or another shell metacharacter.
1568Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon,
1569a <SAMP>`&#38;'</SAMP>, or a newline.
1570</P><P>
1571
1572When a function is executed, the arguments to the
1573function become the positional parameters
1574during its execution (see section <A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>).
1575The special parameter <SAMP>`#'</SAMP> that expands to the number of
1576positional parameters is updated to reflect the change.
1577Special parameter <CODE>0</CODE> is unchanged.
1578The first element of the <CODE>FUNCNAME</CODE> variable is set to the
1579name of the function while the function is executing.
1580All other aspects of the shell execution
1581environment are identical between a function and its caller
1582with the exception that the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps
1583are not inherited unless the function has been given the
1584<CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or
1585the <CODE>-o functrace</CODE> option has been enabled with
1586the <CODE>set</CODE> builtin,
1587(in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps).
1588See section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>, for the description of the
1589<CODE>trap</CODE> builtin.
1590</P><P>
1591
1592If the builtin command <CODE>return</CODE>
1593is executed in a function, the function completes and
1594execution resumes with the next command after the function
1595call.
1596Any command associated with the <CODE>RETURN</CODE> trap is executed
1597before execution resumes.
1598When a function completes, the values of the
1599positional parameters and the special parameter <SAMP>`#'</SAMP>
1600are restored to the values they had prior to the function's
1601execution. If a numeric argument is given to <CODE>return</CODE>,
1602that is the function's return status; otherwise the function's
1603return status is the exit status of the last command executed
1604before the <CODE>return</CODE>.
1605</P><P>
1606
1607Variables local to the function may be declared with the
1608<CODE>local</CODE> builtin. These variables are visible only to
1609the function and the commands it invokes.
1610</P><P>
1611
1612Function names and definitions may be listed with the
1613<SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> or <CODE>typeset</CODE>
1614builtin commands (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
1615The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE>
1616will list the function names only
1617(and optionally the source file and line number, if the <CODE>extdebug</CODE>
1618shell option is enabled).
1619Functions may be exported so that subshells
1620automatically have them defined with the
1621<SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin
1622(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
1623Note that shell functions and variables with the same name may result
1624in multiple identically-named entries in the environment passed to the
1625shell's children.
1626Care should be taken in cases where this may cause a problem.
1627</P><P>
1628
1629Functions may be recursive. No limit is placed on the number of
1630recursive calls.
1631</P><P>
1632
1633<A NAME="Shell Parameters"></A>
1634<HR SIZE="6">
1635<A NAME="SEC25"></A>
1636<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1637<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt; </A>]</TD>
1638<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> &gt; </A>]</TD>
1639<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt;&lt; </A>]</TD>
1640<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1641<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt;&gt; </A>]</TD>
1642<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1643<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1644<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1645<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1646</TR></TABLE>
1647<H2> 3.4 Shell Parameters </H2>
1648<!--docid::SEC25::-->
1649<P>
1650
1651<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1652<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR>
1653<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR>
1654</TABLE></BLOCKQUOTE>
1655<P>
1656
1657A <VAR>parameter</VAR> is an entity that stores values.
1658It can be a <CODE>name</CODE>, a number, or one of the special characters
1659listed below.
1660A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>.
1661A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>.
1662Attributes are assigned using the <CODE>declare</CODE> builtin command
1663(see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
1664</P><P>
1665
1666A parameter is set if it has been assigned a value. The null string is
1667a valid value. Once a variable is set, it may be unset only by using
1668the <CODE>unset</CODE> builtin command.
1669</P><P>
1670
1671A variable may be assigned to by a statement of the form
1672<TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>]
1673</pre></td></tr></table>If <VAR>value</VAR>
1674is not given, the variable is assigned the null string. All
1675<VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion,
1676command substitution, arithmetic expansion, and quote
1677removal (detailed below). If the variable has its <CODE>integer</CODE>
1678attribute set, then <VAR>value</VAR>
1679is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE>
1680expansion is not used (see section <A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>).
1681Word splitting is not performed, with the exception
1682of <CODE>"$@"</CODE> as explained below.
1683Filename expansion is not performed.
1684Assignment statements may also appear as arguments to the
1685<CODE>alias</CODE>,
1686<CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>,
1687and <CODE>local</CODE> builtin commands.
1688</P><P>
1689
1690In the context where an assignment statement is assigning a value
1691to a shell variable or array index (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the <SAMP>`+='</SAMP>
1692operator can be used to
1693append to or add to the variable's previous value.
1694When <SAMP>`+='</SAMP> is applied to a variable for which the integer attribute
1695has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and
1696added to the variable's current value, which is also evaluated.
1697When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment
1698(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the
1699variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new
1700values are appended to the array beginning at one greater than the array's
1701maximum index (for indexed arrays), or added as additional key-value pairs
1702in an associative array.
1703When applied to a string-valued variable, <VAR>value</VAR> is expanded and
1704appended to the variable's value.
1705</P><P>
1706
1707<A NAME="Positional Parameters"></A>
1708<HR SIZE="6">
1709<A NAME="SEC26"></A>
1710<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1711<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt; </A>]</TD>
1712<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> &gt; </A>]</TD>
1713<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt;&lt; </A>]</TD>
1714<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD>
1715<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt;&gt; </A>]</TD>
1716<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1717<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1718<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1719<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1720</TR></TABLE>
1721<H3> 3.4.1 Positional Parameters </H3>
1722<!--docid::SEC26::-->
1723<P>
1724
1725A <VAR>positional parameter</VAR> is a parameter denoted by one or more
1726digits, other than the single digit <CODE>0</CODE>. Positional parameters are
1727assigned from the shell's arguments when it is invoked,
1728and may be reassigned using the <CODE>set</CODE> builtin command.
1729Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or
1730as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit.
1731Positional parameters may not be assigned to with assignment statements.
1732The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and
1733unset them (see section <A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>).
1734The positional parameters are
1735temporarily replaced when a shell function is executed
1736(see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
1737</P><P>
1738
1739When a positional parameter consisting of more than a single
1740digit is expanded, it must be enclosed in braces.
1741</P><P>
1742
1743<A NAME="Special Parameters"></A>
1744<HR SIZE="6">
1745<A NAME="SEC27"></A>
1746<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1747<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> &lt; </A>]</TD>
1748<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt; </A>]</TD>
1749<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt;&lt; </A>]</TD>
1750<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD>
1751<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt;&gt; </A>]</TD>
1752<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1753<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1754<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1755<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1756</TR></TABLE>
1757<H3> 3.4.2 Special Parameters </H3>
1758<!--docid::SEC27::-->
1759<P>
1760
1761The shell treats several parameters specially. These parameters may
1762only be referenced; assignment to them is not allowed.
1763</P><P>
1764
1765<DL COMPACT>
1766
1767<A NAME="IDX46"></A>
1768<DT><CODE>*</CODE>
1769<DD><A NAME="IDX47"></A>
1770Expands to the positional parameters, starting from one. When the
1771expansion occurs within double quotes, it expands to a single word
1772with the value of each parameter separated by the first character
1773of the <CODE>IFS</CODE>
1774special variable. That is, <CODE>"$*"</CODE> is equivalent
1775to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR>
1776is the first character of the value of the <CODE>IFS</CODE>
1777variable.
1778If <CODE>IFS</CODE> is unset, the parameters are separated by spaces.
1779If <CODE>IFS</CODE> is null, the parameters are joined without intervening
1780separators.
1781<P>
1782
1783<A NAME="IDX48"></A>
1784<DT><CODE>@</CODE>
1785<DD><A NAME="IDX49"></A>
1786Expands to the positional parameters, starting from one. When the
1787expansion occurs within double quotes, each parameter expands to a
1788separate word. That is, <CODE>"$@"</CODE> is equivalent to
1789<CODE>"$1" "$2" <small>...</small></CODE>.
1790If the double-quoted expansion occurs within a word, the expansion of
1791the first parameter is joined with the beginning part of the original
1792word, and the expansion of the last parameter is joined with the last
1793part of the original word.
1794When there are no positional parameters, <CODE>"$@"</CODE> and
1795<CODE>$@</CODE>
1796expand to nothing (i.e., they are removed).
1797<P>
1798
1799<A NAME="IDX50"></A>
1800<DT><CODE>#</CODE>
1801<DD><A NAME="IDX51"></A>
1802Expands to the number of positional parameters in decimal.
1803<P>
1804
1805<A NAME="IDX52"></A>
1806<DT><CODE>?</CODE>
1807<DD><A NAME="IDX53"></A>
1808Expands to the exit status of the most recently executed foreground
1809pipeline.
1810<P>
1811
1812<A NAME="IDX54"></A>
1813<DT><CODE>-</CODE>
1814<DD><A NAME="IDX55"></A>
1815(A hyphen.) Expands to the current option flags as specified upon
1816invocation, by the <CODE>set</CODE>
1817builtin command, or those set by the shell itself
1818(such as the <SAMP>`-i'</SAMP> option).
1819<P>
1820
1821<A NAME="IDX56"></A>
1822<DT><CODE>$</CODE>
1823<DD><A NAME="IDX57"></A>
1824Expands to the process ID of the shell. In a <CODE>()</CODE> subshell, it
1825expands to the process ID of the invoking shell, not the subshell.
1826<P>
1827
1828<A NAME="IDX58"></A>
1829<DT><CODE>!</CODE>
1830<DD><A NAME="IDX59"></A>
1831Expands to the process ID of the most recently executed background
1832(asynchronous) command.
1833<P>
1834
1835<A NAME="IDX60"></A>
1836<DT><CODE>0</CODE>
1837<DD><A NAME="IDX61"></A>
1838Expands to the name of the shell or shell script. This is set at
1839shell initialization. If Bash is invoked with a file of commands
1840(see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file.
1841If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>),
1842then <CODE>$0</CODE> is set to the first argument after the string to be
1843executed, if one is present. Otherwise, it is set
1844to the filename used to invoke Bash, as given by argument zero.
1845<P>
1846
1847<A NAME="IDX62"></A>
1848<DT><CODE>_</CODE>
1849<DD><A NAME="IDX63"></A>
1850(An underscore.)
1851At shell startup, set to the absolute pathname used to invoke the
1852shell or shell script being executed as passed in the environment
1853or argument list.
1854Subsequently, expands to the last argument to the previous command,
1855after expansion.
1856Also set to the full pathname used to invoke each command executed
1857and placed in the environment exported to that command.
1858When checking mail, this parameter holds the name of the mail file.
1859</DL>
1860<P>
1861
1862<A NAME="Shell Expansions"></A>
1863<HR SIZE="6">
1864<A NAME="SEC28"></A>
1865<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1866<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> &lt; </A>]</TD>
1867<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &gt; </A>]</TD>
1868<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
1869<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1870<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
1871<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1872<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1873<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1874<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1875</TR></TABLE>
1876<H2> 3.5 Shell Expansions </H2>
1877<!--docid::SEC28::-->
1878<P>
1879
1880Expansion is performed on the command line after it has been split into
1881<CODE>token</CODE>s. There are seven kinds of expansion performed:
1882<UL>
1883<LI>brace expansion
1884<LI>tilde expansion
1885<LI>parameter and variable expansion
1886<LI>command substitution
1887<LI>arithmetic expansion
1888<LI>word splitting
1889<LI>filename expansion
1890</UL>
1891<P>
1892
1893<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1894<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR>
1895<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR>
1896<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR>
1897<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Using the output of a command as an argument.</TD></TR>
1898<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR>
1899<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a
1900 command.</TD></TR>
1901<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How the results of expansion are split into separate
1902 arguments.</TD></TR>
1903<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A shorthand for specifying filenames matching patterns.</TD></TR>
1904<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How and when quote characters are removed from
1905 words.</TD></TR>
1906</TABLE></BLOCKQUOTE>
1907<P>
1908
1909The order of expansions is: brace expansion, tilde expansion,
1910parameter, variable, and arithmetic expansion and
1911command substitution
1912(done in a left-to-right fashion), word splitting, and filename
1913expansion.
1914</P><P>
1915
1916On systems that can support it, there is an additional expansion
1917available: <VAR>process substitution</VAR>. This is performed at the
1918same time as parameter, variable, and arithmetic expansion and
1919command substitution.
1920</P><P>
1921
1922Only brace expansion, word splitting, and filename expansion
1923can change the number of words of the expansion; other expansions
1924expand a single word to a single word.
1925The only exceptions to this are the expansions of
1926<CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE>
1927(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
1928</P><P>
1929
1930After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>)
1931is performed.
1932</P><P>
1933
1934<A NAME="Brace Expansion"></A>
1935<HR SIZE="6">
1936<A NAME="SEC29"></A>
1937<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1938<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt; </A>]</TD>
1939<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> &gt; </A>]</TD>
1940<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
1941<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
1942<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
1943<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1944<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1945<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1946<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1947</TR></TABLE>
1948<H3> 3.5.1 Brace Expansion </H3>
1949<!--docid::SEC29::-->
1950<P>
1951
1952Brace expansion is a mechanism by which arbitrary strings may be generated.
1953This mechanism is similar to
1954<VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>),
1955but the file names generated need not exist.
1956Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>,
1957followed by either a series of comma-separated strings or a seqeunce expression
1958between a pair of braces,
1959followed by an optional <VAR>postscript</VAR>.
1960The preamble is prefixed to each string contained within the braces, and
1961the postscript is then appended to each resulting string, expanding left
1962to right.
1963</P><P>
1964
1965Brace expansions may be nested.
1966The results of each expanded string are not sorted; left to right order
1967is preserved.
1968For example,
1969<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash$ echo a{d,c,b}e
1970ade ace abe
1971</pre></td></tr></table></P><P>
1972
1973A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>[<VAR>incr</VAR>]}</CODE>,
1974where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters,
1975and <VAR>incr</VAR>, an optional increment, is an integer.
1976When integers are supplied, the expression expands to each number between
1977<VAR>x</VAR> and <VAR>y</VAR>, inclusive.
1978Supplied integers may be prefixed with <SAMP>`0'</SAMP> to force each term to have the
1979same width. When either <VAR>x</VAR> or <VAR>y</VAR> begins with a zero, the shell
1980attempts to force all generated terms to contain the same number of digits,
1981zero-padding where necessary.
1982When characters are supplied, the expression expands to each character
1983lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive. Note that
1984both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type.
1985When the increment is supplied, it is used as the difference between
1986each term. The default increment is 1 or -1 as appropriate.
1987</P><P>
1988
1989Brace expansion is performed before any other expansions,
1990and any characters special to other expansions are preserved
1991in the result. It is strictly textual. Bash
1992does not apply any syntactic interpretation to the context of the
1993expansion or the text between the braces.
1994To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
1995is not considered eligible for brace expansion.
1996</P><P>
1997
1998A correctly-formed brace expansion must contain unquoted opening
1999and closing braces, and at least one unquoted comma or a valid
2000sequence expression.
2001Any incorrectly formed brace expansion is left unchanged.
2002</P><P>
2003
2004A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its
2005being considered part of a brace expression.
2006To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2007is not considered eligible for brace expansion.
2008</P><P>
2009
2010This construct is typically used as shorthand when the common
2011prefix of the strings to be generated is longer than in the
2012above example:
2013<TABLE><tr><td>&nbsp;</td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs}
2014</pre></td></tr></table>or
2015<TABLE><tr><td>&nbsp;</td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
2016</pre></td></tr></table></P><P>
2017
2018<A NAME="Tilde Expansion"></A>
2019<HR SIZE="6">
2020<A NAME="SEC30"></A>
2021<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2022<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &lt; </A>]</TD>
2023<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &gt; </A>]</TD>
2024<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &lt;&lt; </A>]</TD>
2025<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2026<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2027<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2028<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2029<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2030<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2031</TR></TABLE>
2032<H3> 3.5.2 Tilde Expansion </H3>
2033<!--docid::SEC30::-->
2034<P>
2035
2036If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the
2037characters up to the first unquoted slash (or all characters,
2038if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>.
2039If none of the characters in the tilde-prefix are quoted, the
2040characters in the tilde-prefix following the tilde are treated as a
2041possible <VAR>login name</VAR>.
2042If this login name is the null string, the tilde is replaced with the
2043value of the <CODE>HOME</CODE> shell variable.
2044If <CODE>HOME</CODE> is unset, the home directory of the user executing the
2045shell is substituted instead.
2046Otherwise, the tilde-prefix is replaced with the home directory
2047associated with the specified login name.
2048</P><P>
2049
2050If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of
2051the shell variable <CODE>PWD</CODE> replaces the tilde-prefix.
2052If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable
2053<CODE>OLDPWD</CODE>, if it is set, is substituted.
2054</P><P>
2055
2056If the characters following the tilde in the tilde-prefix consist of a
2057number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>,
2058the tilde-prefix is replaced with the
2059corresponding element from the directory stack, as it would be displayed
2060by the <CODE>dirs</CODE> builtin invoked with the characters following tilde
2061in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
2062If the tilde-prefix, sans the tilde, consists of a number without a
2063leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed.
2064</P><P>
2065
2066If the login name is invalid, or the tilde expansion fails, the word is
2067left unchanged.
2068</P><P>
2069
2070Each variable assignment is checked for unquoted tilde-prefixes immediately
2071following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>.
2072In these cases, tilde expansion is also performed.
2073Consequently, one may use file names with tildes in assignments to
2074<CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>,
2075and the shell assigns the expanded value.
2076</P><P>
2077
2078The following table shows how Bash treats unquoted tilde-prefixes:
2079</P><P>
2080
2081<DL COMPACT>
2082<DT><CODE>~</CODE>
2083<DD>The value of <CODE>$HOME</CODE>
2084<DT><CODE>~/foo</CODE>
2085<DD><TT>`$HOME/foo'</TT>
2086<P>
2087
2088<DT><CODE>~fred/foo</CODE>
2089<DD>The subdirectory <CODE>foo</CODE> of the home directory of the user
2090<CODE>fred</CODE>
2091<P>
2092
2093<DT><CODE>~+/foo</CODE>
2094<DD><TT>`$PWD/foo'</TT>
2095<P>
2096
2097<DT><CODE>~-/foo</CODE>
2098<DD><TT>`${OLDPWD-'~-'}/foo'</TT>
2099<P>
2100
2101<DT><CODE>~<VAR>N</VAR></CODE>
2102<DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2103<P>
2104
2105<DT><CODE>~+<VAR>N</VAR></CODE>
2106<DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2107<P>
2108
2109<DT><CODE>~-<VAR>N</VAR></CODE>
2110<DD>The string that would be displayed by <SAMP>`dirs -<VAR>N</VAR>'</SAMP>
2111<P>
2112
2113</DL>
2114<P>
2115
2116<A NAME="Shell Parameter Expansion"></A>
2117<HR SIZE="6">
2118<A NAME="SEC31"></A>
2119<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2120<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> &lt; </A>]</TD>
2121<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &gt; </A>]</TD>
2122<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &lt;&lt; </A>]</TD>
2123<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2124<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2125<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2126<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2127<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2128<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2129</TR></TABLE>
2130<H3> 3.5.3 Shell Parameter Expansion </H3>
2131<!--docid::SEC31::-->
2132<P>
2133
2134The <SAMP>`$'</SAMP> character introduces parameter expansion,
2135command substitution, or arithmetic expansion. The parameter name
2136or symbol to be expanded may be enclosed in braces, which
2137are optional but serve to protect the variable to be expanded from
2138characters immediately following it which could be
2139interpreted as part of the name.
2140</P><P>
2141
2142When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP>
2143not escaped by a backslash or within a quoted string, and not within an
2144embedded arithmetic expansion, command substitution, or parameter
2145expansion.
2146</P><P>
2147
2148The basic form of parameter expansion is ${<VAR>parameter</VAR>}.
2149The value of <VAR>parameter</VAR> is substituted. The braces are required
2150when <VAR>parameter</VAR>
2151is a positional parameter with more than one digit,
2152or when <VAR>parameter</VAR>
2153is followed by a character that is not to be
2154interpreted as part of its name.
2155</P><P>
2156
2157If the first character of <VAR>parameter</VAR> is an exclamation point,
2158a level of variable indirection is introduced.
2159Bash uses the value of the variable formed from the rest of
2160<VAR>parameter</VAR> as the name of the variable; this variable is then
2161expanded and that value is used in the rest of the substitution, rather
2162than the value of <VAR>parameter</VAR> itself.
2163This is known as <CODE>indirect expansion</CODE>.
2164The exceptions to this are the expansions of ${!<VAR>prefix*</VAR>}
2165and ${!<VAR>name</VAR>[@]}
2166described below.
2167The exclamation point must immediately follow the left brace in order to
2168introduce indirection.
2169</P><P>
2170
2171In each of the cases below, <VAR>word</VAR> is subject to tilde expansion,
2172parameter expansion, command substitution, and arithmetic expansion.
2173</P><P>
2174
2175When not performing substring expansion, using the form described
2176below, Bash tests for a parameter that is unset or null.
2177Omitting the colon results in a test only for a parameter that is unset.
2178Put another way, if the colon is included,
2179the operator tests for both <VAR>parameter</VAR>'s existence and that its value
2180is not null; if the colon is omitted, the operator tests only for existence.
2181</P><P>
2182
2183<DL COMPACT>
2184
2185<DT><CODE>${<VAR>parameter</VAR>:-<VAR>word</VAR>}</CODE>
2186<DD>If <VAR>parameter</VAR> is unset or null, the expansion of
2187<VAR>word</VAR> is substituted. Otherwise, the value of
2188<VAR>parameter</VAR> is substituted.
2189<P>
2190
2191<DT><CODE>${<VAR>parameter</VAR>:=<VAR>word</VAR>}</CODE>
2192<DD>If <VAR>parameter</VAR>
2193is unset or null, the expansion of <VAR>word</VAR>
2194is assigned to <VAR>parameter</VAR>.
2195The value of <VAR>parameter</VAR> is then substituted.
2196Positional parameters and special parameters may not be assigned to
2197in this way.
2198<P>
2199
2200<DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE>
2201<DD>If <VAR>parameter</VAR>
2202is null or unset, the expansion of <VAR>word</VAR> (or a message
2203to that effect if <VAR>word</VAR>
2204is not present) is written to the standard error and the shell, if it
2205is not interactive, exits. Otherwise, the value of <VAR>parameter</VAR> is
2206substituted.
2207<P>
2208
2209<DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE>
2210<DD>If <VAR>parameter</VAR>
2211is null or unset, nothing is substituted, otherwise the expansion of
2212<VAR>word</VAR> is substituted.
2213<P>
2214
2215<DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>}</CODE>
2216<DD><DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>:<VAR>length</VAR>}</CODE>
2217<DD>Expands to up to <VAR>length</VAR> characters of <VAR>parameter</VAR>
2218starting at the character specified by <VAR>offset</VAR>.
2219If <VAR>length</VAR> is omitted, expands to the substring of
2220<VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>.
2221<VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions
2222(see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
2223This is referred to as Substring Expansion.
2224<P>
2225
2226<VAR>length</VAR> must evaluate to a number greater than or equal to zero.
2227If <VAR>offset</VAR> evaluates to a number less than zero, the value
2228is used as an offset from the end of the value of <VAR>parameter</VAR>.
2229If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional
2230parameters beginning at <VAR>offset</VAR>.
2231If <VAR>parameter</VAR> is an indexed array name subscripted
2232by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the result is the <VAR>length</VAR>
2233members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>.
2234A negative <VAR>offset</VAR> is taken relative to one greater than the maximum
2235index of the specified array.
2236Substring expansion applied to an associative array produces undefined
2237results.
2238</P><P>
2239
2240Note that a negative offset must be separated from the colon by at least
2241one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion.
2242Substring indexing is zero-based unless the positional parameters
2243are used, in which case the indexing starts at 1 by default.
2244If <VAR>offset</VAR> is 0, and the positional parameters are used, <CODE>$@</CODE> is
2245prefixed to the list.
2246</P><P>
2247
2248<DT><CODE>${!<VAR>prefix</VAR>*}</CODE>
2249<DD><DT><CODE>${!<VAR>prefix</VAR>@}</CODE>
2250<DD>Expands to the names of variables whose names begin with <VAR>prefix</VAR>,
2251separated by the first character of the <CODE>IFS</CODE> special variable.
2252When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2253variable name expands to a separate word.
2254<P>
2255
2256<DT><CODE>${!<VAR>name</VAR>[@]}</CODE>
2257<DD><DT><CODE>${!<VAR>name</VAR>[*]}</CODE>
2258<DD>If <VAR>name</VAR> is an array variable, expands to the list of array indices
2259(keys) assigned in <VAR>name</VAR>.
2260If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null
2261otherwise.
2262When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2263key expands to a separate word.
2264<P>
2265
2266<DT><CODE>${#<VAR>parameter</VAR>}</CODE>
2267<DD>The length in characters of the expanded value of <VAR>parameter</VAR> is
2268substituted.
2269If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted
2270is the number of positional parameters.
2271If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>,
2272the value substituted is the number of elements in the array.
2273<P>
2274
2275<DT><CODE>${<VAR>parameter</VAR>#<VAR>word</VAR>}</CODE>
2276<DD><DT><CODE>${<VAR>parameter</VAR>##<VAR>word</VAR>}</CODE>
2277<DD>The <VAR>word</VAR>
2278is expanded to produce a pattern just as in filename
2279expansion (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). If the pattern matches
2280the beginning of the expanded value of <VAR>parameter</VAR>,
2281then the result of the expansion is the expanded value of <VAR>parameter</VAR>
2282with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the
2283longest matching pattern (the <SAMP>`##'</SAMP> case) deleted.
2284If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2285the pattern removal operation is applied to each positional
2286parameter in turn, and the expansion is the resultant list.
2287If <VAR>parameter</VAR> is an array variable subscripted with
2288<SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2289the pattern removal operation is applied to each member of the
2290array in turn, and the expansion is the resultant list.
2291<P>
2292
2293<DT><CODE>${<VAR>parameter</VAR>%<VAR>word</VAR>}</CODE>
2294<DD><DT><CODE>${<VAR>parameter</VAR>%%<VAR>word</VAR>}</CODE>
2295<DD>The <VAR>word</VAR> is expanded to produce a pattern just as in
2296filename expansion.
2297If the pattern matches a trailing portion of the expanded value of
2298<VAR>parameter</VAR>, then the result of the expansion is the value of
2299<VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case)
2300or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted.
2301If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2302the pattern removal operation is applied to each positional
2303parameter in turn, and the expansion is the resultant list.
2304If <VAR>parameter</VAR>
2305is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2306the pattern removal operation is applied to each member of the
2307array in turn, and the expansion is the resultant list.
2308<P>
2309
2310<DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE>
2311<DD><P>
2312
2313The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2314filename expansion.
2315<VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR>
2316against its value is replaced with <VAR>string</VAR>.
2317If <VAR>pattern</VAR> begins with <SAMP>`/'</SAMP>, all matches of <VAR>pattern</VAR> are
2318replaced with <VAR>string</VAR>. Normally only the first match is replaced.
2319If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning
2320of the expanded value of <VAR>parameter</VAR>.
2321If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end
2322of the expanded value of <VAR>parameter</VAR>.
2323If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted
2324and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted.
2325If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2326the substitution operation is applied to each positional
2327parameter in turn, and the expansion is the resultant list.
2328If <VAR>parameter</VAR>
2329is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2330the substitution operation is applied to each member of the
2331array in turn, and the expansion is the resultant list.
2332</P><P>
2333
2334<DT><CODE>${<VAR>parameter</VAR>^<VAR>pattern</VAR>}</CODE>
2335<DD><DT><CODE>${<VAR>parameter</VAR>^^<VAR>pattern</VAR>}</CODE>
2336<DD><DT><CODE>${<VAR>parameter</VAR>,<VAR>pattern</VAR>}</CODE>
2337<DD><DT><CODE>${<VAR>parameter</VAR>,,<VAR>pattern</VAR>}</CODE>
2338<DD>This expansion modifies the case of alphabetic characters in <VAR>parameter</VAR>.
2339The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2340pathname expansion.
2341The <SAMP>`^'</SAMP> operator converts lowercase letters matching <VAR>pattern</VAR>
2342to uppercase; the <SAMP>`,'</SAMP> operator converts matching uppercase letters
2343to lowercase.
2344The <SAMP>`^^'</SAMP> and <SAMP>`,,'</SAMP> expansions convert each matched character in the
2345expanded value; the <SAMP>`^'</SAMP> and <SAMP>`,'</SAMP> expansions match and convert only
2346the first character in the expanded value.
2347If <VAR>pattern</VAR> is omitted, it is treated like a <SAMP>`?'</SAMP>, which matches
2348every character.
2349If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2350the case modification operation is applied to each positional
2351parameter in turn, and the expansion is the resultant list.
2352If <VAR>parameter</VAR>
2353is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2354the case modification operation is applied to each member of the
2355array in turn, and the expansion is the resultant list.
2356<P>
2357
2358</DL>
2359<P>
2360
2361<A NAME="Command Substitution"></A>
2362<HR SIZE="6">
2363<A NAME="SEC32"></A>
2364<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2365<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &lt; </A>]</TD>
2366<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &gt; </A>]</TD>
2367<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &lt;&lt; </A>]</TD>
2368<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2369<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2370<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2371<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2372<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2373<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2374</TR></TABLE>
2375<H3> 3.5.4 Command Substitution </H3>
2376<!--docid::SEC32::-->
2377<P>
2378
2379Command substitution allows the output of a command to replace
2380the command itself.
2381Command substitution occurs when a command is enclosed as follows:
2382<TABLE><tr><td>&nbsp;</td><td class=example><pre>$(<VAR>command</VAR>)
2383</pre></td></tr></table>or
2384<TABLE><tr><td>&nbsp;</td><td class=example><pre>`<VAR>command</VAR>`
2385</pre></td></tr></table></P><P>
2386
2387Bash performs the expansion by executing <VAR>command</VAR> and
2388replacing the command substitution with the standard output of the
2389command, with any trailing newlines deleted.
2390Embedded newlines are not deleted, but they may be removed during
2391word splitting.
2392The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be
2393replaced by the equivalent but faster <CODE>$(&#60; <VAR>file</VAR>)</CODE>.
2394</P><P>
2395
2396When the old-style backquote form of substitution is used,
2397backslash retains its literal meaning except when followed by
2398<SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>.
2399The first backquote not preceded by a backslash terminates the
2400command substitution.
2401When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between
2402the parentheses make up the command; none are treated specially.
2403</P><P>
2404
2405Command substitutions may be nested. To nest when using the backquoted
2406form, escape the inner backquotes with backslashes.
2407</P><P>
2408
2409If the substitution appears within double quotes, word splitting and
2410filename expansion are not performed on the results.
2411</P><P>
2412
2413<A NAME="Arithmetic Expansion"></A>
2414<HR SIZE="6">
2415<A NAME="SEC33"></A>
2416<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2417<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &lt; </A>]</TD>
2418<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &gt; </A>]</TD>
2419<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &lt;&lt; </A>]</TD>
2420<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2421<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2422<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2423<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2424<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2425<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2426</TR></TABLE>
2427<H3> 3.5.5 Arithmetic Expansion </H3>
2428<!--docid::SEC33::-->
2429<P>
2430
2431Arithmetic expansion allows the evaluation of an arithmetic expression
2432and the substitution of the result. The format for arithmetic expansion is:
2433</P><P>
2434
2435<TABLE><tr><td>&nbsp;</td><td class=example><pre>$(( <VAR>expression</VAR> ))
2436</pre></td></tr></table></P><P>
2437
2438The expression is treated as if it were within double quotes, but
2439a double quote inside the parentheses is not treated specially.
2440All tokens in the expression undergo parameter expansion, command
2441substitution, and quote removal.
2442Arithmetic expansions may be nested.
2443</P><P>
2444
2445The evaluation is performed according to the rules listed below
2446(see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
2447If the expression is invalid, Bash prints a message indicating
2448failure to the standard error and no substitution occurs.
2449</P><P>
2450
2451<A NAME="Process Substitution"></A>
2452<HR SIZE="6">
2453<A NAME="SEC34"></A>
2454<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2455<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &lt; </A>]</TD>
2456<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &gt; </A>]</TD>
2457<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &lt;&lt; </A>]</TD>
2458<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2459<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2460<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2461<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2462<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2463<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2464</TR></TABLE>
2465<H3> 3.5.6 Process Substitution </H3>
2466<!--docid::SEC34::-->
2467<P>
2468
2469Process substitution is supported on systems that support named
2470pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files.
2471It takes the form of
2472<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;(<VAR>list</VAR>)
2473</pre></td></tr></table>or
2474<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;(<VAR>list</VAR>)
2475</pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a
2476FIFO or some file in <TT>`/dev/fd'</TT>. The name of this file is
2477passed as an argument to the current command as the result of the
2478expansion. If the <CODE>&#62;(<VAR>list</VAR>)</CODE> form is used, writing to
2479the file will provide input for <VAR>list</VAR>. If the
2480<CODE>&#60;(<VAR>list</VAR>)</CODE> form is used, the file passed as an
2481argument should be read to obtain the output of <VAR>list</VAR>.
2482Note that no space may appear between the <CODE>&#60;</CODE> or <CODE>&#62;</CODE>
2483and the left parenthesis, otherwise the construct would be interpreted
2484as a redirection.
2485</P><P>
2486
2487When available, process substitution is performed simultaneously with
2488parameter and variable expansion, command substitution, and arithmetic
2489expansion.
2490</P><P>
2491
2492<A NAME="Word Splitting"></A>
2493<HR SIZE="6">
2494<A NAME="SEC35"></A>
2495<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2496<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &lt; </A>]</TD>
2497<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &gt; </A>]</TD>
2498<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &lt;&lt; </A>]</TD>
2499<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2500<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2501<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2502<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2503<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2504<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2505</TR></TABLE>
2506<H3> 3.5.7 Word Splitting </H3>
2507<!--docid::SEC35::-->
2508<P>
2509
2510The shell scans the results of parameter expansion, command substitution,
2511and arithmetic expansion that did not occur within double quotes for
2512word splitting.
2513</P><P>
2514
2515The shell treats each character of <CODE>$IFS</CODE> as a delimiter, and splits
2516the results of the other expansions into words on these characters.
2517If <CODE>IFS</CODE> is unset, or its value is exactly <CODE>&#60;space&#62;&#60;tab&#62;&#60;newline&#62;</CODE>,
2518the default, then sequences of
2519<CODE> &#60;space&#62;</CODE>, <CODE>&#60;tab&#62;</CODE>, and <CODE>&#60;newline&#62;</CODE>
2520at the beginning and end of the results of the previous
2521expansions are ignored, and any sequence of <CODE>IFS</CODE>
2522characters not at the beginning or end serves to delimit words.
2523If <CODE>IFS</CODE> has a value other than the default, then sequences of
2524the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE>
2525are ignored at the beginning and end of the
2526word, as long as the whitespace character is in the
2527value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character).
2528Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE>
2529whitespace, along with any adjacent <CODE>IFS</CODE>
2530whitespace characters, delimits a field. A sequence of <CODE>IFS</CODE>
2531whitespace characters is also treated as a delimiter.
2532If the value of <CODE>IFS</CODE> is null, no word splitting occurs.
2533</P><P>
2534
2535Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained.
2536Unquoted implicit null arguments, resulting from the expansion of
2537parameters that have no values, are removed.
2538If a parameter with no value is expanded within double quotes, a
2539null argument results and is retained.
2540</P><P>
2541
2542Note that if no expansion occurs, no splitting
2543is performed.
2544</P><P>
2545
2546<A NAME="Filename Expansion"></A>
2547<HR SIZE="6">
2548<A NAME="SEC36"></A>
2549<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2550<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &lt; </A>]</TD>
2551<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> &gt; </A>]</TD>
2552<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &lt;&lt; </A>]</TD>
2553<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2554<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &gt;&gt; </A>]</TD>
2555<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2556<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2557<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2558<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2559</TR></TABLE>
2560<H3> 3.5.8 Filename Expansion </H3>
2561<!--docid::SEC36::-->
2562<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
2563<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How the shell matches patterns.</TD></TR>
2564</TABLE></BLOCKQUOTE>
2565<A NAME="IDX64"></A>
2566<A NAME="IDX65"></A>
2567<A NAME="IDX66"></A>
2568<A NAME="IDX67"></A>
2569<P>
2570
2571After word splitting, unless the <SAMP>`-f'</SAMP> option has been set
2572(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), Bash scans each word for the characters
2573<SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>.
2574If one of these characters appears, then the word is
2575regarded as a <VAR>pattern</VAR>,
2576and replaced with an alphabetically sorted list of
2577file names matching the pattern. If no matching file names are found,
2578and the shell option <CODE>nullglob</CODE> is disabled, the word is left
2579unchanged.
2580If the <CODE>nullglob</CODE> option is set, and no matches are found, the word
2581is removed.
2582If the <CODE>failglob</CODE> shell option is set, and no matches are found,
2583an error message is printed and the command is not executed.
2584If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed
2585without regard to the case of alphabetic characters.
2586</P><P>
2587
2588When a pattern is used for filename generation, the character <SAMP>`.'</SAMP>
2589at the start of a filename or immediately following a slash
2590must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set.
2591When matching a file name, the slash character must always be
2592matched explicitly.
2593In other cases, the <SAMP>`.'</SAMP> character is not treated specially.
2594</P><P>
2595
2596See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>,
2597for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>,
2598<CODE>failglob</CODE>, and <CODE>dotglob</CODE> options.
2599</P><P>
2600
2601The <CODE>GLOBIGNORE</CODE>
2602shell variable may be used to restrict the set of filenames matching a
2603pattern. If <CODE>GLOBIGNORE</CODE>
2604is set, each matching filename that also matches one of the patterns in
2605<CODE>GLOBIGNORE</CODE> is removed from the list of matches. The filenames
2606<TT>`.'</TT> and <TT>`..'</TT>
2607are always ignored when <CODE>GLOBIGNORE</CODE>
2608is set and not null.
2609However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of
2610enabling the <CODE>dotglob</CODE>
2611shell option, so all other filenames beginning with a
2612<SAMP>`.'</SAMP> will match.
2613To get the old behavior of ignoring filenames beginning with a
2614<SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>.
2615The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE>
2616is unset.
2617</P><P>
2618
2619<A NAME="Pattern Matching"></A>
2620<HR SIZE="6">
2621<A NAME="SEC37"></A>
2622<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2623<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &lt; </A>]</TD>
2624<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &gt; </A>]</TD>
2625<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &lt;&lt; </A>]</TD>
2626<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> Up </A>]</TD>
2627<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &gt;&gt; </A>]</TD>
2628<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2629<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2630<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2631<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2632</TR></TABLE>
2633<H4> 3.5.8.1 Pattern Matching </H4>
2634<!--docid::SEC37::-->
2635<P>
2636
2637Any character that appears in a pattern, other than the special pattern
2638characters described below, matches itself.
2639The NUL character may not occur in a pattern.
2640A backslash escapes the following character; the
2641escaping backslash is discarded when matching.
2642The special pattern characters must be quoted if they are to be matched
2643literally.
2644</P><P>
2645
2646The special pattern characters have the following meanings:
2647<DL COMPACT>
2648<DT><CODE>*</CODE>
2649<DD>Matches any string, including the null string.
2650When the <CODE>globstar</CODE> shell option is enabled, and <SAMP>`*'</SAMP> is used in
2651a filename expansion context, two adjacent <SAMP>`*'</SAMP>s used as a single
2652pattern will match all files and zero or more directories and
2653subdirectories.
2654If followed by a <SAMP>`/'</SAMP>, two adjacent <SAMP>`*'</SAMP>s will match only
2655directories and subdirectories.
2656<DT><CODE>?</CODE>
2657<DD>Matches any single character.
2658<DT><CODE>[<small>...</small>]</CODE>
2659<DD>Matches any one of the enclosed characters. A pair of characters
2660separated by a hyphen denotes a <VAR>range expression</VAR>;
2661any character that sorts between those two characters, inclusive,
2662using the current locale's collating sequence and character set,
2663is matched. If the first character following the
2664<SAMP>`['</SAMP> is a <SAMP>`!'</SAMP> or a <SAMP>`^'</SAMP>
2665then any character not enclosed is matched. A <SAMP>`-'</SAMP>
2666may be matched by including it as the first or last character
2667in the set. A <SAMP>`]'</SAMP> may be matched by including it as the first
2668character in the set.
2669The sorting order of characters in range expressions is determined by
2670the current locale and the value of the <CODE>LC_COLLATE</CODE> shell variable,
2671if set.
2672<P>
2673
2674For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to
2675<SAMP>`[abcdxyz]'</SAMP>. Many locales sort characters in dictionary order, and in
2676these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>;
2677it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example. To obtain
2678the traditional interpretation of ranges in bracket expressions, you can
2679force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or
2680<CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>.
2681</P><P>
2682
2683Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified
2684using the syntax
2685<CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the
2686following classes defined in the POSIX standard:
2687<TABLE><tr><td>&nbsp;</td><td class=example><pre>alnum alpha ascii blank cntrl digit graph lower
2688print punct space upper word xdigit
2689</pre></td></tr></table>A character class matches any character belonging to that class.
2690The <CODE>word</CODE> character class matches letters, digits, and the character
2691<SAMP>`_'</SAMP>.
2692</P><P>
2693
2694Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be
2695specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which
2696matches all characters with the same collation weight (as defined
2697by the current locale) as the character <VAR>c</VAR>.
2698</P><P>
2699
2700Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE>
2701matches the collating symbol <VAR>symbol</VAR>.
2702</DL>
2703<P>
2704
2705If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE>
2706builtin, several extended pattern matching operators are recognized.
2707In the following description, a <VAR>pattern-list</VAR> is a list of one
2708or more patterns separated by a <SAMP>`|'</SAMP>.
2709Composite patterns may be formed using one or more of the following
2710sub-patterns:
2711</P><P>
2712
2713<DL COMPACT>
2714<DT><CODE>?(<VAR>pattern-list</VAR>)</CODE>
2715<DD>Matches zero or one occurrence of the given patterns.
2716<P>
2717
2718<DT><CODE>*(<VAR>pattern-list</VAR>)</CODE>
2719<DD>Matches zero or more occurrences of the given patterns.
2720<P>
2721
2722<DT><CODE>+(<VAR>pattern-list</VAR>)</CODE>
2723<DD>Matches one or more occurrences of the given patterns.
2724<P>
2725
2726<DT><CODE>@(<VAR>pattern-list</VAR>)</CODE>
2727<DD>Matches one of the given patterns.
2728<P>
2729
2730<DT><CODE>!(<VAR>pattern-list</VAR>)</CODE>
2731<DD>Matches anything except one of the given patterns.
2732</DL>
2733<P>
2734
2735<A NAME="Quote Removal"></A>
2736<HR SIZE="6">
2737<A NAME="SEC38"></A>
2738<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2739<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> &lt; </A>]</TD>
2740<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt; </A>]</TD>
2741<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
2742<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2743<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2744<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2745<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2746<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2747<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2748</TR></TABLE>
2749<H3> 3.5.9 Quote Removal </H3>
2750<!--docid::SEC38::-->
2751<P>
2752
2753After the preceding expansions, all unquoted occurrences of the
2754characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not
2755result from one of the above expansions are removed.
2756</P><P>
2757
2758<A NAME="Redirections"></A>
2759<HR SIZE="6">
2760<A NAME="SEC39"></A>
2761<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2762<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &lt; </A>]</TD>
2763<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt; </A>]</TD>
2764<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt;&lt; </A>]</TD>
2765<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
2766<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2767<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2768<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2769<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2771</TR></TABLE>
2772<H2> 3.6 Redirections </H2>
2773<!--docid::SEC39::-->
2774<P>
2775
2776Before a command is executed, its input and output
2777may be <VAR>redirected</VAR>
2778using a special notation interpreted by the shell.
2779Redirection may also be used to open and close files for the
2780current shell execution environment. The following redirection
2781operators may precede or appear anywhere within a
2782simple command or may follow a command.
2783Redirections are processed in the order they appear, from
2784left to right.
2785</P><P>
2786
2787In the following descriptions, if the file descriptor number is
2788omitted, and the first character of the redirection operator is
2789<SAMP>`&#60;'</SAMP>, the redirection refers to the standard input (file
2790descriptor 0). If the first character of the redirection operator
2791is <SAMP>`&#62;'</SAMP>, the redirection refers to the standard output (file
2792descriptor 1).
2793</P><P>
2794
2795The word following the redirection operator in the following
2796descriptions, unless otherwise noted, is subjected to brace expansion,
2797tilde expansion, parameter expansion, command substitution, arithmetic
2798expansion, quote removal, filename expansion, and word splitting.
2799If it expands to more than one word, Bash reports an error.
2800</P><P>
2801
2802Note that the order of redirections is significant. For example,
2803the command
2804<TABLE><tr><td>&nbsp;</td><td class=example><pre>ls &#62; <VAR>dirlist</VAR> 2&#62;&#38;1
2805</pre></td></tr></table>directs both standard output (file descriptor 1) and standard error
2806(file descriptor 2) to the file <VAR>dirlist</VAR>, while the command
2807<TABLE><tr><td>&nbsp;</td><td class=example><pre>ls 2&#62;&#38;1 &#62; <VAR>dirlist</VAR>
2808</pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>,
2809because the standard error was duplicated as standard output
2810before the standard output was redirected to <VAR>dirlist</VAR>.
2811</P><P>
2812
2813Bash handles several filenames specially when they are used in
2814redirections, as described in the following table:
2815</P><P>
2816
2817<DL COMPACT>
2818<DT><CODE>/dev/fd/<VAR>fd</VAR></CODE>
2819<DD>If <VAR>fd</VAR> is a valid integer, file descriptor <VAR>fd</VAR> is duplicated.
2820<P>
2821
2822<DT><CODE>/dev/stdin</CODE>
2823<DD>File descriptor 0 is duplicated.
2824<P>
2825
2826<DT><CODE>/dev/stdout</CODE>
2827<DD>File descriptor 1 is duplicated.
2828<P>
2829
2830<DT><CODE>/dev/stderr</CODE>
2831<DD>File descriptor 2 is duplicated.
2832<P>
2833
2834<DT><CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2835<DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2836is an integer port number or service name, Bash attempts to open a TCP
2837connection to the corresponding socket.
2838<P>
2839
2840<DT><CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2841<DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2842is an integer port number or service name, Bash attempts to open a UDP
2843connection to the corresponding socket.
2844<P>
2845
2846</DL>
2847<P>
2848
2849A failure to open or create a file causes the redirection to fail.
2850</P><P>
2851
2852Redirections using file descriptors greater than 9 should be used with
2853care, as they may conflict with file descriptors the shell uses
2854internally.
2855</P><P>
2856
2857<HR SIZE="6">
2858<A NAME="SEC40"></A>
2859<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2860<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt; </A>]</TD>
2861<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &gt; </A>]</TD>
2862<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt;&lt; </A>]</TD>
2863<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2864<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2865<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2866<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2867<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2868<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2869</TR></TABLE>
2870<H3> 3.6.1 Redirecting Input </H3>
2871<!--docid::SEC40::-->
2872Redirection of input causes the file whose name results from
2873the expansion of <VAR>word</VAR>
2874to be opened for reading on file descriptor <CODE>n</CODE>,
2875or the standard input (file descriptor 0) if <CODE>n</CODE>
2876is not specified.
2877<P>
2878
2879The general format for redirecting input is:
2880<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;<VAR>word</VAR>
2881</pre></td></tr></table></P><P>
2882
2883<HR SIZE="6">
2884<A NAME="SEC41"></A>
2885<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2886<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &lt; </A>]</TD>
2887<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &gt; </A>]</TD>
2888<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &lt;&lt; </A>]</TD>
2889<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2890<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2891<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2892<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2893<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2894<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2895</TR></TABLE>
2896<H3> 3.6.2 Redirecting Output </H3>
2897<!--docid::SEC41::-->
2898Redirection of output causes the file whose name results from
2899the expansion of <VAR>word</VAR>
2900to be opened for writing on file descriptor <VAR>n</VAR>,
2901or the standard output (file descriptor 1) if <VAR>n</VAR>
2902is not specified. If the file does not exist it is created;
2903if it does exist it is truncated to zero size.
2904<P>
2905
2906The general format for redirecting output is:
2907<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;[|]<VAR>word</VAR>
2908</pre></td></tr></table></P><P>
2909
2910If the redirection operator is <SAMP>`&#62;'</SAMP>, and the <CODE>noclobber</CODE>
2911option to the <CODE>set</CODE> builtin has been enabled, the redirection
2912will fail if the file whose name results from the expansion of
2913<VAR>word</VAR> exists and is a regular file.
2914If the redirection operator is <SAMP>`&#62;|'</SAMP>, or the redirection operator is
2915<SAMP>`&#62;'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection
2916is attempted even if the file named by <VAR>word</VAR> exists.
2917</P><P>
2918
2919<HR SIZE="6">
2920<A NAME="SEC42"></A>
2921<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2922<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &lt; </A>]</TD>
2923<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &gt; </A>]</TD>
2924<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &lt;&lt; </A>]</TD>
2925<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2926<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2927<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2928<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2929<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2930<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2931</TR></TABLE>
2932<H3> 3.6.3 Appending Redirected Output </H3>
2933<!--docid::SEC42::-->
2934Redirection of output in this fashion
2935causes the file whose name results from
2936the expansion of <VAR>word</VAR>
2937to be opened for appending on file descriptor <VAR>n</VAR>,
2938or the standard output (file descriptor 1) if <VAR>n</VAR>
2939is not specified. If the file does not exist it is created.
2940<P>
2941
2942The general format for appending output is:
2943<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#62;<VAR>word</VAR>
2944</pre></td></tr></table></P><P>
2945
2946<HR SIZE="6">
2947<A NAME="SEC43"></A>
2948<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2949<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &lt; </A>]</TD>
2950<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &gt; </A>]</TD>
2951<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &lt;&lt; </A>]</TD>
2952<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2953<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2954<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2955<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2956<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2957<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2958</TR></TABLE>
2959<H3> 3.6.4 Redirecting Standard Output and Standard Error </H3>
2960<!--docid::SEC43::-->
2961This construct allows both the
2962standard output (file descriptor 1) and
2963the standard error output (file descriptor 2)
2964to be redirected to the file whose name is the
2965expansion of <VAR>word</VAR>.
2966<P>
2967
2968There are two formats for redirecting standard output and
2969standard error:
2970<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#38;&#62;<VAR>word</VAR>
2971</pre></td></tr></table>and
2972<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;&#38;<VAR>word</VAR>
2973</pre></td></tr></table>Of the two forms, the first is preferred.
2974This is semantically equivalent to
2975<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;<VAR>word</VAR> 2&#62;&#38;1
2976</pre></td></tr></table></P><P>
2977
2978<HR SIZE="6">
2979<A NAME="SEC44"></A>
2980<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2981<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &lt; </A>]</TD>
2982<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &gt; </A>]</TD>
2983<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &lt;&lt; </A>]</TD>
2984<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2985<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2986<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2987<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2988<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2989<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2990</TR></TABLE>
2991<H3> 3.6.5 Appending Standard Output and Standard Error </H3>
2992<!--docid::SEC44::-->
2993This construct allows both the
2994standard output (file descriptor 1) and
2995the standard error output (file descriptor 2)
2996to be appended to the file whose name is the
2997expansion of <VAR>word</VAR>.
2998<P>
2999
3000The format for appending standard output and standard error is:
3001<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#38;&#62;&#62;<VAR>word</VAR>
3002</pre></td></tr></table>This is semantically equivalent to
3003<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;&#62;<VAR>word</VAR> 2&#62;&#38;1
3004</pre></td></tr></table></P><P>
3005
3006<HR SIZE="6">
3007<A NAME="SEC45"></A>
3008<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3009<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &lt; </A>]</TD>
3010<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &gt; </A>]</TD>
3011<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &lt;&lt; </A>]</TD>
3012<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3013<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3014<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3015<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3016<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3017<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3018</TR></TABLE>
3019<H3> 3.6.6 Here Documents </H3>
3020<!--docid::SEC45::-->
3021This type of redirection instructs the shell to read input from the
3022current source until a line containing only <VAR>word</VAR>
3023(with no trailing blanks) is seen. All of
3024the lines read up to that point are then used as the standard
3025input for a command.
3026<P>
3027
3028The format of here-documents is:
3029<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;&#60;[-]<VAR>word</VAR>
3030 <VAR>here-document</VAR>
3031<VAR>delimiter</VAR>
3032</pre></td></tr></table></P><P>
3033
3034No parameter expansion, command substitution, arithmetic expansion,
3035or filename expansion is performed on
3036<VAR>word</VAR>. If any characters in <VAR>word</VAR> are quoted, the
3037<VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>,
3038and the lines in the here-document are not expanded.
3039If <VAR>word</VAR> is unquoted,
3040all lines of the here-document are subjected to parameter expansion,
3041command substitution, and arithmetic expansion. In the latter
3042case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP>
3043must be used to quote the characters
3044<SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>.
3045</P><P>
3046
3047If the redirection operator is <SAMP>`&#60;&#60;-'</SAMP>,
3048then all leading tab characters are stripped from input lines and the
3049line containing <VAR>delimiter</VAR>.
3050This allows here-documents within shell scripts to be indented in a
3051natural fashion.
3052</P><P>
3053
3054<HR SIZE="6">
3055<A NAME="SEC46"></A>
3056<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3057<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &lt; </A>]</TD>
3058<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &gt; </A>]</TD>
3059<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &lt;&lt; </A>]</TD>
3060<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3061<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3062<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3063<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3064<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3065<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3066</TR></TABLE>
3067<H3> 3.6.7 Here Strings </H3>
3068<!--docid::SEC46::-->
3069A variant of here documents, the format is:
3070<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;&#60;&#60; <VAR>word</VAR>
3071</pre></td></tr></table><P>
3072
3073The <VAR>word</VAR> is expanded and supplied to the command on its standard
3074input.
3075</P><P>
3076
3077<HR SIZE="6">
3078<A NAME="SEC47"></A>
3079<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3080<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &lt; </A>]</TD>
3081<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &gt; </A>]</TD>
3082<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &lt;&lt; </A>]</TD>
3083<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3084<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3085<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3086<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3087<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3088<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3089</TR></TABLE>
3090<H3> 3.6.8 Duplicating File Descriptors </H3>
3091<!--docid::SEC47::-->
3092The redirection operator
3093<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#38;<VAR>word</VAR>
3094</pre></td></tr></table>is used to duplicate input file descriptors.
3095If <VAR>word</VAR>
3096expands to one or more digits, the file descriptor denoted by <VAR>n</VAR>
3097is made to be a copy of that file descriptor.
3098If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3099input, a redirection error occurs.
3100If <VAR>word</VAR>
3101evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed. If
3102<VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used.
3103<P>
3104
3105The operator
3106<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#38;<VAR>word</VAR>
3107</pre></td></tr></table>is used similarly to duplicate output file descriptors. If
3108<VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used.
3109If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3110output, a redirection error occurs.
3111As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not
3112expand to one or more digits, the standard output and standard
3113error are redirected as described previously.
3114</P><P>
3115
3116<HR SIZE="6">
3117<A NAME="SEC48"></A>
3118<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3119<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &lt; </A>]</TD>
3120<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> &gt; </A>]</TD>
3121<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt;&lt; </A>]</TD>
3122<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3123<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3124<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3125<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3126<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3127<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3128</TR></TABLE>
3129<H3> 3.6.9 Moving File Descriptors </H3>
3130<!--docid::SEC48::-->
3131The redirection operator
3132<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#38;<VAR>digit</VAR>-
3133</pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3134or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified.
3135<VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>.
3136<P>
3137
3138Similarly, the redirection operator
3139<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#38;<VAR>digit</VAR>-
3140</pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3141or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified.
3142</P><P>
3143
3144<HR SIZE="6">
3145<A NAME="SEC49"></A>
3146<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3147<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &lt; </A>]</TD>
3148<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt; </A>]</TD>
3149<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &lt;&lt; </A>]</TD>
3150<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3151<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3152<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3153<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3154<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3155<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3156</TR></TABLE>
3157<H3> 3.6.10 Opening File Descriptors for Reading and Writing </H3>
3158<!--docid::SEC49::-->
3159The redirection operator
3160<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#62;<VAR>word</VAR>
3161</pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR>
3162to be opened for both reading and writing on file descriptor
3163<VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR>
3164is not specified. If the file does not exist, it is created.
3165<P>
3166
3167<A NAME="Executing Commands"></A>
3168<HR SIZE="6">
3169<A NAME="SEC50"></A>
3170<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3171<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> &lt; </A>]</TD>
3172<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt; </A>]</TD>
3173<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt;&lt; </A>]</TD>
3174<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3175<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3176<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3177<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3178<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3179<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3180</TR></TABLE>
3181<H2> 3.7 Executing Commands </H2>
3182<!--docid::SEC50::-->
3183<P>
3184
3185<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3186<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before
3187 executing them.</TD></TR>
3188<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash finds commands and runs them.</TD></TR>
3189<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash
3190 executes commands that are not
3191 shell builtins.</TD></TR>
3192<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR>
3193<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash
3194 interprets it.</TD></TR>
3195<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs
3196 receives a signal.</TD></TR>
3197</TABLE></BLOCKQUOTE>
3198<P>
3199
3200<A NAME="Simple Command Expansion"></A>
3201<HR SIZE="6">
3202<A NAME="SEC51"></A>
3203<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3204<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt; </A>]</TD>
3205<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> &gt; </A>]</TD>
3206<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt;&lt; </A>]</TD>
3207<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3208<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3209<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3210<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3211<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3212<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3213</TR></TABLE>
3214<H3> 3.7.1 Simple Command Expansion </H3>
3215<!--docid::SEC51::-->
3216<P>
3217
3218When a simple command is executed, the shell performs the following
3219expansions, assignments, and redirections, from left to right.
3220</P><P>
3221
3222<OL>
3223<LI>
3224The words that the parser has marked as variable assignments (those
3225preceding the command name) and redirections are saved for later
3226processing.
3227<P>
3228
3229<LI>
3230The words that are not variable assignments or redirections are
3231expanded (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
3232If any words remain after expansion, the first word
3233is taken to be the name of the command and the remaining words are
3234the arguments.
3235<P>
3236
3237<LI>
3238Redirections are performed as described above (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
3239<P>
3240
3241<LI>
3242The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde
3243expansion, parameter expansion, command substitution, arithmetic expansion,
3244and quote removal before being assigned to the variable.
3245</OL>
3246<P>
3247
3248If no command name results, the variable assignments affect the current
3249shell environment. Otherwise, the variables are added to the environment
3250of the executed command and do not affect the current shell environment.
3251If any of the assignments attempts to assign a value to a readonly variable,
3252an error occurs, and the command exits with a non-zero status.
3253</P><P>
3254
3255If no command name results, redirections are performed, but do not
3256affect the current shell environment. A redirection error causes the
3257command to exit with a non-zero status.
3258</P><P>
3259
3260If there is a command name left after expansion, execution proceeds as
3261described below. Otherwise, the command exits. If one of the expansions
3262contained a command substitution, the exit status of the command is
3263the exit status of the last command substitution performed. If there
3264were no command substitutions, the command exits with a status of zero.
3265</P><P>
3266
3267<A NAME="Command Search and Execution"></A>
3268<HR SIZE="6">
3269<A NAME="SEC52"></A>
3270<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3271<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &lt; </A>]</TD>
3272<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &gt; </A>]</TD>
3273<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &lt;&lt; </A>]</TD>
3274<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3275<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3276<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3277<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3278<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3279<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3280</TR></TABLE>
3281<H3> 3.7.2 Command Search and Execution </H3>
3282<!--docid::SEC52::-->
3283<P>
3284
3285After a command has been split into words, if it results in a
3286simple command and an optional list of arguments, the following
3287actions are taken.
3288</P><P>
3289
3290<OL>
3291<LI>
3292If the command name contains no slashes, the shell attempts to
3293locate it. If there exists a shell function by that name, that
3294function is invoked as described in <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>.
3295<P>
3296
3297<LI>
3298If the name does not match a function, the shell searches for
3299it in the list of shell builtins. If a match is found, that
3300builtin is invoked.
3301<P>
3302
3303<LI>
3304If the name is neither a shell function nor a builtin,
3305and contains no slashes, Bash searches each element of
3306<CODE>$PATH</CODE> for a directory containing an executable file
3307by that name. Bash uses a hash table to remember the full
3308pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches
3309(see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
3310A full search of the directories in <CODE>$PATH</CODE>
3311is performed only if the command is not found in the hash table.
3312If the search is unsuccessful, the shell searches for a defined shell
3313function named <CODE>command_not_found_handle</CODE>.
3314If that function exists, it is invoked with the original command and
3315the original command's arguments as its arguments, and the function's
3316exit status becomes the exit status of the shell.
3317If that function is not defined, the shell prints an error
3318message and returns an exit status of 127.
3319<P>
3320
3321<LI>
3322If the search is successful, or if the command name contains
3323one or more slashes, the shell executes the named program in
3324a separate execution environment.
3325Argument 0 is set to the name given, and the remaining arguments
3326to the command are set to the arguments supplied, if any.
3327<P>
3328
3329<LI>
3330If this execution fails because the file is not in executable
3331format, and the file is not a directory, it is assumed to be a
3332<VAR>shell script</VAR> and the shell executes it as described in
3333<A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>.
3334<P>
3335
3336<LI>
3337If the command was not begun asynchronously, the shell waits for
3338the command to complete and collects its exit status.
3339<P>
3340
3341</OL>
3342<P>
3343
3344<A NAME="Command Execution Environment"></A>
3345<HR SIZE="6">
3346<A NAME="SEC53"></A>
3347<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3348<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> &lt; </A>]</TD>
3349<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &gt; </A>]</TD>
3350<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &lt;&lt; </A>]</TD>
3351<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3352<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3353<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3354<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3355<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3356<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3357</TR></TABLE>
3358<H3> 3.7.3 Command Execution Environment </H3>
3359<!--docid::SEC53::-->
3360<P>
3361
3362The shell has an <VAR>execution environment</VAR>, which consists of the
3363following:
3364</P><P>
3365
3366<UL>
3367<LI>
3368open files inherited by the shell at invocation, as modified by
3369redirections supplied to the <CODE>exec</CODE> builtin
3370<P>
3371
3372<LI>
3373the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or
3374<CODE>popd</CODE>, or inherited by the shell at invocation
3375<P>
3376
3377<LI>
3378the file creation mode mask as set by <CODE>umask</CODE> or inherited from
3379the shell's parent
3380<P>
3381
3382<LI>
3383current traps set by <CODE>trap</CODE>
3384<P>
3385
3386<LI>
3387shell parameters that are set by variable assignment or with <CODE>set</CODE>
3388or inherited from the shell's parent in the environment
3389<P>
3390
3391<LI>
3392shell functions defined during execution or inherited from the shell's
3393parent in the environment
3394<P>
3395
3396<LI>
3397options enabled at invocation (either by default or with command-line
3398arguments) or by <CODE>set</CODE>
3399<P>
3400
3401<LI>
3402options enabled by <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
3403<P>
3404
3405<LI>
3406shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>)
3407<P>
3408
3409<LI>
3410various process IDs, including those of background jobs
3411(see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of
3412<CODE>$PPID</CODE>
3413<P>
3414
3415</UL>
3416<P>
3417
3418When a simple command other than a builtin or shell function
3419is to be executed, it
3420is invoked in a separate execution environment that consists of
3421the following. Unless otherwise noted, the values are inherited
3422from the shell.
3423</P><P>
3424
3425<UL>
3426<LI>
3427the shell's open files, plus any modifications and additions specified
3428by redirections to the command
3429<P>
3430
3431<LI>
3432the current working directory
3433<P>
3434
3435<LI>
3436the file creation mode mask
3437<P>
3438
3439<LI>
3440shell variables and functions marked for export, along with variables
3441exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>)
3442<P>
3443
3444<LI>
3445traps caught by the shell are reset to the values inherited from the
3446shell's parent, and traps ignored by the shell are ignored
3447<P>
3448
3449</UL>
3450<P>
3451
3452A command invoked in this separate environment cannot affect the
3453shell's execution environment.
3454</P><P>
3455
3456Command substitution, commands grouped with parentheses,
3457and asynchronous commands are invoked in a
3458subshell environment that is a duplicate of the shell environment,
3459except that traps caught by the shell are reset to the values
3460that the shell inherited from its parent at invocation. Builtin
3461commands that are invoked as part of a pipeline are also executed
3462in a subshell environment. Changes made to the subshell environment
3463cannot affect the shell's execution environment.
3464</P><P>
3465
3466Subshells spawned to execute command substitutions inherit the value of
3467the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
3468Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
3469</P><P>
3470
3471If a command is followed by a <SAMP>`&#38;'</SAMP> and job control is not active, the
3472default standard input for the command is the empty file <TT>`/dev/null'</TT>.
3473Otherwise, the invoked command inherits the file descriptors of the calling
3474shell as modified by redirections.
3475</P><P>
3476
3477<A NAME="Environment"></A>
3478<HR SIZE="6">
3479<A NAME="SEC54"></A>
3480<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3481<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &lt; </A>]</TD>
3482<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &gt; </A>]</TD>
3483<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &lt;&lt; </A>]</TD>
3484<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3485<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3486<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3487<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3488<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3489<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3490</TR></TABLE>
3491<H3> 3.7.4 Environment </H3>
3492<!--docid::SEC54::-->
3493<P>
3494
3495When a program is invoked it is given an array of strings
3496called the <VAR>environment</VAR>.
3497This is a list of name-value pairs, of the form <CODE>name=value</CODE>.
3498</P><P>
3499
3500Bash provides several ways to manipulate the environment.
3501On invocation, the shell scans its own environment and
3502creates a parameter for each name found, automatically marking
3503it for <VAR>export</VAR>
3504to child processes. Executed commands inherit the environment.
3505The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP>
3506commands allow parameters and functions to be added to and
3507deleted from the environment. If the value of a parameter
3508in the environment is modified, the new value becomes part
3509of the environment, replacing the old. The environment
3510inherited by any executed command consists of the shell's
3511initial environment, whose values may be modified in the shell,
3512less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP>
3513commands, plus any additions via the <CODE>export</CODE> and
3514<SAMP>`declare -x'</SAMP> commands.
3515</P><P>
3516
3517The environment for any simple command
3518or function may be augmented temporarily by prefixing it with
3519parameter assignments, as described in <A HREF="bashref.html#SEC25">3.4 Shell Parameters</A>.
3520These assignment statements affect only the environment seen
3521by that command.
3522</P><P>
3523
3524If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), then all
3525parameter assignments are placed in the environment for a command,
3526not just those that precede the command name.
3527</P><P>
3528
3529When Bash invokes an external command, the variable <SAMP>`$_'</SAMP>
3530is set to the full path name of the command and passed to that
3531command in its environment.
3532</P><P>
3533
3534<A NAME="Exit Status"></A>
3535<HR SIZE="6">
3536<A NAME="SEC55"></A>
3537<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3538<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &lt; </A>]</TD>
3539<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &gt; </A>]</TD>
3540<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &lt;&lt; </A>]</TD>
3541<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3542<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3543<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3544<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3545<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3546<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3547</TR></TABLE>
3548<H3> 3.7.5 Exit Status </H3>
3549<!--docid::SEC55::-->
3550<P>
3551
3552The exit status of an executed command is the value returned by the
3553<VAR>waitpid</VAR> system call or equivalent function. Exit statuses
3554fall between 0 and 255, though, as explained below, the shell may
3555use values above 125 specially. Exit statuses from shell builtins and
3556compound commands are also limited to this range. Under certain
3557circumstances, the shell will use special values to indicate specific
3558failure modes.
3559</P><P>
3560
3561For the shell's purposes, a command which exits with a
3562zero exit status has succeeded.
3563A non-zero exit status indicates failure.
3564This seemingly counter-intuitive scheme is used so there
3565is one well-defined way to indicate success and a variety of
3566ways to indicate various failure modes.
3567When a command terminates on a fatal signal whose number is <VAR>N</VAR>,
3568Bash uses the value 128+<VAR>N</VAR> as the exit status.
3569</P><P>
3570
3571If a command is not found, the child process created to
3572execute it returns a status of 127. If a command is found
3573but is not executable, the return status is 126.
3574</P><P>
3575
3576If a command fails because of an error during expansion or redirection,
3577the exit status is greater than zero.
3578</P><P>
3579
3580The exit status is used by the Bash conditional commands
3581(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list
3582constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>).
3583</P><P>
3584
3585All of the Bash builtins return an exit status of zero if they succeed
3586and a non-zero status on failure, so they may be used by the
3587conditional and list constructs.
3588All builtins return an exit status of 2 to indicate incorrect usage.
3589</P><P>
3590
3591<A NAME="Signals"></A>
3592<HR SIZE="6">
3593<A NAME="SEC56"></A>
3594<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3595<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &lt; </A>]</TD>
3596<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt; </A>]</TD>
3597<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt;&lt; </A>]</TD>
3598<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3599<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3600<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3601<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3602<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3603<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3604</TR></TABLE>
3605<H3> 3.7.6 Signals </H3>
3606<!--docid::SEC56::-->
3607<P>
3608
3609When Bash is interactive, in the absence of any traps, it ignores
3610<CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell),
3611and <CODE>SIGINT</CODE>
3612is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible).
3613When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops.
3614In all cases, Bash ignores <CODE>SIGQUIT</CODE>.
3615If job control is in effect (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), Bash
3616ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3617</P><P>
3618
3619Non-builtin commands started by Bash have signal handlers set to the
3620values inherited by the shell from its parent.
3621When job control is not in effect, asynchronous commands
3622ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited
3623handlers.
3624Commands run as a result of
3625command substitution ignore the keyboard-generated job control signals
3626<CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3627</P><P>
3628
3629The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>.
3630Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to
3631all jobs, running or stopped.
3632Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive
3633the <CODE>SIGHUP</CODE>.
3634To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a
3635particular job, it should be removed
3636from the jobs table with the <CODE>disown</CODE>
3637builtin (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or marked
3638to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>.
3639</P><P>
3640
3641If the <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE>
3642(see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when
3643an interactive login shell exits.
3644</P><P>
3645
3646If Bash is waiting for a command to complete and receives a signal
3647for which a trap has been set, the trap will not be executed until
3648the command completes.
3649When Bash is waiting for an asynchronous
3650command via the <CODE>wait</CODE> builtin, the reception of a signal for
3651which a trap has been set will cause the <CODE>wait</CODE> builtin to return
3652immediately with an exit status greater than 128, immediately after
3653which the trap is executed.
3654</P><P>
3655
3656<A NAME="Shell Scripts"></A>
3657<HR SIZE="6">
3658<A NAME="SEC57"></A>
3659<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3660<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &lt; </A>]</TD>
3661<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt; </A>]</TD>
3662<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
3663<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3664<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3665<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3666<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3667<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3668<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3669</TR></TABLE>
3670<H2> 3.8 Shell Scripts </H2>
3671<!--docid::SEC57::-->
3672<P>
3673
3674A shell script is a text file containing shell commands. When such
3675a file is used as the first non-option argument when invoking Bash,
3676and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied
3677(see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>),
3678Bash reads and executes commands from the file, then exits. This
3679mode of operation creates a non-interactive shell. The shell first
3680searches for the file in the current directory, and looks in the
3681directories in <CODE>$PATH</CODE> if not found there.
3682</P><P>
3683
3684When Bash runs
3685a shell script, it sets the special parameter <CODE>0</CODE> to the name
3686of the file, rather than the name of the shell, and the positional
3687parameters are set to the remaining arguments, if any are given.
3688If no additional arguments are supplied, the positional parameters
3689are unset.
3690</P><P>
3691
3692A shell script may be made executable by using the <CODE>chmod</CODE> command
3693to turn on the execute bit. When Bash finds such a file while
3694searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to
3695execute it. In other words, executing
3696<TABLE><tr><td>&nbsp;</td><td class=example><pre>filename <VAR>arguments</VAR>
3697</pre></td></tr></table>is equivalent to executing
3698<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash filename <VAR>arguments</VAR>
3699</pre></td></tr></table></P><P>
3700
3701if <CODE>filename</CODE> is an executable shell script.
3702This subshell reinitializes itself, so that the effect is as if a
3703new shell had been invoked to interpret the script, with the
3704exception that the locations of commands remembered by the parent
3705(see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
3706are retained by the child.
3707</P><P>
3708
3709Most versions of Unix make this a part of the operating system's command
3710execution mechanism. If the first line of a script begins with
3711the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies
3712an interpreter for the program.
3713Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other
3714interpreter and write the rest of the script file in that language.
3715</P><P>
3716
3717The arguments to the interpreter
3718consist of a single optional argument following the interpreter
3719name on the first line of the script file, followed by the name of
3720the script file, followed by the rest of the arguments. Bash
3721will perform this action on operating systems that do not handle it
3722themselves. Note that some older versions of Unix limit the interpreter
3723name and argument to a maximum of 32 characters.
3724</P><P>
3725
3726Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that
3727Bash has been installed in <TT>`/bin'</TT>), since this ensures that
3728Bash will be used to interpret the script, even if it is executed
3729under another shell.
3730</P><P>
3731
3732<A NAME="Shell Builtin Commands"></A>
3733<HR SIZE="6">
3734<A NAME="SEC58"></A>
3735<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3736<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt; </A>]</TD>
3737<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &gt; </A>]</TD>
3738<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
3739<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
3740<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
3741<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3742<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3743<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3744<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3745</TR></TABLE>
3746<H1> 4. Shell Builtin Commands </H1>
3747<!--docid::SEC58::-->
3748<P>
3749
3750<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3751<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands inherited from the Bourne
3752 Shell.</TD></TR>
3753<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Table of builtins specific to Bash.</TD></TR>
3754<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtins to modify shell attributes and
3755 optional behavior.</TD></TR>
3756<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC64">4.4 Special Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands classified specially by
3757 POSIX.</TD></TR>
3758</TABLE></BLOCKQUOTE>
3759<P>
3760
3761Builtin commands are contained within the shell itself.
3762When the name of a builtin command is used as the first word of
3763a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes
3764the command directly, without invoking another program.
3765Builtin commands are necessary to implement functionality impossible
3766or inconvenient to obtain with separate utilities.
3767</P><P>
3768
3769This section briefly describes the builtins which Bash inherits from
3770the Bourne Shell, as well as the builtin commands which are unique
3771to or have been extended in Bash.
3772</P><P>
3773
3774Several builtin commands are described in other chapters: builtin
3775commands which provide the Bash interface to the job control
3776facilities (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>), the directory stack
3777(see section <A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>), the command history
3778(see section <A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>), and the programmable completion
3779facilities (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>).
3780</P><P>
3781
3782Many of the builtins have been extended by POSIX or Bash.
3783</P><P>
3784
3785Unless otherwise noted, each builtin command documented as accepting
3786options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP>
3787to signify the end of the options.
3788For example, the <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE>
3789builtins do not accept options.
3790</P><P>
3791
3792<A NAME="Bourne Shell Builtins"></A>
3793<HR SIZE="6">
3794<A NAME="SEC59"></A>
3795<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3796<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt; </A>]</TD>
3797<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> &gt; </A>]</TD>
3798<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </A>]</TD>
3799<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
3800<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
3801<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3802<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3803<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3804<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3805</TR></TABLE>
3806<H2> 4.1 Bourne Shell Builtins </H2>
3807<!--docid::SEC59::-->
3808<P>
3809
3810The following shell builtin commands are inherited from the Bourne Shell.
3811These commands are implemented as specified by the POSIX standard.
3812</P><P>
3813
3814<DL COMPACT>
3815<DT><CODE>: (a colon)</CODE>
3816<DD><A NAME="IDX68"></A>
3817<TABLE><tr><td>&nbsp;</td><td class=example><pre>: [<VAR>arguments</VAR>]
3818</pre></td></tr></table>Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections.
3819The return status is zero.
3820<P>
3821
3822<DT><CODE>. (a period)</CODE>
3823<DD><A NAME="IDX69"></A>
3824<TABLE><tr><td>&nbsp;</td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>]
3825</pre></td></tr></table>Read and execute commands from the <VAR>filename</VAR> argument in the
3826current shell context. If <VAR>filename</VAR> does not contain a slash,
3827the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>.
3828When Bash is not in POSIX mode, the current directory is searched
3829if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>.
3830If any <VAR>arguments</VAR> are supplied, they become the positional
3831parameters when <VAR>filename</VAR> is executed. Otherwise the positional
3832parameters are unchanged.
3833The return status is the exit status of the last command executed, or
3834zero if no commands are executed. If <VAR>filename</VAR> is not found, or
3835cannot be read, the return status is non-zero.
3836This builtin is equivalent to <CODE>source</CODE>.
3837<P>
3838
3839<DT><CODE>break</CODE>
3840<DD><A NAME="IDX70"></A>
3841<TABLE><tr><td>&nbsp;</td><td class=example><pre>break [<VAR>n</VAR>]
3842</pre></td></tr></table>Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop.
3843If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited.
3844<VAR>n</VAR> must be greater than or equal to 1.
3845The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
3846<P>
3847
3848<DT><CODE>cd</CODE>
3849<DD><A NAME="IDX71"></A>
3850<TABLE><tr><td>&nbsp;</td><td class=example><pre>cd [-L|-P] [<VAR>directory</VAR>]
3851</pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>.
3852If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell
3853variable is used.
3854If the shell variable <CODE>CDPATH</CODE> exists, it is used as a search path.
3855If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used.
3856<P>
3857
3858The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic
3859links are followed by default or with the <SAMP>`-L'</SAMP> option.
3860If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>.
3861</P><P>
3862
3863If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if
3864<SAMP>`-'</SAMP> is the first argument, and the directory change is
3865successful, the absolute pathname of the new working directory is
3866written to the standard output.
3867</P><P>
3868
3869The return status is zero if the directory is successfully changed,
3870non-zero otherwise.
3871</P><P>
3872
3873<DT><CODE>continue</CODE>
3874<DD><A NAME="IDX72"></A>
3875<TABLE><tr><td>&nbsp;</td><td class=example><pre>continue [<VAR>n</VAR>]
3876</pre></td></tr></table>Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>,
3877<CODE>until</CODE>, or <CODE>select</CODE> loop.
3878If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop
3879is resumed.
3880<VAR>n</VAR> must be greater than or equal to 1.
3881The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
3882<P>
3883
3884<DT><CODE>eval</CODE>
3885<DD><A NAME="IDX73"></A>
3886<TABLE><tr><td>&nbsp;</td><td class=example><pre>eval [<VAR>arguments</VAR>]
3887</pre></td></tr></table>The arguments are concatenated together into a single command, which is
3888then read and executed, and its exit status returned as the exit status
3889of <CODE>eval</CODE>.
3890If there are no arguments or only empty arguments, the return status is
3891zero.
3892<P>
3893
3894<DT><CODE>exec</CODE>
3895<DD><A NAME="IDX74"></A>
3896<TABLE><tr><td>&nbsp;</td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]]
3897</pre></td></tr></table>If <VAR>command</VAR>
3898is supplied, it replaces the shell without creating a new process.
3899If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the
3900beginning of the zeroth argument passed to <VAR>command</VAR>.
3901This is what the <CODE>login</CODE> program does.
3902The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty
3903environment.
3904If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth
3905argument to <VAR>command</VAR>.
3906If no <VAR>command</VAR> is specified, redirections may be used to affect
3907the current shell environment. If there are no redirection errors, the
3908return status is zero; otherwise the return status is non-zero.
3909<P>
3910
3911<DT><CODE>exit</CODE>
3912<DD><A NAME="IDX75"></A>
3913<TABLE><tr><td>&nbsp;</td><td class=example><pre>exit [<VAR>n</VAR>]
3914</pre></td></tr></table>Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent.
3915If <VAR>n</VAR> is omitted, the exit status is that of the last command executed.
3916Any trap on <CODE>EXIT</CODE> is executed before the shell terminates.
3917<P>
3918
3919<DT><CODE>export</CODE>
3920<DD><A NAME="IDX76"></A>
3921<TABLE><tr><td>&nbsp;</td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]]
3922</pre></td></tr></table>Mark each <VAR>name</VAR> to be passed to child processes
3923in the environment. If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s
3924refer to shell functions; otherwise the names refer to shell variables.
3925The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export.
3926If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a
3927list of exported names is displayed.
3928The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input.
3929If a variable name is followed by =<VAR>value</VAR>, the value of
3930the variable is set to <VAR>value</VAR>.
3931<P>
3932
3933The return status is zero unless an invalid option is supplied, one of
3934the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied
3935with a name that is not a shell function.
3936</P><P>
3937
3938<DT><CODE>getopts</CODE>
3939<DD><A NAME="IDX77"></A>
3940<TABLE><tr><td>&nbsp;</td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>]
3941</pre></td></tr></table><CODE>getopts</CODE> is used by shell scripts to parse positional parameters.
3942<VAR>optstring</VAR> contains the option characters to be recognized; if a
3943character is followed by a colon, the option is expected to have an
3944argument, which should be separated from it by white space.
3945The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be
3946used as option characters.
3947Each time it is invoked, <CODE>getopts</CODE>
3948places the next option in the shell variable <VAR>name</VAR>, initializing
3949<VAR>name</VAR> if it does not exist,
3950and the index of the next argument to be processed into the
3951variable <CODE>OPTIND</CODE>.
3952<CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script
3953is invoked.
3954When an option requires an argument,
3955<CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>.
3956The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually
3957reset between multiple calls to <CODE>getopts</CODE> within the same shell
3958invocation if a new set of parameters is to be used.
3959<P>
3960
3961When the end of options is encountered, <CODE>getopts</CODE> exits with a
3962return value greater than zero.
3963<CODE>OPTIND</CODE> is set to the index of the first non-option argument,
3964and <CODE>name</CODE> is set to <SAMP>`?'</SAMP>.
3965</P><P>
3966
3967<CODE>getopts</CODE>
3968normally parses the positional parameters, but if more arguments are
3969given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead.
3970</P><P>
3971
3972<CODE>getopts</CODE> can report errors in two ways. If the first character of
3973<VAR>optstring</VAR> is a colon, <VAR>silent</VAR>
3974error reporting is used. In normal operation diagnostic messages
3975are printed when invalid options or missing option arguments are
3976encountered.
3977If the variable <CODE>OPTERR</CODE>
3978is set to 0, no error messages will be displayed, even if the first
3979character of <CODE>optstring</CODE> is not a colon.
3980</P><P>
3981
3982If an invalid option is seen,
3983<CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent,
3984prints an error message and unsets <CODE>OPTARG</CODE>.
3985If <CODE>getopts</CODE> is silent, the option character found is placed in
3986<CODE>OPTARG</CODE> and no diagnostic message is printed.
3987</P><P>
3988
3989If a required argument is not found, and <CODE>getopts</CODE>
3990is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>,
3991<CODE>OPTARG</CODE> is unset, and a diagnostic message is printed.
3992If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in
3993<VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found.
3994</P><P>
3995
3996<DT><CODE>hash</CODE>
3997<DD><A NAME="IDX78"></A>
3998<TABLE><tr><td>&nbsp;</td><td class=example><pre>hash [-r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>]
3999</pre></td></tr></table>Remember the full pathnames of commands specified as <VAR>name</VAR> arguments,
4000so they need not be searched for on subsequent invocations.
4001The commands are found by searching through the directories listed in
4002<CODE>$PATH</CODE>.
4003The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is
4004used as the location of <VAR>name</VAR>.
4005The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations.
4006The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location
4007of each <VAR>name</VAR>.
4008If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each
4009<VAR>name</VAR> corresponds is printed. If multiple <VAR>name</VAR> arguments are
4010supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed
4011full pathname.
4012The <SAMP>`-l'</SAMP> option causes output to be displayed in a format
4013that may be reused as input.
4014If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied,
4015information about remembered commands is printed.
4016The return status is zero unless a <VAR>name</VAR> is not found or an invalid
4017option is supplied.
4018<P>
4019
4020<DT><CODE>pwd</CODE>
4021<DD><A NAME="IDX79"></A>
4022<TABLE><tr><td>&nbsp;</td><td class=example><pre>pwd [-LP]
4023</pre></td></tr></table>Print the absolute pathname of the current working directory.
4024If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not
4025contain symbolic links.
4026If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain
4027symbolic links.
4028The return status is zero unless an error is encountered while
4029determining the name of the current directory or an invalid option
4030is supplied.
4031<P>
4032
4033<DT><CODE>readonly</CODE>
4034<DD><A NAME="IDX80"></A>
4035<TABLE><tr><td>&nbsp;</td><td class=example><pre>readonly [-aApf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small>
4036</pre></td></tr></table>Mark each <VAR>name</VAR> as readonly.
4037The values of these names may not be changed by subsequent assignment.
4038If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell
4039function.
4040The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed
4041array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers
4042to an associative array variable.
4043If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP>
4044option is supplied, a list of all readonly names is printed.
4045The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that
4046may be reused as input.
4047If a variable name is followed by =<VAR>value</VAR>, the value of
4048the variable is set to <VAR>value</VAR>.
4049The return status is zero unless an invalid option is supplied, one of
4050the <VAR>name</VAR> arguments is not a valid shell variable or function name,
4051or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function.
4052<P>
4053
4054<DT><CODE>return</CODE>
4055<DD><A NAME="IDX81"></A>
4056<TABLE><tr><td>&nbsp;</td><td class=example><pre>return [<VAR>n</VAR>]
4057</pre></td></tr></table>Cause a shell function to exit with the return value <VAR>n</VAR>.
4058If <VAR>n</VAR> is not supplied, the return value is the exit status of the
4059last command executed in the function.
4060This may also be used to terminate execution of a script being executed
4061with the <CODE>.</CODE> (or <CODE>source</CODE>) builtin, returning either <VAR>n</VAR> or
4062the exit status of the last command executed within the script as the exit
4063status of the script.
4064Any command associated with the <CODE>RETURN</CODE> trap is executed
4065before execution resumes after the function or script.
4066The return status is non-zero if <CODE>return</CODE> is used outside a function
4067and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>.
4068<P>
4069
4070<DT><CODE>shift</CODE>
4071<DD><A NAME="IDX82"></A>
4072<TABLE><tr><td>&nbsp;</td><td class=example><pre>shift [<VAR>n</VAR>]
4073</pre></td></tr></table>Shift the positional parameters to the left by <VAR>n</VAR>.
4074The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are
4075renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>.
4076Parameters represented by the numbers <CODE>$#</CODE> to <CODE>$#</CODE>-<VAR>n</VAR>+1
4077are unset.
4078<VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>.
4079If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters
4080are not changed.
4081If <VAR>n</VAR> is not supplied, it is assumed to be 1.
4082The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or
4083less than zero, non-zero otherwise.
4084<P>
4085
4086<DT><CODE>test</CODE>
4087<DD><DT><CODE>[</CODE>
4088<DD><A NAME="IDX83"></A>
4089<A NAME="IDX84"></A>
4090Evaluate a conditional expression <VAR>expr</VAR>.
4091Each operator and operand must be a separate argument.
4092Expressions are composed of the primaries described below in
4093<A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>.
4094<CODE>test</CODE> does not accept any options, nor does it accept and ignore
4095an argument of <SAMP>`--'</SAMP> as signifying the end of options.
4096<P>
4097
4098When the <CODE>[</CODE> form is used, the last argument to the command must
4099be a <CODE>]</CODE>.
4100</P><P>
4101
4102Expressions may be combined using the following operators, listed in
4103decreasing order of precedence.
4104The evaluation depends on the number of arguments; see below.
4105</P><P>
4106
4107<DL COMPACT>
4108<DT><CODE>! <VAR>expr</VAR></CODE>
4109<DD>True if <VAR>expr</VAR> is false.
4110<P>
4111
4112<DT><CODE>( <VAR>expr</VAR> )</CODE>
4113<DD>Returns the value of <VAR>expr</VAR>.
4114This may be used to override the normal precedence of operators.
4115<P>
4116
4117<DT><CODE><VAR>expr1</VAR> -a <VAR>expr2</VAR></CODE>
4118<DD>True if both <VAR>expr1</VAR> and <VAR>expr2</VAR> are true.
4119<P>
4120
4121<DT><CODE><VAR>expr1</VAR> -o <VAR>expr2</VAR></CODE>
4122<DD>True if either <VAR>expr1</VAR> or <VAR>expr2</VAR> is true.
4123</DL>
4124<P>
4125
4126The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional
4127expressions using a set of rules based on the number of arguments.
4128</P><P>
4129
4130<DL COMPACT>
4131<DT>0 arguments
4132<DD>The expression is false.
4133<P>
4134
4135<DT>1 argument
4136<DD>The expression is true if and only if the argument is not null.
4137<P>
4138
4139<DT>2 arguments
4140<DD>If the first argument is <SAMP>`!'</SAMP>, the expression is true if and
4141only if the second argument is null.
4142If the first argument is one of the unary conditional operators
4143(see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the expression
4144is true if the unary test is true.
4145If the first argument is not a valid unary operator, the expression is
4146false.
4147<P>
4148
4149<DT>3 arguments
4150<DD>If the second argument is one of the binary conditional
4151operators (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the
4152result of the expression is the result of the binary test using the
4153first and third arguments as operands.
4154The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators
4155when there are three arguments.
4156If the first argument is <SAMP>`!'</SAMP>, the value is the negation of
4157the two-argument test using the second and third arguments.
4158If the first argument is exactly <SAMP>`('</SAMP> and the third argument is
4159exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second
4160argument.
4161Otherwise, the expression is false.
4162<P>
4163
4164<DT>4 arguments
4165<DD>If the first argument is <SAMP>`!'</SAMP>, the result is the negation of
4166the three-argument expression composed of the remaining arguments.
4167Otherwise, the expression is parsed and evaluated according to
4168precedence using the rules listed above.
4169<P>
4170
4171<DT>5 or more arguments
4172<DD>The expression is parsed and evaluated according to precedence
4173using the rules listed above.
4174</DL>
4175<P>
4176
4177<DT><CODE>times</CODE>
4178<DD><A NAME="IDX85"></A>
4179<TABLE><tr><td>&nbsp;</td><td class=example><pre>times
4180</pre></td></tr></table>Print out the user and system times used by the shell and its children.
4181The return status is zero.
4182<P>
4183
4184<DT><CODE>trap</CODE>
4185<DD><A NAME="IDX86"></A>
4186<TABLE><tr><td>&nbsp;</td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>]
4187</pre></td></tr></table>The commands in <VAR>arg</VAR> are to be read and executed when the
4188shell receives signal <VAR>sigspec</VAR>. If <VAR>arg</VAR> is absent (and
4189there is a single <VAR>sigspec</VAR>) or
4190equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset
4191to the value it had when the shell was started.
4192If <VAR>arg</VAR> is the null string, then the signal specified by
4193each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes.
4194If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied,
4195the shell displays the trap commands associated with each <VAR>sigspec</VAR>.
4196If no arguments are supplied, or
4197only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands
4198associated with each signal number in a form that may be reused as
4199shell input.
4200The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names
4201and their corresponding numbers.
4202Each <VAR>sigspec</VAR> is either a signal name or a signal number.
4203Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional.
4204If a <VAR>sigspec</VAR>
4205is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits.
4206If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed
4207before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
4208<CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
4209the first command executes in a shell function.
4210Refer to the description of the <CODE>extglob</CODE> option to the
4211<CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) for details of its
4212effect on the <CODE>DEBUG</CODE> trap.
4213If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR>
4214is executed whenever a simple command has a non-zero exit status,
4215subject to the following conditions.
4216The <CODE>ERR</CODE> trap is not executed if the failed command is part of the
4217command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword,
4218part of the test in an <CODE>if</CODE> statement,
4219part of a command executed in a <CODE>&#38;&#38;</CODE> or <CODE>||</CODE> list,
4220or if the command's return
4221status is being inverted using <CODE>!</CODE>.
4222These are the same conditions obeyed by the <CODE>errexit</CODE> option.
4223If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed
4224each time a shell function or a script executed with the <CODE>.</CODE> or
4225<CODE>source</CODE> builtins finishes executing.
4226<P>
4227
4228Signals ignored upon entry to the shell cannot be trapped or reset.
4229Trapped signals that are not being ignored are reset to their original
4230values in a child process when it is created.
4231</P><P>
4232
4233The return status is zero unless a <VAR>sigspec</VAR> does not specify a
4234valid signal.
4235</P><P>
4236
4237<DT><CODE>umask</CODE>
4238<DD><A NAME="IDX87"></A>
4239<TABLE><tr><td>&nbsp;</td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>]
4240</pre></td></tr></table>Set the shell process's file creation mask to <VAR>mode</VAR>. If
4241<VAR>mode</VAR> begins with a digit, it is interpreted as an octal number;
4242if not, it is interpreted as a symbolic mode mask similar
4243to that accepted by the <CODE>chmod</CODE> command. If <VAR>mode</VAR> is
4244omitted, the current value of the mask is printed. If the <SAMP>`-S'</SAMP>
4245option is supplied without a <VAR>mode</VAR> argument, the mask is printed
4246in a symbolic format.
4247If the <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR>
4248is omitted, the output is in a form that may be reused as input.
4249The return status is zero if the mode is successfully changed or if
4250no <VAR>mode</VAR> argument is supplied, and non-zero otherwise.
4251<P>
4252
4253Note that when the mode is interpreted as an octal number, each number
4254of the umask is subtracted from <CODE>7</CODE>. Thus, a umask of <CODE>022</CODE>
4255results in permissions of <CODE>755</CODE>.
4256</P><P>
4257
4258<DT><CODE>unset</CODE>
4259<DD><A NAME="IDX88"></A>
4260<TABLE><tr><td>&nbsp;</td><td class=example><pre>unset [-fv] [<VAR>name</VAR>]
4261</pre></td></tr></table>Each variable or function <VAR>name</VAR> is removed.
4262If no options are supplied, or the <SAMP>`-v'</SAMP> option is given, each
4263<VAR>name</VAR> refers to a shell variable.
4264If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell
4265functions, and the function definition is removed.
4266Readonly variables and functions may not be unset.
4267The return status is zero unless a <VAR>name</VAR> is readonly.
4268</DL>
4269<P>
4270
4271<A NAME="Bash Builtins"></A>
4272<HR SIZE="6">
4273<A NAME="SEC60"></A>
4274<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4275<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &lt; </A>]</TD>
4276<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &gt; </A>]</TD>
4277<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &lt;&lt; </A>]</TD>
4278<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
4279<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
4280<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4281<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4282<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
4283<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4284</TR></TABLE>
4285<H2> 4.2 Bash Builtin Commands </H2>
4286<!--docid::SEC60::-->
4287<P>
4288
4289This section describes builtin commands which are unique to
4290or have been extended in Bash.
4291Some of these commands are specified in the POSIX standard.
4292</P><P>
4293
4294<DL COMPACT>
4295
4296<DT><CODE>alias</CODE>
4297<DD><A NAME="IDX89"></A>
4298<TABLE><tr><td>&nbsp;</td><td class=example><pre>alias [<CODE>-p</CODE>] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4299</pre></td></tr></table><P>
4300
4301Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints
4302the list of aliases on the standard output in a form that allows
4303them to be reused as input.
4304If arguments are supplied, an alias is defined for each <VAR>name</VAR>
4305whose <VAR>value</VAR> is given. If no <VAR>value</VAR> is given, the name
4306and value of the alias is printed.
4307Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>.
4308</P><P>
4309
4310<DT><CODE>bind</CODE>
4311<DD><A NAME="IDX90"></A>
4312<TABLE><tr><td>&nbsp;</td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSV]
4313bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>]
4314bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR>
4315bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR>
4316bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR>
4317bind <VAR>readline-command</VAR>
4318</pre></td></tr></table><P>
4319
4320Display current Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>)
4321key and function bindings,
4322bind a key sequence to a Readline function or macro,
4323or set a Readline variable.
4324Each non-option argument is a command as it would appear in a
4325Readline initialization file (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>),
4326but each binding or command must be passed as a separate argument; e.g.,
4327<SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>.
4328</P><P>
4329
4330Options, if supplied, have the following meanings:
4331</P><P>
4332
4333<DL COMPACT>
4334<DT><CODE>-m <VAR>keymap</VAR></CODE>
4335<DD>Use <VAR>keymap</VAR> as the keymap to be affected by
4336the subsequent bindings. Acceptable <VAR>keymap</VAR>
4337names are
4338<CODE>emacs</CODE>,
4339<CODE>emacs-standard</CODE>,
4340<CODE>emacs-meta</CODE>,
4341<CODE>emacs-ctlx</CODE>,
4342<CODE>vi</CODE>,
4343<CODE>vi-move</CODE>,
4344<CODE>vi-command</CODE>, and
4345<CODE>vi-insert</CODE>.
4346<CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>;
4347<CODE>emacs</CODE> is equivalent to <CODE>emacs-standard</CODE>.
4348<P>
4349
4350<DT><CODE>-l</CODE>
4351<DD>List the names of all Readline functions.
4352<P>
4353
4354<DT><CODE>-p</CODE>
4355<DD>Display Readline function names and bindings in such a way that they
4356can be used as input or in a Readline initialization file.
4357<P>
4358
4359<DT><CODE>-P</CODE>
4360<DD>List current Readline function names and bindings.
4361<P>
4362
4363<DT><CODE>-v</CODE>
4364<DD>Display Readline variable names and values in such a way that they
4365can be used as input or in a Readline initialization file.
4366<P>
4367
4368<DT><CODE>-V</CODE>
4369<DD>List current Readline variable names and values.
4370<P>
4371
4372<DT><CODE>-s</CODE>
4373<DD>Display Readline key sequences bound to macros and the strings they output
4374in such a way that they can be used as input or in a Readline
4375initialization file.
4376<P>
4377
4378<DT><CODE>-S</CODE>
4379<DD>Display Readline key sequences bound to macros and the strings they output.
4380<P>
4381
4382<DT><CODE>-f <VAR>filename</VAR></CODE>
4383<DD>Read key bindings from <VAR>filename</VAR>.
4384<P>
4385
4386<DT><CODE>-q <VAR>function</VAR></CODE>
4387<DD>Query about which keys invoke the named <VAR>function</VAR>.
4388<P>
4389
4390<DT><CODE>-u <VAR>function</VAR></CODE>
4391<DD>Unbind all keys bound to the named <VAR>function</VAR>.
4392<P>
4393
4394<DT><CODE>-r <VAR>keyseq</VAR></CODE>
4395<DD>Remove any current binding for <VAR>keyseq</VAR>.
4396<P>
4397
4398<DT><CODE>-x <VAR>keyseq:shell-command</VAR></CODE>
4399<DD>Cause <VAR>shell-command</VAR> to be executed whenever <VAR>keyseq</VAR> is
4400entered.
4401When <VAR>shell-command</VAR> is executed, the shell sets the
4402<CODE>READLINE_LINE</CODE> variable to the contents of the Readline line
4403buffer and the <CODE>READLINE_POINT</CODE> variable to the current location
4404of the insertion point.
4405If the executed command changes the value of <CODE>READLINE_LINE</CODE> or
4406<CODE>READLINE_POINT</CODE>, those new values will be reflected in the
4407editing state.
4408</DL>
4409<P>
4410
4411The return status is zero unless an invalid option is supplied or an
4412error occurs.
4413</P><P>
4414
4415<DT><CODE>builtin</CODE>
4416<DD><A NAME="IDX91"></A>
4417<TABLE><tr><td>&nbsp;</td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]]
4418</pre></td></tr></table>Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status.
4419This is useful when defining a shell function with the same
4420name as a shell builtin, retaining the functionality of the builtin within
4421the function.
4422The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell
4423builtin command.
4424<P>
4425
4426<DT><CODE>caller</CODE>
4427<DD><A NAME="IDX92"></A>
4428<TABLE><tr><td>&nbsp;</td><td class=example><pre>caller [<VAR>expr</VAR>]
4429</pre></td></tr></table>Returns the context of any active subroutine call (a shell function or
4430a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins).
4431<P>
4432
4433Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source
4434filename of the current subroutine call.
4435If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE>
4436displays the line number, subroutine name, and source file corresponding
4437to that position in the current execution call stack. This extra
4438information may be used, for example, to print a stack trace. The
4439current frame is frame 0.
4440</P><P>
4441
4442The return value is 0 unless the shell is not executing a subroutine
4443call or <VAR>expr</VAR> does not correspond to a valid position in the
4444call stack.
4445</P><P>
4446
4447<DT><CODE>command</CODE>
4448<DD><A NAME="IDX93"></A>
4449<TABLE><tr><td>&nbsp;</td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>]
4450</pre></td></tr></table>Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function
4451named <VAR>command</VAR>.
4452Only shell builtin commands or commands found by searching the
4453<CODE>PATH</CODE> are executed.
4454If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP>
4455within the function will execute the external command <CODE>ls</CODE>
4456instead of calling the function recursively.
4457The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE>
4458that is guaranteed to find all of the standard utilities.
4459The return status in this case is 127 if <VAR>command</VAR> cannot be
4460found or an error occurred, and the exit status of <VAR>command</VAR>
4461otherwise.
4462<P>
4463
4464If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a
4465description of <VAR>command</VAR> is printed. The <SAMP>`-v'</SAMP> option
4466causes a single word indicating the command or file name used to
4467invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces
4468a more verbose description. In this case, the return status is
4469zero if <VAR>command</VAR> is found, and non-zero if not.
4470</P><P>
4471
4472<DT><CODE>declare</CODE>
4473<DD><A NAME="IDX94"></A>
4474<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare [-aAfFilrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4475</pre></td></tr></table><P>
4476
4477Declare variables and give them attributes. If no <VAR>name</VAR>s
4478are given, then display the values of variables instead.
4479</P><P>
4480
4481The <SAMP>`-p'</SAMP> option will display the attributes and values of each
4482<VAR>name</VAR>.
4483When <SAMP>`-p'</SAMP> is used with <VAR>name</VAR> arguments, additional options
4484are ignored.
4485</P><P>
4486
4487When <SAMP>`-p'</SAMP> is supplied without <VAR>name</VAR> arguments, <CODE>declare</CODE>
4488will display the attributes and values of all variables having the
4489attributes specified by the additional options.
4490If no other options are supplied with <SAMP>`-p'</SAMP>, <CODE>declare</CODE> will
4491display the attributes and values of all shell variables. The <SAMP>`-f'</SAMP>
4492option will restrict the display to shell functions.
4493</P><P>
4494
4495The <SAMP>`-F'</SAMP> option inhibits the display of function definitions;
4496only the function name and attributes are printed.
4497If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE>
4498(see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the source file name and line number where
4499the function is defined are displayed as well.
4500<SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>.
4501The following options can be used to restrict output to variables with
4502the specified attributes or to give variables attributes:
4503</P><P>
4504
4505<DL COMPACT>
4506<DT><CODE>-a</CODE>
4507<DD>Each <VAR>name</VAR> is an indexed array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
4508<P>
4509
4510<DT><CODE>-A</CODE>
4511<DD>Each <VAR>name</VAR> is an associative array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
4512<P>
4513
4514<DT><CODE>-f</CODE>
4515<DD>Use function names only.
4516<P>
4517
4518<DT><CODE>-i</CODE>
4519<DD>The variable is to be treated as
4520an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) is
4521performed when the variable is assigned a value.
4522<P>
4523
4524<DT><CODE>-l</CODE>
4525<DD>When the variable is assigned a value, all upper-case characters are
4526converted to lower-case.
4527The upper-case attribute is disabled.
4528<P>
4529
4530<DT><CODE>-r</CODE>
4531<DD>Make <VAR>name</VAR>s readonly. These names cannot then be assigned values
4532by subsequent assignment statements or unset.
4533<P>
4534
4535<DT><CODE>-t</CODE>
4536<DD>Give each <VAR>name</VAR> the <CODE>trace</CODE> attribute.
4537Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from
4538the calling shell.
4539The trace attribute has no special meaning for variables.
4540<P>
4541
4542<DT><CODE>-u</CODE>
4543<DD>When the variable is assigned a value, all lower-case characters are
4544converted to upper-case.
4545The lower-case attribute is disabled.
4546<P>
4547
4548<DT><CODE>-x</CODE>
4549<DD>Mark each <VAR>name</VAR> for export to subsequent commands via
4550the environment.
4551</DL>
4552<P>
4553
4554Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead,
4555with the exceptions that <SAMP>`+a'</SAMP>
4556may not be used to destroy an array variable and <SAMP>`+r'</SAMP> will not
4557remove the readonly attribute.
4558When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local,
4559as with the <CODE>local</CODE> command. If a variable name is followed by
4560=<VAR>value</VAR>, the value of the variable is set to <VAR>value</VAR>.
4561</P><P>
4562
4563The return status is zero unless an invalid option is encountered,
4564an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>,
4565an attempt is made to assign a value to a readonly variable,
4566an attempt is made to assign a value to an array variable without
4567using the compound assignment syntax (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>),
4568one of the <VAR>names</VAR> is not a valid shell variable name,
4569an attempt is made to turn off readonly status for a readonly variable,
4570an attempt is made to turn off array status for an array variable,
4571or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>.
4572</P><P>
4573
4574<DT><CODE>echo</CODE>
4575<DD><A NAME="IDX95"></A>
4576<TABLE><tr><td>&nbsp;</td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>]
4577</pre></td></tr></table>Output the <VAR>arg</VAR>s, separated by spaces, terminated with a
4578newline.
4579The return status is always 0.
4580If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed.
4581If the <SAMP>`-e'</SAMP> option is given, interpretation of the following
4582backslash-escaped characters is enabled.
4583The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters,
4584even on systems where they are interpreted by default.
4585The <CODE>xpg_echo</CODE> shell option may be used to
4586dynamically determine whether or not <CODE>echo</CODE> expands these
4587escape characters by default.
4588<CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options.
4589<P>
4590
4591<CODE>echo</CODE> interprets the following escape sequences:
4592<DL COMPACT>
4593<DT><CODE>\a</CODE>
4594<DD>alert (bell)
4595<DT><CODE>\b</CODE>
4596<DD>backspace
4597<DT><CODE>\c</CODE>
4598<DD>suppress further output
4599<DT><CODE>\e</CODE>
4600<DD>escape
4601<DT><CODE>\f</CODE>
4602<DD>form feed
4603<DT><CODE>\n</CODE>
4604<DD>new line
4605<DT><CODE>\r</CODE>
4606<DD>carriage return
4607<DT><CODE>\t</CODE>
4608<DD>horizontal tab
4609<DT><CODE>\v</CODE>
4610<DD>vertical tab
4611<DT><CODE>\\</CODE>
4612<DD>backslash
4613<DT><CODE>\0<VAR>nnn</VAR></CODE>
4614<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
4615(zero to three octal digits)
4616<DT><CODE>\x<VAR>HH</VAR></CODE>
4617<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
4618(one or two hex digits)
4619</DL>
4620<P>
4621
4622<DT><CODE>enable</CODE>
4623<DD><A NAME="IDX96"></A>
4624<TABLE><tr><td>&nbsp;</td><td class=example><pre>enable [-a] [-dnps] [-f <VAR>filename</VAR>] [<VAR>name</VAR> <small>...</small>]
4625</pre></td></tr></table>Enable and disable builtin shell commands.
4626Disabling a builtin allows a disk command which has the same name
4627as a shell builtin to be executed without specifying a full pathname,
4628even though the shell normally searches for builtins before disk commands.
4629If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled. Otherwise
4630<VAR>name</VAR>s are enabled. For example, to use the <CODE>test</CODE> binary
4631found via <CODE>$PATH</CODE> instead of the shell builtin version, type
4632<SAMP>`enable -n test'</SAMP>.
4633<P>
4634
4635If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear,
4636a list of shell builtins is printed. With no other arguments, the list
4637consists of all enabled shell builtins.
4638The <SAMP>`-a'</SAMP> option means to list
4639each builtin with an indication of whether or not it is enabled.
4640</P><P>
4641
4642The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR>
4643from shared object <VAR>filename</VAR>, on systems that support dynamic loading.
4644The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>.
4645</P><P>
4646
4647If there are no options, a list of the shell builtins is displayed.
4648The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special
4649builtins. If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes
4650a special builtin (see section <A HREF="bashref.html#SEC64">4.4 Special Builtins</A>).
4651</P><P>
4652
4653The return status is zero unless a <VAR>name</VAR> is not a shell builtin
4654or there is an error loading a new builtin from a shared object.
4655</P><P>
4656
4657<DT><CODE>help</CODE>
4658<DD><A NAME="IDX97"></A>
4659<TABLE><tr><td>&nbsp;</td><td class=example><pre>help [-dms] [<VAR>pattern</VAR>]
4660</pre></td></tr></table>Display helpful information about builtin commands.
4661If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help
4662on all commands matching <VAR>pattern</VAR>, otherwise a list of
4663the builtins is printed.
4664<P>
4665
4666Options, if supplied, have the following meanings:
4667</P><P>
4668
4669<DL COMPACT>
4670<DT><CODE>-d</CODE>
4671<DD>Display a short description of each <VAR>pattern</VAR>
4672<DT><CODE>-m</CODE>
4673<DD>Display the description of each <VAR>pattern</VAR> in a manpage-like format
4674<DT><CODE>-s</CODE>
4675<DD>Display only a short usage synopsis for each <VAR>pattern</VAR>
4676</DL>
4677<P>
4678
4679The return status is zero unless no command matches <VAR>pattern</VAR>.
4680</P><P>
4681
4682<DT><CODE>let</CODE>
4683<DD><A NAME="IDX98"></A>
4684<TABLE><tr><td>&nbsp;</td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR>]
4685</pre></td></tr></table>The <CODE>let</CODE> builtin allows arithmetic to be performed on shell
4686variables. Each <VAR>expression</VAR> is evaluated according to the
4687rules given below in <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>. If the
4688last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1;
4689otherwise 0 is returned.
4690<P>
4691
4692<DT><CODE>local</CODE>
4693<DD><A NAME="IDX99"></A>
4694<TABLE><tr><td>&nbsp;</td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>
4695</pre></td></tr></table>For each argument, a local variable named <VAR>name</VAR> is created,
4696and assigned <VAR>value</VAR>.
4697The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>.
4698<CODE>local</CODE> can only be used within a function; it makes the variable
4699<VAR>name</VAR> have a visible scope restricted to that function and its
4700children. The return status is zero unless <CODE>local</CODE> is used outside
4701a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a
4702readonly variable.
4703<P>
4704
4705<DT><CODE>logout</CODE>
4706<DD><A NAME="IDX100"></A>
4707<TABLE><tr><td>&nbsp;</td><td class=example><pre>logout [<VAR>n</VAR>]
4708</pre></td></tr></table>Exit a login shell, returning a status of <VAR>n</VAR> to the shell's
4709parent.
4710<P>
4711
4712<DT><CODE>mapfile</CODE>
4713<DD><A NAME="IDX101"></A>
4714<TABLE><tr><td>&nbsp;</td><td class=example><pre>mapfile [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [
4715-C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
4716</pre></td></tr></table>Read lines from the standard input into array variable <VAR>array</VAR>,
4717or from file descriptor <VAR>fd</VAR>
4718if the <SAMP>`-u'</SAMP> option is supplied.
4719The variable <CODE>MAPFILE</CODE> is the default <VAR>array</VAR>.
4720Options, if supplied, have the following meanings:
4721<DL COMPACT>
4722
4723<DT><CODE>-n</CODE>
4724<DD>Copy at most <VAR>count</VAR> lines. If <VAR>count</VAR> is 0, all lines are copied.
4725<DT><CODE>-O</CODE>
4726<DD>Begin assigning to <VAR>array</VAR> at index <VAR>origin</VAR>.
4727The default index is 0.
4728<DT><CODE>-s</CODE>
4729<DD>Discard the first <VAR>count</VAR> lines read.
4730<DT><CODE>-t</CODE>
4731<DD>Remove a trailing line from each line read.
4732<DT><CODE>-u</CODE>
4733<DD>Read lines from file descriptor <VAR>fd</VAR> instead of the standard input.
4734<DT><CODE>-C</CODE>
4735<DD>Evaluate <VAR>callback</VAR> each time <VAR>quantum</VAR>P lines are read.
4736The <SAMP>`-c'</SAMP> option specifies <VAR>quantum</VAR>.
4737<DT><CODE>-c</CODE>
4738<DD>Specify the number of lines read between each call to <VAR>callback</VAR>.
4739</DL>
4740<P>
4741
4742If <SAMP>`-C'</SAMP> is specified without <SAMP>`-c'</SAMP>,
4743the default quantum is 5000.
4744When <VAR>callback</VAR> is evaluated, it is supplied the index of the next
4745array element to be assigned as an additional argument.
4746<VAR>callback</VAR> is evaluated after the line is read but before the
4747array element is assigned.
4748</P><P>
4749
4750If not supplied with an explicit origin, <CODE>mapfile</CODE> will clear <VAR>array</VAR>
4751before assigning to it.
4752</P><P>
4753
4754<CODE>mapfile</CODE> returns successfully unless an invalid option or option
4755argument is supplied, or <VAR>array</VAR> is invalid or unassignable.
4756</P><P>
4757
4758<DT><CODE>printf</CODE>
4759<DD><A NAME="IDX102"></A>
4760<TABLE><tr><td>&nbsp;</td><td class=example><pre>printf [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>]
4761</pre></td></tr></table>Write the formatted <VAR>arguments</VAR> to the standard output under the
4762control of the <VAR>format</VAR>.
4763The <VAR>format</VAR> is a character string which contains three types of objects:
4764plain characters, which are simply copied to standard output, character
4765escape sequences, which are converted and copied to the standard output, and
4766format specifications, each of which causes printing of the next successive
4767<VAR>argument</VAR>.
4768In addition to the standard <CODE>printf(1)</CODE> formats, <SAMP>`%b'</SAMP> causes
4769<CODE>printf</CODE> to expand backslash escape sequences in the corresponding
4770<VAR>argument</VAR>,
4771(except that <SAMP>`\c'</SAMP> terminates output, backslashes in
4772<SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes
4773beginning with <SAMP>`\0'</SAMP> may contain up to four digits),
4774and <SAMP>`%q'</SAMP> causes <CODE>printf</CODE> to output the
4775corresponding <VAR>argument</VAR> in a format that can be reused as shell input.
4776<P>
4777
4778The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable
4779<VAR>var</VAR> rather than being printed to the standard output.
4780</P><P>
4781
4782The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>.
4783If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the
4784extra format specifications behave as if a zero value or null string, as
4785appropriate, had been supplied. The return value is zero on success,
4786non-zero on failure.
4787</P><P>
4788
4789<DT><CODE>read</CODE>
4790<DD><A NAME="IDX103"></A>
4791<TABLE><tr><td>&nbsp;</td><td class=example><pre>read [-ers] [-a <VAR>aname</VAR>] [-d <VAR>delim</VAR>] [-i <VAR>text</VAR>] [-n <VAR>nchars</VAR>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>]
4792</pre></td></tr></table>One line is read from the standard input, or from the file descriptor
4793<VAR>fd</VAR> supplied as an argument to the <SAMP>`-u'</SAMP> option, and the first word
4794is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>,
4795and so on, with leftover words and their intervening separators assigned
4796to the last <VAR>name</VAR>.
4797If there are fewer words read from the input stream than names,
4798the remaining names are assigned empty values.
4799The characters in the value of the <CODE>IFS</CODE> variable
4800are used to split the line into words.
4801The backslash character <SAMP>`\'</SAMP> may be used to remove any special
4802meaning for the next character read and for line continuation.
4803If no names are supplied, the line read is assigned to the
4804variable <CODE>REPLY</CODE>.
4805The return code is zero, unless end-of-file is encountered, <CODE>read</CODE>
4806times out (in which case the return code is greater than 128), or an
4807invalid file descriptor is supplied as the argument to <SAMP>`-u'</SAMP>.
4808<P>
4809
4810Options, if supplied, have the following meanings:
4811</P><P>
4812
4813<DL COMPACT>
4814<DT><CODE>-a <VAR>aname</VAR></CODE>
4815<DD>The words are assigned to sequential indices of the array variable
4816<VAR>aname</VAR>, starting at 0.
4817All elements are removed from <VAR>aname</VAR> before the assignment.
4818Other <VAR>name</VAR> arguments are ignored.
4819<P>
4820
4821<DT><CODE>-d <VAR>delim</VAR></CODE>
4822<DD>The first character of <VAR>delim</VAR> is used to terminate the input line,
4823rather than newline.
4824<P>
4825
4826<DT><CODE>-e</CODE>
4827<DD>Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to obtain the line.
4828Readline uses the current (or default, if line editing was not previously
4829active) editing settings.
4830<P>
4831
4832<DT><CODE>-i <VAR>text</VAR></CODE>
4833<DD>If Readline is being used to read the line, <VAR>text</VAR> is placed into
4834the editing buffer before editing begins.
4835<P>
4836
4837<DT><CODE>-n <VAR>nchars</VAR></CODE>
4838<DD><CODE>read</CODE> returns after reading <VAR>nchars</VAR> characters rather than
4839waiting for a complete line of input.
4840<P>
4841
4842<DT><CODE>-p <VAR>prompt</VAR></CODE>
4843<DD>Display <VAR>prompt</VAR>, without a trailing newline, before attempting
4844to read any input.
4845The prompt is displayed only if input is coming from a terminal.
4846<P>
4847
4848<DT><CODE>-r</CODE>
4849<DD>If this option is given, backslash does not act as an escape character.
4850The backslash is considered to be part of the line.
4851In particular, a backslash-newline pair may not be used as a line
4852continuation.
4853<P>
4854
4855<DT><CODE>-s</CODE>
4856<DD>Silent mode. If input is coming from a terminal, characters are
4857not echoed.
4858<P>
4859
4860<DT><CODE>-t <VAR>timeout</VAR></CODE>
4861<DD>Cause <CODE>read</CODE> to time out and return failure if a complete line of
4862input is not read within <VAR>timeout</VAR> seconds.
4863<VAR>timeout</VAR> may be a decimal number with a fractional portion following
4864the decimal point.
4865This option is only effective if <CODE>read</CODE> is reading input from a
4866terminal, pipe, or other special file; it has no effect when reading
4867from regular files.
4868If <VAR>timeout</VAR> is 0, <CODE>read</CODE> returns success if input is available on
4869the specified file descriptor, failure otherwise.
4870The exit status is greater than 128 if the timeout is exceeded.
4871<P>
4872
4873<DT><CODE>-u <VAR>fd</VAR></CODE>
4874<DD>Read input from file descriptor <VAR>fd</VAR>.
4875<P>
4876
4877</DL>
4878<P>
4879
4880<DT><CODE>readarray</CODE>
4881<DD><A NAME="IDX104"></A>
4882<TABLE><tr><td>&nbsp;</td><td class=example><pre>readarray [-n <VAR>count</VAR>] [-O <VAR>origin</VAR>] [-s <VAR>count</VAR>] [-t] [-u <VAR>fd</VAR>] [
4883-C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
4884</pre></td></tr></table>Read lines from the standard input into array variable <VAR>array</VAR>,
4885or from file descriptor <VAR>fd</VAR>
4886if the <SAMP>`-u'</SAMP> option is supplied.
4887<P>
4888
4889A synonym for <CODE>mapfile</CODE>.
4890</P><P>
4891
4892<DT><CODE>source</CODE>
4893<DD><A NAME="IDX105"></A>
4894<TABLE><tr><td>&nbsp;</td><td class=example><pre>source <VAR>filename</VAR>
4895</pre></td></tr></table>A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
4896<P>
4897
4898<DT><CODE>type</CODE>
4899<DD><A NAME="IDX106"></A>
4900<TABLE><tr><td>&nbsp;</td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>]
4901</pre></td></tr></table>For each <VAR>name</VAR>, indicate how it would be interpreted if used as a
4902command name.
4903<P>
4904
4905If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word
4906which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>,
4907<SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>,
4908if <VAR>name</VAR> is an alias, shell function, shell builtin,
4909disk file, or shell reserved word, respectively.
4910If the <VAR>name</VAR> is not found, then nothing is printed, and
4911<CODE>type</CODE> returns a failure status.
4912</P><P>
4913
4914If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name
4915of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP>
4916would not return <SAMP>`file'</SAMP>.
4917</P><P>
4918
4919The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if
4920<SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>.
4921</P><P>
4922
4923If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value,
4924not necessarily the file that appears first in <CODE>$PATH</CODE>.
4925</P><P>
4926
4927If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places
4928that contain an executable named <VAR>file</VAR>.
4929This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option
4930is not also used.
4931</P><P>
4932
4933If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find
4934shell functions, as with the <CODE>command</CODE> builtin.
4935</P><P>
4936
4937The return status is zero if all of the <VAR>names</VAR> are found, non-zero
4938if any are not found.
4939</P><P>
4940
4941<DT><CODE>typeset</CODE>
4942<DD><A NAME="IDX107"></A>
4943<TABLE><tr><td>&nbsp;</td><td class=example><pre>typeset [-afFrxi] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4944</pre></td></tr></table>The <CODE>typeset</CODE> command is supplied for compatibility with the Korn
4945shell; however, it has been deprecated in favor of the <CODE>declare</CODE>
4946builtin command.
4947<P>
4948
4949<DT><CODE>ulimit</CODE>
4950<DD><A NAME="IDX108"></A>
4951<TABLE><tr><td>&nbsp;</td><td class=example><pre>ulimit [-abcdefilmnpqrstuvxHST] [<VAR>limit</VAR>]
4952</pre></td></tr></table><CODE>ulimit</CODE> provides control over the resources available to processes
4953started by the shell, on systems that allow such control. If an
4954option is given, it is interpreted as follows:
4955<DL COMPACT>
4956<DT><CODE>-S</CODE>
4957<DD>Change and report the soft limit associated with a resource.
4958<P>
4959
4960<DT><CODE>-H</CODE>
4961<DD>Change and report the hard limit associated with a resource.
4962<P>
4963
4964<DT><CODE>-a</CODE>
4965<DD>All current limits are reported.
4966<P>
4967
4968<DT><CODE>-b</CODE>
4969<DD>The maximum socket buffer size.
4970<P>
4971
4972<DT><CODE>-c</CODE>
4973<DD>The maximum size of core files created.
4974<P>
4975
4976<DT><CODE>-d</CODE>
4977<DD>The maximum size of a process's data segment.
4978<P>
4979
4980<DT><CODE>-e</CODE>
4981<DD>The maximum scheduling priority ("nice").
4982<P>
4983
4984<DT><CODE>-f</CODE>
4985<DD>The maximum size of files written by the shell and its children.
4986<P>
4987
4988<DT><CODE>-i</CODE>
4989<DD>The maximum number of pending signals.
4990<P>
4991
4992<DT><CODE>-l</CODE>
4993<DD>The maximum size that may be locked into memory.
4994<P>
4995
4996<DT><CODE>-m</CODE>
4997<DD>The maximum resident set size.
4998<P>
4999
5000<DT><CODE>-n</CODE>
5001<DD>The maximum number of open file descriptors.
5002<P>
5003
5004<DT><CODE>-p</CODE>
5005<DD>The pipe buffer size.
5006<P>
5007
5008<DT><CODE>-q</CODE>
5009<DD>The maximum number of bytes in POSIX message queues.
5010<P>
5011
5012<DT><CODE>-r</CODE>
5013<DD>The maximum real-time scheduling priority.
5014<P>
5015
5016<DT><CODE>-s</CODE>
5017<DD>The maximum stack size.
5018<P>
5019
5020<DT><CODE>-t</CODE>
5021<DD>The maximum amount of cpu time in seconds.
5022<P>
5023
5024<DT><CODE>-u</CODE>
5025<DD>The maximum number of processes available to a single user.
5026<P>
5027
5028<DT><CODE>-v</CODE>
5029<DD>The maximum amount of virtual memory available to the process.
5030<P>
5031
5032<DT><CODE>-x</CODE>
5033<DD>The maximum number of file locks.
5034<P>
5035
5036<DT><CODE>-T</CODE>
5037<DD>The maximum number of threads.
5038<P>
5039
5040</DL>
5041<P>
5042
5043If <VAR>limit</VAR> is given, it is the new value of the specified resource;
5044the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and
5045<CODE>unlimited</CODE> stand for the current hard limit, the current soft limit,
5046and no limit, respectively.
5047A hard limit cannot be increased by a non-root user once it is set;
5048a soft limit may be increased up to the value of the hard limit.
5049Otherwise, the current value of the soft limit for the specified resource
5050is printed, unless the <SAMP>`-H'</SAMP> option is supplied.
5051When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied,
5052both the hard and soft limits are set.
5053If no option is given, then <SAMP>`-f'</SAMP> is assumed. Values are in 1024-byte
5054increments, except for <SAMP>`-t'</SAMP>, which is in seconds, <SAMP>`-p'</SAMP>,
5055which is in units of 512-byte blocks, and <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which
5056are unscaled values.
5057</P><P>
5058
5059The return status is zero unless an invalid option or argument is supplied,
5060or an error occurs while setting a new limit.
5061</P><P>
5062
5063<DT><CODE>unalias</CODE>
5064<DD><A NAME="IDX109"></A>
5065<TABLE><tr><td>&nbsp;</td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ]
5066</pre></td></tr></table><P>
5067
5068Remove each <VAR>name</VAR> from the list of aliases. If <SAMP>`-a'</SAMP> is
5069supplied, all aliases are removed.
5070Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>.
5071</P><P>
5072
5073</DL>
5074<P>
5075
5076<A NAME="Modifying Shell Behavior"></A>
5077<HR SIZE="6">
5078<A NAME="SEC61"></A>
5079<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5080<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> &lt; </A>]</TD>
5081<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> &gt; </A>]</TD>
5082<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt;&lt; </A>]</TD>
5083<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
5084<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt;&gt; </A>]</TD>
5085<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5086<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5087<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5088<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5089</TR></TABLE>
5090<H2> 4.3 Modifying Shell Behavior </H2>
5091<!--docid::SEC61::-->
5092
5093<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
5094<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Change the values of shell attributes and
5095 positional parameters.</TD></TR>
5096<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Modify shell optional behavior.</TD></TR>
5097</TABLE></BLOCKQUOTE>
5098<P>
5099
5100<A NAME="The Set Builtin"></A>
5101<HR SIZE="6">
5102<A NAME="SEC62"></A>
5103<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5104<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &lt; </A>]</TD>
5105<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> &gt; </A>]</TD>
5106<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt;&lt; </A>]</TD>
5107<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD>
5108<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt;&gt; </A>]</TD>
5109<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5110<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5111<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5112<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5113</TR></TABLE>
5114<H3> 4.3.1 The Set Builtin </H3>
5115<!--docid::SEC62::-->
5116<P>
5117
5118This builtin is so complicated that it deserves its own section. <CODE>set</CODE>
5119allows you to change the values of shell options and set the positional
5120parameters, or to display the names and values of shell variables.
5121</P><P>
5122
5123<DL COMPACT>
5124<DT><CODE>set</CODE>
5125<DD><A NAME="IDX110"></A>
5126<TABLE><tr><td>&nbsp;</td><td class=example><pre>set [--abefhkmnptuvxBCEHPT] [-o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>]
5127set [+abefhkmnptuvxBCEHPT] [+o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>]
5128</pre></td></tr></table><P>
5129
5130If no options or arguments are supplied, <CODE>set</CODE> displays the names
5131and values of all shell variables and functions, sorted according to the
5132current locale, in a format that may be reused as input
5133for setting or resetting the currently-set variables.
5134Read-only variables cannot be reset.
5135In POSIX mode, only shell variables are listed.
5136</P><P>
5137
5138When options are supplied, they set or unset shell attributes.
5139Options, if specified, have the following meanings:
5140</P><P>
5141
5142<DL COMPACT>
5143<DT><CODE>-a</CODE>
5144<DD>Mark variables and function which are modified or created for export
5145to the environment of subsequent commands.
5146<P>
5147
5148<DT><CODE>-b</CODE>
5149<DD>Cause the status of terminated background jobs to be reported
5150immediately, rather than before printing the next primary prompt.
5151<P>
5152
5153<DT><CODE>-e</CODE>
5154<DD>Exit immediately if a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>) exits
5155with a non-zero status, unless the command that fails is part of the
5156command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> keyword,
5157part of the test in an <CODE>if</CODE> statement,
5158part of a command executed in a <CODE>&#38;&#38;</CODE> or <CODE>||b</CODE> list,
5159any command in a pipeline but the last,
5160or if the command's return status is being inverted using <CODE>!</CODE>.
5161Failing simple commands that are part of shell functions or command lists
5162enclosed in braces or parentheses satisfying the above conditions do not
5163cause the shell to exit.
5164A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits.
5165<P>
5166
5167<DT><CODE>-f</CODE>
5168<DD>Disable file name generation (globbing).
5169<P>
5170
5171<DT><CODE>-h</CODE>
5172<DD>Locate and remember (hash) commands as they are looked up for execution.
5173This option is enabled by default.
5174<P>
5175
5176<DT><CODE>-k</CODE>
5177<DD>All arguments in the form of assignment statements are placed
5178in the environment for a command, not just those that precede
5179the command name.
5180<P>
5181
5182<DT><CODE>-m</CODE>
5183<DD>Job control is enabled (see section <A HREF="bashref.html#SEC91">7. Job Control</A>).
5184<P>
5185
5186<DT><CODE>-n</CODE>
5187<DD>Read commands but do not execute them; this may be used to check a
5188script for syntax errors.
5189This option is ignored by interactive shells.
5190<P>
5191
5192<DT><CODE>-o <VAR>option-name</VAR></CODE>
5193<DD><P>
5194
5195Set the option corresponding to <VAR>option-name</VAR>:
5196</P><P>
5197
5198<DL COMPACT>
5199<DT><CODE>allexport</CODE>
5200<DD>Same as <CODE>-a</CODE>.
5201<P>
5202
5203<DT><CODE>braceexpand</CODE>
5204<DD>Same as <CODE>-B</CODE>.
5205<P>
5206
5207<DT><CODE>emacs</CODE>
5208<DD>Use an <CODE>emacs</CODE>-style line editing interface (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>).
5209This also affects the editing interface used for <CODE>read -e</CODE>.
5210<P>
5211
5212<DT><CODE>errexit</CODE>
5213<DD>Same as <CODE>-e</CODE>.
5214<P>
5215
5216<DT><CODE>errtrace</CODE>
5217<DD>Same as <CODE>-E</CODE>.
5218<P>
5219
5220<DT><CODE>functrace</CODE>
5221<DD>Same as <CODE>-T</CODE>.
5222<P>
5223
5224<DT><CODE>hashall</CODE>
5225<DD>Same as <CODE>-h</CODE>.
5226<P>
5227
5228<DT><CODE>histexpand</CODE>
5229<DD>Same as <CODE>-H</CODE>.
5230<P>
5231
5232<DT><CODE>history</CODE>
5233<DD>Enable command history, as described in <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>.
5234This option is on by default in interactive shells.
5235<P>
5236
5237<DT><CODE>ignoreeof</CODE>
5238<DD>An interactive shell will not exit upon reading EOF.
5239<P>
5240
5241<DT><CODE>keyword</CODE>
5242<DD>Same as <CODE>-k</CODE>.
5243<P>
5244
5245<DT><CODE>monitor</CODE>
5246<DD>Same as <CODE>-m</CODE>.
5247<P>
5248
5249<DT><CODE>noclobber</CODE>
5250<DD>Same as <CODE>-C</CODE>.
5251<P>
5252
5253<DT><CODE>noexec</CODE>
5254<DD>Same as <CODE>-n</CODE>.
5255<P>
5256
5257<DT><CODE>noglob</CODE>
5258<DD>Same as <CODE>-f</CODE>.
5259<P>
5260
5261<DT><CODE>nolog</CODE>
5262<DD>Currently ignored.
5263<P>
5264
5265<DT><CODE>notify</CODE>
5266<DD>Same as <CODE>-b</CODE>.
5267<P>
5268
5269<DT><CODE>nounset</CODE>
5270<DD>Same as <CODE>-u</CODE>.
5271<P>
5272
5273<DT><CODE>onecmd</CODE>
5274<DD>Same as <CODE>-t</CODE>.
5275<P>
5276
5277<DT><CODE>physical</CODE>
5278<DD>Same as <CODE>-P</CODE>.
5279<P>
5280
5281<DT><CODE>pipefail</CODE>
5282<DD>If set, the return value of a pipeline is the value of the last
5283(rightmost) command to exit with a non-zero status, or zero if all
5284commands in the pipeline exit successfully.
5285This option is disabled by default.
5286<P>
5287
5288<DT><CODE>posix</CODE>
5289<DD>Change the behavior of Bash where the default operation differs
5290from the POSIX standard to match the standard
5291(see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
5292This is intended to make Bash behave as a strict superset of that
5293standard.
5294<P>
5295
5296<DT><CODE>privileged</CODE>
5297<DD>Same as <CODE>-p</CODE>.
5298<P>
5299
5300<DT><CODE>verbose</CODE>
5301<DD>Same as <CODE>-v</CODE>.
5302<P>
5303
5304<DT><CODE>vi</CODE>
5305<DD>Use a <CODE>vi</CODE>-style line editing interface.
5306This also affects the editing interface used for <CODE>read -e</CODE>.
5307<P>
5308
5309<DT><CODE>xtrace</CODE>
5310<DD>Same as <CODE>-x</CODE>.
5311</DL>
5312<P>
5313
5314<DT><CODE>-p</CODE>
5315<DD>Turn on privileged mode.
5316In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not
5317processed, shell functions are not inherited from the environment,
5318and the <CODE>SHELLOPTS</CODE>, <CODE>CDPATH</CODE> and <CODE>GLOBIGNORE</CODE> variables,
5319if they appear in the environment, are ignored.
5320If the shell is started with the effective user (group) id not equal to the
5321real user (group) id, and the <CODE>-p</CODE> option is not supplied, these actions
5322are taken and the effective user id is set to the real user id.
5323If the <CODE>-p</CODE> option is supplied at startup, the effective user id is
5324not reset.
5325Turning this option off causes the effective user
5326and group ids to be set to the real user and group ids.
5327<P>
5328
5329<DT><CODE>-t</CODE>
5330<DD>Exit after reading and executing one command.
5331<P>
5332
5333<DT><CODE>-u</CODE>
5334<DD>Treat unset variables as an error when performing parameter expansion.
5335An error message will be written to the standard error, and a non-interactive
5336shell will exit.
5337<P>
5338
5339<DT><CODE>-v</CODE>
5340<DD>Print shell input lines as they are read.
5341<P>
5342
5343<DT><CODE>-x</CODE>
5344<DD>Print a trace of simple commands, <CODE>for</CODE> commands, <CODE>case</CODE>
5345commands, <CODE>select</CODE> commands, and arithmetic <CODE>for</CODE> commands
5346and their arguments or associated word lists after they are
5347expanded and before they are executed. The value of the <CODE>PS4</CODE>
5348variable is expanded and the resultant value is printed before
5349the command and its expanded arguments.
5350<P>
5351
5352<DT><CODE>-B</CODE>
5353<DD>The shell will perform brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>).
5354This option is on by default.
5355<P>
5356
5357<DT><CODE>-C</CODE>
5358<DD>Prevent output redirection using <SAMP>`&#62;'</SAMP>, <SAMP>`&#62;&#38;'</SAMP>, and <SAMP>`&#60;&#62;'</SAMP>
5359from overwriting existing files.
5360<P>
5361
5362<DT><CODE>-E</CODE>
5363<DD>If set, any trap on <CODE>ERR</CODE> is inherited by shell functions, command
5364substitutions, and commands executed in a subshell environment.
5365The <CODE>ERR</CODE> trap is normally not inherited in such cases.
5366<P>
5367
5368<DT><CODE>-H</CODE>
5369<DD>Enable <SAMP>`!'</SAMP> style history substitution (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
5370This option is on by default for interactive shells.
5371<P>
5372
5373<DT><CODE>-P</CODE>
5374<DD>If set, do not follow symbolic links when performing commands such as
5375<CODE>cd</CODE> which change the current directory. The physical directory
5376is used instead. By default, Bash follows
5377the logical chain of directories when performing commands
5378which change the current directory.
5379<P>
5380
5381For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT>
5382then:
5383<TABLE><tr><td>&nbsp;</td><td class=example><pre>$ cd /usr/sys; echo $PWD
5384/usr/sys
5385$ cd ..; pwd
5386/usr
5387</pre></td></tr></table></P><P>
5388
5389If <CODE>set -P</CODE> is on, then:
5390<TABLE><tr><td>&nbsp;</td><td class=example><pre>$ cd /usr/sys; echo $PWD
5391/usr/local/sys
5392$ cd ..; pwd
5393/usr/local
5394</pre></td></tr></table></P><P>
5395
5396<DT><CODE>-T</CODE>
5397<DD>If set, any trap on <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> are inherited by
5398shell functions, command substitutions, and commands executed
5399in a subshell environment.
5400The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited
5401in such cases.
5402<P>
5403
5404<DT><CODE>--</CODE>
5405<DD>If no arguments follow this option, then the positional parameters are
5406unset. Otherwise, the positional parameters are set to the
5407<VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>.
5408<P>
5409
5410<DT><CODE>-</CODE>
5411<DD>Signal the end of options, cause all remaining <VAR>arguments</VAR>
5412to be assigned to the positional parameters. The <SAMP>`-x'</SAMP>
5413and <SAMP>`-v'</SAMP> options are turned off.
5414If there are no arguments, the positional parameters remain unchanged.
5415</DL>
5416<P>
5417
5418Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be
5419turned off. The options can also be used upon invocation of the
5420shell. The current set of options may be found in <CODE>$-</CODE>.
5421</P><P>
5422
5423The remaining N <VAR>arguments</VAR> are positional parameters and are
5424assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small> <CODE>$N</CODE>.
5425The special parameter <CODE>#</CODE> is set to N.
5426</P><P>
5427
5428The return status is always zero unless an invalid option is supplied.
5429</DL>
5430<P>
5431
5432<A NAME="The Shopt Builtin"></A>
5433<HR SIZE="6">
5434<A NAME="SEC63"></A>
5435<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5436<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> &lt; </A>]</TD>
5437<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt; </A>]</TD>
5438<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt;&lt; </A>]</TD>
5439<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD>
5440<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt;&gt; </A>]</TD>
5441<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5442<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5443<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5444<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5445</TR></TABLE>
5446<H3> 4.3.2 The Shopt Builtin </H3>
5447<!--docid::SEC63::-->
5448<P>
5449
5450This builtin allows you to change additional shell optional behavior.
5451</P><P>
5452
5453<DL COMPACT>
5454
5455<DT><CODE>shopt</CODE>
5456<DD><A NAME="IDX111"></A>
5457<TABLE><tr><td>&nbsp;</td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>]
5458</pre></td></tr></table>Toggle the values of variables controlling optional shell behavior.
5459With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable
5460options is displayed, with an indication of whether or not each is set.
5461The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that
5462may be reused as input.
5463Other options have the following meanings:
5464<P>
5465
5466<DL COMPACT>
5467<DT><CODE>-s</CODE>
5468<DD>Enable (set) each <VAR>optname</VAR>.
5469<P>
5470
5471<DT><CODE>-u</CODE>
5472<DD>Disable (unset) each <VAR>optname</VAR>.
5473<P>
5474
5475<DT><CODE>-q</CODE>
5476<DD>Suppresses normal output; the return status
5477indicates whether the <VAR>optname</VAR> is set or unset.
5478If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>,
5479the return status is zero if all <VAR>optnames</VAR> are enabled;
5480non-zero otherwise.
5481<P>
5482
5483<DT><CODE>-o</CODE>
5484<DD>Restricts the values of
5485<VAR>optname</VAR> to be those defined for the <SAMP>`-o'</SAMP> option to the
5486<CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
5487</DL>
5488<P>
5489
5490If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP>
5491is used with no <VAR>optname</VAR> arguments, the display is limited to
5492those options which are set or unset, respectively.
5493</P><P>
5494
5495Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off)
5496by default.
5497</P><P>
5498
5499The return status when listing options is zero if all <VAR>optnames</VAR>
5500are enabled, non-zero otherwise. When setting or unsetting options,
5501the return status is zero unless an <VAR>optname</VAR> is not a valid shell
5502option.
5503</P><P>
5504
5505The list of <CODE>shopt</CODE> options is:
5506<DL COMPACT>
5507
5508<DT><CODE>autocd</CODE>
5509<DD>If set, a command name that is the name of a directory is executed as if
5510it were the argument to the <CODE>cd</CODE> command.
5511This option is only used by interactive shells.
5512<P>
5513
5514<DT><CODE>cdable_vars</CODE>
5515<DD>If this is set, an argument to the <CODE>cd</CODE> builtin command that
5516is not a directory is assumed to be the name of a variable whose
5517value is the directory to change to.
5518<P>
5519
5520<DT><CODE>cdspell</CODE>
5521<DD>If set, minor errors in the spelling of a directory component in a
5522<CODE>cd</CODE> command will be corrected.
5523The errors checked for are transposed characters,
5524a missing character, and a character too many.
5525If a correction is found, the corrected path is printed,
5526and the command proceeds.
5527This option is only used by interactive shells.
5528<P>
5529
5530<DT><CODE>checkhash</CODE>
5531<DD>If this is set, Bash checks that a command found in the hash
5532table exists before trying to execute it. If a hashed command no
5533longer exists, a normal path search is performed.
5534<P>
5535
5536<DT><CODE>checkjobs</CODE>
5537<DD>If set, Bash lists the status of any stopped and running jobs before
5538exiting an interactive shell. If any jobs are running, this causes
5539the exit to be deferred until a second exit is attempted without an
5540intervening command (see section <A HREF="bashref.html#SEC91">7. Job Control</A>).
5541The shell always postpones exiting if any jobs are stopped.
5542<P>
5543
5544<DT><CODE>checkwinsize</CODE>
5545<DD>If set, Bash checks the window size after each command
5546and, if necessary, updates the values of
5547<CODE>LINES</CODE> and <CODE>COLUMNS</CODE>.
5548<P>
5549
5550<DT><CODE>cmdhist</CODE>
5551<DD>If set, Bash
5552attempts to save all lines of a multiple-line
5553command in the same history entry. This allows
5554easy re-editing of multi-line commands.
5555<P>
5556
5557<DT><CODE>compat31</CODE>
5558<DD>If set, Bash
5559changes its behavior to that of version 3.1 with respect to quoted
5560arguments to the conditional command's =~ operator.
5561<P>
5562
5563<DT><CODE>dirspell</CODE>
5564<DD>If set, Bash
5565attempts spelling correction on directory names during word completion
5566if the directory name initially supplied does not exist.
5567<P>
5568
5569<DT><CODE>dotglob</CODE>
5570<DD>If set, Bash includes filenames beginning with a `.' in
5571the results of filename expansion.
5572<P>
5573
5574<DT><CODE>execfail</CODE>
5575<DD>If this is set, a non-interactive shell will not exit if
5576it cannot execute the file specified as an argument to the <CODE>exec</CODE>
5577builtin command. An interactive shell does not exit if <CODE>exec</CODE>
5578fails.
5579<P>
5580
5581<DT><CODE>expand_aliases</CODE>
5582<DD>If set, aliases are expanded as described below under Aliases,
5583<A HREF="bashref.html#SEC84">6.6 Aliases</A>.
5584This option is enabled by default for interactive shells.
5585<P>
5586
5587<DT><CODE>extdebug</CODE>
5588<DD>If set, behavior intended for use by debuggers is enabled:
5589<P>
5590
5591<OL>
5592<LI>
5593The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>)
5594displays the source file name and line number corresponding to each function
5595name supplied as an argument.
5596<P>
5597
5598<LI>
5599If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the
5600next command is skipped and not executed.
5601<P>
5602
5603<LI>
5604If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the
5605shell is executing in a subroutine (a shell function or a shell script
5606executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to
5607<CODE>return</CODE> is simulated.
5608<P>
5609
5610<LI>
5611<CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their
5612descriptions (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
5613<P>
5614
5615<LI>
5616Function tracing is enabled: command substitution, shell functions, and
5617subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5618<CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps.
5619<P>
5620
5621<LI>
5622Error tracing is enabled: command substitution, shell functions, and
5623subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5624<CODE>ERROR</CODE> trap.
5625</OL>
5626<P>
5627
5628<DT><CODE>extglob</CODE>
5629<DD>If set, the extended pattern matching features described above
5630(see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>) are enabled.
5631<P>
5632
5633<DT><CODE>extquote</CODE>
5634<DD>If set, <CODE>$'<VAR>string</VAR>'</CODE> and <CODE>$"<VAR>string</VAR>"</CODE> quoting is
5635performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions
5636enclosed in double quotes. This option is enabled by default.
5637<P>
5638
5639<DT><CODE>failglob</CODE>
5640<DD>If set, patterns which fail to match filenames during pathname expansion
5641result in an expansion error.
5642<P>
5643
5644<DT><CODE>force_fignore</CODE>
5645<DD>If set, the suffixes specified by the <CODE>FIGNORE</CODE> shell variable
5646cause words to be ignored when performing word completion even if
5647the ignored words are the only possible completions.
5648See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
5649This option is enabled by default.
5650<P>
5651
5652<DT><CODE>globstar</CODE>
5653<DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename expansion context will
5654match a files and zero or more directories and subdirectories.
5655If the pattern is followed by a <SAMP>`/'</SAMP>, only directories and
5656subdirectories match.
5657<P>
5658
5659<DT><CODE>gnu_errfmt</CODE>
5660<DD>If set, shell error messages are written in the standard GNU error
5661message format.
5662<P>
5663
5664<DT><CODE>histappend</CODE>
5665<DD>If set, the history list is appended to the file named by the value
5666of the <CODE>HISTFILE</CODE>
5667variable when the shell exits, rather than overwriting the file.
5668<P>
5669
5670<DT><CODE>histreedit</CODE>
5671<DD>If set, and Readline
5672is being used, a user is given the opportunity to re-edit a
5673failed history substitution.
5674<P>
5675
5676<DT><CODE>histverify</CODE>
5677<DD>If set, and Readline
5678is being used, the results of history substitution are not immediately
5679passed to the shell parser. Instead, the resulting line is loaded into
5680the Readline editing buffer, allowing further modification.
5681<P>
5682
5683<DT><CODE>hostcomplete</CODE>
5684<DD>If set, and Readline is being used, Bash will attempt to perform
5685hostname completion when a word containing a <SAMP>`@'</SAMP> is being
5686completed (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>). This option is enabled
5687by default.
5688<P>
5689
5690<DT><CODE>huponexit</CODE>
5691<DD>If set, Bash will send <CODE>SIGHUP</CODE> to all jobs when an interactive
5692login shell exits (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
5693<P>
5694
5695<DT><CODE>interactive_comments</CODE>
5696<DD>Allow a word beginning with <SAMP>`#'</SAMP>
5697to cause that word and all remaining characters on that
5698line to be ignored in an interactive shell.
5699This option is enabled by default.
5700<P>
5701
5702<DT><CODE>lithist</CODE>
5703<DD>If enabled, and the <CODE>cmdhist</CODE>
5704option is enabled, multi-line commands are saved to the history with
5705embedded newlines rather than using semicolon separators where possible.
5706<P>
5707
5708<DT><CODE>login_shell</CODE>
5709<DD>The shell sets this option if it is started as a login shell
5710(see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
5711The value may not be changed.
5712<P>
5713
5714<DT><CODE>mailwarn</CODE>
5715<DD>If set, and a file that Bash is checking for mail has been
5716accessed since the last time it was checked, the message
5717<CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed.
5718<P>
5719
5720<DT><CODE>no_empty_cmd_completion</CODE>
5721<DD>If set, and Readline is being used, Bash will not attempt to search
5722the <CODE>PATH</CODE> for possible completions when completion is attempted
5723on an empty line.
5724<P>
5725
5726<DT><CODE>nocaseglob</CODE>
5727<DD>If set, Bash matches filenames in a case-insensitive fashion when
5728performing filename expansion.
5729<P>
5730
5731<DT><CODE>nocasematch</CODE>
5732<DD>If set, Bash matches patterns in a case-insensitive fashion when
5733performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE>
5734conditional commands.
5735<P>
5736
5737<DT><CODE>nullglob</CODE>
5738<DD>If set, Bash allows filename patterns which match no
5739files to expand to a null string, rather than themselves.
5740<P>
5741
5742<DT><CODE>progcomp</CODE>
5743<DD>If set, the programmable completion facilities
5744(see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>) are enabled.
5745This option is enabled by default.
5746<P>
5747
5748<DT><CODE>promptvars</CODE>
5749<DD>If set, prompt strings undergo
5750parameter expansion, command substitution, arithmetic
5751expansion, and quote removal after being expanded
5752as described below (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
5753This option is enabled by default.
5754<P>
5755
5756<DT><CODE>restricted_shell</CODE>
5757<DD>The shell sets this option if it is started in restricted mode
5758(see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
5759The value may not be changed.
5760This is not reset when the startup files are executed, allowing
5761the startup files to discover whether or not a shell is restricted.
5762<P>
5763
5764<DT><CODE>shift_verbose</CODE>
5765<DD>If this is set, the <CODE>shift</CODE>
5766builtin prints an error message when the shift count exceeds the
5767number of positional parameters.
5768<P>
5769
5770<DT><CODE>sourcepath</CODE>
5771<DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE>
5772to find the directory containing the file supplied as an argument.
5773This option is enabled by default.
5774<P>
5775
5776<DT><CODE>xpg_echo</CODE>
5777<DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences
5778by default.
5779<P>
5780
5781</DL>
5782<P>
5783
5784The return status when listing options is zero if all <VAR>optnames</VAR>
5785are enabled, non-zero otherwise.
5786When setting or unsetting options, the return status is zero unless an
5787<VAR>optname</VAR> is not a valid shell option.
5788</P><P>
5789
5790</DL>
5791<P>
5792
5793<A NAME="Special Builtins"></A>
5794<HR SIZE="6">
5795<A NAME="SEC64"></A>
5796<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5797<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> &lt; </A>]</TD>
5798<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt; </A>]</TD>
5799<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </A>]</TD>
5800<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
5801<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
5802<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5803<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5804<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5805<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5806</TR></TABLE>
5807<H2> 4.4 Special Builtins </H2>
5808<!--docid::SEC64::-->
5809<P>
5810
5811For historical reasons, the POSIX standard has classified
5812several builtin commands as <EM>special</EM>.
5813When Bash is executing in POSIX mode, the special builtins
5814differ from other builtin commands in three respects:
5815</P><P>
5816
5817<OL>
5818<LI>
5819Special builtins are found before shell functions during command lookup.
5820<P>
5821
5822<LI>
5823If a special builtin returns an error status, a non-interactive shell exits.
5824<P>
5825
5826<LI>
5827Assignment statements preceding the command stay in effect in the shell
5828environment after the command completes.
5829</OL>
5830<P>
5831
5832When Bash is not executing in POSIX mode, these builtins behave no
5833differently than the rest of the Bash builtin commands.
5834The Bash POSIX mode is described in <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>.
5835</P><P>
5836
5837These are the POSIX special builtins:
5838<TABLE><tr><td>&nbsp;</td><td class=example><pre>break : . continue eval exec exit export readonly return set
5839shift trap unset
5840</pre></td></tr></table></P><P>
5841
5842<A NAME="Shell Variables"></A>
5843<HR SIZE="6">
5844<A NAME="SEC65"></A>
5845<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5846<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt; </A>]</TD>
5847<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &gt; </A>]</TD>
5848<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt;&lt; </A>]</TD>
5849<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
5850<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt;&gt; </A>]</TD>
5851<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5852<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5853<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5854<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5855</TR></TABLE>
5856<H1> 5. Shell Variables </H1>
5857<!--docid::SEC65::-->
5858<P>
5859
5860<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
5861<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way
5862 as the Bourne Shell.</TD></TR>
5863<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR>
5864</TABLE></BLOCKQUOTE>
5865<P>
5866
5867This chapter describes the shell variables that Bash uses.
5868Bash automatically assigns default values to a number of variables.
5869</P><P>
5870
5871<A NAME="Bourne Shell Variables"></A>
5872<HR SIZE="6">
5873<A NAME="SEC66"></A>
5874<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5875<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt; </A>]</TD>
5876<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> &gt; </A>]</TD>
5877<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
5878<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD>
5879<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt;&gt; </A>]</TD>
5880<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5881<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5882<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5883<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5884</TR></TABLE>
5885<H2> 5.1 Bourne Shell Variables </H2>
5886<!--docid::SEC66::-->
5887<P>
5888
5889Bash uses certain shell variables in the same way as the Bourne shell.
5890In some cases, Bash assigns a default value to the variable.
5891</P><P>
5892
5893<DL COMPACT>
5894
5895<A NAME="IDX112"></A>
5896<DT><CODE>CDPATH</CODE>
5897<DD><A NAME="IDX113"></A>
5898A colon-separated list of directories used as a search path for
5899the <CODE>cd</CODE> builtin command.
5900<P>
5901
5902<A NAME="IDX114"></A>
5903<DT><CODE>HOME</CODE>
5904<DD><A NAME="IDX115"></A>
5905The current user's home directory; the default for the <CODE>cd</CODE> builtin
5906command.
5907The value of this variable is also used by tilde expansion
5908(see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
5909<P>
5910
5911<A NAME="IDX116"></A>
5912<DT><CODE>IFS</CODE>
5913<DD><A NAME="IDX117"></A>
5914A list of characters that separate fields; used when the shell splits
5915words as part of expansion.
5916<P>
5917
5918<A NAME="IDX118"></A>
5919<DT><CODE>MAIL</CODE>
5920<DD><A NAME="IDX119"></A>
5921If this parameter is set to a filename and the <CODE>MAILPATH</CODE> variable
5922is not set, Bash informs the user of the arrival of mail in
5923the specified file.
5924<P>
5925
5926<A NAME="IDX120"></A>
5927<DT><CODE>MAILPATH</CODE>
5928<DD><A NAME="IDX121"></A>
5929A colon-separated list of filenames which the shell periodically checks
5930for new mail.
5931Each list entry can specify the message that is printed when new mail
5932arrives in the mail file by separating the file name from the message with
5933a <SAMP>`?'</SAMP>.
5934When used in the text of the message, <CODE>$_</CODE> expands to the name of
5935the current mail file.
5936<P>
5937
5938<A NAME="IDX122"></A>
5939<DT><CODE>OPTARG</CODE>
5940<DD><A NAME="IDX123"></A>
5941The value of the last option argument processed by the <CODE>getopts</CODE> builtin.
5942<P>
5943
5944<A NAME="IDX124"></A>
5945<DT><CODE>OPTIND</CODE>
5946<DD><A NAME="IDX125"></A>
5947The index of the last option argument processed by the <CODE>getopts</CODE> builtin.
5948<P>
5949
5950<A NAME="IDX126"></A>
5951<DT><CODE>PATH</CODE>
5952<DD><A NAME="IDX127"></A>
5953A colon-separated list of directories in which the shell looks for
5954commands.
5955A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the
5956current directory.
5957A null directory name may appear as two adjacent colons, or as an initial
5958or trailing colon.
5959<P>
5960
5961<A NAME="IDX128"></A>
5962<DT><CODE>PS1</CODE>
5963<DD><A NAME="IDX129"></A>
5964The primary prompt string. The default value is <SAMP>`\s-\v\$ '</SAMP>.
5965See section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for the complete list of escape
5966sequences that are expanded before <CODE>PS1</CODE> is displayed.
5967<P>
5968
5969<A NAME="IDX130"></A>
5970<DT><CODE>PS2</CODE>
5971<DD><A NAME="IDX131"></A>
5972The secondary prompt string. The default value is <SAMP>`&#62; '</SAMP>.
5973<P>
5974
5975</DL>
5976<P>
5977
5978<A NAME="Bash Variables"></A>
5979<HR SIZE="6">
5980<A NAME="SEC67"></A>
5981<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5982<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &lt; </A>]</TD>
5983<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt; </A>]</TD>
5984<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
5985<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD>
5986<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt;&gt; </A>]</TD>
5987<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5988<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5989<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5990<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5991</TR></TABLE>
5992<H2> 5.2 Bash Variables </H2>
5993<!--docid::SEC67::-->
5994<P>
5995
5996These variables are set or used by Bash, but other shells
5997do not normally treat them specially.
5998</P><P>
5999
6000A few variables used by Bash are described in different chapters:
6001variables for controlling the job control facilities
6002(see section <A HREF="bashref.html#SEC94">7.3 Job Control Variables</A>).
6003</P><P>
6004
6005<DL COMPACT>
6006
6007<A NAME="IDX132"></A>
6008<DT><CODE>BASH</CODE>
6009<DD><A NAME="IDX133"></A>
6010The full pathname used to execute the current instance of Bash.
6011<P>
6012
6013<A NAME="IDX134"></A>
6014<DT><CODE>BASHPID</CODE>
6015<DD><A NAME="IDX135"></A>
6016Expands to the process id of the current Bash process.
6017This differs from <CODE>$$</CODE> under certain circumstances, such as subshells
6018that do not require Bash to be re-initialized.
6019<P>
6020
6021<A NAME="IDX136"></A>
6022<DT><CODE>BASH_ALIASES</CODE>
6023<DD><A NAME="IDX137"></A>
6024An associative array variable whose members correspond to the internal
6025list of aliases as maintained by the <CODE>alias</CODE> builtin
6026(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
6027Elements added to this array appear in the alias list; unsetting array
6028elements cause aliases to be removed from the alias list.
6029<P>
6030
6031<A NAME="IDX138"></A>
6032<DT><CODE>BASH_ARGC</CODE>
6033<DD><A NAME="IDX139"></A>
6034An array variable whose values are the number of parameters in each
6035frame of the current bash execution call stack. The number of
6036parameters to the current subroutine (shell function or script executed
6037with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack. When a
6038subroutine is executed, the number of parameters passed is pushed onto
6039<CODE>BASH_ARGC</CODE>.
6040The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode
6041(see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6042for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6043builtin).
6044<P>
6045
6046<A NAME="IDX140"></A>
6047<DT><CODE>BASH_ARGV</CODE>
6048<DD><A NAME="IDX141"></A>
6049An array variable containing all of the parameters in the current bash
6050execution call stack. The final parameter of the last subroutine call
6051is at the top of the stack; the first parameter of the initial call is
6052at the bottom. When a subroutine is executed, the parameters supplied
6053are pushed onto <CODE>BASH_ARGV</CODE>.
6054The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode
6055(see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6056for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6057builtin).
6058<P>
6059
6060<A NAME="IDX142"></A>
6061<DT><CODE>BASH_CMDS</CODE>
6062<DD><A NAME="IDX143"></A>
6063An associative array variable whose members correspond to the internal
6064hash table of commands as maintained by the <CODE>hash</CODE> builtin
6065(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
6066Elements added to this array appear in the hash table; unsetting array
6067elements cause commands to be removed from the hash table.
6068<P>
6069
6070<A NAME="IDX144"></A>
6071<DT><CODE>BASH_COMMAND</CODE>
6072<DD><A NAME="IDX145"></A>
6073The command currently being executed or about to be executed, unless the
6074shell is executing a command as the result of a trap,
6075in which case it is the command executing at the time of the trap.
6076<P>
6077
6078<A NAME="IDX146"></A>
6079<DT><CODE>BASH_ENV</CODE>
6080<DD><A NAME="IDX147"></A>
6081If this variable is set when Bash is invoked to execute a shell
6082script, its value is expanded and used as the name of a startup file
6083to read before executing the script. See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>.
6084<P>
6085
6086<A NAME="IDX148"></A>
6087<DT><CODE>BASH_EXECUTION_STRING</CODE>
6088<DD><A NAME="IDX149"></A>
6089The command argument to the <SAMP>`-c'</SAMP> invocation option.
6090<P>
6091
6092<A NAME="IDX150"></A>
6093<DT><CODE>BASH_LINENO</CODE>
6094<DD><A NAME="IDX151"></A>
6095An array variable whose members are the line numbers in source files
6096corresponding to each member of <VAR>FUNCNAME</VAR>.
6097<CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file where
6098<CODE>${FUNCNAME[$i]}</CODE> was called (or <CODE>${BASH_LINENO[$i-1]}</CODE> if
6099referenced within another shell function).
6100The corresponding source file name is <CODE>${BASH_SOURCE[$i]}</CODE>.
6101Use <CODE>LINENO</CODE> to obtain the current line number.
6102<P>
6103
6104<A NAME="IDX152"></A>
6105<DT><CODE>BASH_REMATCH</CODE>
6106<DD><A NAME="IDX153"></A>
6107An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary
6108operator to the <CODE>[[</CODE> conditional command
6109(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
6110The element with index 0 is the portion of the string
6111matching the entire regular expression.
6112The element with index <VAR>n</VAR> is the portion of the
6113string matching the <VAR>n</VAR>th parenthesized subexpression.
6114This variable is read-only.
6115<P>
6116
6117<A NAME="IDX154"></A>
6118<DT><CODE>BASH_SOURCE</CODE>
6119<DD><A NAME="IDX155"></A>
6120An array variable whose members are the source filenames corresponding
6121to the elements in the <CODE>FUNCNAME</CODE> array variable.
6122<P>
6123
6124<A NAME="IDX156"></A>
6125<DT><CODE>BASH_SUBSHELL</CODE>
6126<DD><A NAME="IDX157"></A>
6127Incremented by one each time a subshell or subshell environment is spawned.
6128The initial value is 0.
6129<P>
6130
6131<A NAME="IDX158"></A>
6132<DT><CODE>BASH_VERSINFO</CODE>
6133<DD><A NAME="IDX159"></A>
6134A readonly array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
6135whose members hold version information for this instance of Bash.
6136The values assigned to the array members are as follows:
6137<P>
6138
6139<DL COMPACT>
6140
6141<DT><CODE>BASH_VERSINFO[0]</CODE>
6142<DD>The major version number (the <VAR>release</VAR>).
6143<P>
6144
6145<DT><CODE>BASH_VERSINFO[1]</CODE>
6146<DD>The minor version number (the <VAR>version</VAR>).
6147<P>
6148
6149<DT><CODE>BASH_VERSINFO[2]</CODE>
6150<DD>The patch level.
6151<P>
6152
6153<DT><CODE>BASH_VERSINFO[3]</CODE>
6154<DD>The build version.
6155<P>
6156
6157<DT><CODE>BASH_VERSINFO[4]</CODE>
6158<DD>The release status (e.g., <VAR>beta1</VAR>).
6159<P>
6160
6161<DT><CODE>BASH_VERSINFO[5]</CODE>
6162<DD>The value of <CODE>MACHTYPE</CODE>.
6163<P>
6164
6165</DL>
6166<P>
6167
6168<A NAME="IDX160"></A>
6169<DT><CODE>BASH_VERSION</CODE>
6170<DD><A NAME="IDX161"></A>
6171The version number of the current instance of Bash.
6172<P>
6173
6174<A NAME="IDX162"></A>
6175<DT><CODE>COLUMNS</CODE>
6176<DD><A NAME="IDX163"></A>
6177Used by the <CODE>select</CODE> builtin command to determine the terminal width
6178when printing selection lists. Automatically set upon receipt of a
6179<CODE>SIGWINCH</CODE>.
6180<P>
6181
6182<A NAME="IDX164"></A>
6183<DT><CODE>COMP_CWORD</CODE>
6184<DD><A NAME="IDX165"></A>
6185An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current
6186cursor position.
6187This variable is available only in shell functions invoked by the
6188programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6189<P>
6190
6191<A NAME="IDX166"></A>
6192<DT><CODE>COMP_LINE</CODE>
6193<DD><A NAME="IDX167"></A>
6194The current command line.
6195This variable is available only in shell functions and external
6196commands invoked by the
6197programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6198<P>
6199
6200<A NAME="IDX168"></A>
6201<DT><CODE>COMP_POINT</CODE>
6202<DD><A NAME="IDX169"></A>
6203The index of the current cursor position relative to the beginning of
6204the current command.
6205If the current cursor position is at the end of the current command,
6206the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>.
6207This variable is available only in shell functions and external
6208commands invoked by the
6209programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6210<P>
6211
6212<A NAME="IDX170"></A>
6213<DT><CODE>COMP_TYPE</CODE>
6214<DD><A NAME="IDX171"></A>
6215Set to an integer value corresponding to the type of completion attempted
6216that caused a completion function to be called:
6217<VAR>TAB</VAR>, for normal completion,
6218<SAMP>`?'</SAMP>, for listing completions after successive tabs,
6219<SAMP>`!'</SAMP>, for listing alternatives on partial word completion,
6220<SAMP>`@'</SAMP>, to list completions if the word is not unmodified,
6221or
6222<SAMP>`%'</SAMP>, for menu completion.
6223This variable is available only in shell functions and external
6224commands invoked by the
6225programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6226<P>
6227
6228<A NAME="IDX172"></A>
6229<DT><CODE>COMP_KEY</CODE>
6230<DD><A NAME="IDX173"></A>
6231The key (or final key of a key sequence) used to invoke the current
6232completion function.
6233<P>
6234
6235<A NAME="IDX174"></A>
6236<DT><CODE>COMP_WORDBREAKS</CODE>
6237<DD><A NAME="IDX175"></A>
6238The set of characters that the Readline library treats as word
6239separators when performing word completion.
6240If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties,
6241even if it is subsequently reset.
6242<P>
6243
6244<A NAME="IDX176"></A>
6245<DT><CODE>COMP_WORDS</CODE>
6246<DD><A NAME="IDX177"></A>
6247An array variable consisting of the individual
6248words in the current command line.
6249The words are split on shell metacharacters as the shell parser would
6250separate them.
6251This variable is available only in shell functions invoked by the
6252programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6253<P>
6254
6255<A NAME="IDX178"></A>
6256<DT><CODE>COMPREPLY</CODE>
6257<DD><A NAME="IDX179"></A>
6258An array variable from which Bash reads the possible completions
6259generated by a shell function invoked by the programmable completion
6260facility (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6261<P>
6262
6263<A NAME="IDX180"></A>
6264<DT><CODE>DIRSTACK</CODE>
6265<DD><A NAME="IDX181"></A>
6266An array variable containing the current contents of the directory stack.
6267Directories appear in the stack in the order they are displayed by the
6268<CODE>dirs</CODE> builtin.
6269Assigning to members of this array variable may be used to modify
6270directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE>
6271builtins must be used to add and remove directories.
6272Assignment to this variable will not change the current directory.
6273If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if
6274it is subsequently reset.
6275<P>
6276
6277<A NAME="IDX182"></A>
6278<DT><CODE>EMACS</CODE>
6279<DD><A NAME="IDX183"></A>
6280If Bash finds this variable in the environment when the shell
6281starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an
6282emacs shell buffer and disables line editing.
6283<P>
6284
6285<A NAME="IDX184"></A>
6286<DT><CODE>EUID</CODE>
6287<DD><A NAME="IDX185"></A>
6288The numeric effective user id of the current user. This variable
6289is readonly.
6290<P>
6291
6292<A NAME="IDX186"></A>
6293<DT><CODE>FCEDIT</CODE>
6294<DD><A NAME="IDX187"></A>
6295The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE>
6296builtin command.
6297<P>
6298
6299<A NAME="IDX188"></A>
6300<DT><CODE>FIGNORE</CODE>
6301<DD><A NAME="IDX189"></A>
6302A colon-separated list of suffixes to ignore when performing
6303filename completion.
6304A file name whose suffix matches one of the entries in
6305<CODE>FIGNORE</CODE>
6306is excluded from the list of matched file names. A sample
6307value is <SAMP>`.o:~'</SAMP>
6308<P>
6309
6310<A NAME="IDX190"></A>
6311<DT><CODE>FUNCNAME</CODE>
6312<DD><A NAME="IDX191"></A>
6313An array variable containing the names of all shell functions
6314currently in the execution call stack.
6315The element with index 0 is the name of any currently-executing
6316shell function.
6317The bottom-most element is <CODE>"main"</CODE>.
6318This variable exists only when a shell function is executing.
6319Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status.
6320If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if
6321it is subsequently reset.
6322<P>
6323
6324<A NAME="IDX192"></A>
6325<DT><CODE>GLOBIGNORE</CODE>
6326<DD><A NAME="IDX193"></A>
6327A colon-separated list of patterns defining the set of filenames to
6328be ignored by filename expansion.
6329If a filename matched by a filename expansion pattern also matches one
6330of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list
6331of matches.
6332<P>
6333
6334<A NAME="IDX194"></A>
6335<DT><CODE>GROUPS</CODE>
6336<DD><A NAME="IDX195"></A>
6337An array variable containing the list of groups of which the current
6338user is a member.
6339Assignments to <CODE>GROUPS</CODE> have no effect and return an error status.
6340If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is
6341subsequently reset.
6342<P>
6343
6344<A NAME="IDX196"></A>
6345<DT><CODE>histchars</CODE>
6346<DD><A NAME="IDX197"></A>
6347Up to three characters which control history expansion, quick
6348substitution, and tokenization (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
6349The first character is the
6350<VAR>history expansion</VAR> character, that is, the character which signifies the
6351start of a history expansion, normally <SAMP>`!'</SAMP>. The second character is the
6352character which signifies `quick substitution' when seen as the first
6353character on a line, normally <SAMP>`^'</SAMP>. The optional third character is the
6354character which indicates that the remainder of the line is a comment when
6355found as the first character of a word, usually <SAMP>`#'</SAMP>. The history
6356comment character causes history substitution to be skipped for the
6357remaining words on the line. It does not necessarily cause the shell
6358parser to treat the rest of the line as a comment.
6359<P>
6360
6361<A NAME="IDX198"></A>
6362<DT><CODE>HISTCMD</CODE>
6363<DD><A NAME="IDX199"></A>
6364The history number, or index in the history list, of the current
6365command. If <CODE>HISTCMD</CODE> is unset, it loses its special properties,
6366even if it is subsequently reset.
6367<P>
6368
6369<A NAME="IDX200"></A>
6370<DT><CODE>HISTCONTROL</CODE>
6371<DD><A NAME="IDX201"></A>
6372A colon-separated list of values controlling how commands are saved on
6373the history list.
6374If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin
6375with a space character are not saved in the history list.
6376A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous
6377history entry to not be saved.
6378A value of <SAMP>`ignoreboth'</SAMP> is shorthand for
6379<SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>.
6380A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the
6381current line to be removed from the history list before that line
6382is saved.
6383Any value not in the above list is ignored.
6384If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value,
6385all lines read by the shell parser are saved on the history list,
6386subject to the value of <CODE>HISTIGNORE</CODE>.
6387The second and subsequent lines of a multi-line compound command are
6388not tested, and are added to the history regardless of the value of
6389<CODE>HISTCONTROL</CODE>.
6390<P>
6391
6392<A NAME="IDX202"></A>
6393<DT><CODE>HISTFILE</CODE>
6394<DD><A NAME="IDX203"></A>
6395The name of the file to which the command history is saved. The
6396default value is <TT>`~/.bash_history'</TT>.
6397<P>
6398
6399<A NAME="IDX204"></A>
6400<DT><CODE>HISTFILESIZE</CODE>
6401<DD><A NAME="IDX205"></A>
6402The maximum number of lines contained in the history file. When this
6403variable is assigned a value, the history file is truncated, if
6404necessary, by removing the oldest entries,
6405to contain no more than that number of lines.
6406The history file is also truncated to this size after
6407writing it when an interactive shell exits.
6408The default value is 500.
6409<P>
6410
6411<A NAME="IDX206"></A>
6412<DT><CODE>HISTIGNORE</CODE>
6413<DD><A NAME="IDX207"></A>
6414A colon-separated list of patterns used to decide which command
6415lines should be saved on the history list. Each pattern is
6416anchored at the beginning of the line and must match the complete
6417line (no implicit <SAMP>`*'</SAMP> is appended). Each pattern is tested
6418against the line after the checks specified by <CODE>HISTCONTROL</CODE>
6419are applied. In addition to the normal shell pattern matching
6420characters, <SAMP>`&#38;'</SAMP> matches the previous history line. <SAMP>`&#38;'</SAMP>
6421may be escaped using a backslash; the backslash is removed
6422before attempting a match.
6423The second and subsequent lines of a multi-line compound command are
6424not tested, and are added to the history regardless of the value of
6425<CODE>HISTIGNORE</CODE>.
6426<P>
6427
6428<CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>. A
6429pattern of <SAMP>`&#38;'</SAMP> is identical to <CODE>ignoredups</CODE>, and a
6430pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>.
6431Combining these two patterns, separating them with a colon,
6432provides the functionality of <CODE>ignoreboth</CODE>.
6433</P><P>
6434
6435<A NAME="IDX208"></A>
6436<DT><CODE>HISTSIZE</CODE>
6437<DD><A NAME="IDX209"></A>
6438The maximum number of commands to remember on the history list.
6439The default value is 500.
6440<P>
6441
6442<A NAME="IDX210"></A>
6443<DT><CODE>HISTTIMEFORMAT</CODE>
6444<DD><A NAME="IDX211"></A>
6445If this variable is set and not null, its value is used as a format string
6446for <VAR>strftime</VAR> to print the time stamp associated with each history
6447entry displayed by the <CODE>history</CODE> builtin.
6448If this variable is set, time stamps are written to the history file so
6449they may be preserved across shell sessions.
6450This uses the history comment character to distinguish timestamps from
6451other history lines.
6452<P>
6453
6454<A NAME="IDX212"></A>
6455<DT><CODE>HOSTFILE</CODE>
6456<DD><A NAME="IDX213"></A>
6457Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that
6458should be read when the shell needs to complete a hostname.
6459The list of possible hostname completions may be changed while the shell
6460is running;
6461the next time hostname completion is attempted after the
6462value is changed, Bash adds the contents of the new file to the
6463existing list.
6464If <CODE>HOSTFILE</CODE> is set, but has no value, Bash attempts to read
6465<TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions.
6466When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared.
6467<P>
6468
6469<A NAME="IDX214"></A>
6470<DT><CODE>HOSTNAME</CODE>
6471<DD><A NAME="IDX215"></A>
6472The name of the current host.
6473<P>
6474
6475<A NAME="IDX216"></A>
6476<DT><CODE>HOSTTYPE</CODE>
6477<DD><A NAME="IDX217"></A>
6478A string describing the machine Bash is running on.
6479<P>
6480
6481<A NAME="IDX218"></A>
6482<DT><CODE>IGNOREEOF</CODE>
6483<DD><A NAME="IDX219"></A>
6484Controls the action of the shell on receipt of an <CODE>EOF</CODE> character
6485as the sole input. If set, the value denotes the number
6486of consecutive <CODE>EOF</CODE> characters that can be read as the
6487first character on an input line
6488before the shell will exit. If the variable exists but does not
6489have a numeric value (or has no value) then the default is 10.
6490If the variable does not exist, then <CODE>EOF</CODE> signifies the end of
6491input to the shell. This is only in effect for interactive shells.
6492<P>
6493
6494<A NAME="IDX220"></A>
6495<DT><CODE>INPUTRC</CODE>
6496<DD><A NAME="IDX221"></A>
6497The name of the Readline initialization file, overriding the default
6498of <TT>`~/.inputrc'</TT>.
6499<P>
6500
6501<A NAME="IDX222"></A>
6502<DT><CODE>LANG</CODE>
6503<DD><A NAME="IDX223"></A>
6504Used to determine the locale category for any category not specifically
6505selected with a variable starting with <CODE>LC_</CODE>.
6506<P>
6507
6508<A NAME="IDX224"></A>
6509<DT><CODE>LC_ALL</CODE>
6510<DD><A NAME="IDX225"></A>
6511This variable overrides the value of <CODE>LANG</CODE> and any other
6512<CODE>LC_</CODE> variable specifying a locale category.
6513<P>
6514
6515<A NAME="IDX226"></A>
6516<DT><CODE>LC_COLLATE</CODE>
6517<DD><A NAME="IDX227"></A>
6518This variable determines the collation order used when sorting the
6519results of filename expansion, and
6520determines the behavior of range expressions, equivalence classes,
6521and collating sequences within filename expansion and pattern matching
6522(see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
6523<P>
6524
6525<A NAME="IDX228"></A>
6526<DT><CODE>LC_CTYPE</CODE>
6527<DD><A NAME="IDX229"></A>
6528This variable determines the interpretation of characters and the
6529behavior of character classes within filename expansion and pattern
6530matching (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
6531<P>
6532
6533<A NAME="IDX230"></A>
6534<DT><CODE>LC_MESSAGES</CODE>
6535<DD><A NAME="IDX231"></A>
6536This variable determines the locale used to translate double-quoted
6537strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
6538<P>
6539
6540<A NAME="IDX232"></A>
6541<DT><CODE>LC_NUMERIC</CODE>
6542<DD><A NAME="IDX233"></A>
6543This variable determines the locale category used for number formatting.
6544<P>
6545
6546<A NAME="IDX234"></A>
6547<DT><CODE>LINENO</CODE>
6548<DD><A NAME="IDX235"></A>
6549The line number in the script or shell function currently executing.
6550<P>
6551
6552<A NAME="IDX236"></A>
6553<DT><CODE>LINES</CODE>
6554<DD><A NAME="IDX237"></A>
6555Used by the <CODE>select</CODE> builtin command to determine the column length
6556for printing selection lists. Automatically set upon receipt of a
6557<CODE>SIGWINCH</CODE>.
6558<P>
6559
6560<A NAME="IDX238"></A>
6561<DT><CODE>MACHTYPE</CODE>
6562<DD><A NAME="IDX239"></A>
6563A string that fully describes the system type on which Bash
6564is executing, in the standard GNU <VAR>cpu-company-system</VAR> format.
6565<P>
6566
6567<A NAME="IDX240"></A>
6568<DT><CODE>MAILCHECK</CODE>
6569<DD><A NAME="IDX241"></A>
6570How often (in seconds) that the shell should check for mail in the
6571files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables.
6572The default is 60 seconds. When it is time to check
6573for mail, the shell does so before displaying the primary prompt.
6574If this variable is unset, or set to a value that is not a number
6575greater than or equal to zero, the shell disables mail checking.
6576<P>
6577
6578<A NAME="IDX242"></A>
6579<DT><CODE>OLDPWD</CODE>
6580<DD><A NAME="IDX243"></A>
6581The previous working directory as set by the <CODE>cd</CODE> builtin.
6582<P>
6583
6584<A NAME="IDX244"></A>
6585<DT><CODE>OPTERR</CODE>
6586<DD><A NAME="IDX245"></A>
6587If set to the value 1, Bash displays error messages
6588generated by the <CODE>getopts</CODE> builtin command.
6589<P>
6590
6591<A NAME="IDX246"></A>
6592<DT><CODE>OSTYPE</CODE>
6593<DD><A NAME="IDX247"></A>
6594A string describing the operating system Bash is running on.
6595<P>
6596
6597<A NAME="IDX248"></A>
6598<DT><CODE>PIPESTATUS</CODE>
6599<DD><A NAME="IDX249"></A>
6600An array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
6601containing a list of exit status values from the processes
6602in the most-recently-executed foreground pipeline (which may
6603contain only a single command).
6604<P>
6605
6606<A NAME="IDX250"></A>
6607<DT><CODE>POSIXLY_CORRECT</CODE>
6608<DD><A NAME="IDX251"></A>
6609If this variable is in the environment when <CODE>bash</CODE> starts, the shell
6610enters POSIX mode (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>) before reading the
6611startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied.
6612If it is set while the shell is running, <CODE>bash</CODE> enables POSIX mode,
6613as if the command
6614<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>set -o posix</CODE>
6615</pre></td></tr></table>had been executed.
6616<P>
6617
6618<A NAME="IDX252"></A>
6619<DT><CODE>PPID</CODE>
6620<DD><A NAME="IDX253"></A>
6621The process ID of the shell's parent process. This variable
6622is readonly.
6623<P>
6624
6625<A NAME="IDX254"></A>
6626<DT><CODE>PROMPT_COMMAND</CODE>
6627<DD><A NAME="IDX255"></A>
6628If set, the value is interpreted as a command to execute
6629before the printing of each primary prompt (<CODE>$PS1</CODE>).
6630<P>
6631
6632<A NAME="IDX256"></A>
6633<DT><CODE>PROMPT_DIRTRIM</CODE>
6634<DD><A NAME="IDX257"></A>
6635If set to a number greater than zero, the value is used as the number of
6636trailing directory components to retain when expanding the <CODE>\w</CODE> and
6637<CODE>\W</CODE> prompt string escapes (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
6638Characters removed are replaced with an ellipsis.
6639<P>
6640
6641<A NAME="IDX258"></A>
6642<DT><CODE>PS3</CODE>
6643<DD><A NAME="IDX259"></A>
6644The value of this variable is used as the prompt for the
6645<CODE>select</CODE> command. If this variable is not set, the
6646<CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP>
6647<P>
6648
6649<A NAME="IDX260"></A>
6650<DT><CODE>PS4</CODE>
6651<DD><A NAME="IDX261"></A>
6652The value is the prompt printed before the command line is echoed
6653when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
6654The first character of <CODE>PS4</CODE> is replicated multiple times, as
6655necessary, to indicate multiple levels of indirection.
6656The default is <SAMP>`+ '</SAMP>.
6657<P>
6658
6659<A NAME="IDX262"></A>
6660<DT><CODE>PWD</CODE>
6661<DD><A NAME="IDX263"></A>
6662The current working directory as set by the <CODE>cd</CODE> builtin.
6663<P>
6664
6665<A NAME="IDX264"></A>
6666<DT><CODE>RANDOM</CODE>
6667<DD><A NAME="IDX265"></A>
6668Each time this parameter is referenced, a random integer
6669between 0 and 32767 is generated. Assigning a value to this
6670variable seeds the random number generator.
6671<P>
6672
6673<A NAME="IDX266"></A>
6674<DT><CODE>REPLY</CODE>
6675<DD><A NAME="IDX267"></A>
6676The default variable for the <CODE>read</CODE> builtin.
6677<P>
6678
6679<A NAME="IDX268"></A>
6680<DT><CODE>SECONDS</CODE>
6681<DD><A NAME="IDX269"></A>
6682This variable expands to the number of seconds since the
6683shell was started. Assignment to this variable resets
6684the count to the value assigned, and the expanded value
6685becomes the value assigned plus the number of seconds
6686since the assignment.
6687<P>
6688
6689<A NAME="IDX270"></A>
6690<DT><CODE>SHELL</CODE>
6691<DD><A NAME="IDX271"></A>
6692The full pathname to the shell is kept in this environment variable.
6693If it is not set when the shell starts,
6694Bash assigns to it the full pathname of the current user's login shell.
6695<P>
6696
6697<A NAME="IDX272"></A>
6698<DT><CODE>SHELLOPTS</CODE>
6699<DD><A NAME="IDX273"></A>
6700A colon-separated list of enabled shell options. Each word in
6701the list is a valid argument for the <SAMP>`-o'</SAMP> option to the
6702<CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
6703The options appearing in <CODE>SHELLOPTS</CODE> are those reported
6704as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>.
6705If this variable is in the environment when Bash
6706starts up, each shell option in the list will be enabled before
6707reading any startup files. This variable is readonly.
6708<P>
6709
6710<A NAME="IDX274"></A>
6711<DT><CODE>SHLVL</CODE>
6712<DD><A NAME="IDX275"></A>
6713Incremented by one each time a new instance of Bash is started. This is
6714intended to be a count of how deeply your Bash shells are nested.
6715<P>
6716
6717<A NAME="IDX276"></A>
6718<DT><CODE>TIMEFORMAT</CODE>
6719<DD><A NAME="IDX277"></A>
6720The value of this parameter is used as a format string specifying
6721how the timing information for pipelines prefixed with the <CODE>time</CODE>
6722reserved word should be displayed.
6723The <SAMP>`%'</SAMP> character introduces an
6724escape sequence that is expanded to a time value or other
6725information.
6726The escape sequences and their meanings are as
6727follows; the braces denote optional portions.
6728<P>
6729
6730<DL COMPACT>
6731
6732<DT><CODE>%%</CODE>
6733<DD>A literal <SAMP>`%'</SAMP>.
6734<P>
6735
6736<DT><CODE>%[<VAR>p</VAR>][l]R</CODE>
6737<DD>The elapsed time in seconds.
6738<P>
6739
6740<DT><CODE>%[<VAR>p</VAR>][l]U</CODE>
6741<DD>The number of CPU seconds spent in user mode.
6742<P>
6743
6744<DT><CODE>%[<VAR>p</VAR>][l]S</CODE>
6745<DD>The number of CPU seconds spent in system mode.
6746<P>
6747
6748<DT><CODE>%P</CODE>
6749<DD>The CPU percentage, computed as (%U + %S) / %R.
6750</DL>
6751<P>
6752
6753The optional <VAR>p</VAR> is a digit specifying the precision, the number of
6754fractional digits after a decimal point.
6755A value of 0 causes no decimal point or fraction to be output.
6756At most three places after the decimal point may be specified; values
6757of <VAR>p</VAR> greater than 3 are changed to 3.
6758If <VAR>p</VAR> is not specified, the value 3 is used.
6759</P><P>
6760
6761The optional <CODE>l</CODE> specifies a longer format, including minutes, of
6762the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s.
6763The value of <VAR>p</VAR> determines whether or not the fraction is included.
6764</P><P>
6765
6766If this variable is not set, Bash acts as if it had the value
6767<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE>
6768</pre></td></tr></table>If the value is null, no timing information is displayed.
6769A trailing newline is added when the format string is displayed.
6770</P><P>
6771
6772<A NAME="IDX278"></A>
6773<DT><CODE>TMOUT</CODE>
6774<DD><A NAME="IDX279"></A>
6775If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the
6776default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
6777The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates
6778if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming
6779from a terminal.
6780<P>
6781
6782In an interactive shell, the value is interpreted as
6783the number of seconds to wait for input after issuing the primary
6784prompt when the shell is interactive.
6785Bash terminates after that number of seconds if input does
6786not arrive.
6787</P><P>
6788
6789<A NAME="IDX280"></A>
6790<DT><CODE>TMPDIR</CODE>
6791<DD><A NAME="IDX281"></A>
6792If set, Bash uses its value as the name of a directory in which
6793Bash creates temporary files for the shell's use.
6794<P>
6795
6796<A NAME="IDX282"></A>
6797<DT><CODE>UID</CODE>
6798<DD><A NAME="IDX283"></A>
6799The numeric real user id of the current user. This variable is readonly.
6800<P>
6801
6802</DL>
6803<P>
6804
6805<A NAME="Bash Features"></A>
6806<HR SIZE="6">
6807<A NAME="SEC68"></A>
6808<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6809<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> &lt; </A>]</TD>
6810<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &gt; </A>]</TD>
6811<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt;&lt; </A>]</TD>
6812<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
6813<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
6814<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6815<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6816<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6817<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6818</TR></TABLE>
6819<H1> 6. Bash Features </H1>
6820<!--docid::SEC68::-->
6821<P>
6822
6823This section describes features unique to Bash.
6824</P><P>
6825
6826<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
6827<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Command line options that you can give
6828 to Bash.</TD></TR>
6829<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">When and how Bash executes scripts.</TD></TR>
6830<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What an interactive shell is.</TD></TR>
6831<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Primitives used in composing expressions for
6832 the <CODE>test</CODE> builtin.</TD></TR>
6833<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR>
6834<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR>
6835<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR>
6836<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR>
6837<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Controlling the PS1 string.</TD></TR>
6838<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR>
6839<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what
6840 the POSIX standard specifies.</TD></TR>
6841</TABLE></BLOCKQUOTE>
6842<P>
6843
6844<A NAME="Invoking Bash"></A>
6845<HR SIZE="6">
6846<A NAME="SEC69"></A>
6847<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6848<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt; </A>]</TD>
6849<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &gt; </A>]</TD>
6850<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt;&lt; </A>]</TD>
6851<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
6852<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
6853<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6854<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6855<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6856<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6857</TR></TABLE>
6858<H2> 6.1 Invoking Bash </H2>
6859<!--docid::SEC69::-->
6860<P>
6861
6862<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
6863bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>]
6864bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
6865</pre></td></tr></table></P><P>
6866
6867In addition to the single-character shell command-line options
6868(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), there are several multi-character
6869options that you can use. These options must appear on the command
6870line before the single-character options to be recognized.
6871</P><P>
6872
6873<DL COMPACT>
6874<DT><CODE>--debugger</CODE>
6875<DD>Arrange for the debugger profile to be executed before the shell
6876starts. Turns on extended debugging mode (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6877for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6878builtin) and shell function tracing
6879(see <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A> for a description of the <CODE>-o functrace</CODE>
6880option).
6881<P>
6882
6883<DT><CODE>--dump-po-strings</CODE>
6884<DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
6885is printed on the standard output
6886in the GNU <CODE>gettext</CODE> PO (portable object) file format.
6887Equivalent to <SAMP>`-D'</SAMP> except for the output format.
6888<P>
6889
6890<DT><CODE>--dump-strings</CODE>
6891<DD>Equivalent to <SAMP>`-D'</SAMP>.
6892<P>
6893
6894<DT><CODE>--help</CODE>
6895<DD>Display a usage message on standard output and exit successfully.
6896<P>
6897
6898<DT><CODE>--init-file <VAR>filename</VAR></CODE>
6899<DD><DT><CODE>--rcfile <VAR>filename</VAR></CODE>
6900<DD>Execute commands from <VAR>filename</VAR> (instead of <TT>`~/.bashrc'</TT>)
6901in an interactive shell.
6902<P>
6903
6904<DT><CODE>--login</CODE>
6905<DD>Equivalent to <SAMP>`-l'</SAMP>.
6906<P>
6907
6908<DT><CODE>--noediting</CODE>
6909<DD>Do not use the GNU Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>)
6910to read command lines when the shell is interactive.
6911<P>
6912
6913<DT><CODE>--noprofile</CODE>
6914<DD>Don't load the system-wide startup file <TT>`/etc/profile'</TT>
6915or any of the personal initialization files
6916<TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT>
6917when Bash is invoked as a login shell.
6918<P>
6919
6920<DT><CODE>--norc</CODE>
6921<DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an
6922interactive shell. This is on by default if the shell is
6923invoked as <CODE>sh</CODE>.
6924<P>
6925
6926<DT><CODE>--posix</CODE>
6927<DD>Change the behavior of Bash where the default operation differs
6928from the POSIX standard to match the standard. This
6929is intended to make Bash behave as a strict superset of that
6930standard. See section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>, for a description of the Bash
6931POSIX mode.
6932<P>
6933
6934<DT><CODE>--restricted</CODE>
6935<DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
6936<P>
6937
6938<DT><CODE>--verbose</CODE>
6939<DD>Equivalent to <SAMP>`-v'</SAMP>. Print shell input lines as they're read.
6940<P>
6941
6942<DT><CODE>--version</CODE>
6943<DD>Show version information for this instance of
6944Bash on the standard output and exit successfully.
6945<P>
6946
6947</DL>
6948<P>
6949
6950There are several single-character options that may be supplied at
6951invocation which are not available with the <CODE>set</CODE> builtin.
6952</P><P>
6953
6954<DL COMPACT>
6955<DT><CODE>-c <VAR>string</VAR></CODE>
6956<DD>Read and execute commands from <VAR>string</VAR> after processing the
6957options, then exit. Any remaining arguments are assigned to the
6958positional parameters, starting with <CODE>$0</CODE>.
6959<P>
6960
6961<DT><CODE>-i</CODE>
6962<DD>Force the shell to run interactively. Interactive shells are
6963described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>.
6964<P>
6965
6966<DT><CODE>-l</CODE>
6967<DD>Make this shell act as if it had been directly invoked by login.
6968When the shell is interactive, this is equivalent to starting a
6969login shell with <SAMP>`exec -l bash'</SAMP>.
6970When the shell is not interactive, the login shell startup files will
6971be executed.
6972<SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP>
6973will replace the current shell with a Bash login shell.
6974See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>, for a description of the special behavior
6975of a login shell.
6976<P>
6977
6978<DT><CODE>-r</CODE>
6979<DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
6980<P>
6981
6982<DT><CODE>-s</CODE>
6983<DD>If this option is present, or if no arguments remain after option
6984processing, then commands are read from the standard input.
6985This option allows the positional parameters to be set
6986when invoking an interactive shell.
6987<P>
6988
6989<DT><CODE>-D</CODE>
6990<DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
6991is printed on the standard output.
6992These are the strings that
6993are subject to language translation when the current locale
6994is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
6995This implies the <SAMP>`-n'</SAMP> option; no commands will be executed.
6996<P>
6997
6998<DT><CODE>[-+]O [<VAR>shopt_option</VAR>]</CODE>
6999<DD><VAR>shopt_option</VAR> is one of the shell options accepted by the
7000<CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7001If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option;
7002<SAMP>`+O'</SAMP> unsets it.
7003If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell
7004options accepted by <CODE>shopt</CODE> are printed on the standard output.
7005If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format
7006that may be reused as input.
7007<P>
7008
7009<DT><CODE>--</CODE>
7010<DD>A <CODE>--</CODE> signals the end of options and disables further option
7011processing.
7012Any arguments after the <CODE>--</CODE> are treated as filenames and arguments.
7013<P>
7014
7015</DL>
7016<P>
7017
7018<A NAME="IDX284"></A>
7019A <EM>login</EM> shell is one whose first character of argument zero is
7020<SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option.
7021</P><P>
7022
7023<A NAME="IDX285"></A>
7024An <EM>interactive</EM> shell is one started without non-option arguments,
7025unless <SAMP>`-s'</SAMP> is specified,
7026without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both
7027connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one
7028started with the <SAMP>`-i'</SAMP> option. See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for more
7029information.
7030</P><P>
7031
7032If arguments remain after option processing, and neither the
7033<SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP>
7034option has been supplied, the first argument is assumed to
7035be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>).
7036When Bash is invoked in this fashion, <CODE>$0</CODE>
7037is set to the name of the file, and the positional parameters
7038are set to the remaining arguments.
7039Bash reads and executes commands from this file, then exits.
7040Bash's exit status is the exit status of the last command executed
7041in the script. If no commands are executed, the exit status is 0.
7042</P><P>
7043
7044<A NAME="Bash Startup Files"></A>
7045<HR SIZE="6">
7046<A NAME="SEC70"></A>
7047<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7048<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &lt; </A>]</TD>
7049<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> &gt; </A>]</TD>
7050<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> &lt;&lt; </A>]</TD>
7051<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7052<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7053<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7054<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7055<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7056<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7057</TR></TABLE>
7058<H2> 6.2 Bash Startup Files </H2>
7059<!--docid::SEC70::-->
7060<P>
7061
7062This section describes how Bash executes its startup files.
7063If any of the files exist but cannot be read, Bash reports an error.
7064Tildes are expanded in file names as described above under
7065Tilde Expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
7066</P><P>
7067
7068Interactive shells are described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>.
7069</P><P>
7070
7071<A NAME="SEC71"></A>
7072<H4> Invoked as an interactive login shell, or with <SAMP>`--login'</SAMP> </H4>
7073<!--docid::SEC71::-->
7074<P>
7075
7076When Bash is invoked as an interactive login shell, or as a
7077non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and
7078executes commands from the file <TT>`/etc/profile'</TT>, if that file exists.
7079After reading that file, it looks for <TT>`~/.bash_profile'</TT>,
7080<TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads
7081and executes commands from the first one that exists and is readable.
7082The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to
7083inhibit this behavior.
7084</P><P>
7085
7086When a login shell exits, Bash reads and executes commands from
7087the file <TT>`~/.bash_logout'</TT>, if it exists.
7088</P><P>
7089
7090<A NAME="SEC72"></A>
7091<H4> Invoked as an interactive non-login shell </H4>
7092<!--docid::SEC72::-->
7093<P>
7094
7095When an interactive shell that is not a login shell is started, Bash
7096reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists.
7097This may be inhibited by using the <SAMP>`--norc'</SAMP> option.
7098The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and
7099execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>.
7100</P><P>
7101
7102So, typically, your <TT>`~/.bash_profile'</TT> contains the line
7103<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE>
7104</pre></td></tr></table>after (or before) any login-specific initializations.
7105</P><P>
7106
7107<A NAME="SEC73"></A>
7108<H4> Invoked non-interactively </H4>
7109<!--docid::SEC73::-->
7110<P>
7111
7112When Bash is started non-interactively, to run a shell script,
7113for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment,
7114expands its value if it appears there, and uses the expanded value as
7115the name of a file to read and execute. Bash behaves as if the
7116following command were executed:
7117<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE>
7118</pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the
7119file name.
7120</P><P>
7121
7122As noted above, if a non-interactive shell is invoked with the
7123<SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the
7124login shell startup files.
7125</P><P>
7126
7127<A NAME="SEC74"></A>
7128<H4> Invoked with name <CODE>sh</CODE> </H4>
7129<!--docid::SEC74::-->
7130<P>
7131
7132If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the
7133startup behavior of historical versions of <CODE>sh</CODE> as closely as
7134possible, while conforming to the POSIX standard as well.
7135</P><P>
7136
7137When invoked as an interactive login shell, or as a non-interactive
7138shell with the <SAMP>`--login'</SAMP> option, it first attempts to read
7139and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in
7140that order.
7141The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior.
7142When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash
7143looks for the variable <CODE>ENV</CODE>, expands its value if it is defined,
7144and uses the expanded value as the name of a file to read and execute.
7145Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute
7146commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has
7147no effect.
7148A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt
7149to read any other startup files.
7150</P><P>
7151
7152When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after
7153the startup files are read.
7154</P><P>
7155
7156<A NAME="SEC75"></A>
7157<H4> Invoked in POSIX mode </H4>
7158<!--docid::SEC75::-->
7159<P>
7160
7161When Bash is started in POSIX mode, as with the
7162<SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard
7163for startup files.
7164In this mode, interactive shells expand the <CODE>ENV</CODE> variable
7165and commands are read and executed from the file whose name is the
7166expanded value.
7167No other startup files are read.
7168</P><P>
7169
7170<A NAME="SEC76"></A>
7171<H4> Invoked by remote shell daemon </H4>
7172<!--docid::SEC76::-->
7173<P>
7174
7175Bash attempts to determine when it is being run with its standard input
7176connected to a a network connection, as if by the remote shell
7177daemon, usually <CODE>rshd</CODE>, or the secure shell daemon <CODE>sshd</CODE>.
7178If Bash determines it is being run in
7179this fashion, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that
7180file exists and is readable.
7181It will not do this if invoked as <CODE>sh</CODE>.
7182The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the
7183<SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but
7184<CODE>rshd</CODE> does not generally invoke the shell with those options or
7185allow them to be specified.
7186</P><P>
7187
7188<A NAME="SEC77"></A>
7189<H4> Invoked with unequal effective and real UID/GIDs </H4>
7190<!--docid::SEC77::-->
7191<P>
7192
7193If Bash is started with the effective user (group) id not equal to the
7194real user (group) id, and the <CODE>-p</CODE> option is not supplied, no startup
7195files are read, shell functions are not inherited from the environment,
7196the <CODE>SHELLOPTS</CODE> variable, if it appears in the environment, is ignored,
7197and the effective user id is set to the real user id.
7198If the <CODE>-p</CODE> option is supplied at invocation, the startup behavior is
7199the same, but the effective user id is not reset.
7200</P><P>
7201
7202<A NAME="Interactive Shells"></A>
7203<HR SIZE="6">
7204<A NAME="SEC78"></A>
7205<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7206<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &lt; </A>]</TD>
7207<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> &gt; </A>]</TD>
7208<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt;&lt; </A>]</TD>
7209<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7210<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7211<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7212<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7213<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7214<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7215</TR></TABLE>
7216<H2> 6.3 Interactive Shells </H2>
7217<!--docid::SEC78::-->
7218<P>
7219
7220<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
7221<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What determines whether a shell is Interactive.</TD></TR>
7222<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to tell if a shell is interactive.</TD></TR>
7223<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR>
7224</TABLE></BLOCKQUOTE>
7225<P>
7226
7227<A NAME="What is an Interactive Shell?"></A>
7228<HR SIZE="6">
7229<A NAME="SEC79"></A>
7230<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7231<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> &lt; </A>]</TD>
7232<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> &gt; </A>]</TD>
7233<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt;&lt; </A>]</TD>
7234<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7235<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7236<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7237<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7238<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7239<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7240</TR></TABLE>
7241<H3> 6.3.1 What is an Interactive Shell? </H3>
7242<!--docid::SEC79::-->
7243<P>
7244
7245An interactive shell
7246is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is
7247specified, without specifying the <SAMP>`-c'</SAMP> option, and
7248whose input and error output are both
7249connected to terminals (as determined by <CODE>isatty(3)</CODE>),
7250or one started with the <SAMP>`-i'</SAMP> option.
7251</P><P>
7252
7253An interactive shell generally reads from and writes to a user's
7254terminal.
7255</P><P>
7256
7257The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters
7258when an interactive shell is started.
7259</P><P>
7260
7261<A NAME="Is this Shell Interactive?"></A>
7262<HR SIZE="6">
7263<A NAME="SEC80"></A>
7264<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7265<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> &lt; </A>]</TD>
7266<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &gt; </A>]</TD>
7267<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &lt;&lt; </A>]</TD>
7268<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7269<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7270<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7271<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7272<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7273<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7274</TR></TABLE>
7275<H3> 6.3.2 Is this Shell Interactive? </H3>
7276<!--docid::SEC80::-->
7277<P>
7278
7279To determine within a startup script whether or not Bash is
7280running interactively,
7281test the value of the <SAMP>`-'</SAMP> special parameter.
7282It contains <CODE>i</CODE> when the shell is interactive. For example:
7283</P><P>
7284
7285<TABLE><tr><td>&nbsp;</td><td class=example><pre>case "$-" in
7286*i*) echo This shell is interactive ;;
7287*) echo This shell is not interactive ;;
7288esac
7289</pre></td></tr></table></P><P>
7290
7291Alternatively, startup scripts may examine the variable
7292<CODE>PS1</CODE>; it is unset in non-interactive shells, and set in
7293interactive shells. Thus:
7294</P><P>
7295
7296<TABLE><tr><td>&nbsp;</td><td class=example><pre>if [ -z "$PS1" ]; then
7297 echo This shell is not interactive
7298else
7299 echo This shell is interactive
7300fi
7301</pre></td></tr></table></P><P>
7302
7303<A NAME="Interactive Shell Behavior"></A>
7304<HR SIZE="6">
7305<A NAME="SEC81"></A>
7306<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7307<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> &lt; </A>]</TD>
7308<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt; </A>]</TD>
7309<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt;&lt; </A>]</TD>
7310<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7311<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7312<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7313<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7314<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7315<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7316</TR></TABLE>
7317<H3> 6.3.3 Interactive Shell Behavior </H3>
7318<!--docid::SEC81::-->
7319<P>
7320
7321When the shell is running interactively, it changes its behavior in
7322several ways.
7323</P><P>
7324
7325<OL>
7326<LI>
7327Startup files are read and executed as described in <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>.
7328<P>
7329
7330<LI>
7331Job Control (see section <A HREF="bashref.html#SEC91">7. Job Control</A>) is enabled by default. When job
7332control is in effect, Bash ignores the keyboard-generated job control
7333signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
7334<P>
7335
7336<LI>
7337Bash expands and displays <CODE>PS1</CODE> before reading the first line
7338of a command, and expands and displays <CODE>PS2</CODE> before reading the
7339second and subsequent lines of a multi-line command.
7340<P>
7341
7342<LI>
7343Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command
7344before printing the primary prompt, <CODE>$PS1</CODE>
7345(see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7346<P>
7347
7348<LI>
7349Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to read commands from
7350the user's terminal.
7351<P>
7352
7353<LI>
7354Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE>
7355instead of exiting immediately when it receives an <CODE>EOF</CODE> on its
7356standard input when reading a command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7357<P>
7358
7359<LI>
7360Command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>)
7361and history expansion (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>)
7362are enabled by default.
7363Bash will save the command history to the file named by <CODE>$HISTFILE</CODE>
7364when an interactive shell exits.
7365<P>
7366
7367<LI>
7368Alias expansion (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>) is performed by default.
7369<P>
7370
7371<LI>
7372In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE>
7373(see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7374<P>
7375
7376<LI>
7377In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled
7378((see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7379<CODE>SIGINT</CODE> will interrupt some shell builtins.
7380<P>
7381
7382<LI>
7383An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit
7384if the <CODE>huponexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7385<P>
7386
7387<LI>
7388The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has
7389no effect (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7390<P>
7391
7392<LI>
7393Bash will check for mail periodically, depending on the values of the
7394<CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables
7395(see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7396<P>
7397
7398<LI>
7399Expansion errors due to references to unbound shell variables after
7400<SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit
7401(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7402<P>
7403
7404<LI>
7405The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset
7406or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions
7407(see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
7408<P>
7409
7410<LI>
7411Redirection errors encountered by shell builtins will not cause the
7412shell to exit.
7413<P>
7414
7415<LI>
7416When running in POSIX mode, a special builtin returning an error
7417status will not cause the shell to exit (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
7418<P>
7419
7420<LI>
7421A failed <CODE>exec</CODE> will not cause the shell to exit
7422(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
7423<P>
7424
7425<LI>
7426Parser syntax errors will not cause the shell to exit.
7427<P>
7428
7429<LI>
7430Simple spelling correction for directory arguments to the <CODE>cd</CODE>
7431builtin is enabled by default (see the description of the <CODE>cdspell</CODE>
7432option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7433<P>
7434
7435<LI>
7436The shell will check the value of the <CODE>TMOUT</CODE> variable and exit
7437if a command is not read within the specified number of seconds after
7438printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7439<P>
7440
7441</OL>
7442<P>
7443
7444<A NAME="Bash Conditional Expressions"></A>
7445<HR SIZE="6">
7446<A NAME="SEC82"></A>
7447<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7448<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &lt; </A>]</TD>
7449<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &gt; </A>]</TD>
7450<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt;&lt; </A>]</TD>
7451<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7452<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7453<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7454<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7455<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7456<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7457</TR></TABLE>
7458<H2> 6.4 Bash Conditional Expressions </H2>
7459<!--docid::SEC82::-->
7460<P>
7461
7462Conditional expressions are used by the <CODE>[[</CODE> compound command
7463and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands.
7464</P><P>
7465
7466Expressions may be unary or binary.
7467Unary expressions are often used to examine the status of a file.
7468There are string operators and numeric comparison operators as well.
7469If the <VAR>file</VAR> argument to one of the primaries is of the form
7470<TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked.
7471If the <VAR>file</VAR> argument to one of the primaries is one of
7472<TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file
7473descriptor 0, 1, or 2, respectively, is checked.
7474</P><P>
7475
7476Unless otherwise specified, primaries that operate on files follow symbolic
7477links and operate on the target of the link, rather than the link itself.
7478</P><P>
7479
7480<DL COMPACT>
7481<DT><CODE>-a <VAR>file</VAR></CODE>
7482<DD>True if <VAR>file</VAR> exists.
7483<P>
7484
7485<DT><CODE>-b <VAR>file</VAR></CODE>
7486<DD>True if <VAR>file</VAR> exists and is a block special file.
7487<P>
7488
7489<DT><CODE>-c <VAR>file</VAR></CODE>
7490<DD>True if <VAR>file</VAR> exists and is a character special file.
7491<P>
7492
7493<DT><CODE>-d <VAR>file</VAR></CODE>
7494<DD>True if <VAR>file</VAR> exists and is a directory.
7495<P>
7496
7497<DT><CODE>-e <VAR>file</VAR></CODE>
7498<DD>True if <VAR>file</VAR> exists.
7499<P>
7500
7501<DT><CODE>-f <VAR>file</VAR></CODE>
7502<DD>True if <VAR>file</VAR> exists and is a regular file.
7503<P>
7504
7505<DT><CODE>-g <VAR>file</VAR></CODE>
7506<DD>True if <VAR>file</VAR> exists and its set-group-id bit is set.
7507<P>
7508
7509<DT><CODE>-h <VAR>file</VAR></CODE>
7510<DD>True if <VAR>file</VAR> exists and is a symbolic link.
7511<P>
7512
7513<DT><CODE>-k <VAR>file</VAR></CODE>
7514<DD>True if <VAR>file</VAR> exists and its "sticky" bit is set.
7515<P>
7516
7517<DT><CODE>-p <VAR>file</VAR></CODE>
7518<DD>True if <VAR>file</VAR> exists and is a named pipe (FIFO).
7519<P>
7520
7521<DT><CODE>-r <VAR>file</VAR></CODE>
7522<DD>True if <VAR>file</VAR> exists and is readable.
7523<P>
7524
7525<DT><CODE>-s <VAR>file</VAR></CODE>
7526<DD>True if <VAR>file</VAR> exists and has a size greater than zero.
7527<P>
7528
7529<DT><CODE>-t <VAR>fd</VAR></CODE>
7530<DD>True if file descriptor <VAR>fd</VAR> is open and refers to a terminal.
7531<P>
7532
7533<DT><CODE>-u <VAR>file</VAR></CODE>
7534<DD>True if <VAR>file</VAR> exists and its set-user-id bit is set.
7535<P>
7536
7537<DT><CODE>-w <VAR>file</VAR></CODE>
7538<DD>True if <VAR>file</VAR> exists and is writable.
7539<P>
7540
7541<DT><CODE>-x <VAR>file</VAR></CODE>
7542<DD>True if <VAR>file</VAR> exists and is executable.
7543<P>
7544
7545<DT><CODE>-O <VAR>file</VAR></CODE>
7546<DD>True if <VAR>file</VAR> exists and is owned by the effective user id.
7547<P>
7548
7549<DT><CODE>-G <VAR>file</VAR></CODE>
7550<DD>True if <VAR>file</VAR> exists and is owned by the effective group id.
7551<P>
7552
7553<DT><CODE>-L <VAR>file</VAR></CODE>
7554<DD>True if <VAR>file</VAR> exists and is a symbolic link.
7555<P>
7556
7557<DT><CODE>-S <VAR>file</VAR></CODE>
7558<DD>True if <VAR>file</VAR> exists and is a socket.
7559<P>
7560
7561<DT><CODE>-N <VAR>file</VAR></CODE>
7562<DD>True if <VAR>file</VAR> exists and has been modified since it was last read.
7563<P>
7564
7565<DT><CODE><VAR>file1</VAR> -nt <VAR>file2</VAR></CODE>
7566<DD>True if <VAR>file1</VAR> is newer (according to modification date)
7567than <VAR>file2</VAR>, or if <VAR>file1</VAR> exists and <VAR>file2</VAR> does not.
7568<P>
7569
7570<DT><CODE><VAR>file1</VAR> -ot <VAR>file2</VAR></CODE>
7571<DD>True if <VAR>file1</VAR> is older than <VAR>file2</VAR>,
7572or if <VAR>file2</VAR> exists and <VAR>file1</VAR> does not.
7573<P>
7574
7575<DT><CODE><VAR>file1</VAR> -ef <VAR>file2</VAR></CODE>
7576<DD>True if <VAR>file1</VAR> and <VAR>file2</VAR> refer to the same device and
7577inode numbers.
7578<P>
7579
7580<DT><CODE>-o <VAR>optname</VAR></CODE>
7581<DD>True if shell option <VAR>optname</VAR> is enabled.
7582The list of options appears in the description of the <SAMP>`-o'</SAMP>
7583option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7584<P>
7585
7586<DT><CODE>-z <VAR>string</VAR></CODE>
7587<DD>True if the length of <VAR>string</VAR> is zero.
7588<P>
7589
7590<DT><CODE>-n <VAR>string</VAR></CODE>
7591<DD><DT><CODE><VAR>string</VAR></CODE>
7592<DD>True if the length of <VAR>string</VAR> is non-zero.
7593<P>
7594
7595<DT><CODE><VAR>string1</VAR> == <VAR>string2</VAR></CODE>
7596<DD>True if the strings are equal.
7597<SAMP>`='</SAMP> may be used in place of <SAMP>`=='</SAMP> for strict POSIX compliance.
7598<P>
7599
7600<DT><CODE><VAR>string1</VAR> != <VAR>string2</VAR></CODE>
7601<DD>True if the strings are not equal.
7602<P>
7603
7604<DT><CODE><VAR>string1</VAR> &#60; <VAR>string2</VAR></CODE>
7605<DD>True if <VAR>string1</VAR> sorts before <VAR>string2</VAR> lexicographically
7606in the current locale.
7607<P>
7608
7609<DT><CODE><VAR>string1</VAR> &#62; <VAR>string2</VAR></CODE>
7610<DD>True if <VAR>string1</VAR> sorts after <VAR>string2</VAR> lexicographically
7611in the current locale.
7612<P>
7613
7614<DT><CODE><VAR>arg1</VAR> OP <VAR>arg2</VAR></CODE>
7615<DD><CODE>OP</CODE> is one of
7616<SAMP>`-eq'</SAMP>, <SAMP>`-ne'</SAMP>, <SAMP>`-lt'</SAMP>, <SAMP>`-le'</SAMP>, <SAMP>`-gt'</SAMP>, or <SAMP>`-ge'</SAMP>.
7617These arithmetic binary operators return true if <VAR>arg1</VAR>
7618is equal to, not equal to, less than, less than or equal to,
7619greater than, or greater than or equal to <VAR>arg2</VAR>,
7620respectively. <VAR>Arg1</VAR> and <VAR>arg2</VAR>
7621may be positive or negative integers.
7622<P>
7623
7624</DL>
7625<P>
7626
7627<A NAME="Shell Arithmetic"></A>
7628<HR SIZE="6">
7629<A NAME="SEC83"></A>
7630<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7631<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt; </A>]</TD>
7632<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &gt; </A>]</TD>
7633<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &lt;&lt; </A>]</TD>
7634<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7635<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7636<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7637<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7638<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7639<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7640</TR></TABLE>
7641<H2> 6.5 Shell Arithmetic </H2>
7642<!--docid::SEC83::-->
7643<P>
7644
7645The shell allows arithmetic expressions to be evaluated, as one of
7646the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option
7647to the <CODE>declare</CODE> builtins.
7648</P><P>
7649
7650Evaluation is done in fixed-width integers with no check for overflow,
7651though division by 0 is trapped and flagged as an error.
7652The operators and their precedence, associativity, and values
7653are the same as in the C language.
7654The following list of operators is grouped into levels of
7655equal-precedence operators.
7656The levels are listed in order of decreasing precedence.
7657</P><P>
7658
7659<DL COMPACT>
7660
7661<DT><CODE><VAR>id</VAR>++ <VAR>id</VAR>--</CODE>
7662<DD>variable post-increment and post-decrement
7663<P>
7664
7665<DT><CODE>++<VAR>id</VAR> --<VAR>id</VAR></CODE>
7666<DD>variable pre-increment and pre-decrement
7667<P>
7668
7669<DT><CODE>- +</CODE>
7670<DD>unary minus and plus
7671<P>
7672
7673<DT><CODE>! ~</CODE>
7674<DD>logical and bitwise negation
7675<P>
7676
7677<DT><CODE>**</CODE>
7678<DD>exponentiation
7679<P>
7680
7681<DT><CODE>* / %</CODE>
7682<DD>multiplication, division, remainder
7683<P>
7684
7685<DT><CODE>+ -</CODE>
7686<DD>addition, subtraction
7687<P>
7688
7689<DT><CODE>&#60;&#60; &#62;&#62;</CODE>
7690<DD>left and right bitwise shifts
7691<P>
7692
7693<DT><CODE>&#60;= &#62;= &#60; &#62;</CODE>
7694<DD>comparison
7695<P>
7696
7697<DT><CODE>== !=</CODE>
7698<DD>equality and inequality
7699<P>
7700
7701<DT><CODE>&#38;</CODE>
7702<DD>bitwise AND
7703<P>
7704
7705<DT><CODE>^</CODE>
7706<DD>bitwise exclusive OR
7707<P>
7708
7709<DT><CODE>|</CODE>
7710<DD>bitwise OR
7711<P>
7712
7713<DT><CODE>&#38;&#38;</CODE>
7714<DD>logical AND
7715<P>
7716
7717<DT><CODE>||</CODE>
7718<DD>logical OR
7719<P>
7720
7721<DT><CODE>expr ? expr : expr</CODE>
7722<DD>conditional operator
7723<P>
7724
7725<DT><CODE>= *= /= %= += -= &#60;&#60;= &#62;&#62;= &#38;= ^= |=</CODE>
7726<DD>assignment
7727<P>
7728
7729<DT><CODE>expr1 , expr2</CODE>
7730<DD>comma
7731</DL>
7732<P>
7733
7734Shell variables are allowed as operands; parameter expansion is
7735performed before the expression is evaluated.
7736Within an expression, shell variables may also be referenced by name
7737without using the parameter expansion syntax.
7738A shell variable that is null or unset evaluates to 0 when referenced
7739by name without using the parameter expansion syntax.
7740The value of a variable is evaluated as an arithmetic expression
7741when it is referenced, or when a variable which has been given the
7742<VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value.
7743A null value evaluates to 0.
7744A shell variable need not have its integer attribute turned on
7745to be used in an expression.
7746</P><P>
7747
7748Constants with a leading 0 are interpreted as octal numbers.
7749A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal. Otherwise,
7750numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where <VAR>base</VAR>
7751is a decimal number between 2 and 64 representing the arithmetic
7752base, and <VAR>n</VAR> is a number in that base. If <VAR>base</VAR><CODE>#</CODE> is
7753omitted, then base 10 is used.
7754The digits greater than 9 are represented by the lowercase letters,
7755the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order.
7756If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase
7757letters may be used interchangeably to represent numbers between 10
7758and 35.
7759</P><P>
7760
7761Operators are evaluated in order of precedence. Sub-expressions in
7762parentheses are evaluated first and may override the precedence
7763rules above.
7764</P><P>
7765
7766<A NAME="Aliases"></A>
7767<HR SIZE="6">
7768<A NAME="SEC84"></A>
7769<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7770<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt; </A>]</TD>
7771<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &gt; </A>]</TD>
7772<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &lt;&lt; </A>]</TD>
7773<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7774<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7775<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7776<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7777<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7778<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7779</TR></TABLE>
7780<H2> 6.6 Aliases </H2>
7781<!--docid::SEC84::-->
7782<P>
7783
7784<VAR>Aliases</VAR> allow a string to be substituted for a word when it is used
7785as the first word of a simple command.
7786The shell maintains a list of aliases that may be set and unset with
7787the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands.
7788</P><P>
7789
7790The first word of each simple command, if unquoted, is checked to see
7791if it has an alias.
7792If so, that word is replaced by the text of the alias.
7793The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the
7794shell metacharacters or quoting characters listed above may not appear
7795in an alias name.
7796The replacement text may contain any valid
7797shell input, including shell metacharacters.
7798The first word of the replacement text is tested for
7799aliases, but a word that is identical to an alias being expanded
7800is not expanded a second time.
7801This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>,
7802for instance, and Bash does not try to recursively expand the
7803replacement text. If the last character of the alias value is a
7804space or tab character, then the next command word following the
7805alias is also checked for alias expansion.
7806</P><P>
7807
7808Aliases are created and listed with the <CODE>alias</CODE>
7809command, and removed with the <CODE>unalias</CODE> command.
7810</P><P>
7811
7812There is no mechanism for using arguments in the replacement text,
7813as in <CODE>csh</CODE>.
7814If arguments are needed, a shell function should be used
7815(see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
7816</P><P>
7817
7818Aliases are not expanded when the shell is not interactive,
7819unless the <CODE>expand_aliases</CODE> shell option is set using
7820<CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7821</P><P>
7822
7823The rules concerning the definition and use of aliases are
7824somewhat confusing. Bash
7825always reads at least one complete line
7826of input before executing any
7827of the commands on that line. Aliases are expanded when a
7828command is read, not when it is executed. Therefore, an
7829alias definition appearing on the same line as another
7830command does not take effect until the next line of input is read.
7831The commands following the alias definition
7832on that line are not affected by the new alias.
7833This behavior is also an issue when functions are executed.
7834Aliases are expanded when a function definition is read,
7835not when the function is executed, because a function definition
7836is itself a compound command. As a consequence, aliases
7837defined in a function are not available until after that
7838function is executed. To be safe, always put
7839alias definitions on a separate line, and do not use <CODE>alias</CODE>
7840in compound commands.
7841</P><P>
7842
7843For almost every purpose, shell functions are preferred over aliases.
7844</P><P>
7845
7846<A NAME="Arrays"></A>
7847<HR SIZE="6">
7848<A NAME="SEC85"></A>
7849<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7850<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &lt; </A>]</TD>
7851<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &gt; </A>]</TD>
7852<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &lt;&lt; </A>]</TD>
7853<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7854<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7855<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7856<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7857<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7858<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7859</TR></TABLE>
7860<H2> 6.7 Arrays </H2>
7861<!--docid::SEC85::-->
7862<P>
7863
7864Bash provides one-dimensional indexed and associative array variables.
7865Any variable may be used as an indexed array;
7866the <CODE>declare</CODE> builtin will explicitly declare an array.
7867There is no maximum
7868limit on the size of an array, nor any requirement that members
7869be indexed or assigned contiguously.
7870Indexed arrays are referenced using integers (including arithmetic
7871expressions (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) and are zero-based;
7872associative arrays use arbitrary strings.
7873</P><P>
7874
7875An indexed array is created automatically if any variable is assigned to
7876using the syntax
7877<TABLE><tr><td>&nbsp;</td><td class=example><pre>name[<VAR>subscript</VAR>]=<VAR>value</VAR>
7878</pre></td></tr></table></P><P>
7879
7880The <VAR>subscript</VAR>
7881is treated as an arithmetic expression that must evaluate to a number
7882greater than or equal to zero. To explicitly declare an array, use
7883<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -a <VAR>name</VAR>
7884</pre></td></tr></table>The syntax
7885<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>]
7886</pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored.
7887</P><P>
7888
7889Associative arrays are created using
7890<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -A <VAR>name</VAR>.
7891</pre></td></tr></table></P><P>
7892
7893Attributes may be
7894specified for an array variable using the <CODE>declare</CODE> and
7895<CODE>readonly</CODE> builtins. Each attribute applies to all members of
7896an array.
7897</P><P>
7898
7899Arrays are assigned to using compound assignments of the form
7900<TABLE><tr><td>&nbsp;</td><td class=example><pre>name=(value<VAR>1</VAR> <small>...</small> value<VAR>n</VAR>)
7901</pre></td></tr></table>where each
7902<VAR>value</VAR> is of the form <CODE>[<VAR>subscript</VAR>]=</CODE><VAR>string</VAR>.
7903Indexed array assignments do not require the bracket and subscript.
7904When assigning to indexed arrays, if
7905the optional subscript is supplied, that index is assigned to;
7906otherwise the index of the element assigned is the last index assigned
7907to by the statement plus one. Indexing starts at zero.
7908</P><P>
7909
7910When assigning to an associative array, the subscript is required.
7911</P><P>
7912
7913This syntax is also accepted by the <CODE>declare</CODE>
7914builtin. Individual array elements may be assigned to using the
7915<CODE>name[</CODE><VAR>subscript</VAR><CODE>]=</CODE><VAR>value</VAR> syntax introduced above.
7916</P><P>
7917
7918Any element of an array may be referenced using
7919<CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
7920The braces are required to avoid
7921conflicts with the shell's filename expansion operators. If the
7922<VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members
7923of the array <VAR>name</VAR>. These subscripts differ only when the word
7924appears within double quotes.
7925If the word is double-quoted,
7926<CODE>${name[*]}</CODE> expands to a single word with
7927the value of each array member separated by the first character of the
7928<CODE>IFS</CODE> variable, and <CODE>${name[@]}</CODE> expands each element of
7929<VAR>name</VAR> to a separate word. When there are no array members,
7930<CODE>${name[@]}</CODE> expands to nothing.
7931If the double-quoted expansion occurs within a word, the expansion of
7932the first parameter is joined with the beginning part of the original
7933word, and the expansion of the last parameter is joined with the last
7934part of the original word.
7935This is analogous to the
7936expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>.
7937<CODE>${#name[</CODE><VAR>subscript</VAR><CODE>]}</CODE> expands to the length of
7938<CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
7939If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or
7940<SAMP>`*'</SAMP>, the expansion is the number of elements in the array.
7941Referencing an array variable without a subscript is equivalent to
7942referencing with a subscript of 0.
7943</P><P>
7944
7945The <CODE>unset</CODE> builtin is used to destroy arrays.
7946<CODE>unset</CODE> <VAR>name</VAR>[<VAR>subscript</VAR>]
7947destroys the array element at index <VAR>subscript</VAR>.
7948Care must be taken to avoid unwanted side effects caused by filename
7949generation.
7950<CODE>unset</CODE> <VAR>name</VAR>, where <VAR>name</VAR> is an array, removes the
7951entire array. A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the
7952entire array.
7953</P><P>
7954
7955The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE>
7956builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed
7957array and a <SAMP>`-A'</SAMP> option to specify an associative array.
7958The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP>
7959option to assign a list of words read from the standard input
7960to an array, and can read values from the standard input into
7961individual array elements. The <CODE>set</CODE> and <CODE>declare</CODE>
7962builtins display array values in a way that allows them to be
7963reused as input.
7964</P><P>
7965
7966<A NAME="The Directory Stack"></A>
7967<HR SIZE="6">
7968<A NAME="SEC86"></A>
7969<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7970<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &lt; </A>]</TD>
7971<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> &gt; </A>]</TD>
7972<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &lt;&lt; </A>]</TD>
7973<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7974<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &gt;&gt; </A>]</TD>
7975<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7976<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7977<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7978<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7979</TR></TABLE>
7980<H2> 6.8 The Directory Stack </H2>
7981<!--docid::SEC86::-->
7982<P>
7983
7984<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
7985<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate
7986 the directory stack.</TD></TR>
7987</TABLE></BLOCKQUOTE>
7988<P>
7989
7990The directory stack is a list of recently-visited directories. The
7991<CODE>pushd</CODE> builtin adds directories to the stack as it changes
7992the current directory, and the <CODE>popd</CODE> builtin removes specified
7993directories from the stack and changes the current directory to
7994the directory removed. The <CODE>dirs</CODE> builtin displays the contents
7995of the directory stack.
7996</P><P>
7997
7998The contents of the directory stack are also visible
7999as the value of the <CODE>DIRSTACK</CODE> shell variable.
8000</P><P>
8001
8002<A NAME="Directory Stack Builtins"></A>
8003<HR SIZE="6">
8004<A NAME="SEC87"></A>
8005<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8006<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &lt; </A>]</TD>
8007<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &gt; </A>]</TD>
8008<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &lt;&lt; </A>]</TD>
8009<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> Up </A>]</TD>
8010<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &gt;&gt; </A>]</TD>
8011<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8012<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8013<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8014<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8015</TR></TABLE>
8016<H3> 6.8.1 Directory Stack Builtins </H3>
8017<!--docid::SEC87::-->
8018<P>
8019
8020<DL COMPACT>
8021
8022<DT><CODE>dirs</CODE>
8023<DD><A NAME="IDX286"></A>
8024<TABLE><tr><td>&nbsp;</td><td class=example><pre>dirs [+<VAR>N</VAR> | -<VAR>N</VAR>] [-clpv]
8025</pre></td></tr></table>Display the list of currently remembered directories. Directories
8026are added to the list with the <CODE>pushd</CODE> command; the
8027<CODE>popd</CODE> command removes directories from the list.
8028<DL COMPACT>
8029<DT><CODE>+<VAR>N</VAR></CODE>
8030<DD>Displays the <VAR>N</VAR>th directory (counting from the left of the
8031list printed by <CODE>dirs</CODE> when invoked without options), starting
8032with zero.
8033<DT><CODE>-<VAR>N</VAR></CODE>
8034<DD>Displays the <VAR>N</VAR>th directory (counting from the right of the
8035list printed by <CODE>dirs</CODE> when invoked without options), starting
8036with zero.
8037<DT><CODE>-c</CODE>
8038<DD>Clears the directory stack by deleting all of the elements.
8039<DT><CODE>-l</CODE>
8040<DD>Produces a longer listing; the default listing format uses a
8041tilde to denote the home directory.
8042<DT><CODE>-p</CODE>
8043<DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8044line.
8045<DT><CODE>-v</CODE>
8046<DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8047line, prefixing each entry with its index in the stack.
8048</DL>
8049<P>
8050
8051<DT><CODE>popd</CODE>
8052<DD><A NAME="IDX287"></A>
8053<TABLE><tr><td>&nbsp;</td><td class=example><pre>popd [+<VAR>N</VAR> | -<VAR>N</VAR>] [-n]
8054</pre></td></tr></table><P>
8055
8056Remove the top entry from the directory stack, and <CODE>cd</CODE>
8057to the new top directory.
8058When no arguments are given, <CODE>popd</CODE>
8059removes the top directory from the stack and
8060performs a <CODE>cd</CODE> to the new top directory. The
8061elements are numbered from 0 starting at the first directory listed with
8062<CODE>dirs</CODE>; i.e., <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>.
8063<DL COMPACT>
8064<DT><CODE>+<VAR>N</VAR></CODE>
8065<DD>Removes the <VAR>N</VAR>th directory (counting from the left of the
8066list printed by <CODE>dirs</CODE>), starting with zero.
8067<DT><CODE>-<VAR>N</VAR></CODE>
8068<DD>Removes the <VAR>N</VAR>th directory (counting from the right of the
8069list printed by <CODE>dirs</CODE>), starting with zero.
8070<DT><CODE>-n</CODE>
8071<DD>Suppresses the normal change of directory when removing directories
8072from the stack, so that only the stack is manipulated.
8073</DL>
8074<P>
8075
8076<A NAME="IDX288"></A>
8077<DT><CODE>pushd</CODE>
8078<DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>pushd [-n] [<VAR>+N</VAR> | <VAR>-N</VAR> | <VAR>dir</VAR> ]
8079</pre></td></tr></table><P>
8080
8081Save the current directory on the top of the directory stack
8082and then <CODE>cd</CODE> to <VAR>dir</VAR>.
8083With no arguments, <CODE>pushd</CODE> exchanges the top two directories.
8084</P><P>
8085
8086<DL COMPACT>
8087<DT><CODE>-n</CODE>
8088<DD>Suppresses the normal change of directory when adding directories
8089to the stack, so that only the stack is manipulated.
8090<DT><CODE>+<VAR>N</VAR></CODE>
8091<DD>Brings the <VAR>N</VAR>th directory (counting from the left of the
8092list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8093the list by rotating the stack.
8094<DT><CODE>-<VAR>N</VAR></CODE>
8095<DD>Brings the <VAR>N</VAR>th directory (counting from the right of the
8096list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8097the list by rotating the stack.
8098<DT><CODE><VAR>dir</VAR></CODE>
8099<DD>Makes the current working directory be the top of the stack, and then
8100executes the equivalent of `<CODE>cd</CODE> <VAR>dir</VAR>'.
8101<CODE>cd</CODE>s to <VAR>dir</VAR>.
8102</DL>
8103<P>
8104
8105</DL>
8106<P>
8107
8108<A NAME="Printing a Prompt"></A>
8109<HR SIZE="6">
8110<A NAME="SEC88"></A>
8111<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8112<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> &lt; </A>]</TD>
8113<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &gt; </A>]</TD>
8114<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt;&lt; </A>]</TD>
8115<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8116<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
8117<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8118<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8119<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8120<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8121</TR></TABLE>
8122<H2> 6.9 Controlling the Prompt </H2>
8123<!--docid::SEC88::-->
8124<P>
8125
8126The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before
8127Bash prints each primary prompt. If <CODE>PROMPT_COMMAND</CODE> is set and
8128has a non-null value, then the
8129value is executed just as if it had been typed on the command line.
8130</P><P>
8131
8132In addition, the following table describes the special characters which
8133can appear in the prompt variables:
8134</P><P>
8135
8136<DL COMPACT>
8137<DT><CODE>\a</CODE>
8138<DD>A bell character.
8139<DT><CODE>\d</CODE>
8140<DD>The date, in "Weekday Month Date" format (e.g., "Tue May 26").
8141<DT><CODE>\D{<VAR>format</VAR>}</CODE>
8142<DD>The <VAR>format</VAR> is passed to <CODE>strftime</CODE>(3) and the result is inserted
8143into the prompt string; an empty <VAR>format</VAR> results in a locale-specific
8144time representation. The braces are required.
8145<DT><CODE>\e</CODE>
8146<DD>An escape character.
8147<DT><CODE>\h</CODE>
8148<DD>The hostname, up to the first `.'.
8149<DT><CODE>\H</CODE>
8150<DD>The hostname.
8151<DT><CODE>\j</CODE>
8152<DD>The number of jobs currently managed by the shell.
8153<DT><CODE>\l</CODE>
8154<DD>The basename of the shell's terminal device name.
8155<DT><CODE>\n</CODE>
8156<DD>A newline.
8157<DT><CODE>\r</CODE>
8158<DD>A carriage return.
8159<DT><CODE>\s</CODE>
8160<DD>The name of the shell, the basename of <CODE>$0</CODE> (the portion
8161following the final slash).
8162<DT><CODE>\t</CODE>
8163<DD>The time, in 24-hour HH:MM:SS format.
8164<DT><CODE>\T</CODE>
8165<DD>The time, in 12-hour HH:MM:SS format.
8166<DT><CODE>\@</CODE>
8167<DD>The time, in 12-hour am/pm format.
8168<DT><CODE>\A</CODE>
8169<DD>The time, in 24-hour HH:MM format.
8170<DT><CODE>\u</CODE>
8171<DD>The username of the current user.
8172<DT><CODE>\v</CODE>
8173<DD>The version of Bash (e.g., 2.00)
8174<DT><CODE>\V</CODE>
8175<DD>The release of Bash, version + patchlevel (e.g., 2.00.0)
8176<DT><CODE>\w</CODE>
8177<DD>The current working directory, with <CODE>$HOME</CODE> abbreviated with a tilde
8178(uses the <CODE>$PROMPT_DIRTRIM</CODE> variable).
8179<DT><CODE>\W</CODE>
8180<DD>The basename of <CODE>$PWD</CODE>, with <CODE>$HOME</CODE> abbreviated with a tilde.
8181<DT><CODE>\!</CODE>
8182<DD>The history number of this command.
8183<DT><CODE>\#</CODE>
8184<DD>The command number of this command.
8185<DT><CODE>\$</CODE>
8186<DD>If the effective uid is 0, <CODE>#</CODE>, otherwise <CODE>$</CODE>.
8187<DT><CODE>\<VAR>nnn</VAR></CODE>
8188<DD>The character whose ASCII code is the octal value <VAR>nnn</VAR>.
8189<DT><CODE>\\</CODE>
8190<DD>A backslash.
8191<DT><CODE>\[</CODE>
8192<DD>Begin a sequence of non-printing characters. This could be used to
8193embed a terminal control sequence into the prompt.
8194<DT><CODE>\]</CODE>
8195<DD>End a sequence of non-printing characters.
8196</DL>
8197<P>
8198
8199The command number and the history number are usually different:
8200the history number of a command is its position in the history
8201list, which may include commands restored from the history file
8202(see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>), while the command number is
8203the position in the sequence of commands executed during the current
8204shell session.
8205</P><P>
8206
8207After the string is decoded, it is expanded via
8208parameter expansion, command substitution, arithmetic
8209expansion, and quote removal, subject to the value of the
8210<CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
8211</P><P>
8212
8213<A NAME="The Restricted Shell"></A>
8214<HR SIZE="6">
8215<A NAME="SEC89"></A>
8216<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8217<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &lt; </A>]</TD>
8218<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> &gt; </A>]</TD>
8219<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &lt;&lt; </A>]</TD>
8220<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8221<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
8222<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8223<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8224<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8225<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8226</TR></TABLE>
8227<H2> 6.10 The Restricted Shell </H2>
8228<!--docid::SEC89::-->
8229<P>
8230
8231If Bash is started with the name <CODE>rbash</CODE>, or the
8232<SAMP>`--restricted'</SAMP>
8233or
8234<SAMP>`-r'</SAMP>
8235option is supplied at invocation, the shell becomes restricted.
8236A restricted shell is used to
8237set up an environment more controlled than the standard shell.
8238A restricted shell behaves identically to <CODE>bash</CODE>
8239with the exception that the following are disallowed or not performed:
8240</P><P>
8241
8242<UL>
8243<LI>
8244Changing directories with the <CODE>cd</CODE> builtin.
8245<LI>
8246Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>,
8247<CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables.
8248<LI>
8249Specifying command names containing slashes.
8250<LI>
8251Specifying a filename containing a slash as an argument to the <CODE>.</CODE>
8252builtin command.
8253<LI>
8254Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP>
8255option to the <CODE>hash</CODE> builtin command.
8256<LI>
8257Importing function definitions from the shell environment at startup.
8258<LI>
8259Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup.
8260<LI>
8261Redirecting output using the <SAMP>`&#62;'</SAMP>, <SAMP>`&#62;|'</SAMP>, <SAMP>`&#60;&#62;'</SAMP>, <SAMP>`&#62;&#38;'</SAMP>,
8262<SAMP>`&#38;&#62;'</SAMP>, and <SAMP>`&#62;&#62;'</SAMP> redirection operators.
8263<LI>
8264Using the <CODE>exec</CODE> builtin to replace the shell with another command.
8265<LI>
8266Adding or deleting builtin commands with the
8267<SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin.
8268<LI>
8269Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins.
8270<LI>
8271Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin.
8272<LI>
8273Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>.
8274</UL>
8275<P>
8276
8277These restrictions are enforced after any startup files are read.
8278</P><P>
8279
8280When a command that is found to be a shell script is executed
8281(see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in
8282the shell spawned to execute the script.
8283</P><P>
8284
8285<A NAME="Bash POSIX Mode"></A>
8286<HR SIZE="6">
8287<A NAME="SEC90"></A>
8288<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8289<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &lt; </A>]</TD>
8290<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt; </A>]</TD>
8291<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &lt;&lt; </A>]</TD>
8292<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8293<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
8294<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8295<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8296<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8297<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8298</TR></TABLE>
8299<H2> 6.11 Bash POSIX Mode </H2>
8300<!--docid::SEC90::-->
8301<P>
8302
8303Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing
8304<SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more
8305closely to the POSIX standard by changing the behavior to
8306match that specified by POSIX in areas where the Bash default differs.
8307</P><P>
8308
8309When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the
8310startup files.
8311</P><P>
8312
8313The following list is what's changed when `POSIX mode' is in effect:
8314</P><P>
8315
8316<OL>
8317<LI>
8318When a command in the hash table no longer exists, Bash will re-search
8319<CODE>$PATH</CODE> to find the new location. This is also available with
8320<SAMP>`shopt -s checkhash'</SAMP>.
8321<P>
8322
8323<LI>
8324The message printed by the job control code and builtins when a job
8325exits with a non-zero status is `Done(status)'.
8326<P>
8327
8328<LI>
8329The message printed by the job control code and builtins when a job
8330is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for
8331example, <CODE>SIGTSTP</CODE>.
8332<P>
8333
8334<LI>
8335The <CODE>bg</CODE> builtin uses the required format to describe each job placed
8336in the background, which does not include an indication of whether the job
8337is the current or previous job.
8338<P>
8339
8340<LI>
8341Reserved words appearing in a context where reserved words are recognized
8342do not undergo alias expansion.
8343<P>
8344
8345<LI>
8346The POSIX <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to
8347the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled,
8348and parameter expansion is performed on the values of <CODE>PS1</CODE> and
8349<CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option.
8350<P>
8351
8352<LI>
8353The POSIX startup files are executed (<CODE>$ENV</CODE>) rather than
8354the normal Bash files.
8355<P>
8356
8357<LI>
8358Tilde expansion is only performed on assignments preceding a command
8359name, rather than on all assignment statements on the line.
8360<P>
8361
8362<LI>
8363The default history file is <TT>`~/.sh_history'</TT> (this is the
8364default value of <CODE>$HISTFILE</CODE>).
8365<P>
8366
8367<LI>
8368The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line,
8369separated by spaces, without the <SAMP>`SIG'</SAMP> prefix.
8370<P>
8371
8372<LI>
8373The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP>
8374prefix.
8375<P>
8376
8377<LI>
8378Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR>
8379is not found.
8380<P>
8381
8382<LI>
8383Non-interactive shells exit if a syntax error in an arithmetic expansion
8384results in an invalid expression.
8385<P>
8386
8387<LI>
8388Redirection operators do not perform filename expansion on the word
8389in the redirection unless the shell is interactive.
8390<P>
8391
8392<LI>
8393Redirection operators do not perform word splitting on the word in the
8394redirection.
8395<P>
8396
8397<LI>
8398Function names must be valid shell <CODE>name</CODE>s. That is, they may not
8399contain characters other than letters, digits, and underscores, and
8400may not start with a digit. Declaring a function with an invalid name
8401causes a fatal syntax error in non-interactive shells.
8402<P>
8403
8404<LI>
8405POSIX special builtins are found before shell functions
8406during command lookup.
8407<P>
8408
8409<LI>
8410If a POSIX special builtin returns an error status, a
8411non-interactive shell exits. The fatal errors are those listed in
8412the POSIX standard, and include things like passing incorrect options,
8413redirection errors, variable assignment errors for assignments preceding
8414the command name, and so on.
8415<P>
8416
8417<LI>
8418If <CODE>CDPATH</CODE> is set, the <CODE>cd</CODE> builtin will not implicitly
8419append the current directory to it. This means that <CODE>cd</CODE> will
8420fail if no valid directory name can be constructed from
8421any of the entries in <CODE>$CDPATH</CODE>, even if the a directory with
8422the same name as the name given as an argument to <CODE>cd</CODE> exists
8423in the current directory.
8424<P>
8425
8426<LI>
8427A non-interactive shell exits with an error status if a variable
8428assignment error occurs when no command name follows the assignment
8429statements.
8430A variable assignment error occurs, for example, when trying to assign
8431a value to a readonly variable.
8432<P>
8433
8434<LI>
8435A non-interactive shell exits with an error status if the iteration
8436variable in a <CODE>for</CODE> statement or the selection variable in a
8437<CODE>select</CODE> statement is a readonly variable.
8438<P>
8439
8440<LI>
8441Process substitution is not available.
8442<P>
8443
8444<LI>
8445Assignment statements preceding POSIX special builtins
8446persist in the shell environment after the builtin completes.
8447<P>
8448
8449<LI>
8450Assignment statements preceding shell function calls persist in the
8451shell environment after the function returns, as if a POSIX
8452special builtin command had been executed.
8453<P>
8454
8455<LI>
8456The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their
8457output in the format required by POSIX.
8458<P>
8459
8460<LI>
8461The <CODE>trap</CODE> builtin displays signal names without the leading
8462<CODE>SIG</CODE>.
8463<P>
8464
8465<LI>
8466The <CODE>trap</CODE> builtin doesn't check the first argument for a possible
8467signal specification and revert the signal handling to the original
8468disposition if it is, unless that argument consists solely of digits and
8469is a valid signal number. If users want to reset the handler for a given
8470signal to the original disposition, they should use <SAMP>`-'</SAMP> as the
8471first argument.
8472<P>
8473
8474<LI>
8475The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory
8476for the filename argument if it is not found by searching <CODE>PATH</CODE>.
8477<P>
8478
8479<LI>
8480Subshells spawned to execute command substitutions inherit the value of
8481the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
8482Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
8483<P>
8484
8485<LI>
8486Alias expansion is always enabled, even in non-interactive shells.
8487<P>
8488
8489<LI>
8490When the <CODE>alias</CODE> builtin displays alias definitions, it does not
8491display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option
8492is supplied.
8493<P>
8494
8495<LI>
8496When the <CODE>set</CODE> builtin is invoked without options, it does not display
8497shell function names and definitions.
8498<P>
8499
8500<LI>
8501When the <CODE>set</CODE> builtin is invoked without options, it displays
8502variable values without quotes, unless they contain shell metacharacters,
8503even if the result contains nonprinting characters.
8504<P>
8505
8506<LI>
8507When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname
8508constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument
8509does not refer to an existing directory, <CODE>cd</CODE> will fail instead of
8510falling back to <VAR>physical</VAR> mode.
8511<P>
8512
8513<LI>
8514When the <CODE>pwd</CODE> builtin is supplied the <SAMP>`-P'</SAMP> option, it resets
8515<CODE>$PWD</CODE> to a pathname containing no symlinks.
8516<P>
8517
8518<LI>
8519The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the
8520current directory, even if it is not asked to check the file system with the
8521<SAMP>`-P'</SAMP> option.
8522<P>
8523
8524<LI>
8525When listing the history, the <CODE>fc</CODE> builtin does not include an
8526indication of whether or not a history entry has been modified.
8527<P>
8528
8529<LI>
8530The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>.
8531<P>
8532
8533<LI>
8534The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable
8535file as having been found, though the shell will attempt to execute such a
8536file if it is the only so-named file found in <CODE>$PATH</CODE>.
8537<P>
8538
8539<LI>
8540The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when
8541the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$VISUAL</CODE> and
8542<CODE>$EDITOR</CODE>.
8543<P>
8544
8545<LI>
8546When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret
8547any arguments to <CODE>echo</CODE> as options. Each argument is displayed, after
8548escape characters are converted.
8549<P>
8550
8551<LI>
8552The <CODE>ulimit</CODE> builtin uses a block size of 512 bytes for the <SAMP>`-c'</SAMP>
8553and <SAMP>`-f'</SAMP> options.
8554<P>
8555
8556</OL>
8557<P>
8558
8559There is other POSIX behavior that Bash does not implement by
8560default even when in POSIX mode.
8561Specifically:
8562</P><P>
8563
8564<OL>
8565
8566<LI>
8567The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history
8568entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to
8569<CODE>ed</CODE>. <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset.
8570<P>
8571
8572<LI>
8573As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for
8574the <CODE>echo</CODE> builtin to be fully conformant.
8575<P>
8576
8577</OL>
8578<P>
8579
8580Bash can be configured to be POSIX-conformant by default, by specifying
8581the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building
8582(see section <A HREF="bashref.html#SEC134">10.8 Optional Features</A>).
8583</P><P>
8584
8585<A NAME="Job Control"></A>
8586<HR SIZE="6">
8587<A NAME="SEC91"></A>
8588<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8589<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> &lt; </A>]</TD>
8590<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt; </A>]</TD>
8591<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt;&lt; </A>]</TD>
8592<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
8593<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8594<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8595<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8596<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8597<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8598</TR></TABLE>
8599<H1> 7. Job Control </H1>
8600<!--docid::SEC91::-->
8601<P>
8602
8603This chapter discusses what job control is, how it works, and how
8604Bash allows you to access its facilities.
8605</P><P>
8606
8607<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8608<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR>
8609<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact
8610 with job control.</TD></TR>
8611<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job
8612 control.</TD></TR>
8613</TABLE></BLOCKQUOTE>
8614<P>
8615
8616<A NAME="Job Control Basics"></A>
8617<HR SIZE="6">
8618<A NAME="SEC92"></A>
8619<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8620<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt; </A>]</TD>
8621<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> &gt; </A>]</TD>
8622<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt;&lt; </A>]</TD>
8623<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8624<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8625<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8626<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8627<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8628<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8629</TR></TABLE>
8630<H2> 7.1 Job Control Basics </H2>
8631<!--docid::SEC92::-->
8632<P>
8633
8634Job control
8635refers to the ability to selectively stop (suspend)
8636the execution of processes and continue (resume)
8637their execution at a later point. A user typically employs
8638this facility via an interactive interface supplied jointly
8639by the system's terminal driver and Bash.
8640</P><P>
8641
8642The shell associates a <VAR>job</VAR> with each pipeline. It keeps a
8643table of currently executing jobs, which may be listed with the
8644<CODE>jobs</CODE> command. When Bash starts a job
8645asynchronously, it prints a line that looks
8646like:
8647<TABLE><tr><td>&nbsp;</td><td class=example><pre>[1] 25647
8648</pre></td></tr></table>indicating that this job is job number 1 and that the process ID
8649of the last process in the pipeline associated with this job is
865025647. All of the processes in a single pipeline are members of
8651the same job. Bash uses the <VAR>job</VAR> abstraction as the
8652basis for job control.
8653</P><P>
8654
8655To facilitate the implementation of the user interface to job
8656control, the operating system maintains the notion of a current terminal
8657process group ID. Members of this process group (processes whose
8658process group ID is equal to the current terminal process group
8659ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>.
8660These processes are said to be in the foreground. Background
8661processes are those whose process group ID differs from the
8662terminal's; such processes are immune to keyboard-generated
8663signals. Only foreground processes are allowed to read from or
8664write to the terminal. Background processes which attempt to
8665read from (write to) the terminal are sent a <CODE>SIGTTIN</CODE>
8666(<CODE>SIGTTOU</CODE>) signal by the terminal driver, which, unless
8667caught, suspends the process.
8668</P><P>
8669
8670If the operating system on which Bash is running supports
8671job control, Bash contains facilities to use it. Typing the
8672<VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a
8673process is running causes that process to be stopped and returns
8674control to Bash. Typing the <VAR>delayed suspend</VAR> character
8675(typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped
8676when it attempts to read input from the terminal, and control to
8677be returned to Bash. The user then manipulates the state of
8678this job, using the <CODE>bg</CODE> command to continue it in the
8679background, the <CODE>fg</CODE> command to continue it in the
8680foreground, or the <CODE>kill</CODE> command to kill it. A <SAMP>`^Z'</SAMP>
8681takes effect immediately, and has the additional side effect of
8682causing pending output and typeahead to be discarded.
8683</P><P>
8684
8685There are a number of ways to refer to a job in the shell. The
8686character <SAMP>`%'</SAMP> introduces a job specification (<VAR>jobspec</VAR>).
8687</P><P>
8688
8689Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>.
8690The symbols <SAMP>`%%'</SAMP> and <SAMP>`%+'</SAMP> refer to the shell's notion of the
8691current job, which is the last job stopped while it was in the foreground
8692or started in the background.
8693A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers
8694to the current job.
8695The previous job may be referenced using <SAMP>`%-'</SAMP>.
8696If there is only a single job, <SAMP>`%+'</SAMP> and <SAMP>`%-'</SAMP> can both be used
8697to refer to that job.
8698In output pertaining to jobs (e.g., the output of the <CODE>jobs</CODE>
8699command), the current job is always flagged with a <SAMP>`+'</SAMP>, and the
8700previous job with a <SAMP>`-'</SAMP>.
8701</P><P>
8702
8703A job may also be referred to
8704using a prefix of the name used to start it, or using a substring
8705that appears in its command line. For example, <SAMP>`%ce'</SAMP> refers
8706to a stopped <CODE>ce</CODE> job. Using <SAMP>`%?ce'</SAMP>, on the
8707other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in
8708its command line. If the prefix or substring matches more than one job,
8709Bash reports an error.
8710</P><P>
8711
8712Simply naming a job can be used to bring it into the foreground:
8713<SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the
8714background into the foreground. Similarly, <SAMP>`%1 &#38;'</SAMP> resumes
8715job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP>
8716</P><P>
8717
8718The shell learns immediately whenever a job changes state.
8719Normally, Bash waits until it is about to print a prompt
8720before reporting changes in a job's status so as to not interrupt
8721any other output.
8722If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled,
8723Bash reports such changes immediately (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
8724Any trap on <CODE>SIGCHLD</CODE> is executed for each child process
8725that exits.
8726</P><P>
8727
8728If an attempt to exit Bash is made while jobs are stopped, (or running, if
8729the <CODE>checkjobs</CODE> option is enabled -- see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the
8730shell prints a warning message, and if the <CODE>checkjobs</CODE> option is
8731enabled, lists the jobs and their statuses.
8732The <CODE>jobs</CODE> command may then be used to inspect their status.
8733If a second attempt to exit is made without an intervening command,
8734Bash does not print another warning, and any stopped jobs are terminated.
8735</P><P>
8736
8737<A NAME="Job Control Builtins"></A>
8738<HR SIZE="6">
8739<A NAME="SEC93"></A>
8740<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8741<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &lt; </A>]</TD>
8742<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &gt; </A>]</TD>
8743<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &lt;&lt; </A>]</TD>
8744<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8745<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8746<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8747<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8748<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8749<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8750</TR></TABLE>
8751<H2> 7.2 Job Control Builtins </H2>
8752<!--docid::SEC93::-->
8753<P>
8754
8755<DL COMPACT>
8756
8757<DT><CODE>bg</CODE>
8758<DD><A NAME="IDX289"></A>
8759<TABLE><tr><td>&nbsp;</td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>]
8760</pre></td></tr></table>Resume each suspended job <VAR>jobspec</VAR> in the background, as if it
8761had been started with <SAMP>`&#38;'</SAMP>.
8762If <VAR>jobspec</VAR> is not supplied, the current job is used.
8763The return status is zero unless it is run when job control is not
8764enabled, or, when run with job control enabled, any
8765<VAR>jobspec</VAR> was not found or specifies a job
8766that was started without job control.
8767<P>
8768
8769<DT><CODE>fg</CODE>
8770<DD><A NAME="IDX290"></A>
8771<TABLE><tr><td>&nbsp;</td><td class=example><pre>fg [<VAR>jobspec</VAR>]
8772</pre></td></tr></table>Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job.
8773If <VAR>jobspec</VAR> is not supplied, the current job is used.
8774The return status is that of the command placed into the foreground,
8775or non-zero if run when job control is disabled or, when run with
8776job control enabled, <VAR>jobspec</VAR> does not specify a valid job or
8777<VAR>jobspec</VAR> specifies a job that was started without job control.
8778<P>
8779
8780<DT><CODE>jobs</CODE>
8781<DD><A NAME="IDX291"></A>
8782<TABLE><tr><td>&nbsp;</td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>]
8783jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>]
8784</pre></td></tr></table><P>
8785
8786The first form lists the active jobs. The options have the
8787following meanings:
8788</P><P>
8789
8790<DL COMPACT>
8791<DT><CODE>-l</CODE>
8792<DD>List process IDs in addition to the normal information.
8793<P>
8794
8795<DT><CODE>-n</CODE>
8796<DD>Display information only about jobs that have changed status since
8797the user was last notified of their status.
8798<P>
8799
8800<DT><CODE>-p</CODE>
8801<DD>List only the process ID of the job's process group leader.
8802<P>
8803
8804<DT><CODE>-r</CODE>
8805<DD>Restrict output to running jobs.
8806<P>
8807
8808<DT><CODE>-s</CODE>
8809<DD>Restrict output to stopped jobs.
8810</DL>
8811<P>
8812
8813If <VAR>jobspec</VAR> is given,
8814output is restricted to information about that job.
8815If <VAR>jobspec</VAR> is not supplied, the status of all jobs is
8816listed.
8817</P><P>
8818
8819If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any
8820<VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the
8821corresponding process group ID, and executes <VAR>command</VAR>,
8822passing it <VAR>argument</VAR>s, returning its exit status.
8823</P><P>
8824
8825<DT><CODE>kill</CODE>
8826<DD><A NAME="IDX292"></A>
8827<TABLE><tr><td>&nbsp;</td><td class=example><pre>kill [-s <VAR>sigspec</VAR>] [-n <VAR>signum</VAR>] [-<VAR>sigspec</VAR>] <VAR>jobspec</VAR> or <VAR>pid</VAR>
8828kill -l [<VAR>exit_status</VAR>]
8829</pre></td></tr></table>Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process
8830named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>.
8831<VAR>sigspec</VAR> is either a case-insensitive signal name such as
8832<CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix)
8833or a signal number; <VAR>signum</VAR> is a signal number.
8834If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used.
8835The <SAMP>`-l'</SAMP> option lists the signal names.
8836If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the
8837signals corresponding to the arguments are listed, and the return status
8838is zero.
8839<VAR>exit_status</VAR> is a number specifying a signal number or the exit
8840status of a process terminated by a signal.
8841The return status is zero if at least one signal was successfully sent,
8842or non-zero if an error occurs or an invalid option is encountered.
8843<P>
8844
8845<DT><CODE>wait</CODE>
8846<DD><A NAME="IDX293"></A>
8847<TABLE><tr><td>&nbsp;</td><td class=example><pre>wait [<VAR>jobspec</VAR> or <VAR>pid</VAR> ...]
8848</pre></td></tr></table>Wait until the child process specified by each process ID <VAR>pid</VAR>
8849or job specification <VAR>jobspec</VAR> exits and return the exit status of the
8850last command waited for.
8851If a job spec is given, all processes in the job are waited for.
8852If no arguments are given, all currently active child processes are
8853waited for, and the return status is zero.
8854If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process
8855of the shell, the return status is 127.
8856<P>
8857
8858<DT><CODE>disown</CODE>
8859<DD><A NAME="IDX294"></A>
8860<TABLE><tr><td>&nbsp;</td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>]
8861</pre></td></tr></table>Without options, each <VAR>jobspec</VAR> is removed from the table of
8862active jobs.
8863If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table,
8864but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell
8865receives a <CODE>SIGHUP</CODE>.
8866If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor <SAMP>`-r'</SAMP>
8867option is supplied, the current job is used.
8868If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or
8869mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR>
8870argument restricts operation to running jobs.
8871<P>
8872
8873<DT><CODE>suspend</CODE>
8874<DD><A NAME="IDX295"></A>
8875<TABLE><tr><td>&nbsp;</td><td class=example><pre>suspend [-f]
8876</pre></td></tr></table>Suspend the execution of this shell until it receives a
8877<CODE>SIGCONT</CODE> signal.
8878A login shell cannot be suspended; the <SAMP>`-f'</SAMP>
8879option can be used to override this and force the suspension.
8880<P>
8881
8882</DL>
8883<P>
8884
8885When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE>
8886builtins do not accept <VAR>jobspec</VAR> arguments. They must be
8887supplied process IDs.
8888</P><P>
8889
8890<A NAME="Job Control Variables"></A>
8891<HR SIZE="6">
8892<A NAME="SEC94"></A>
8893<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8894<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> &lt; </A>]</TD>
8895<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt; </A>]</TD>
8896<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt;&lt; </A>]</TD>
8897<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8898<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8899<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8900<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8901<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8902<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8903</TR></TABLE>
8904<H2> 7.3 Job Control Variables </H2>
8905<!--docid::SEC94::-->
8906<P>
8907
8908<DL COMPACT>
8909
8910<A NAME="IDX296"></A>
8911<DT><CODE>auto_resume</CODE>
8912<DD><A NAME="IDX297"></A>
8913This variable controls how the shell interacts with the user and
8914job control. If this variable exists then single word simple
8915commands without redirections are treated as candidates for resumption
8916of an existing job. There is no ambiguity allowed; if there is
8917more than one job beginning with the string typed, then
8918the most recently accessed job will be selected.
8919The name of a stopped job, in this context, is the command line
8920used to start it. If this variable is set to the value <SAMP>`exact'</SAMP>,
8921the string supplied must match the name of a stopped job exactly;
8922if set to <SAMP>`substring'</SAMP>,
8923the string supplied needs to match a substring of the name of a
8924stopped job. The <SAMP>`substring'</SAMP> value provides functionality
8925analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC92">7.1 Job Control Basics</A>).
8926If set to any other value, the supplied string must
8927be a prefix of a stopped job's name; this provides functionality
8928analogous to the <SAMP>`%'</SAMP> job ID.
8929<P>
8930
8931</DL>
8932<P>
8933
8934<A NAME="IDX298"></A>
8935</P><P>
8936
8937<A NAME="Command Line Editing"></A>
8938<HR SIZE="6">
8939<A NAME="SEC95"></A>
8940<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8941<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &lt; </A>]</TD>
8942<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &gt; </A>]</TD>
8943<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &lt;&lt; </A>]</TD>
8944<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
8945<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
8946<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8947<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8948<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8949<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8950</TR></TABLE>
8951<H1> 8. Command Line Editing </H1>
8952<!--docid::SEC95::-->
8953<P>
8954
8955This chapter describes the basic features of the GNU
8956command line editing interface.
8957Command line editing is provided by the Readline library, which is
8958used by several different programs, including Bash.
8959Command line editing is enabled by default when using an interactive shell,
8960unless the <SAMP>`--noediting'</SAMP> option is supplied at shell invocation.
8961Line editing is also used when using the <SAMP>`-e'</SAMP> option to the
8962<CODE>read</CODE> builtin command (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
8963By default, the line editing commands are similar to those of emacs.
8964A vi-style line editing interface is also available.
8965Line editing can be enabled at any time using the <SAMP>`-o emacs'</SAMP> or
8966<SAMP>`-o vi'</SAMP> options to the <CODE>set</CODE> builtin command
8967(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), or disabled using the <SAMP>`+o emacs'</SAMP> or
8968<SAMP>`+o vi'</SAMP> options to <CODE>set</CODE>.
8969</P><P>
8970
8971<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8972<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR>
8973<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR>
8974<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR>
8975<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands
8976 available for binding</TD></TR>
8977<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">8.5 Readline vi Mode</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline
8978 behave like the vi editor.</TD></TR>
8979<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for
8980 a specific command.</TD></TR>
8981<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to
8982 complete arguments for a particular command.</TD></TR>
8983</TABLE></BLOCKQUOTE>
8984<P>
8985
8986<A NAME="Introduction and Notation"></A>
8987<HR SIZE="6">
8988<A NAME="SEC96"></A>
8989<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8990<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt; </A>]</TD>
8991<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> &gt; </A>]</TD>
8992<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt;&lt; </A>]</TD>
8993<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
8994<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
8995<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8996<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8997<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8998<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8999</TR></TABLE>
9000<H2> 8.1 Introduction to Line Editing </H2>
9001<!--docid::SEC96::-->
9002<P>
9003
9004The following paragraphs describe the notation used to represent
9005keystrokes.
9006</P><P>
9007
9008The text <KBD>C-k</KBD> is read as `Control-K' and describes the character
9009produced when the <KBD>k</KBD> key is pressed while the Control key
9010is depressed.
9011</P><P>
9012
9013The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character
9014produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD>
9015key is pressed.
9016The Meta key is labeled <KBD>ALT</KBD> on many keyboards.
9017On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of
9018the space bar), the <KBD>ALT</KBD> on the left side is generally set to
9019work as a Meta key.
9020The <KBD>ALT</KBD> key on the right may also be configured to work as a
9021Meta key or may be configured as some other modifier, such as a
9022Compose key for typing accented characters.
9023</P><P>
9024
9025If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as
9026a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD>
9027<EM>first</EM>, and then typing <KBD>k</KBD>.
9028Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key.
9029</P><P>
9030
9031The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the
9032character produced by <EM>metafying</EM> <KBD>C-k</KBD>.
9033</P><P>
9034
9035In addition, several keys have their own names. Specifically,
9036<KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all
9037stand for themselves when seen in this text, or in an init file
9038(see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>).
9039If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will
9040produce the desired character.
9041The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on
9042some keyboards.
9043</P><P>
9044
9045<A NAME="Readline Interaction"></A>
9046<HR SIZE="6">
9047<A NAME="SEC97"></A>
9048<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9049<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &lt; </A>]</TD>
9050<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> &gt; </A>]</TD>
9051<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt;&lt; </A>]</TD>
9052<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9053<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9054<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9055<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9056<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9057<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9058</TR></TABLE>
9059<H2> 8.2 Readline Interaction </H2>
9060<!--docid::SEC97::-->
9061<P>
9062
9063Often during an interactive session you type in a long line of text,
9064only to notice that the first word on the line is misspelled. The
9065Readline library gives you a set of commands for manipulating the text
9066as you type it in, allowing you to just fix your typo, and not forcing
9067you to retype the majority of the line. Using these editing commands,
9068you move the cursor to the place that needs correction, and delete or
9069insert the text of the corrections. Then, when you are satisfied with
9070the line, you simply press <KBD>RET</KBD>. You do not have to be at the
9071end of the line to press <KBD>RET</KBD>; the entire line is accepted
9072regardless of the location of the cursor within the line.
9073</P><P>
9074
9075<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9076<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The least you need to know about Readline.</TD></TR>
9077<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR>
9078<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to delete text, and how to get it back!</TD></TR>
9079<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR>
9080<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR>
9081</TABLE></BLOCKQUOTE>
9082<P>
9083
9084<A NAME="Readline Bare Essentials"></A>
9085<HR SIZE="6">
9086<A NAME="SEC98"></A>
9087<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9088<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> &lt; </A>]</TD>
9089<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> &gt; </A>]</TD>
9090<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt;&lt; </A>]</TD>
9091<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9092<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9093<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9094<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9095<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9096<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9097</TR></TABLE>
9098<H3> 8.2.1 Readline Bare Essentials </H3>
9099<!--docid::SEC98::-->
9100<P>
9101
9102In order to enter characters into the line, simply type them. The typed
9103character appears where the cursor was, and then the cursor moves one
9104space to the right. If you mistype a character, you can use your
9105erase character to back up and delete the mistyped character.
9106</P><P>
9107
9108Sometimes you may mistype a character, and
9109not notice the error until you have typed several other characters. In
9110that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then
9111correct your mistake. Afterwards, you can move the cursor to the right
9112with <KBD>C-f</KBD>.
9113</P><P>
9114
9115When you add text in the middle of a line, you will notice that characters
9116to the right of the cursor are `pushed over' to make room for the text
9117that you have inserted. Likewise, when you delete text behind the cursor,
9118characters to the right of the cursor are `pulled back' to fill in the
9119blank space created by the removal of the text. A list of the bare
9120essentials for editing the text of an input line follows.
9121</P><P>
9122
9123<DL COMPACT>
9124<DT><KBD>C-b</KBD>
9125<DD>Move back one character.
9126<DT><KBD>C-f</KBD>
9127<DD>Move forward one character.
9128<DT><KBD>DEL</KBD> or <KBD>Backspace</KBD>
9129<DD>Delete the character to the left of the cursor.
9130<DT><KBD>C-d</KBD>
9131<DD>Delete the character underneath the cursor.
9132<DT>Printing characters
9133<DD>Insert the character into the line at the cursor.
9134<DT><KBD>C-_</KBD> or <KBD>C-x C-u</KBD>
9135<DD>Undo the last editing command. You can undo all the way back to an
9136empty line.
9137</DL>
9138<P>
9139
9140(Depending on your configuration, the <KBD>Backspace</KBD> key be set to
9141delete the character to the left of the cursor and the <KBD>DEL</KBD> key set
9142to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather
9143than the character to the left of the cursor.)
9144</P><P>
9145
9146<A NAME="Readline Movement Commands"></A>
9147<HR SIZE="6">
9148<A NAME="SEC99"></A>
9149<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9150<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> &lt; </A>]</TD>
9151<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &gt; </A>]</TD>
9152<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &lt;&lt; </A>]</TD>
9153<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9154<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9155<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9156<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9157<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9158<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9159</TR></TABLE>
9160<H3> 8.2.2 Readline Movement Commands </H3>
9161<!--docid::SEC99::-->
9162<P>
9163
9164The above table describes the most basic keystrokes that you need
9165in order to do editing of the input line. For your convenience, many
9166other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>,
9167<KBD>C-d</KBD>, and <KBD>DEL</KBD>. Here are some commands for moving more rapidly
9168about the line.
9169</P><P>
9170
9171<DL COMPACT>
9172<DT><KBD>C-a</KBD>
9173<DD>Move to the start of the line.
9174<DT><KBD>C-e</KBD>
9175<DD>Move to the end of the line.
9176<DT><KBD>M-f</KBD>
9177<DD>Move forward a word, where a word is composed of letters and digits.
9178<DT><KBD>M-b</KBD>
9179<DD>Move backward a word.
9180<DT><KBD>C-l</KBD>
9181<DD>Clear the screen, reprinting the current line at the top.
9182</DL>
9183<P>
9184
9185Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves
9186forward a word. It is a loose convention that control keystrokes
9187operate on characters while meta keystrokes operate on words.
9188</P><P>
9189
9190<A NAME="Readline Killing Commands"></A>
9191<HR SIZE="6">
9192<A NAME="SEC100"></A>
9193<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9194<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> &lt; </A>]</TD>
9195<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &gt; </A>]</TD>
9196<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &lt;&lt; </A>]</TD>
9197<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9198<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9199<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9200<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9201<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9202<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9203</TR></TABLE>
9204<H3> 8.2.3 Readline Killing Commands </H3>
9205<!--docid::SEC100::-->
9206<P>
9207
9208<A NAME="IDX299"></A>
9209<A NAME="IDX300"></A>
9210</P><P>
9211
9212<EM>Killing</EM> text means to delete the text from the line, but to save
9213it away for later use, usually by <EM>yanking</EM> (re-inserting)
9214it back into the line.
9215(`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
9216</P><P>
9217
9218If the description for a command says that it `kills' text, then you can
9219be sure that you can get the text back in a different (or the same)
9220place later.
9221</P><P>
9222
9223When you use a kill command, the text is saved in a <EM>kill-ring</EM>.
9224Any number of consecutive kills save all of the killed text together, so
9225that when you yank it back, you get it all. The kill
9226ring is not line specific; the text that you killed on a previously
9227typed line is available to be yanked back later, when you are typing
9228another line.
9229<A NAME="IDX301"></A>
9230</P><P>
9231
9232Here is the list of commands for killing text.
9233</P><P>
9234
9235<DL COMPACT>
9236<DT><KBD>C-k</KBD>
9237<DD>Kill the text from the current cursor position to the end of the line.
9238<P>
9239
9240<DT><KBD>M-d</KBD>
9241<DD>Kill from the cursor to the end of the current word, or, if between
9242words, to the end of the next word.
9243Word boundaries are the same as those used by <KBD>M-f</KBD>.
9244<P>
9245
9246<DT><KBD>M-<KBD>DEL</KBD></KBD>
9247<DD>Kill from the cursor the start of the current word, or, if between
9248words, to the start of the previous word.
9249Word boundaries are the same as those used by <KBD>M-b</KBD>.
9250<P>
9251
9252<DT><KBD>C-w</KBD>
9253<DD>Kill from the cursor to the previous whitespace. This is different than
9254<KBD>M-<KBD>DEL</KBD></KBD> because the word boundaries differ.
9255<P>
9256
9257</DL>
9258<P>
9259
9260Here is how to <EM>yank</EM> the text back into the line. Yanking
9261means to copy the most-recently-killed text from the kill buffer.
9262</P><P>
9263
9264<DL COMPACT>
9265<DT><KBD>C-y</KBD>
9266<DD>Yank the most recently killed text back into the buffer at the cursor.
9267<P>
9268
9269<DT><KBD>M-y</KBD>
9270<DD>Rotate the kill-ring, and yank the new top. You can only do this if
9271the prior command is <KBD>C-y</KBD> or <KBD>M-y</KBD>.
9272</DL>
9273<P>
9274
9275<A NAME="Readline Arguments"></A>
9276<HR SIZE="6">
9277<A NAME="SEC101"></A>
9278<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9279<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &lt; </A>]</TD>
9280<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &gt; </A>]</TD>
9281<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &lt;&lt; </A>]</TD>
9282<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9283<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9284<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9285<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9286<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9287<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9288</TR></TABLE>
9289<H3> 8.2.4 Readline Arguments </H3>
9290<!--docid::SEC101::-->
9291<P>
9292
9293You can pass numeric arguments to Readline commands. Sometimes the
9294argument acts as a repeat count, other times it is the <I>sign</I> of the
9295argument that is significant. If you pass a negative argument to a
9296command which normally acts in a forward direction, that command will
9297act in a backward direction. For example, to kill text back to the
9298start of the line, you might type <SAMP>`M-- C-k'</SAMP>.
9299</P><P>
9300
9301The general way to pass numeric arguments to a command is to type meta
9302digits before the command. If the first `digit' typed is a minus
9303sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative. Once
9304you have typed one meta digit to get the argument started, you can type
9305the remainder of the digits, and then the command. For example, to give
9306the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>,
9307which will delete the next ten characters on the input line.
9308</P><P>
9309
9310<A NAME="Searching"></A>
9311<HR SIZE="6">
9312<A NAME="SEC102"></A>
9313<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9314<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &lt; </A>]</TD>
9315<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt; </A>]</TD>
9316<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt;&lt; </A>]</TD>
9317<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9318<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9319<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9320<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9321<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9322<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9323</TR></TABLE>
9324<H3> 8.2.5 Searching for Commands in the History </H3>
9325<!--docid::SEC102::-->
9326<P>
9327
9328Readline provides commands for searching through the command history
9329(see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>)
9330for lines containing a specified string.
9331There are two search modes: <EM>incremental</EM> and <EM>non-incremental</EM>.
9332</P><P>
9333
9334Incremental searches begin before the user has finished typing the
9335search string.
9336As each character of the search string is typed, Readline displays
9337the next entry from the history matching the string typed so far.
9338An incremental search requires only as many characters as needed to
9339find the desired history entry.
9340To search backward in the history for a particular string, type
9341<KBD>C-r</KBD>. Typing <KBD>C-s</KBD> searches forward through the history.
9342The characters present in the value of the <CODE>isearch-terminators</CODE> variable
9343are used to terminate an incremental search.
9344If that variable has not been assigned a value, the <KBD>ESC</KBD> and
9345<KBD>C-J</KBD> characters will terminate an incremental search.
9346<KBD>C-g</KBD> will abort an incremental search and restore the original line.
9347When the search is terminated, the history entry containing the
9348search string becomes the current line.
9349</P><P>
9350
9351To find other matching entries in the history list, type <KBD>C-r</KBD> or
9352<KBD>C-s</KBD> as appropriate.
9353This will search backward or forward in the history for the next
9354entry matching the search string typed so far.
9355Any other key sequence bound to a Readline command will terminate
9356the search and execute that command.
9357For instance, a <KBD>RET</KBD> will terminate the search and accept
9358the line, thereby executing the command from the history list.
9359A movement command will terminate the search, make the last line found
9360the current line, and begin editing.
9361</P><P>
9362
9363Readline remembers the last incremental search string. If two
9364<KBD>C-r</KBD>s are typed without any intervening characters defining a new
9365search string, any remembered search string is used.
9366</P><P>
9367
9368Non-incremental searches read the entire search string before starting
9369to search for matching history lines. The search string may be
9370typed by the user or be part of the contents of the current line.
9371</P><P>
9372
9373<A NAME="Readline Init File"></A>
9374<HR SIZE="6">
9375<A NAME="SEC103"></A>
9376<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9377<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &lt; </A>]</TD>
9378<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt; </A>]</TD>
9379<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt;&lt; </A>]</TD>
9380<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9381<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
9382<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9383<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9384<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9385<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9386</TR></TABLE>
9387<H2> 8.3 Readline Init File </H2>
9388<!--docid::SEC103::-->
9389<P>
9390
9391Although the Readline library comes with a set of Emacs-like
9392keybindings installed by default, it is possible to use a different set
9393of keybindings.
9394Any user can customize programs that use Readline by putting
9395commands in an <EM>inputrc</EM> file, conventionally in his home directory.
9396The name of this
9397file is taken from the value of the shell variable <CODE>INPUTRC</CODE>. If
9398that variable is unset, the default is <TT>`~/.inputrc'</TT>. If that
9399file does not exist or cannot be read, the ultimate default is
9400<TT>`/etc/inputrc'</TT>.
9401</P><P>
9402
9403When a program which uses the Readline library starts up, the
9404init file is read, and the key bindings are set.
9405</P><P>
9406
9407In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus
9408incorporating any changes that you might have made to it.
9409</P><P>
9410
9411<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9412<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Syntax for the commands in the inputrc file.</TD></TR>
9413</TABLE>
9414
9415<br>
9416<TABLE BORDER=0 CELLSPACING=0>
9417<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Conditional key bindings in the inputrc file.</TD></TR>
9418</TABLE>
9419
9420<br>
9421<TABLE BORDER=0 CELLSPACING=0>
9422<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC106">8.3.3 Sample Init File</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">An example inputrc file.</TD></TR>
9423</TABLE></BLOCKQUOTE>
9424<P>
9425
9426<A NAME="Readline Init File Syntax"></A>
9427<HR SIZE="6">
9428<A NAME="SEC104"></A>
9429<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9430<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt; </A>]</TD>
9431<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> &gt; </A>]</TD>
9432<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt;&lt; </A>]</TD>
9433<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
9434<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
9435<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9436<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9437<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9438<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9439</TR></TABLE>
9440<H3> 8.3.1 Readline Init File Syntax </H3>
9441<!--docid::SEC104::-->
9442<P>
9443
9444There are only a few basic constructs allowed in the
9445Readline init file. Blank lines are ignored.
9446Lines beginning with a <SAMP>`#'</SAMP> are comments.
9447Lines beginning with a <SAMP>`$'</SAMP> indicate conditional
9448constructs (see section <A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>). Other lines
9449denote variable settings and key bindings.
9450</P><P>
9451
9452<DL COMPACT>
9453<DT>Variable Settings
9454<DD>You can modify the run-time behavior of Readline by
9455altering the values of variables in Readline
9456using the <CODE>set</CODE> command within the init file.
9457The syntax is simple:
9458<P>
9459
9460<TABLE><tr><td>&nbsp;</td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR>
9461</pre></td></tr></table></P><P>
9462
9463Here, for example, is how to
9464change from the default Emacs-like key binding to use
9465<CODE>vi</CODE> line editing commands:
9466</P><P>
9467
9468<TABLE><tr><td>&nbsp;</td><td class=example><pre>set editing-mode vi
9469</pre></td></tr></table></P><P>
9470
9471Variable names and values, where appropriate, are recognized without regard
9472to case. Unrecognized variable names are ignored.
9473</P><P>
9474
9475Boolean variables (those that can be set to on or off) are set to on if
9476the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1. Any other
9477value results in the variable being set to off.
9478</P><P>
9479
9480The <CODE>bind -V</CODE> command lists the current Readline variable names
9481and values. See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.
9482</P><P>
9483
9484A great deal of run-time behavior is changeable with the following
9485variables.
9486</P><P>
9487
9488<A NAME="IDX302"></A>
9489<DL COMPACT>
9490
9491<DT><CODE>bell-style</CODE>
9492<DD><A NAME="IDX303"></A>
9493Controls what happens when Readline wants to ring the terminal bell.
9494If set to <SAMP>`none'</SAMP>, Readline never rings the bell. If set to
9495<SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available.
9496If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring
9497the terminal's bell.
9498<P>
9499
9500<DT><CODE>bind-tty-special-chars</CODE>
9501<DD><A NAME="IDX304"></A>
9502If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters
9503treated specially by the kernel's terminal driver to their Readline
9504equivalents.
9505<P>
9506
9507<DT><CODE>comment-begin</CODE>
9508<DD><A NAME="IDX305"></A>
9509The string to insert at the beginning of the line when the
9510<CODE>insert-comment</CODE> command is executed. The default value
9511is <CODE>"#"</CODE>.
9512<P>
9513
9514<DT><CODE>completion-ignore-case</CODE>
9515<DD>If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion
9516in a case-insensitive fashion.
9517The default value is <SAMP>`off'</SAMP>.
9518<P>
9519
9520<DT><CODE>completion-prefix-display-length</CODE>
9521<DD><A NAME="IDX306"></A>
9522The length in characters of the common prefix of a list of possible
9523completions that is displayed without modification. When set to a
9524value greater than zero, common prefixes longer than this value are
9525replaced with an ellipsis when displaying possible completions.
9526<P>
9527
9528<DT><CODE>completion-query-items</CODE>
9529<DD><A NAME="IDX307"></A>
9530The number of possible completions that determines when the user is
9531asked whether the list of possibilities should be displayed.
9532If the number of possible completions is greater than this value,
9533Readline will ask the user whether or not he wishes to view
9534them; otherwise, they are simply listed.
9535This variable must be set to an integer value greater than or equal to 0.
9536A negative value means Readline should never ask.
9537The default limit is <CODE>100</CODE>.
9538<P>
9539
9540<DT><CODE>convert-meta</CODE>
9541<DD><A NAME="IDX308"></A>
9542If set to <SAMP>`on'</SAMP>, Readline will convert characters with the
9543eighth bit set to an ASCII key sequence by stripping the eighth
9544bit and prefixing an <KBD>ESC</KBD> character, converting them to a
9545meta-prefixed key sequence. The default value is <SAMP>`on'</SAMP>.
9546<P>
9547
9548<DT><CODE>disable-completion</CODE>
9549<DD><A NAME="IDX309"></A>
9550If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion.
9551Completion characters will be inserted into the line as if they had
9552been mapped to <CODE>self-insert</CODE>. The default is <SAMP>`off'</SAMP>.
9553<P>
9554
9555<DT><CODE>editing-mode</CODE>
9556<DD><A NAME="IDX310"></A>
9557The <CODE>editing-mode</CODE> variable controls which default set of
9558key bindings is used. By default, Readline starts up in Emacs editing
9559mode, where the keystrokes are most similar to Emacs. This variable can be
9560set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>.
9561<P>
9562
9563<DT><CODE>enable-keypad</CODE>
9564<DD><A NAME="IDX311"></A>
9565When set to <SAMP>`on'</SAMP>, Readline will try to enable the application
9566keypad when it is called. Some systems need this to enable the
9567arrow keys. The default is <SAMP>`off'</SAMP>.
9568<P>
9569
9570<DT><CODE>expand-tilde</CODE>
9571<DD><A NAME="IDX312"></A>
9572If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline
9573attempts word completion. The default is <SAMP>`off'</SAMP>.
9574<P>
9575
9576<DT><CODE>history-preserve-point</CODE>
9577<DD><A NAME="IDX313"></A>
9578If set to <SAMP>`on'</SAMP>, the history code attempts to place the point (the
9579current cursor position) at the
9580same location on each history line retrieved with <CODE>previous-history</CODE>
9581or <CODE>next-history</CODE>. The default is <SAMP>`off'</SAMP>.
9582<P>
9583
9584<DT><CODE>history-size</CODE>
9585<DD><A NAME="IDX314"></A>
9586Set the maximum number of history entries saved in the history list. If
9587set to zero, the number of entries in the history list is not limited.
9588<P>
9589
9590<DT><CODE>horizontal-scroll-mode</CODE>
9591<DD><A NAME="IDX315"></A>
9592This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>. Setting it
9593to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll
9594horizontally on a single screen line when they are longer than the width
9595of the screen, instead of wrapping onto a new screen line. By default,
9596this variable is set to <SAMP>`off'</SAMP>.
9597<P>
9598
9599<DT><CODE>input-meta</CODE>
9600<DD><A NAME="IDX316"></A>
9601<A NAME="IDX317"></A>
9602If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it
9603will not clear the eighth bit in the characters it reads),
9604regardless of what the terminal claims it can support. The
9605default value is <SAMP>`off'</SAMP>. The name <CODE>meta-flag</CODE> is a
9606synonym for this variable.
9607<P>
9608
9609<DT><CODE>isearch-terminators</CODE>
9610<DD><A NAME="IDX318"></A>
9611The string of characters that should terminate an incremental search without
9612subsequently executing the character as a command (see section <A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>).
9613If this variable has not been given a value, the characters <KBD>ESC</KBD> and
9614<KBD>C-J</KBD> will terminate an incremental search.
9615<P>
9616
9617<DT><CODE>keymap</CODE>
9618<DD><A NAME="IDX319"></A>
9619Sets Readline's idea of the current keymap for key binding commands.
9620Acceptable <CODE>keymap</CODE> names are
9621<CODE>emacs</CODE>,
9622<CODE>emacs-standard</CODE>,
9623<CODE>emacs-meta</CODE>,
9624<CODE>emacs-ctlx</CODE>,
9625<CODE>vi</CODE>,
9626<CODE>vi-move</CODE>,
9627<CODE>vi-command</CODE>, and
9628<CODE>vi-insert</CODE>.
9629<CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; <CODE>emacs</CODE> is
9630equivalent to <CODE>emacs-standard</CODE>. The default value is <CODE>emacs</CODE>.
9631The value of the <CODE>editing-mode</CODE> variable also affects the
9632default keymap.
9633<P>
9634
9635<DT><CODE>mark-directories</CODE>
9636<DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash
9637appended. The default is <SAMP>`on'</SAMP>.
9638<P>
9639
9640<DT><CODE>mark-modified-lines</CODE>
9641<DD><A NAME="IDX320"></A>
9642This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an
9643asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified.
9644This variable is <SAMP>`off'</SAMP> by default.
9645<P>
9646
9647<DT><CODE>mark-symlinked-directories</CODE>
9648<DD><A NAME="IDX321"></A>
9649If set to <SAMP>`on'</SAMP>, completed names which are symbolic links
9650to directories have a slash appended (subject to the value of
9651<CODE>mark-directories</CODE>).
9652The default is <SAMP>`off'</SAMP>.
9653<P>
9654
9655<DT><CODE>match-hidden-files</CODE>
9656<DD><A NAME="IDX322"></A>
9657This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose
9658names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename
9659completion, unless the leading <SAMP>`.'</SAMP> is
9660supplied by the user in the filename to be completed.
9661This variable is <SAMP>`on'</SAMP> by default.
9662<P>
9663
9664<DT><CODE>output-meta</CODE>
9665<DD><A NAME="IDX323"></A>
9666If set to <SAMP>`on'</SAMP>, Readline will display characters with the
9667eighth bit set directly rather than as a meta-prefixed escape
9668sequence. The default is <SAMP>`off'</SAMP>.
9669<P>
9670
9671<DT><CODE>page-completions</CODE>
9672<DD><A NAME="IDX324"></A>
9673If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager
9674to display a screenful of possible completions at a time.
9675This variable is <SAMP>`on'</SAMP> by default.
9676<P>
9677
9678<DT><CODE>print-completions-horizontally</CODE>
9679<DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches
9680sorted horizontally in alphabetical order, rather than down the screen.
9681The default is <SAMP>`off'</SAMP>.
9682<P>
9683
9684<DT><CODE>revert-all-at-newline</CODE>
9685<DD><A NAME="IDX325"></A>
9686If set to <SAMP>`on'</SAMP>, Readline will undo all changes to history lines
9687before returning when <CODE>accept-line</CODE> is executed. By default,
9688history lines may be modified and retain individual undo lists across
9689calls to <CODE>readline</CODE>. The default is <SAMP>`off'</SAMP>.
9690<P>
9691
9692<DT><CODE>show-all-if-ambiguous</CODE>
9693<DD><A NAME="IDX326"></A>
9694This alters the default behavior of the completion functions. If
9695set to <SAMP>`on'</SAMP>,
9696words which have more than one possible completion cause the
9697matches to be listed immediately instead of ringing the bell.
9698The default value is <SAMP>`off'</SAMP>.
9699<P>
9700
9701<DT><CODE>show-all-if-unmodified</CODE>
9702<DD><A NAME="IDX327"></A>
9703This alters the default behavior of the completion functions in
9704a fashion similar to <VAR>show-all-if-ambiguous</VAR>.
9705If set to <SAMP>`on'</SAMP>,
9706words which have more than one possible completion without any
9707possible partial completion (the possible completions don't share
9708a common prefix) cause the matches to be listed immediately instead
9709of ringing the bell.
9710The default value is <SAMP>`off'</SAMP>.
9711<P>
9712
9713<DT><CODE>visible-stats</CODE>
9714<DD><A NAME="IDX328"></A>
9715If set to <SAMP>`on'</SAMP>, a character denoting a file's type
9716is appended to the filename when listing possible
9717completions. The default is <SAMP>`off'</SAMP>.
9718<P>
9719
9720</DL>
9721<P>
9722
9723<DT>Key Bindings
9724<DD>The syntax for controlling key bindings in the init file is
9725simple. First you need to find the name of the command that you
9726want to change. The following sections contain tables of the command
9727name, the default keybinding, if any, and a short description of what
9728the command does.
9729<P>
9730
9731Once you know the name of the command, simply place on a line
9732in the init file the name of the key
9733you wish to bind the command to, a colon, and then the name of the
9734command.
9735There can be no space between the key name and the colon -- that will be
9736interpreted as part of the key name.
9737The name of the key can be expressed in different ways, depending on
9738what you find most comfortable.
9739</P><P>
9740
9741In addition to command names, readline allows keys to be bound
9742to a string that is inserted when the key is pressed (a <VAR>macro</VAR>).
9743</P><P>
9744
9745The <CODE>bind -p</CODE> command displays Readline function names and
9746bindings in a format that can put directly into an initialization file.
9747See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.
9748</P><P>
9749
9750<DL COMPACT>
9751<DT><VAR>keyname</VAR>: <VAR>function-name</VAR> or <VAR>macro</VAR>
9752<DD><VAR>keyname</VAR> is the name of a key spelled out in English. For example:
9753<TABLE><tr><td>&nbsp;</td><td class=example><pre>Control-u: universal-argument
9754Meta-Rubout: backward-kill-word
9755Control-o: "&#62; output"
9756</pre></td></tr></table><P>
9757
9758In the above example, <KBD>C-u</KBD> is bound to the function
9759<CODE>universal-argument</CODE>,
9760<KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and
9761<KBD>C-o</KBD> is bound to run the macro
9762expressed on the right hand side (that is, to insert the text
9763<SAMP>`&#62; output'</SAMP> into the line).
9764</P><P>
9765
9766A number of symbolic character names are recognized while
9767processing this key binding syntax:
9768<VAR>DEL</VAR>,
9769<VAR>ESC</VAR>,
9770<VAR>ESCAPE</VAR>,
9771<VAR>LFD</VAR>,
9772<VAR>NEWLINE</VAR>,
9773<VAR>RET</VAR>,
9774<VAR>RETURN</VAR>,
9775<VAR>RUBOUT</VAR>,
9776<VAR>SPACE</VAR>,
9777<VAR>SPC</VAR>,
9778and
9779<VAR>TAB</VAR>.
9780</P><P>
9781
9782<DT>"<VAR>keyseq</VAR>": <VAR>function-name</VAR> or <VAR>macro</VAR>
9783<DD><VAR>keyseq</VAR> differs from <VAR>keyname</VAR> above in that strings
9784denoting an entire key sequence can be specified, by placing
9785the key sequence in double quotes. Some GNU Emacs style key
9786escapes can be used, as in the following example, but the
9787special character names are not recognized.
9788<P>
9789
9790<TABLE><tr><td>&nbsp;</td><td class=example><pre>"\C-u": universal-argument
9791"\C-x\C-r": re-read-init-file
9792"\e[11~": "Function Key 1"
9793</pre></td></tr></table></P><P>
9794
9795In the above example, <KBD>C-u</KBD> is again bound to the function
9796<CODE>universal-argument</CODE> (just as it was in the first example),
9797<SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>,
9798and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert
9799the text <SAMP>`Function Key 1'</SAMP>.
9800</P><P>
9801
9802</DL>
9803<P>
9804
9805The following GNU Emacs style escape sequences are available when
9806specifying key sequences:
9807</P><P>
9808
9809<DL COMPACT>
9810<DT><CODE><KBD>\C-</KBD></CODE>
9811<DD>control prefix
9812<DT><CODE><KBD>\M-</KBD></CODE>
9813<DD>meta prefix
9814<DT><CODE><KBD>\e</KBD></CODE>
9815<DD>an escape character
9816<DT><CODE><KBD>\\</KBD></CODE>
9817<DD>backslash
9818<DT><CODE><KBD>\"</KBD></CODE>
9819<DD><KBD>"</KBD>, a double quotation mark
9820<DT><CODE><KBD>\'</KBD></CODE>
9821<DD><KBD>'</KBD>, a single quote or apostrophe
9822</DL>
9823<P>
9824
9825In addition to the GNU Emacs style escape sequences, a second
9826set of backslash escapes is available:
9827</P><P>
9828
9829<DL COMPACT>
9830<DT><CODE>\a</CODE>
9831<DD>alert (bell)
9832<DT><CODE>\b</CODE>
9833<DD>backspace
9834<DT><CODE>\d</CODE>
9835<DD>delete
9836<DT><CODE>\f</CODE>
9837<DD>form feed
9838<DT><CODE>\n</CODE>
9839<DD>newline
9840<DT><CODE>\r</CODE>
9841<DD>carriage return
9842<DT><CODE>\t</CODE>
9843<DD>horizontal tab
9844<DT><CODE>\v</CODE>
9845<DD>vertical tab
9846<DT><CODE>\<VAR>nnn</VAR></CODE>
9847<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
9848(one to three digits)
9849<DT><CODE>\x<VAR>HH</VAR></CODE>
9850<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
9851(one or two hex digits)
9852</DL>
9853<P>
9854
9855When entering the text of a macro, single or double quotes must
9856be used to indicate a macro definition.
9857Unquoted text is assumed to be a function name.
9858In the macro body, the backslash escapes described above are expanded.
9859Backslash will quote any other character in the macro text,
9860including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>.
9861For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP>
9862insert a single <SAMP>`\'</SAMP> into the line:
9863<TABLE><tr><td>&nbsp;</td><td class=example><pre>"\C-x\\": "\\"
9864</pre></td></tr></table></P><P>
9865
9866</DL>
9867<P>
9868
9869<A NAME="Conditional Init Constructs"></A>
9870<HR SIZE="6">
9871<A NAME="SEC105"></A>
9872<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9873<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &lt; </A>]</TD>
9874<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &gt; </A>]</TD>
9875<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &lt;&lt; </A>]</TD>
9876<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
9877<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
9878<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9879<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9880<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9881<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9882</TR></TABLE>
9883<H3> 8.3.2 Conditional Init Constructs </H3>
9884<!--docid::SEC105::-->
9885<P>
9886
9887Readline implements a facility similar in spirit to the conditional
9888compilation features of the C preprocessor which allows key
9889bindings and variable settings to be performed as the result
9890of tests. There are four parser directives used.
9891</P><P>
9892
9893<DL COMPACT>
9894<DT><CODE>$if</CODE>
9895<DD>The <CODE>$if</CODE> construct allows bindings to be made based on the
9896editing mode, the terminal being used, or the application using
9897Readline. The text of the test extends to the end of the line;
9898no characters are required to isolate it.
9899<P>
9900
9901<DL COMPACT>
9902<DT><CODE>mode</CODE>
9903<DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test
9904whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode.
9905This may be used in conjunction
9906with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in
9907the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if
9908Readline is starting out in <CODE>emacs</CODE> mode.
9909<P>
9910
9911<DT><CODE>term</CODE>
9912<DD>The <CODE>term=</CODE> form may be used to include terminal-specific
9913key bindings, perhaps to bind the key sequences output by the
9914terminal's function keys. The word on the right side of the
9915<SAMP>`='</SAMP> is tested against both the full name of the terminal and
9916the portion of the terminal name before the first <SAMP>`-'</SAMP>. This
9917allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>,
9918for instance.
9919<P>
9920
9921<DT><CODE>application</CODE>
9922<DD>The <VAR>application</VAR> construct is used to include
9923application-specific settings. Each program using the Readline
9924library sets the <VAR>application name</VAR>, and you can test for
9925a particular value.
9926This could be used to bind key sequences to functions useful for
9927a specific program. For instance, the following command adds a
9928key sequence that quotes the current or previous word in Bash:
9929<TABLE><tr><td>&nbsp;</td><td class=example><pre>$if Bash
9930# Quote the current or previous word
9931"\C-xq": "\eb\"\ef\""
9932$endif
9933</pre></td></tr></table></DL>
9934<P>
9935
9936<DT><CODE>$endif</CODE>
9937<DD>This command, as seen in the previous example, terminates an
9938<CODE>$if</CODE> command.
9939<P>
9940
9941<DT><CODE>$else</CODE>
9942<DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if
9943the test fails.
9944<P>
9945
9946<DT><CODE>$include</CODE>
9947<DD>This directive takes a single filename as an argument and reads commands
9948and bindings from that file.
9949For example, the following directive reads from <TT>`/etc/inputrc'</TT>:
9950<TABLE><tr><td>&nbsp;</td><td class=example><pre>$include /etc/inputrc
9951</pre></td></tr></table></DL>
9952<P>
9953
9954<A NAME="Sample Init File"></A>
9955<HR SIZE="6">
9956<A NAME="SEC106"></A>
9957<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9958<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> &lt; </A>]</TD>
9959<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt; </A>]</TD>
9960<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt;&lt; </A>]</TD>
9961<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
9962<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
9963<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9964<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9965<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9966<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9967</TR></TABLE>
9968<H3> 8.3.3 Sample Init File </H3>
9969<!--docid::SEC106::-->
9970<P>
9971
9972Here is an example of an <VAR>inputrc</VAR> file. This illustrates key
9973binding, variable assignment, and conditional syntax.
9974</P><P>
9975
9976<TABLE><tr><td>&nbsp;</td><td class=example><pre># This file controls the behaviour of line input editing for
9977# programs that use the GNU Readline library. Existing
9978# programs include FTP, Bash, and GDB.
9979#
9980# You can re-read the inputrc file with C-x C-r.
9981# Lines beginning with '#' are comments.
9982#
9983# First, include any systemwide bindings and variable
9984# assignments from /etc/Inputrc
9985$include /etc/Inputrc
9986
9987#
9988# Set various bindings for emacs mode.
9989
9990set editing-mode emacs
9991
9992$if mode=emacs
9993
9994Meta-Control-h: backward-kill-word Text after the function name is ignored
9995
9996#
9997# Arrow keys in keypad mode
9998#
9999#"\M-OD": backward-char
10000#"\M-OC": forward-char
10001#"\M-OA": previous-history
10002#"\M-OB": next-history
10003#
10004# Arrow keys in ANSI mode
10005#
10006"\M-[D": backward-char
10007"\M-[C": forward-char
10008"\M-[A": previous-history
10009"\M-[B": next-history
10010#
10011# Arrow keys in 8 bit keypad mode
10012#
10013#"\M-\C-OD": backward-char
10014#"\M-\C-OC": forward-char
10015#"\M-\C-OA": previous-history
10016#"\M-\C-OB": next-history
10017#
10018# Arrow keys in 8 bit ANSI mode
10019#
10020#"\M-\C-[D": backward-char
10021#"\M-\C-[C": forward-char
10022#"\M-\C-[A": previous-history
10023#"\M-\C-[B": next-history
10024
10025C-q: quoted-insert
10026
10027$endif
10028
10029# An old-style binding. This happens to be the default.
10030TAB: complete
10031
10032# Macros that are convenient for shell interaction
10033$if Bash
10034# edit the path
10035"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
10036# prepare to type a quoted word --
10037# insert open and close double quotes
10038# and move to just after the open quote
10039"\C-x\"": "\"\"\C-b"
10040# insert a backslash (testing backslash escapes
10041# in sequences and macros)
10042"\C-x\\": "\\"
10043# Quote the current or previous word
10044"\C-xq": "\eb\"\ef\""
10045# Add a binding to refresh the line, which is unbound
10046"\C-xr": redraw-current-line
10047# Edit variable on current line.
10048"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
10049$endif
10050
10051# use a visible bell if one is available
10052set bell-style visible
10053
10054# don't strip characters to 7 bits when reading
10055set input-meta on
10056
10057# allow iso-latin1 characters to be inserted rather
10058# than converted to prefix-meta sequences
10059set convert-meta off
10060
10061# display characters with the eighth bit set directly
10062# rather than as meta-prefixed characters
10063set output-meta on
10064
10065# if there are more than 150 possible completions for
10066# a word, ask the user if he wants to see all of them
10067set completion-query-items 150
10068
10069# For FTP
10070$if Ftp
10071"\C-xg": "get \M-?"
10072"\C-xt": "put \M-?"
10073"\M-.": yank-last-arg
10074$endif
10075</pre></td></tr></table></P><P>
10076
10077<A NAME="Bindable Readline Commands"></A>
10078<HR SIZE="6">
10079<A NAME="SEC107"></A>
10080<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10081<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &lt; </A>]</TD>
10082<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &gt; </A>]</TD>
10083<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt;&lt; </A>]</TD>
10084<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
10085<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10086<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10087<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10088<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10089<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10090</TR></TABLE>
10091<H2> 8.4 Bindable Readline Commands </H2>
10092<!--docid::SEC107::-->
10093<P>
10094
10095<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
10096<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR>
10097<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR>
10098<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR>
10099<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR>
10100<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR>
10101<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Getting Readline to do the typing for you.</TD></TR>
10102<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR>
10103<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR>
10104</TABLE></BLOCKQUOTE>
10105<P>
10106
10107This section describes Readline commands that may be bound to key
10108sequences.
10109You can list your key bindings by executing
10110<CODE>bind -P</CODE> or, for a more terse format, suitable for an
10111<VAR>inputrc</VAR> file, <CODE>bind -p</CODE>. (See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.)
10112Command names without an accompanying key sequence are unbound by default.
10113</P><P>
10114
10115In the following descriptions, <EM>point</EM> refers to the current cursor
10116position, and <EM>mark</EM> refers to a cursor position saved by the
10117<CODE>set-mark</CODE> command.
10118The text between the point and mark is referred to as the <EM>region</EM>.
10119</P><P>
10120
10121<A NAME="Commands For Moving"></A>
10122<HR SIZE="6">
10123<A NAME="SEC108"></A>
10124<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10125<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt; </A>]</TD>
10126<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> &gt; </A>]</TD>
10127<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt;&lt; </A>]</TD>
10128<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10129<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10130<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10131<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10132<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10133<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10134</TR></TABLE>
10135<H3> 8.4.1 Commands For Moving </H3>
10136<!--docid::SEC108::-->
10137<DL COMPACT>
10138<A NAME="IDX329"></A>
10139<DT><CODE>beginning-of-line (C-a)</CODE>
10140<DD><A NAME="IDX330"></A>
10141Move to the start of the current line.
10142<P>
10143
10144<A NAME="IDX331"></A>
10145<DT><CODE>end-of-line (C-e)</CODE>
10146<DD><A NAME="IDX332"></A>
10147Move to the end of the line.
10148<P>
10149
10150<A NAME="IDX333"></A>
10151<DT><CODE>forward-char (C-f)</CODE>
10152<DD><A NAME="IDX334"></A>
10153Move forward a character.
10154<P>
10155
10156<A NAME="IDX335"></A>
10157<DT><CODE>backward-char (C-b)</CODE>
10158<DD><A NAME="IDX336"></A>
10159Move back a character.
10160<P>
10161
10162<A NAME="IDX337"></A>
10163<DT><CODE>forward-word (M-f)</CODE>
10164<DD><A NAME="IDX338"></A>
10165Move forward to the end of the next word.
10166Words are composed of letters and digits.
10167<P>
10168
10169<A NAME="IDX339"></A>
10170<DT><CODE>backward-word (M-b)</CODE>
10171<DD><A NAME="IDX340"></A>
10172Move back to the start of the current or previous word.
10173Words are composed of letters and digits.
10174<P>
10175
10176<A NAME="IDX341"></A>
10177<DT><CODE>shell-forward-word ()</CODE>
10178<DD><A NAME="IDX342"></A>
10179Move forward to the end of the next word.
10180Words are delimited by non-quoted shell metacharacters.
10181<P>
10182
10183<A NAME="IDX343"></A>
10184<DT><CODE>shell-backward-word ()</CODE>
10185<DD><A NAME="IDX344"></A>
10186Move back to the start of the current or previous word.
10187Words are delimited by non-quoted shell metacharacters.
10188<P>
10189
10190<A NAME="IDX345"></A>
10191<DT><CODE>clear-screen (C-l)</CODE>
10192<DD><A NAME="IDX346"></A>
10193Clear the screen and redraw the current line,
10194leaving the current line at the top of the screen.
10195<P>
10196
10197<A NAME="IDX347"></A>
10198<DT><CODE>redraw-current-line ()</CODE>
10199<DD><A NAME="IDX348"></A>
10200Refresh the current line. By default, this is unbound.
10201<P>
10202
10203</DL>
10204<P>
10205
10206<A NAME="Commands For History"></A>
10207<HR SIZE="6">
10208<A NAME="SEC109"></A>
10209<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10210<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &lt; </A>]</TD>
10211<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &gt; </A>]</TD>
10212<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &lt;&lt; </A>]</TD>
10213<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10214<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10215<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10216<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10217<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10218<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10219</TR></TABLE>
10220<H3> 8.4.2 Commands For Manipulating The History </H3>
10221<!--docid::SEC109::-->
10222<P>
10223
10224<DL COMPACT>
10225<A NAME="IDX349"></A>
10226<DT><CODE>accept-line (Newline or Return)</CODE>
10227<DD><A NAME="IDX350"></A>
10228Accept the line regardless of where the cursor is.
10229If this line is
10230non-empty, add it to the history list according to the setting of
10231the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables.
10232If this line is a modified history line, then restore the history line
10233to its original state.
10234<P>
10235
10236<A NAME="IDX351"></A>
10237<DT><CODE>previous-history (C-p)</CODE>
10238<DD><A NAME="IDX352"></A>
10239Move `back' through the history list, fetching the previous command.
10240<P>
10241
10242<A NAME="IDX353"></A>
10243<DT><CODE>next-history (C-n)</CODE>
10244<DD><A NAME="IDX354"></A>
10245Move `forward' through the history list, fetching the next command.
10246<P>
10247
10248<A NAME="IDX355"></A>
10249<DT><CODE>beginning-of-history (M-&#60;)</CODE>
10250<DD><A NAME="IDX356"></A>
10251Move to the first line in the history.
10252<P>
10253
10254<A NAME="IDX357"></A>
10255<DT><CODE>end-of-history (M-&#62;)</CODE>
10256<DD><A NAME="IDX358"></A>
10257Move to the end of the input history, i.e., the line currently
10258being entered.
10259<P>
10260
10261<A NAME="IDX359"></A>
10262<DT><CODE>reverse-search-history (C-r)</CODE>
10263<DD><A NAME="IDX360"></A>
10264Search backward starting at the current line and moving `up' through
10265the history as necessary. This is an incremental search.
10266<P>
10267
10268<A NAME="IDX361"></A>
10269<DT><CODE>forward-search-history (C-s)</CODE>
10270<DD><A NAME="IDX362"></A>
10271Search forward starting at the current line and moving `down' through
10272the the history as necessary. This is an incremental search.
10273<P>
10274
10275<A NAME="IDX363"></A>
10276<DT><CODE>non-incremental-reverse-search-history (M-p)</CODE>
10277<DD><A NAME="IDX364"></A>
10278Search backward starting at the current line and moving `up'
10279through the history as necessary using a non-incremental search
10280for a string supplied by the user.
10281<P>
10282
10283<A NAME="IDX365"></A>
10284<DT><CODE>non-incremental-forward-search-history (M-n)</CODE>
10285<DD><A NAME="IDX366"></A>
10286Search forward starting at the current line and moving `down'
10287through the the history as necessary using a non-incremental search
10288for a string supplied by the user.
10289<P>
10290
10291<A NAME="IDX367"></A>
10292<DT><CODE>history-search-forward ()</CODE>
10293<DD><A NAME="IDX368"></A>
10294Search forward through the history for the string of characters
10295between the start of the current line and the point.
10296This is a non-incremental search.
10297By default, this command is unbound.
10298<P>
10299
10300<A NAME="IDX369"></A>
10301<DT><CODE>history-search-backward ()</CODE>
10302<DD><A NAME="IDX370"></A>
10303Search backward through the history for the string of characters
10304between the start of the current line and the point. This
10305is a non-incremental search. By default, this command is unbound.
10306<P>
10307
10308<A NAME="IDX371"></A>
10309<DT><CODE>yank-nth-arg (M-C-y)</CODE>
10310<DD><A NAME="IDX372"></A>
10311Insert the first argument to the previous command (usually
10312the second word on the previous line) at point.
10313With an argument <VAR>n</VAR>,
10314insert the <VAR>n</VAR>th word from the previous command (the words
10315in the previous command begin with word 0). A negative argument
10316inserts the <VAR>n</VAR>th word from the end of the previous command.
10317Once the argument <VAR>n</VAR> is computed, the argument is extracted
10318as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified.
10319<P>
10320
10321<A NAME="IDX373"></A>
10322<DT><CODE>yank-last-arg (M-. or M-_)</CODE>
10323<DD><A NAME="IDX374"></A>
10324Insert last argument to the previous command (the last word of the
10325previous history entry). With an
10326argument, behave exactly like <CODE>yank-nth-arg</CODE>.
10327Successive calls to <CODE>yank-last-arg</CODE> move back through the history
10328list, inserting the last argument of each line in turn.
10329The history expansion facilities are used to extract the last argument,
10330as if the <SAMP>`!$'</SAMP> history expansion had been specified.
10331<P>
10332
10333</DL>
10334<P>
10335
10336<A NAME="Commands For Text"></A>
10337<HR SIZE="6">
10338<A NAME="SEC110"></A>
10339<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10340<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> &lt; </A>]</TD>
10341<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &gt; </A>]</TD>
10342<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &lt;&lt; </A>]</TD>
10343<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10344<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10345<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10346<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10347<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10348<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10349</TR></TABLE>
10350<H3> 8.4.3 Commands For Changing Text </H3>
10351<!--docid::SEC110::-->
10352<P>
10353
10354<DL COMPACT>
10355<A NAME="IDX375"></A>
10356<DT><CODE>delete-char (C-d)</CODE>
10357<DD><A NAME="IDX376"></A>
10358Delete the character at point. If point is at the
10359beginning of the line, there are no characters in the line, and
10360the last character typed was not bound to <CODE>delete-char</CODE>, then
10361return EOF.
10362<P>
10363
10364<A NAME="IDX377"></A>
10365<DT><CODE>backward-delete-char (Rubout)</CODE>
10366<DD><A NAME="IDX378"></A>
10367Delete the character behind the cursor. A numeric argument means
10368to kill the characters instead of deleting them.
10369<P>
10370
10371<A NAME="IDX379"></A>
10372<DT><CODE>forward-backward-delete-char ()</CODE>
10373<DD><A NAME="IDX380"></A>
10374Delete the character under the cursor, unless the cursor is at the
10375end of the line, in which case the character behind the cursor is
10376deleted. By default, this is not bound to a key.
10377<P>
10378
10379<A NAME="IDX381"></A>
10380<DT><CODE>quoted-insert (C-q or C-v)</CODE>
10381<DD><A NAME="IDX382"></A>
10382Add the next character typed to the line verbatim. This is
10383how to insert key sequences like <KBD>C-q</KBD>, for example.
10384<P>
10385
10386<A NAME="IDX383"></A>
10387<DT><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE>
10388<DD><A NAME="IDX384"></A>
10389Insert yourself.
10390<P>
10391
10392<A NAME="IDX385"></A>
10393<DT><CODE>transpose-chars (C-t)</CODE>
10394<DD><A NAME="IDX386"></A>
10395Drag the character before the cursor forward over
10396the character at the cursor, moving the
10397cursor forward as well. If the insertion point
10398is at the end of the line, then this
10399transposes the last two characters of the line.
10400Negative arguments have no effect.
10401<P>
10402
10403<A NAME="IDX387"></A>
10404<DT><CODE>transpose-words (M-t)</CODE>
10405<DD><A NAME="IDX388"></A>
10406Drag the word before point past the word after point,
10407moving point past that word as well.
10408If the insertion point is at the end of the line, this transposes
10409the last two words on the line.
10410<P>
10411
10412<A NAME="IDX389"></A>
10413<DT><CODE>upcase-word (M-u)</CODE>
10414<DD><A NAME="IDX390"></A>
10415Uppercase the current (or following) word. With a negative argument,
10416uppercase the previous word, but do not move the cursor.
10417<P>
10418
10419<A NAME="IDX391"></A>
10420<DT><CODE>downcase-word (M-l)</CODE>
10421<DD><A NAME="IDX392"></A>
10422Lowercase the current (or following) word. With a negative argument,
10423lowercase the previous word, but do not move the cursor.
10424<P>
10425
10426<A NAME="IDX393"></A>
10427<DT><CODE>capitalize-word (M-c)</CODE>
10428<DD><A NAME="IDX394"></A>
10429Capitalize the current (or following) word. With a negative argument,
10430capitalize the previous word, but do not move the cursor.
10431<P>
10432
10433<A NAME="IDX395"></A>
10434<DT><CODE>overwrite-mode ()</CODE>
10435<DD><A NAME="IDX396"></A>
10436Toggle overwrite mode. With an explicit positive numeric argument,
10437switches to overwrite mode. With an explicit non-positive numeric
10438argument, switches to insert mode. This command affects only
10439<CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently.
10440Each call to <CODE>readline()</CODE> starts in insert mode.
10441<P>
10442
10443In overwrite mode, characters bound to <CODE>self-insert</CODE> replace
10444the text at point rather than pushing the text to the right.
10445Characters bound to <CODE>backward-delete-char</CODE> replace the character
10446before point with a space.
10447</P><P>
10448
10449By default, this command is unbound.
10450</P><P>
10451
10452</DL>
10453<P>
10454
10455<A NAME="Commands For Killing"></A>
10456<HR SIZE="6">
10457<A NAME="SEC111"></A>
10458<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10459<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &lt; </A>]</TD>
10460<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &gt; </A>]</TD>
10461<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &lt;&lt; </A>]</TD>
10462<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10463<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10464<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10465<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10466<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10467<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10468</TR></TABLE>
10469<H3> 8.4.4 Killing And Yanking </H3>
10470<!--docid::SEC111::-->
10471<P>
10472
10473<DL COMPACT>
10474
10475<A NAME="IDX397"></A>
10476<DT><CODE>kill-line (C-k)</CODE>
10477<DD><A NAME="IDX398"></A>
10478Kill the text from point to the end of the line.
10479<P>
10480
10481<A NAME="IDX399"></A>
10482<DT><CODE>backward-kill-line (C-x Rubout)</CODE>
10483<DD><A NAME="IDX400"></A>
10484Kill backward to the beginning of the line.
10485<P>
10486
10487<A NAME="IDX401"></A>
10488<DT><CODE>unix-line-discard (C-u)</CODE>
10489<DD><A NAME="IDX402"></A>
10490Kill backward from the cursor to the beginning of the current line.
10491<P>
10492
10493<A NAME="IDX403"></A>
10494<DT><CODE>kill-whole-line ()</CODE>
10495<DD><A NAME="IDX404"></A>
10496Kill all characters on the current line, no matter where point is.
10497By default, this is unbound.
10498<P>
10499
10500<A NAME="IDX405"></A>
10501<DT><CODE>kill-word (M-d)</CODE>
10502<DD><A NAME="IDX406"></A>
10503Kill from point to the end of the current word, or if between
10504words, to the end of the next word.
10505Word boundaries are the same as <CODE>forward-word</CODE>.
10506<P>
10507
10508<A NAME="IDX407"></A>
10509<DT><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE>
10510<DD><A NAME="IDX408"></A>
10511Kill the word behind point.
10512Word boundaries are the same as <CODE>backward-word</CODE>.
10513<P>
10514
10515<A NAME="IDX409"></A>
10516<DT><CODE>shell-kill-word ()</CODE>
10517<DD><A NAME="IDX410"></A>
10518Kill from point to the end of the current word, or if between
10519words, to the end of the next word.
10520Word boundaries are the same as <CODE>shell-forward-word</CODE>.
10521<P>
10522
10523<A NAME="IDX411"></A>
10524<DT><CODE>backward-kill-word ()</CODE>
10525<DD><A NAME="IDX412"></A>
10526Kill the word behind point.
10527Word boundaries are the same as <CODE>shell-backward-word</CODE>.
10528<P>
10529
10530<A NAME="IDX413"></A>
10531<DT><CODE>unix-word-rubout (C-w)</CODE>
10532<DD><A NAME="IDX414"></A>
10533Kill the word behind point, using white space as a word boundary.
10534The killed text is saved on the kill-ring.
10535<P>
10536
10537<A NAME="IDX415"></A>
10538<DT><CODE>unix-filename-rubout ()</CODE>
10539<DD><A NAME="IDX416"></A>
10540Kill the word behind point, using white space and the slash character
10541as the word boundaries.
10542The killed text is saved on the kill-ring.
10543<P>
10544
10545<A NAME="IDX417"></A>
10546<DT><CODE>delete-horizontal-space ()</CODE>
10547<DD><A NAME="IDX418"></A>
10548Delete all spaces and tabs around point. By default, this is unbound.
10549<P>
10550
10551<A NAME="IDX419"></A>
10552<DT><CODE>kill-region ()</CODE>
10553<DD><A NAME="IDX420"></A>
10554Kill the text in the current region.
10555By default, this command is unbound.
10556<P>
10557
10558<A NAME="IDX421"></A>
10559<DT><CODE>copy-region-as-kill ()</CODE>
10560<DD><A NAME="IDX422"></A>
10561Copy the text in the region to the kill buffer, so it can be yanked
10562right away. By default, this command is unbound.
10563<P>
10564
10565<A NAME="IDX423"></A>
10566<DT><CODE>copy-backward-word ()</CODE>
10567<DD><A NAME="IDX424"></A>
10568Copy the word before point to the kill buffer.
10569The word boundaries are the same as <CODE>backward-word</CODE>.
10570By default, this command is unbound.
10571<P>
10572
10573<A NAME="IDX425"></A>
10574<DT><CODE>copy-forward-word ()</CODE>
10575<DD><A NAME="IDX426"></A>
10576Copy the word following point to the kill buffer.
10577The word boundaries are the same as <CODE>forward-word</CODE>.
10578By default, this command is unbound.
10579<P>
10580
10581<A NAME="IDX427"></A>
10582<DT><CODE>yank (C-y)</CODE>
10583<DD><A NAME="IDX428"></A>
10584Yank the top of the kill ring into the buffer at point.
10585<P>
10586
10587<A NAME="IDX429"></A>
10588<DT><CODE>yank-pop (M-y)</CODE>
10589<DD><A NAME="IDX430"></A>
10590Rotate the kill-ring, and yank the new top. You can only do this if
10591the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>.
10592</DL>
10593<P>
10594
10595<A NAME="Numeric Arguments"></A>
10596<HR SIZE="6">
10597<A NAME="SEC112"></A>
10598<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10599<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &lt; </A>]</TD>
10600<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &gt; </A>]</TD>
10601<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &lt;&lt; </A>]</TD>
10602<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10603<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10604<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10605<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10606<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10607<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10608</TR></TABLE>
10609<H3> 8.4.5 Specifying Numeric Arguments </H3>
10610<!--docid::SEC112::-->
10611<DL COMPACT>
10612
10613<A NAME="IDX431"></A>
10614<DT><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE>
10615<DD><A NAME="IDX432"></A>
10616Add this digit to the argument already accumulating, or start a new
10617argument. <KBD>M--</KBD> starts a negative argument.
10618<P>
10619
10620<A NAME="IDX433"></A>
10621<DT><CODE>universal-argument ()</CODE>
10622<DD><A NAME="IDX434"></A>
10623This is another way to specify an argument.
10624If this command is followed by one or more digits, optionally with a
10625leading minus sign, those digits define the argument.
10626If the command is followed by digits, executing <CODE>universal-argument</CODE>
10627again ends the numeric argument, but is otherwise ignored.
10628As a special case, if this command is immediately followed by a
10629character that is neither a digit or minus sign, the argument count
10630for the next command is multiplied by four.
10631The argument count is initially one, so executing this function the
10632first time makes the argument count four, a second time makes the
10633argument count sixteen, and so on.
10634By default, this is not bound to a key.
10635</DL>
10636<P>
10637
10638<A NAME="Commands For Completion"></A>
10639<HR SIZE="6">
10640<A NAME="SEC113"></A>
10641<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10642<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &lt; </A>]</TD>
10643<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &gt; </A>]</TD>
10644<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &lt;&lt; </A>]</TD>
10645<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10646<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10647<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10648<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10649<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10650<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10651</TR></TABLE>
10652<H3> 8.4.6 Letting Readline Type For You </H3>
10653<!--docid::SEC113::-->
10654<P>
10655
10656<DL COMPACT>
10657<A NAME="IDX435"></A>
10658<DT><CODE>complete (<KBD>TAB</KBD>)</CODE>
10659<DD><A NAME="IDX436"></A>
10660Attempt to perform completion on the text before point.
10661The actual completion performed is application-specific.
10662Bash attempts completion treating the text as a variable (if the
10663text begins with <SAMP>`$'</SAMP>), username (if the text begins with
10664<SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or
10665command (including aliases and functions) in turn. If none
10666of these produces a match, filename completion is attempted.
10667<P>
10668
10669<A NAME="IDX437"></A>
10670<DT><CODE>possible-completions (M-?)</CODE>
10671<DD><A NAME="IDX438"></A>
10672List the possible completions of the text before point.
10673<P>
10674
10675<A NAME="IDX439"></A>
10676<DT><CODE>insert-completions (M-*)</CODE>
10677<DD><A NAME="IDX440"></A>
10678Insert all completions of the text before point that would have
10679been generated by <CODE>possible-completions</CODE>.
10680<P>
10681
10682<A NAME="IDX441"></A>
10683<DT><CODE>menu-complete ()</CODE>
10684<DD><A NAME="IDX442"></A>
10685Similar to <CODE>complete</CODE>, but replaces the word to be completed
10686with a single match from the list of possible completions.
10687Repeated execution of <CODE>menu-complete</CODE> steps through the list
10688of possible completions, inserting each match in turn.
10689At the end of the list of completions, the bell is rung
10690(subject to the setting of <CODE>bell-style</CODE>)
10691and the original text is restored.
10692An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list
10693of matches; a negative argument may be used to move backward
10694through the list.
10695This command is intended to be bound to <KBD>TAB</KBD>, but is unbound
10696by default.
10697<P>
10698
10699<A NAME="IDX443"></A>
10700<DT><CODE>delete-char-or-list ()</CODE>
10701<DD><A NAME="IDX444"></A>
10702Deletes the character under the cursor if not at the beginning or
10703end of the line (like <CODE>delete-char</CODE>).
10704If at the end of the line, behaves identically to
10705<CODE>possible-completions</CODE>.
10706This command is unbound by default.
10707<P>
10708
10709<A NAME="IDX445"></A>
10710<DT><CODE>complete-filename (M-/)</CODE>
10711<DD><A NAME="IDX446"></A>
10712Attempt filename completion on the text before point.
10713<P>
10714
10715<A NAME="IDX447"></A>
10716<DT><CODE>possible-filename-completions (C-x /)</CODE>
10717<DD><A NAME="IDX448"></A>
10718List the possible completions of the text before point,
10719treating it as a filename.
10720<P>
10721
10722<A NAME="IDX449"></A>
10723<DT><CODE>complete-username (M-~)</CODE>
10724<DD><A NAME="IDX450"></A>
10725Attempt completion on the text before point, treating
10726it as a username.
10727<P>
10728
10729<A NAME="IDX451"></A>
10730<DT><CODE>possible-username-completions (C-x ~)</CODE>
10731<DD><A NAME="IDX452"></A>
10732List the possible completions of the text before point,
10733treating it as a username.
10734<P>
10735
10736<A NAME="IDX453"></A>
10737<DT><CODE>complete-variable (M-$)</CODE>
10738<DD><A NAME="IDX454"></A>
10739Attempt completion on the text before point, treating
10740it as a shell variable.
10741<P>
10742
10743<A NAME="IDX455"></A>
10744<DT><CODE>possible-variable-completions (C-x $)</CODE>
10745<DD><A NAME="IDX456"></A>
10746List the possible completions of the text before point,
10747treating it as a shell variable.
10748<P>
10749
10750<A NAME="IDX457"></A>
10751<DT><CODE>complete-hostname (M-@)</CODE>
10752<DD><A NAME="IDX458"></A>
10753Attempt completion on the text before point, treating
10754it as a hostname.
10755<P>
10756
10757<A NAME="IDX459"></A>
10758<DT><CODE>possible-hostname-completions (C-x @)</CODE>
10759<DD><A NAME="IDX460"></A>
10760List the possible completions of the text before point,
10761treating it as a hostname.
10762<P>
10763
10764<A NAME="IDX461"></A>
10765<DT><CODE>complete-command (M-!)</CODE>
10766<DD><A NAME="IDX462"></A>
10767Attempt completion on the text before point, treating
10768it as a command name. Command completion attempts to
10769match the text against aliases, reserved words, shell
10770functions, shell builtins, and finally executable filenames,
10771in that order.
10772<P>
10773
10774<A NAME="IDX463"></A>
10775<DT><CODE>possible-command-completions (C-x !)</CODE>
10776<DD><A NAME="IDX464"></A>
10777List the possible completions of the text before point,
10778treating it as a command name.
10779<P>
10780
10781<A NAME="IDX465"></A>
10782<DT><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE>
10783<DD><A NAME="IDX466"></A>
10784Attempt completion on the text before point, comparing
10785the text against lines from the history list for possible
10786completion matches.
10787<P>
10788
10789<A NAME="IDX467"></A>
10790<DT><CODE>dabbrev-expand ()</CODE>
10791<DD><A NAME="IDX468"></A>
10792Attempt menu completion on the text before point, comparing
10793the text against lines from the history list for possible
10794completion matches.
10795<P>
10796
10797<A NAME="IDX469"></A>
10798<DT><CODE>complete-into-braces (M-{)</CODE>
10799<DD><A NAME="IDX470"></A>
10800Perform filename completion and insert the list of possible completions
10801enclosed within braces so the list is available to the shell
10802(see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>).
10803<P>
10804
10805</DL>
10806<P>
10807
10808<A NAME="Keyboard Macros"></A>
10809<HR SIZE="6">
10810<A NAME="SEC114"></A>
10811<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10812<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &lt; </A>]</TD>
10813<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &gt; </A>]</TD>
10814<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &lt;&lt; </A>]</TD>
10815<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10816<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10817<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10818<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10819<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10820<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10821</TR></TABLE>
10822<H3> 8.4.7 Keyboard Macros </H3>
10823<!--docid::SEC114::-->
10824<DL COMPACT>
10825
10826<A NAME="IDX471"></A>
10827<DT><CODE>start-kbd-macro (C-x ()</CODE>
10828<DD><A NAME="IDX472"></A>
10829Begin saving the characters typed into the current keyboard macro.
10830<P>
10831
10832<A NAME="IDX473"></A>
10833<DT><CODE>end-kbd-macro (C-x ))</CODE>
10834<DD><A NAME="IDX474"></A>
10835Stop saving the characters typed into the current keyboard macro
10836and save the definition.
10837<P>
10838
10839<A NAME="IDX475"></A>
10840<DT><CODE>call-last-kbd-macro (C-x e)</CODE>
10841<DD><A NAME="IDX476"></A>
10842Re-execute the last keyboard macro defined, by making the characters
10843in the macro appear as if typed at the keyboard.
10844<P>
10845
10846</DL>
10847<P>
10848
10849<A NAME="Miscellaneous Commands"></A>
10850<HR SIZE="6">
10851<A NAME="SEC115"></A>
10852<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10853<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &lt; </A>]</TD>
10854<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt; </A>]</TD>
10855<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt;&lt; </A>]</TD>
10856<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10857<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10858<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10859<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10860<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10861<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10862</TR></TABLE>
10863<H3> 8.4.8 Some Miscellaneous Commands </H3>
10864<!--docid::SEC115::-->
10865<DL COMPACT>
10866
10867<A NAME="IDX477"></A>
10868<DT><CODE>re-read-init-file (C-x C-r)</CODE>
10869<DD><A NAME="IDX478"></A>
10870Read in the contents of the <VAR>inputrc</VAR> file, and incorporate
10871any bindings or variable assignments found there.
10872<P>
10873
10874<A NAME="IDX479"></A>
10875<DT><CODE>abort (C-g)</CODE>
10876<DD><A NAME="IDX480"></A>
10877Abort the current editing command and
10878ring the terminal's bell (subject to the setting of
10879<CODE>bell-style</CODE>).
10880<P>
10881
10882<A NAME="IDX481"></A>
10883<DT><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE>
10884<DD><A NAME="IDX482"></A>
10885If the metafied character <VAR>x</VAR> is lowercase, run the command
10886that is bound to the corresponding uppercase character.
10887<P>
10888
10889<A NAME="IDX483"></A>
10890<DT><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE>
10891<DD><A NAME="IDX484"></A>
10892Metafy the next character typed. This is for keyboards
10893without a meta key. Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing
10894<KBD>M-f</KBD>.
10895<P>
10896
10897<A NAME="IDX485"></A>
10898<DT><CODE>undo (C-_ or C-x C-u)</CODE>
10899<DD><A NAME="IDX486"></A>
10900Incremental undo, separately remembered for each line.
10901<P>
10902
10903<A NAME="IDX487"></A>
10904<DT><CODE>revert-line (M-r)</CODE>
10905<DD><A NAME="IDX488"></A>
10906Undo all changes made to this line. This is like executing the <CODE>undo</CODE>
10907command enough times to get back to the beginning.
10908<P>
10909
10910<A NAME="IDX489"></A>
10911<DT><CODE>tilde-expand (M-&#38;)</CODE>
10912<DD><A NAME="IDX490"></A>
10913Perform tilde expansion on the current word.
10914<P>
10915
10916<A NAME="IDX491"></A>
10917<DT><CODE>set-mark (C-@)</CODE>
10918<DD><A NAME="IDX492"></A>
10919Set the mark to the point. If a
10920numeric argument is supplied, the mark is set to that position.
10921<P>
10922
10923<A NAME="IDX493"></A>
10924<DT><CODE>exchange-point-and-mark (C-x C-x)</CODE>
10925<DD><A NAME="IDX494"></A>
10926Swap the point with the mark. The current cursor position is set to
10927the saved position, and the old cursor position is saved as the mark.
10928<P>
10929
10930<A NAME="IDX495"></A>
10931<DT><CODE>character-search (C-])</CODE>
10932<DD><A NAME="IDX496"></A>
10933A character is read and point is moved to the next occurrence of that
10934character. A negative count searches for previous occurrences.
10935<P>
10936
10937<A NAME="IDX497"></A>
10938<DT><CODE>character-search-backward (M-C-])</CODE>
10939<DD><A NAME="IDX498"></A>
10940A character is read and point is moved to the previous occurrence
10941of that character. A negative count searches for subsequent
10942occurrences.
10943<P>
10944
10945<A NAME="IDX499"></A>
10946<DT><CODE>insert-comment (M-#)</CODE>
10947<DD><A NAME="IDX500"></A>
10948Without a numeric argument, the value of the <CODE>comment-begin</CODE>
10949variable is inserted at the beginning of the current line.
10950If a numeric argument is supplied, this command acts as a toggle: if
10951the characters at the beginning of the line do not match the value
10952of <CODE>comment-begin</CODE>, the value is inserted, otherwise
10953the characters in <CODE>comment-begin</CODE> are deleted from the beginning of
10954the line.
10955In either case, the line is accepted as if a newline had been typed.
10956The default value of <CODE>comment-begin</CODE> causes this command
10957to make the current line a shell comment.
10958If a numeric argument causes the comment character to be removed, the line
10959will be executed by the shell.
10960<P>
10961
10962<A NAME="IDX501"></A>
10963<DT><CODE>dump-functions ()</CODE>
10964<DD><A NAME="IDX502"></A>
10965Print all of the functions and their key bindings to the
10966Readline output stream. If a numeric argument is supplied,
10967the output is formatted in such a way that it can be made part
10968of an <VAR>inputrc</VAR> file. This command is unbound by default.
10969<P>
10970
10971<A NAME="IDX503"></A>
10972<DT><CODE>dump-variables ()</CODE>
10973<DD><A NAME="IDX504"></A>
10974Print all of the settable variables and their values to the
10975Readline output stream. If a numeric argument is supplied,
10976the output is formatted in such a way that it can be made part
10977of an <VAR>inputrc</VAR> file. This command is unbound by default.
10978<P>
10979
10980<A NAME="IDX505"></A>
10981<DT><CODE>dump-macros ()</CODE>
10982<DD><A NAME="IDX506"></A>
10983Print all of the Readline key sequences bound to macros and the
10984strings they output. If a numeric argument is supplied,
10985the output is formatted in such a way that it can be made part
10986of an <VAR>inputrc</VAR> file. This command is unbound by default.
10987<P>
10988
10989<A NAME="IDX507"></A>
10990<DT><CODE>glob-complete-word (M-g)</CODE>
10991<DD><A NAME="IDX508"></A>
10992The word before point is treated as a pattern for pathname expansion,
10993with an asterisk implicitly appended. This pattern is used to
10994generate a list of matching file names for possible completions.
10995<P>
10996
10997<A NAME="IDX509"></A>
10998<DT><CODE>glob-expand-word (C-x *)</CODE>
10999<DD><A NAME="IDX510"></A>
11000The word before point is treated as a pattern for pathname expansion,
11001and the list of matching file names is inserted, replacing the word.
11002If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11003pathname expansion.
11004<P>
11005
11006<A NAME="IDX511"></A>
11007<DT><CODE>glob-list-expansions (C-x g)</CODE>
11008<DD><A NAME="IDX512"></A>
11009The list of expansions that would have been generated by
11010<CODE>glob-expand-word</CODE> is displayed, and the line is redrawn.
11011If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11012pathname expansion.
11013<P>
11014
11015<A NAME="IDX513"></A>
11016<DT><CODE>display-shell-version (C-x C-v)</CODE>
11017<DD><A NAME="IDX514"></A>
11018Display version information about the current instance of Bash.
11019<P>
11020
11021<A NAME="IDX515"></A>
11022<DT><CODE>shell-expand-line (M-C-e)</CODE>
11023<DD><A NAME="IDX516"></A>
11024Expand the line as the shell does.
11025This performs alias and history expansion as well as all of the shell
11026word expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
11027<P>
11028
11029<A NAME="IDX517"></A>
11030<DT><CODE>history-expand-line (M-^)</CODE>
11031<DD><A NAME="IDX518"></A>
11032Perform history expansion on the current line.
11033<P>
11034
11035<A NAME="IDX519"></A>
11036<DT><CODE>magic-space ()</CODE>
11037<DD><A NAME="IDX520"></A>
11038Perform history expansion on the current line and insert a space
11039(see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
11040<P>
11041
11042<A NAME="IDX521"></A>
11043<DT><CODE>alias-expand-line ()</CODE>
11044<DD><A NAME="IDX522"></A>
11045Perform alias expansion on the current line (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
11046<P>
11047
11048<A NAME="IDX523"></A>
11049<DT><CODE>history-and-alias-expand-line ()</CODE>
11050<DD><A NAME="IDX524"></A>
11051Perform history and alias expansion on the current line.
11052<P>
11053
11054<A NAME="IDX525"></A>
11055<DT><CODE>insert-last-argument (M-. or M-_)</CODE>
11056<DD><A NAME="IDX526"></A>
11057A synonym for <CODE>yank-last-arg</CODE>.
11058<P>
11059
11060<A NAME="IDX527"></A>
11061<DT><CODE>operate-and-get-next (C-o)</CODE>
11062<DD><A NAME="IDX528"></A>
11063Accept the current line for execution and fetch the next line
11064relative to the current line from the history for editing. Any
11065argument is ignored.
11066<P>
11067
11068<A NAME="IDX529"></A>
11069<DT><CODE>edit-and-execute-command (C-xC-e)</CODE>
11070<DD><A NAME="IDX530"></A>
11071Invoke an editor on the current command line, and execute the result as shell
11072commands.
11073Bash attempts to invoke
11074<CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE>
11075as the editor, in that order.
11076<P>
11077
11078</DL>
11079<P>
11080
11081<A NAME="Readline vi Mode"></A>
11082<HR SIZE="6">
11083<A NAME="SEC116"></A>
11084<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11085<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &lt; </A>]</TD>
11086<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt; </A>]</TD>
11087<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt;&lt; </A>]</TD>
11088<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11089<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
11090<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11091<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11092<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11093<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11094</TR></TABLE>
11095<H2> 8.5 Readline vi Mode </H2>
11096<!--docid::SEC116::-->
11097<P>
11098
11099While the Readline library does not have a full set of <CODE>vi</CODE>
11100editing functions, it does contain enough to allow simple editing
11101of the line. The Readline <CODE>vi</CODE> mode behaves as specified in
11102the POSIX 1003.2 standard.
11103</P><P>
11104
11105In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE>
11106editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP>
11107commands (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
11108The Readline default is <CODE>emacs</CODE> mode.
11109</P><P>
11110
11111When you enter a line in <CODE>vi</CODE> mode, you are already placed in
11112`insertion' mode, as if you had typed an <SAMP>`i'</SAMP>. Pressing <KBD>ESC</KBD>
11113switches you into `command' mode, where you can edit the text of the
11114line with the standard <CODE>vi</CODE> movement keys, move to previous
11115history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and
11116so forth.
11117</P><P>
11118
11119<A NAME="Programmable Completion"></A>
11120<HR SIZE="6">
11121<A NAME="SEC117"></A>
11122<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11123<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt; </A>]</TD>
11124<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &gt; </A>]</TD>
11125<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &lt;&lt; </A>]</TD>
11126<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11127<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
11128<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11129<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11130<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11131<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11132</TR></TABLE>
11133<H2> 8.6 Programmable Completion </H2>
11134<!--docid::SEC117::-->
11135<P>
11136
11137When word completion is attempted for an argument to a command for
11138which a completion specification (a <VAR>compspec</VAR>) has been defined
11139using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>),
11140the programmable completion facilities are invoked.
11141</P><P>
11142
11143First, the command name is identified.
11144If a compspec has been defined for that command, the
11145compspec is used to generate the list of possible completions for the word.
11146If the command word is a full pathname, a compspec for the full
11147pathname is searched for first.
11148If no compspec is found for the full pathname, an attempt is made to
11149find a compspec for the portion following the final slash.
11150</P><P>
11151
11152Once a compspec has been found, it is used to generate the list of
11153matching words.
11154If a compspec is not found, the default Bash completion
11155described above (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>) is performed.
11156</P><P>
11157
11158First, the actions specified by the compspec are used.
11159Only matches which are prefixed by the word being completed are
11160returned.
11161When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or
11162directory name completion, the shell variable <CODE>FIGNORE</CODE> is
11163used to filter the matches.
11164See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
11165</P><P>
11166
11167Any completions specified by a filename expansion pattern to the
11168<SAMP>`-G'</SAMP> option are generated next.
11169The words generated by the pattern need not match the word being completed.
11170The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches,
11171but the <CODE>FIGNORE</CODE> shell variable is used.
11172</P><P>
11173
11174Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option
11175is considered.
11176The string is first split using the characters in the <CODE>IFS</CODE>
11177special variable as delimiters.
11178Shell quoting is honored.
11179Each word is then expanded using
11180brace expansion, tilde expansion, parameter and variable expansion,
11181command substitution, and arithmetic expansion,
11182as described above (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
11183The results are split using the rules described above
11184(see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>).
11185The results of the expansion are prefix-matched against the word being
11186completed, and the matching words become the possible completions.
11187</P><P>
11188
11189After these matches have been generated, any shell function or command
11190specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked.
11191When the command or function is invoked, the <CODE>COMP_LINE</CODE>,
11192<CODE>COMP_POINT</CODE>, <CODE>COMP_KEY</CODE>, and <CODE>COMP_TYPE</CODE> variables are
11193assigned values as described above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
11194If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and
11195<CODE>COMP_CWORD</CODE> variables are also set.
11196When the function or command is invoked, the first argument is the
11197name of the command whose arguments are being completed, the
11198second argument is the word being completed, and the third argument
11199is the word preceding the word being completed on the current command line.
11200No filtering of the generated completions against the word being completed
11201is performed; the function or command has complete freedom in generating
11202the matches.
11203</P><P>
11204
11205Any function specified with <SAMP>`-F'</SAMP> is invoked first.
11206The function may use any of the shell facilities, including the
11207<CODE>compgen</CODE> and <CODE>compopt</CODE> builtins described below
11208(see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>), to generate the matches.
11209It must put the possible completions in the <CODE>COMPREPLY</CODE> array
11210variable.
11211</P><P>
11212
11213Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked
11214in an environment equivalent to command substitution.
11215It should print a list of completions, one per line, to
11216the standard output.
11217Backslash may be used to escape a newline, if necessary.
11218</P><P>
11219
11220After all of the possible completions are generated, any filter
11221specified with the <SAMP>`-X'</SAMP> option is applied to the list.
11222The filter is a pattern as used for pathname expansion; a <SAMP>`&#38;'</SAMP>
11223in the pattern is replaced with the text of the word being completed.
11224A literal <SAMP>`&#38;'</SAMP> may be escaped with a backslash; the backslash
11225is removed before attempting a match.
11226Any completion that matches the pattern will be removed from the list.
11227A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion
11228not matching the pattern will be removed.
11229</P><P>
11230
11231Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP>
11232options are added to each member of the completion list, and the result is
11233returned to the Readline completion code as the list of possible
11234completions.
11235</P><P>
11236
11237If the previously-applied actions do not generate any matches, and the
11238<SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the
11239compspec was defined, directory name completion is attempted.
11240</P><P>
11241
11242If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when
11243the compspec was defined, directory name completion is attempted and any
11244matches are added to the results of the other actions.
11245</P><P>
11246
11247By default, if a compspec is found, whatever it generates is returned to
11248the completion code as the full set of possible completions.
11249The default Bash completions are not attempted, and the Readline default
11250of filename completion is disabled.
11251If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when
11252the compspec was defined, the default Bash completions are attempted
11253if the compspec generates no matches.
11254If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the
11255compspec was defined, Readline's default completion will be performed
11256if the compspec (and, if attempted, the default Bash completions)
11257generate no matches.
11258</P><P>
11259
11260When a compspec indicates that directory name completion is desired,
11261the programmable completion functions force Readline to append a slash
11262to completed names which are symbolic links to directories, subject to
11263the value of the <VAR>mark-directories</VAR> Readline variable, regardless
11264of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable.
11265</P><P>
11266
11267<A NAME="Programmable Completion Builtins"></A>
11268<HR SIZE="6">
11269<A NAME="SEC118"></A>
11270<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11271<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt; </A>]</TD>
11272<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt; </A>]</TD>
11273<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt;&lt; </A>]</TD>
11274<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11275<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
11276<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11277<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11278<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11279<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11280</TR></TABLE>
11281<H2> 8.7 Programmable Completion Builtins </H2>
11282<!--docid::SEC118::-->
11283<P>
11284
11285Two builtin commands are available to manipulate the programmable completion
11286facilities.
11287</P><P>
11288
11289<DL COMPACT>
11290<DT><CODE>compgen</CODE>
11291<DD><A NAME="IDX531"></A>
11292<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE>
11293</pre></td></tr></table><P>
11294
11295Generate possible completion matches for <VAR>word</VAR> according to
11296the <VAR>option</VAR>s, which may be any option accepted by the
11297<CODE>complete</CODE>
11298builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write
11299the matches to the standard output.
11300When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables
11301set by the programmable completion facilities, while available, will not
11302have useful values.
11303</P><P>
11304
11305The matches will be generated in the same way as if the programmable
11306completion code had generated them directly from a completion specification
11307with the same flags.
11308If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR>
11309will be displayed.
11310</P><P>
11311
11312The return value is true unless an invalid option is supplied, or no
11313matches were generated.
11314</P><P>
11315
11316<DT><CODE>complete</CODE>
11317<DD><A NAME="IDX532"></A>
11318<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>complete [-abcdefgjksuv] [-o <VAR>comp-option</VAR>] [-E] [-A <VAR>action</VAR>] [-G <VAR>globpat</VAR>] [-W <VAR>wordlist</VAR>]
11319[-F <VAR>function</VAR>] [-C <VAR>command</VAR>] [-X <VAR>filterpat</VAR>]
11320[-P <VAR>prefix</VAR>] [-S <VAR>suffix</VAR>] <VAR>name</VAR> [<VAR>name</VAR> <small>...</small>]</CODE>
11321<CODE>complete -pr [-E] [<VAR>name</VAR> <small>...</small>]</CODE>
11322</pre></td></tr></table><P>
11323
11324Specify how arguments to each <VAR>name</VAR> should be completed.
11325If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing
11326completion specifications are printed in a way that allows them to be
11327reused as input.
11328The <SAMP>`-r'</SAMP> option removes a completion specification for
11329each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all
11330completion specifications.
11331The <SAMP>`-E'</SAMP> option indicates that the remaining options and actions should
11332apply to "empty" command completion; that is, completion attempted on a
11333blank line.
11334</P><P>
11335
11336The process of applying these completion specifications when word completion
11337is attempted is described above (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
11338</P><P>
11339
11340Other options, if specified, have the following meanings.
11341The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options
11342(and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options)
11343should be quoted to protect them from expansion before the
11344<CODE>complete</CODE> builtin is invoked.
11345</P><P>
11346
11347<DL COMPACT>
11348<DT><CODE>-o <VAR>comp-option</VAR></CODE>
11349<DD>The <VAR>comp-option</VAR> controls several aspects of the compspec's behavior
11350beyond the simple generation of completions.
11351<VAR>comp-option</VAR> may be one of:
11352<P>
11353
11354<DL COMPACT>
11355
11356<DT><CODE>bashdefault</CODE>
11357<DD>Perform the rest of the default Bash completions if the compspec
11358generates no matches.
11359<P>
11360
11361<DT><CODE>default</CODE>
11362<DD>Use Readline's default filename completion if the compspec generates
11363no matches.
11364<P>
11365
11366<DT><CODE>dirnames</CODE>
11367<DD>Perform directory name completion if the compspec generates no matches.
11368<P>
11369
11370<DT><CODE>filenames</CODE>
11371<DD>Tell Readline that the compspec generates filenames, so it can perform any
11372filename-specific processing (like adding a slash to directory names
11373quoting special characters, or suppressing trailing spaces).
11374This option is intended to be used with shell functions specified
11375with <SAMP>`-F'</SAMP>.
11376<P>
11377
11378<DT><CODE>nospace</CODE>
11379<DD>Tell Readline not to append a space (the default) to words completed at
11380the end of the line.
11381<P>
11382
11383<DT><CODE>plusdirs</CODE>
11384<DD>After any matches defined by the compspec are generated,
11385directory name completion is attempted and any
11386matches are added to the results of the other actions.
11387<P>
11388
11389</DL>
11390<P>
11391
11392<DT><CODE>-A <VAR>action</VAR></CODE>
11393<DD>The <VAR>action</VAR> may be one of the following to generate a list of possible
11394completions:
11395<P>
11396
11397<DL COMPACT>
11398<DT><CODE>alias</CODE>
11399<DD>Alias names. May also be specified as <SAMP>`-a'</SAMP>.
11400<P>
11401
11402<DT><CODE>arrayvar</CODE>
11403<DD>Array variable names.
11404<P>
11405
11406<DT><CODE>binding</CODE>
11407<DD>Readline key binding names (see section <A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A>).
11408<P>
11409
11410<DT><CODE>builtin</CODE>
11411<DD>Names of shell builtin commands. May also be specified as <SAMP>`-b'</SAMP>.
11412<P>
11413
11414<DT><CODE>command</CODE>
11415<DD>Command names. May also be specified as <SAMP>`-c'</SAMP>.
11416<P>
11417
11418<DT><CODE>directory</CODE>
11419<DD>Directory names. May also be specified as <SAMP>`-d'</SAMP>.
11420<P>
11421
11422<DT><CODE>disabled</CODE>
11423<DD>Names of disabled shell builtins.
11424<P>
11425
11426<DT><CODE>enabled</CODE>
11427<DD>Names of enabled shell builtins.
11428<P>
11429
11430<DT><CODE>export</CODE>
11431<DD>Names of exported shell variables. May also be specified as <SAMP>`-e'</SAMP>.
11432<P>
11433
11434<DT><CODE>file</CODE>
11435<DD>File names. May also be specified as <SAMP>`-f'</SAMP>.
11436<P>
11437
11438<DT><CODE>function</CODE>
11439<DD>Names of shell functions.
11440<P>
11441
11442<DT><CODE>group</CODE>
11443<DD>Group names. May also be specified as <SAMP>`-g'</SAMP>.
11444<P>
11445
11446<DT><CODE>helptopic</CODE>
11447<DD>Help topics as accepted by the <CODE>help</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
11448<P>
11449
11450<DT><CODE>hostname</CODE>
11451<DD>Hostnames, as taken from the file specified by the
11452<CODE>HOSTFILE</CODE> shell variable (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
11453<P>
11454
11455<DT><CODE>job</CODE>
11456<DD>Job names, if job control is active. May also be specified as <SAMP>`-j'</SAMP>.
11457<P>
11458
11459<DT><CODE>keyword</CODE>
11460<DD>Shell reserved words. May also be specified as <SAMP>`-k'</SAMP>.
11461<P>
11462
11463<DT><CODE>running</CODE>
11464<DD>Names of running jobs, if job control is active.
11465<P>
11466
11467<DT><CODE>service</CODE>
11468<DD>Service names. May also be specified as <SAMP>`-s'</SAMP>.
11469<P>
11470
11471<DT><CODE>setopt</CODE>
11472<DD>Valid arguments for the <SAMP>`-o'</SAMP> option to the <CODE>set</CODE> builtin
11473(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
11474<P>
11475
11476<DT><CODE>shopt</CODE>
11477<DD>Shell option names as accepted by the <CODE>shopt</CODE> builtin
11478(see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
11479<P>
11480
11481<DT><CODE>signal</CODE>
11482<DD>Signal names.
11483<P>
11484
11485<DT><CODE>stopped</CODE>
11486<DD>Names of stopped jobs, if job control is active.
11487<P>
11488
11489<DT><CODE>user</CODE>
11490<DD>User names. May also be specified as <SAMP>`-u'</SAMP>.
11491<P>
11492
11493<DT><CODE>variable</CODE>
11494<DD>Names of all shell variables. May also be specified as <SAMP>`-v'</SAMP>.
11495</DL>
11496<P>
11497
11498<DT><CODE>-G <VAR>globpat</VAR></CODE>
11499<DD>The filename expansion pattern <VAR>globpat</VAR> is expanded to generate
11500the possible completions.
11501<P>
11502
11503<DT><CODE>-W <VAR>wordlist</VAR></CODE>
11504<DD>The <VAR>wordlist</VAR> is split using the characters in the
11505<CODE>IFS</CODE> special variable as delimiters, and each resultant word
11506is expanded.
11507The possible completions are the members of the resultant list which
11508match the word being completed.
11509<P>
11510
11511<DT><CODE>-C <VAR>command</VAR></CODE>
11512<DD><VAR>command</VAR> is executed in a subshell environment, and its output is
11513used as the possible completions.
11514<P>
11515
11516<DT><CODE>-F <VAR>function</VAR></CODE>
11517<DD>The shell function <VAR>function</VAR> is executed in the current shell
11518environment.
11519When it finishes, the possible completions are retrieved from the value
11520of the <CODE>COMPREPLY</CODE> array variable.
11521<P>
11522
11523<DT><CODE>-X <VAR>filterpat</VAR></CODE>
11524<DD><VAR>filterpat</VAR> is a pattern as used for filename expansion.
11525It is applied to the list of possible completions generated by the
11526preceding options and arguments, and each completion matching
11527<VAR>filterpat</VAR> is removed from the list.
11528A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this
11529case, any completion not matching <VAR>filterpat</VAR> is removed.
11530<P>
11531
11532<DT><CODE>-P <VAR>prefix</VAR></CODE>
11533<DD><VAR>prefix</VAR> is added at the beginning of each possible completion
11534after all other options have been applied.
11535<P>
11536
11537<DT><CODE>-S <VAR>suffix</VAR></CODE>
11538<DD><VAR>suffix</VAR> is appended to each possible completion
11539after all other options have been applied.
11540</DL>
11541<P>
11542
11543The return value is true unless an invalid option is supplied, an option
11544other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR>
11545argument, an attempt is made to remove a completion specification for
11546a <VAR>name</VAR> for which no specification exists, or
11547an error occurs adding a completion specification.
11548</P><P>
11549
11550<DT><CODE>compopt</CODE>
11551<DD><A NAME="IDX533"></A>
11552<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>compopt</CODE> [-o <VAR>option</VAR>] [+o <VAR>option</VAR>] [<VAR>name</VAR>]
11553</pre></td></tr></table>Modify completion options for each <VAR>name</VAR> according to the
11554<VAR>option</VAR>s, or for the currently-execution completion if no <VAR>name</VAR>s
11555are supplied.
11556If no <VAR>option</VAR>s are given, display the completion options for each
11557<VAR>name</VAR> or the current completion.
11558The possible values of <VAR>option</VAR> are those valid for the <CODE>complete</CODE>
11559builtin described above.
11560<P>
11561
11562The return value is true unless an invalid option is supplied, an attempt
11563is made to modify the options for a <VAR>name</VAR> for which no completion
11564specification exists, or an output error occurs.
11565</P><P>
11566
11567</DL>
11568<P>
11569
11570<A NAME="IDX534"></A>
11571</P><P>
11572
11573<A NAME="Using History Interactively"></A>
11574<HR SIZE="6">
11575<A NAME="SEC119"></A>
11576<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11577<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &lt; </A>]</TD>
11578<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> &gt; </A>]</TD>
11579<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
11580<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
11581<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11582<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11583<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11584<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11585<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11586</TR></TABLE>
11587<H1> 9. Using History Interactively </H1>
11588<!--docid::SEC119::-->
11589<P>
11590
11591This chapter describes how to use the GNU History Library
11592interactively, from a user's standpoint.
11593It should be considered a user's guide.
11594For information on using the GNU History Library in other programs,
11595see the GNU Readline Library Manual.
11596</P><P>
11597
11598<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
11599<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash lets you manipulate your command
11600 history.</TD></TR>
11601<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The Bash builtin commands that manipulate
11602 the command history.</TD></TR>
11603<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR>
11604</TABLE></BLOCKQUOTE>
11605<P>
11606
11607<A NAME="Bash History Facilities"></A>
11608<HR SIZE="6">
11609<A NAME="SEC120"></A>
11610<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11611<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &lt; </A>]</TD>
11612<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt; </A>]</TD>
11613<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
11614<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
11615<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11616<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11617<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11618<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11619<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11620</TR></TABLE>
11621<H2> 9.1 Bash History Facilities </H2>
11622<!--docid::SEC120::-->
11623<P>
11624
11625When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin
11626is enabled (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>),
11627the shell provides access to the <EM>command history</EM>,
11628the list of commands previously typed.
11629The value of the <CODE>HISTSIZE</CODE> shell variable is used as the
11630number of commands to save in a history list.
11631The text of the last <CODE>$HISTSIZE</CODE>
11632commands (default 500) is saved.
11633The shell stores each command in the history list prior to
11634parameter and variable expansion
11635but after history expansion is performed, subject to the
11636values of the shell variables
11637<CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>.
11638</P><P>
11639
11640When the shell starts up, the history is initialized from the
11641file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>).
11642The file named by the value of <CODE>HISTFILE</CODE> is truncated, if
11643necessary, to contain no more than the number of lines specified by
11644the value of the <CODE>HISTFILESIZE</CODE> variable.
11645When an interactive shell exits, the last
11646<CODE>$HISTSIZE</CODE> lines are copied from the history list to the file
11647named by <CODE>$HISTFILE</CODE>.
11648If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>),
11649the lines are appended to the history file,
11650otherwise the history file is overwritten.
11651If <CODE>HISTFILE</CODE>
11652is unset, or if the history file is unwritable, the history is
11653not saved. After saving the history, the history file is truncated
11654to contain no more than <CODE>$HISTFILESIZE</CODE>
11655lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed.
11656</P><P>
11657
11658If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information
11659associated with each history entry is written to the history file,
11660marked with the history comment character.
11661When the history file is read, lines beginning with the history
11662comment character followed immediately by a digit are interpreted
11663as timestamps for the previous history line.
11664</P><P>
11665
11666The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute
11667a portion of the history list.
11668The <CODE>history</CODE> builtin may be used to display or modify the history
11669list and manipulate the history file.
11670When using command-line editing, search commands
11671are available in each editing mode that provide access to the
11672history list (see section <A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>).
11673</P><P>
11674
11675The shell allows control over which commands are saved on the history
11676list. The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE>
11677variables may be set to cause the shell to save only a subset of the
11678commands entered.
11679The <CODE>cmdhist</CODE>
11680shell option, if enabled, causes the shell to attempt to save each
11681line of a multi-line command in the same history entry, adding
11682semicolons where necessary to preserve syntactic correctness.
11683The <CODE>lithist</CODE>
11684shell option causes the shell to save the command with embedded newlines
11685instead of semicolons.
11686The <CODE>shopt</CODE> builtin is used to set these options.
11687See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>.
11688</P><P>
11689
11690<A NAME="Bash History Builtins"></A>
11691<HR SIZE="6">
11692<A NAME="SEC121"></A>
11693<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11694<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> &lt; </A>]</TD>
11695<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &gt; </A>]</TD>
11696<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &lt;&lt; </A>]</TD>
11697<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
11698<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11699<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11700<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11701<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11702<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11703</TR></TABLE>
11704<H2> 9.2 Bash History Builtins </H2>
11705<!--docid::SEC121::-->
11706<P>
11707
11708Bash provides two builtin commands which manipulate the
11709history list and history file.
11710</P><P>
11711
11712<DL COMPACT>
11713
11714<DT><CODE>fc</CODE>
11715<DD><A NAME="IDX535"></A>
11716<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>fc [-e <VAR>ename</VAR>] [-lnr] [<VAR>first</VAR>] [<VAR>last</VAR>]</CODE>
11717<CODE>fc -s [<VAR>pat</VAR>=<VAR>rep</VAR>] [<VAR>command</VAR>]</CODE>
11718</pre></td></tr></table><P>
11719
11720Fix Command. In the first form, a range of commands from <VAR>first</VAR> to
11721<VAR>last</VAR> is selected from the history list. Both <VAR>first</VAR> and
11722<VAR>last</VAR> may be specified as a string (to locate the most recent
11723command beginning with that string) or as a number (an index into the
11724history list, where a negative number is used as an offset from the
11725current command number). If <VAR>last</VAR> is not specified it is set to
11726<VAR>first</VAR>. If <VAR>first</VAR> is not specified it is set to the previous
11727command for editing and -16 for listing. If the <SAMP>`-l'</SAMP> flag is
11728given, the commands are listed on standard output. The <SAMP>`-n'</SAMP> flag
11729suppresses the command numbers when listing. The <SAMP>`-r'</SAMP> flag
11730reverses the order of the listing. Otherwise, the editor given by
11731<VAR>ename</VAR> is invoked on a file containing those commands. If
11732<VAR>ename</VAR> is not given, the value of the following variable expansion
11733is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>. This says to use the
11734value of the <CODE>FCEDIT</CODE> variable if set, or the value of the
11735<CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set.
11736When editing is complete, the edited commands are echoed and executed.
11737</P><P>
11738
11739In the second form, <VAR>command</VAR> is re-executed after each instance
11740of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>.
11741</P><P>
11742
11743A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so
11744that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE>
11745and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
11746</P><P>
11747
11748<DT><CODE>history</CODE>
11749<DD><A NAME="IDX536"></A>
11750<TABLE><tr><td>&nbsp;</td><td class=example><pre>history [<VAR>n</VAR>]
11751history -c
11752history -d <VAR>offset</VAR>
11753history [-anrw] [<VAR>filename</VAR>]
11754history -ps <VAR>arg</VAR>
11755</pre></td></tr></table><P>
11756
11757With no options, display the history list with line numbers.
11758Lines prefixed with a <SAMP>`*'</SAMP> have been modified.
11759An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines.
11760If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null,
11761it is used as a format string for <VAR>strftime</VAR> to display
11762the time stamp associated with each displayed history entry.
11763No intervening blank is printed between the formatted time stamp
11764and the history line.
11765</P><P>
11766
11767Options, if supplied, have the following meanings:
11768</P><P>
11769
11770<DL COMPACT>
11771<DT><CODE>-c</CODE>
11772<DD>Clear the history list. This may be combined
11773with the other options to replace the history list completely.
11774<P>
11775
11776<DT><CODE>-d <VAR>offset</VAR></CODE>
11777<DD>Delete the history entry at position <VAR>offset</VAR>.
11778<VAR>offset</VAR> should be specified as it appears when the history is
11779displayed.
11780<P>
11781
11782<DT><CODE>-a</CODE>
11783<DD>Append the new
11784history lines (history lines entered since the beginning of the
11785current Bash session) to the history file.
11786<P>
11787
11788<DT><CODE>-n</CODE>
11789<DD>Append the history lines not already read from the history file
11790to the current history list. These are lines appended to the history
11791file since the beginning of the current Bash session.
11792<P>
11793
11794<DT><CODE>-r</CODE>
11795<DD>Read the current history file and append its contents to
11796the history list.
11797<P>
11798
11799<DT><CODE>-w</CODE>
11800<DD>Write out the current history to the history file.
11801<P>
11802
11803<DT><CODE>-p</CODE>
11804<DD>Perform history substitution on the <VAR>arg</VAR>s and display the result
11805on the standard output, without storing the results in the history list.
11806<P>
11807
11808<DT><CODE>-s</CODE>
11809<DD>The <VAR>arg</VAR>s are added to the end of
11810the history list as a single entry.
11811<P>
11812
11813</DL>
11814<P>
11815
11816When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is
11817used, if <VAR>filename</VAR>
11818is given, then it is used as the history file. If not, then
11819the value of the <CODE>HISTFILE</CODE> variable is used.
11820</P><P>
11821
11822</DL>
11823<P>
11824
11825<A NAME="History Interaction"></A>
11826<HR SIZE="6">
11827<A NAME="SEC122"></A>
11828<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11829<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &lt; </A>]</TD>
11830<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> &gt; </A>]</TD>
11831<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
11832<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
11833<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11834<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11835<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11836<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11837<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11838</TR></TABLE>
11839<H2> 9.3 History Expansion </H2>
11840<!--docid::SEC122::-->
11841<P>
11842
11843The History library provides a history expansion feature that is similar
11844to the history expansion provided by <CODE>csh</CODE>. This section
11845describes the syntax used to manipulate the history information.
11846</P><P>
11847
11848History expansions introduce words from the history list into
11849the input stream, making it easy to repeat commands, insert the
11850arguments to a previous command into the current input line, or
11851fix errors in previous commands quickly.
11852</P><P>
11853
11854History expansion takes place in two parts. The first is to determine
11855which line from the history list should be used during substitution.
11856The second is to select portions of that line for inclusion into the
11857current one. The line selected from the history is called the
11858<EM>event</EM>, and the portions of that line that are acted upon are
11859called <EM>words</EM>. Various <EM>modifiers</EM> are available to manipulate
11860the selected words. The line is broken into words in the same fashion
11861that Bash does, so that several words
11862surrounded by quotes are considered one word.
11863History expansions are introduced by the appearance of the
11864history expansion character, which is <SAMP>`!'</SAMP> by default.
11865Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion
11866character.
11867</P><P>
11868
11869Several shell options settable with the <CODE>shopt</CODE>
11870builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) may be used to tailor
11871the behavior of history expansion. If the
11872<CODE>histverify</CODE> shell option is enabled, and Readline
11873is being used, history substitutions are not immediately passed to
11874the shell parser.
11875Instead, the expanded line is reloaded into the Readline
11876editing buffer for further modification.
11877If Readline is being used, and the <CODE>histreedit</CODE>
11878shell option is enabled, a failed history expansion will be
11879reloaded into the Readline editing buffer for correction.
11880The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command
11881may be used to see what a history expansion will do before using it.
11882The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to
11883add commands to the end of the history list without actually executing
11884them, so that they are available for subsequent recall.
11885This is most useful in conjunction with Readline.
11886</P><P>
11887
11888The shell allows control of the various characters used by the
11889history expansion mechanism with the <CODE>histchars</CODE> variable,
11890as explained above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). The shell uses
11891the history comment character to mark history timestamps when
11892writing the history file.
11893</P><P>
11894
11895<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
11896<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR>
11897<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">9.3.2 Word Designators</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR>
11898<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">9.3.3 Modifiers</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR>
11899</TABLE></BLOCKQUOTE>
11900<P>
11901
11902<A NAME="Event Designators"></A>
11903<HR SIZE="6">
11904<A NAME="SEC123"></A>
11905<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11906<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &lt; </A>]</TD>
11907<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> &gt; </A>]</TD>
11908<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
11909<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
11910<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11911<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11912<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11913<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11914<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11915</TR></TABLE>
11916<H3> 9.3.1 Event Designators </H3>
11917<!--docid::SEC123::-->
11918<P>
11919
11920An event designator is a reference to a command line entry in the
11921history list.
11922<A NAME="IDX537"></A>
11923</P><P>
11924
11925<DL COMPACT>
11926
11927<DT><CODE>!</CODE>
11928<DD>Start a history substitution, except when followed by a space, tab,
11929the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the
11930<CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin).
11931<P>
11932
11933<DT><CODE>!<VAR>n</VAR></CODE>
11934<DD>Refer to command line <VAR>n</VAR>.
11935<P>
11936
11937<DT><CODE>!-<VAR>n</VAR></CODE>
11938<DD>Refer to the command <VAR>n</VAR> lines back.
11939<P>
11940
11941<DT><CODE>!!</CODE>
11942<DD>Refer to the previous command. This is a synonym for <SAMP>`!-1'</SAMP>.
11943<P>
11944
11945<DT><CODE>!<VAR>string</VAR></CODE>
11946<DD>Refer to the most recent command starting with <VAR>string</VAR>.
11947<P>
11948
11949<DT><CODE>!?<VAR>string</VAR>[?]</CODE>
11950<DD>Refer to the most recent command containing <VAR>string</VAR>. The trailing
11951<SAMP>`?'</SAMP> may be omitted if the <VAR>string</VAR> is followed immediately by
11952a newline.
11953<P>
11954
11955<DT><CODE>^<VAR>string1</VAR>^<VAR>string2</VAR>^</CODE>
11956<DD>Quick Substitution. Repeat the last command, replacing <VAR>string1</VAR>
11957with <VAR>string2</VAR>. Equivalent to
11958<CODE>!!:s/<VAR>string1</VAR>/<VAR>string2</VAR>/</CODE>.
11959<P>
11960
11961<DT><CODE>!#</CODE>
11962<DD>The entire command line typed so far.
11963<P>
11964
11965</DL>
11966<P>
11967
11968<A NAME="Word Designators"></A>
11969<HR SIZE="6">
11970<A NAME="SEC124"></A>
11971<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11972<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> &lt; </A>]</TD>
11973<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &gt; </A>]</TD>
11974<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &lt;&lt; </A>]</TD>
11975<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
11976<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11977<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11978<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11979<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11980<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11981</TR></TABLE>
11982<H3> 9.3.2 Word Designators </H3>
11983<!--docid::SEC124::-->
11984<P>
11985
11986Word designators are used to select desired words from the event.
11987A <SAMP>`:'</SAMP> separates the event specification from the word designator. It
11988may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>,
11989<SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>. Words are numbered from the beginning
11990of the line, with the first word being denoted by 0 (zero). Words are
11991inserted into the current line separated by single spaces.
11992</P><P>
11993
11994For example,
11995</P><P>
11996
11997<DL COMPACT>
11998<DT><CODE>!!</CODE>
11999<DD>designates the preceding command. When you type this, the preceding
12000command is repeated in toto.
12001<P>
12002
12003<DT><CODE>!!:$</CODE>
12004<DD>designates the last argument of the preceding command. This may be
12005shortened to <CODE>!$</CODE>.
12006<P>
12007
12008<DT><CODE>!fi:2</CODE>
12009<DD>designates the second argument of the most recent command starting with
12010the letters <CODE>fi</CODE>.
12011</DL>
12012<P>
12013
12014Here are the word designators:
12015
12016<DL COMPACT>
12017
12018<DT><CODE>0 (zero)</CODE>
12019<DD>The <CODE>0</CODE>th word. For many applications, this is the command word.
12020<P>
12021
12022<DT><CODE><VAR>n</VAR></CODE>
12023<DD>The <VAR>n</VAR>th word.
12024<P>
12025
12026<DT><CODE>^</CODE>
12027<DD>The first argument; that is, word 1.
12028<P>
12029
12030<DT><CODE>$</CODE>
12031<DD>The last argument.
12032<P>
12033
12034<DT><CODE>%</CODE>
12035<DD>The word matched by the most recent <SAMP>`?<VAR>string</VAR>?'</SAMP> search.
12036<P>
12037
12038<DT><CODE><VAR>x</VAR>-<VAR>y</VAR></CODE>
12039<DD>A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>.
12040<P>
12041
12042<DT><CODE>*</CODE>
12043<DD>All of the words, except the <CODE>0</CODE>th. This is a synonym for <SAMP>`1-$'</SAMP>.
12044It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event;
12045the empty string is returned in that case.
12046<P>
12047
12048<DT><CODE><VAR>x</VAR>*</CODE>
12049<DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP>
12050<P>
12051
12052<DT><CODE><VAR>x</VAR>-</CODE>
12053<DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omits the last word.
12054<P>
12055
12056</DL>
12057<P>
12058
12059If a word designator is supplied without an event specification, the
12060previous command is used as the event.
12061</P><P>
12062
12063<A NAME="Modifiers"></A>
12064<HR SIZE="6">
12065<A NAME="SEC125"></A>
12066<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12067<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> &lt; </A>]</TD>
12068<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt; </A>]</TD>
12069<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
12070<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
12071<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
12072<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12073<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12074<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12075<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12076</TR></TABLE>
12077<H3> 9.3.3 Modifiers </H3>
12078<!--docid::SEC125::-->
12079<P>
12080
12081After the optional word designator, you can add a sequence of one or more
12082of the following modifiers, each preceded by a <SAMP>`:'</SAMP>.
12083</P><P>
12084
12085<DL COMPACT>
12086
12087<DT><CODE>h</CODE>
12088<DD>Remove a trailing pathname component, leaving only the head.
12089<P>
12090
12091<DT><CODE>t</CODE>
12092<DD>Remove all leading pathname components, leaving the tail.
12093<P>
12094
12095<DT><CODE>r</CODE>
12096<DD>Remove a trailing suffix of the form <SAMP>`.<VAR>suffix</VAR>'</SAMP>, leaving
12097the basename.
12098<P>
12099
12100<DT><CODE>e</CODE>
12101<DD>Remove all but the trailing suffix.
12102<P>
12103
12104<DT><CODE>p</CODE>
12105<DD>Print the new command but do not execute it.
12106<P>
12107
12108<DT><CODE>q</CODE>
12109<DD>Quote the substituted words, escaping further substitutions.
12110<P>
12111
12112<DT><CODE>x</CODE>
12113<DD>Quote the substituted words as with <SAMP>`q'</SAMP>,
12114but break into words at spaces, tabs, and newlines.
12115<P>
12116
12117<DT><CODE>s/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>
12118<DD>Substitute <VAR>new</VAR> for the first occurrence of <VAR>old</VAR> in the
12119event line. Any delimiter may be used in place of <SAMP>`/'</SAMP>.
12120The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR>
12121with a single backslash. If <SAMP>`&#38;'</SAMP> appears in <VAR>new</VAR>,
12122it is replaced by <VAR>old</VAR>. A single backslash will quote
12123the <SAMP>`&#38;'</SAMP>. The final delimiter is optional if it is the last
12124character on the input line.
12125<P>
12126
12127<DT><CODE>&#38;</CODE>
12128<DD>Repeat the previous substitution.
12129<P>
12130
12131<DT><CODE>g</CODE>
12132<DD><DT><CODE>a</CODE>
12133<DD>Cause changes to be applied over the entire event line. Used in
12134conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>,
12135or with <SAMP>`&#38;'</SAMP>.
12136<P>
12137
12138<DT><CODE>G</CODE>
12139<DD>Apply the following <SAMP>`s'</SAMP> modifier once to each word in the event.
12140<P>
12141
12142</DL>
12143<P>
12144
12145<A NAME="Installing Bash"></A>
12146<HR SIZE="6">
12147<A NAME="SEC126"></A>
12148<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12149<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &lt; </A>]</TD>
12150<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> &gt; </A>]</TD>
12151<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &lt;&lt; </A>]</TD>
12152<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12153<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12154<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12155<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12156<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12157<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12158</TR></TABLE>
12159<H1> 10. Installing Bash </H1>
12160<!--docid::SEC126::-->
12161<P>
12162
12163This chapter provides basic instructions for installing Bash on
12164the various supported platforms. The distribution supports the
12165GNU operating systems, nearly every version of Unix, and several
12166non-Unix systems such as BeOS and Interix.
12167Other independent ports exist for
12168MS-DOS, OS/2, and Windows platforms.
12169</P><P>
12170
12171<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12172<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR>
12173<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10.2 Compilers and Options</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various
12174 systems.</TD></TR>
12175<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC129">10.3 Compiling For Multiple Architectures</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to compile Bash for more
12176 than one kind of system from
12177 the same source tree.</TD></TR>
12178<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.4 Installation Names</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to set the various paths used by the installation.</TD></TR>
12179<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC131">10.5 Specifying the System Type</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to configure Bash for a particular system.</TD></TR>
12180<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC132">10.6 Sharing Defaults</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU
12181 programs.</TD></TR>
12182<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC133">10.7 Operation Controls</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR>
12183<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC134">10.8 Optional Features</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when
12184 building Bash.</TD></TR>
12185</TABLE></BLOCKQUOTE>
12186<P>
12187
12188<A NAME="Basic Installation"></A>
12189<HR SIZE="6">
12190<A NAME="SEC127"></A>
12191<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12192<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt; </A>]</TD>
12193<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt; </A>]</TD>
12194<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt;&lt; </A>]</TD>
12195<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12196<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12197<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12198<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12199<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12200<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12201</TR></TABLE>
12202<H2> 10.1 Basic Installation </H2>
12203<!--docid::SEC127::-->
12204<P>
12205
12206These are installation instructions for Bash.
12207</P><P>
12208
12209The simplest way to compile Bash is:
12210</P><P>
12211
12212<OL>
12213<LI>
12214<CODE>cd</CODE> to the directory containing the source code and type
12215<SAMP>`./configure'</SAMP> to configure Bash for your system. If you're
12216using <CODE>csh</CODE> on an old version of System V, you might need to
12217type <SAMP>`sh ./configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying
12218to execute <CODE>configure</CODE> itself.
12219<P>
12220
12221Running <CODE>configure</CODE> takes some time.
12222While running, it prints messages telling which features it is
12223checking for.
12224</P><P>
12225
12226<LI>
12227Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug
12228reporting script.
12229<P>
12230
12231<LI>
12232Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite.
12233<P>
12234
12235<LI>
12236Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>.
12237This will also install the manual pages and Info file.
12238<P>
12239
12240</OL>
12241<P>
12242
12243The <CODE>configure</CODE> shell script attempts to guess correct
12244values for various system-dependent variables used during
12245compilation. It uses those values to create a <TT>`Makefile'</TT> in
12246each directory of the package (the top directory, the
12247<TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories,
12248each directory under <TT>`lib'</TT>, and several others). It also creates a
12249<TT>`config.h'</TT> file containing system-dependent definitions.
12250Finally, it creates a shell script named <CODE>config.status</CODE> that you
12251can run in the future to recreate the current configuration, a
12252file <TT>`config.cache'</TT> that saves the results of its tests to
12253speed up reconfiguring, and a file <TT>`config.log'</TT> containing
12254compiler output (useful mainly for debugging <CODE>configure</CODE>).
12255If at some point
12256<TT>`config.cache'</TT> contains results you don't want to keep, you
12257may remove or edit it.
12258</P><P>
12259
12260To find out more about the options and arguments that the
12261<CODE>configure</CODE> script understands, type
12262</P><P>
12263
12264<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash-2.04$ ./configure --help
12265</pre></td></tr></table></P><P>
12266
12267at the Bash prompt in your Bash source directory.
12268</P><P>
12269
12270If you need to do unusual things to compile Bash, please
12271try to figure out how <CODE>configure</CODE> could check whether or not
12272to do them, and mail diffs or instructions to
12273<A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be
12274considered for the next release.
12275</P><P>
12276
12277The file <TT>`configure.in'</TT> is used to create <CODE>configure</CODE>
12278by a program called Autoconf. You only need
12279<TT>`configure.in'</TT> if you want to change it or regenerate
12280<CODE>configure</CODE> using a newer version of Autoconf. If
12281you do this, make sure you are using Autoconf version 2.50 or
12282newer.
12283</P><P>
12284
12285You can remove the program binaries and object files from the
12286source code directory by typing <SAMP>`make clean'</SAMP>. To also remove the
12287files that <CODE>configure</CODE> created (so you can compile Bash for
12288a different kind of computer), type <SAMP>`make distclean'</SAMP>.
12289</P><P>
12290
12291<A NAME="Compilers and Options"></A>
12292<HR SIZE="6">
12293<A NAME="SEC128"></A>
12294<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12295<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> &lt; </A>]</TD>
12296<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &gt; </A>]</TD>
12297<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &lt;&lt; </A>]</TD>
12298<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12299<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12300<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12301<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12302<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12303<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12304</TR></TABLE>
12305<H2> 10.2 Compilers and Options </H2>
12306<!--docid::SEC128::-->
12307<P>
12308
12309Some systems require unusual options for compilation or linking
12310that the <CODE>configure</CODE> script does not know about. You can
12311give <CODE>configure</CODE> initial values for variables by setting
12312them in the environment. Using a Bourne-compatible shell, you
12313can do that on the command line like this:
12314</P><P>
12315
12316<TABLE><tr><td>&nbsp;</td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
12317</pre></td></tr></table></P><P>
12318
12319On systems that have the <CODE>env</CODE> program, you can do it like this:
12320</P><P>
12321
12322<TABLE><tr><td>&nbsp;</td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
12323</pre></td></tr></table></P><P>
12324
12325The configuration process uses GCC to build Bash if it
12326is available.
12327</P><P>
12328
12329<A NAME="Compiling For Multiple Architectures"></A>
12330<HR SIZE="6">
12331<A NAME="SEC129"></A>
12332<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12333<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &lt; </A>]</TD>
12334<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &gt; </A>]</TD>
12335<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &lt;&lt; </A>]</TD>
12336<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12337<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12338<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12339<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12340<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12341<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12342</TR></TABLE>
12343<H2> 10.3 Compiling For Multiple Architectures </H2>
12344<!--docid::SEC129::-->
12345<P>
12346
12347You can compile Bash for more than one kind of computer at the
12348same time, by placing the object files for each architecture in their
12349own directory. To do this, you must use a version of <CODE>make</CODE> that
12350supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>.
12351<CODE>cd</CODE> to the
12352directory where you want the object files and executables to go and run
12353the <CODE>configure</CODE> script from the source directory. You may need to
12354supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the
12355source files are. <CODE>configure</CODE> automatically checks for the
12356source code in the directory that <CODE>configure</CODE> is in and in `..'.
12357</P><P>
12358
12359If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE>
12360variable, you can compile Bash for one architecture at a
12361time in the source code directory. After you have installed
12362Bash for one architecture, use <SAMP>`make distclean'</SAMP> before
12363reconfiguring for another architecture.
12364</P><P>
12365
12366Alternatively, if your system supports symbolic links, you can use the
12367<TT>`support/mkclone'</TT> script to create a build tree which has
12368symbolic links back to each file in the source directory. Here's an
12369example that creates a build directory in the current directory from a
12370source directory <TT>`/usr/gnu/src/bash-2.0'</TT>:
12371</P><P>
12372
12373<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
12374</pre></td></tr></table></P><P>
12375
12376The <CODE>mkclone</CODE> script requires Bash, so you must have already built
12377Bash for at least one architecture before you can create build
12378directories for other architectures.
12379</P><P>
12380
12381<A NAME="Installation Names"></A>
12382<HR SIZE="6">
12383<A NAME="SEC130"></A>
12384<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12385<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &lt; </A>]</TD>
12386<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &gt; </A>]</TD>
12387<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &lt;&lt; </A>]</TD>
12388<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12389<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12390<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12391<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12392<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12393<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12394</TR></TABLE>
12395<H2> 10.4 Installation Names </H2>
12396<!--docid::SEC130::-->
12397<P>
12398
12399By default, <SAMP>`make install'</SAMP> will install into
12400<TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc. You can
12401specify an installation prefix other than <TT>`/usr/local'</TT> by
12402giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>,
12403or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP>
12404variable when running <SAMP>`make install'</SAMP>.
12405</P><P>
12406
12407You can specify separate installation prefixes for
12408architecture-specific files and architecture-independent files.
12409If you give <CODE>configure</CODE> the option
12410<SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use
12411<VAR>PATH</VAR> as the prefix for installing programs and libraries.
12412Documentation and other data files will still use the regular prefix.
12413</P><P>
12414
12415<A NAME="Specifying the System Type"></A>
12416<HR SIZE="6">
12417<A NAME="SEC131"></A>
12418<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12419<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &lt; </A>]</TD>
12420<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &gt; </A>]</TD>
12421<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &lt;&lt; </A>]</TD>
12422<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12423<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12424<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12425<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12426<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12427<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12428</TR></TABLE>
12429<H2> 10.5 Specifying the System Type </H2>
12430<!--docid::SEC131::-->
12431<P>
12432
12433There may be some features <CODE>configure</CODE> can not figure out
12434automatically, but need to determine by the type of host Bash
12435will run on. Usually <CODE>configure</CODE> can figure that
12436out, but if it prints a message saying it can not guess the host
12437type, give it the <SAMP>`--host=TYPE'</SAMP> option. <SAMP>`TYPE'</SAMP> can
12438either be a short name for the system type, such as <SAMP>`sun4'</SAMP>,
12439or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP>
12440(e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>).
12441</P><P>
12442
12443See the file <TT>`support/config.sub'</TT> for the possible
12444values of each field.
12445</P><P>
12446
12447<A NAME="Sharing Defaults"></A>
12448<HR SIZE="6">
12449<A NAME="SEC132"></A>
12450<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12451<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &lt; </A>]</TD>
12452<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &gt; </A>]</TD>
12453<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &lt;&lt; </A>]</TD>
12454<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12455<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12456<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12457<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12458<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12459<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12460</TR></TABLE>
12461<H2> 10.6 Sharing Defaults </H2>
12462<!--docid::SEC132::-->
12463<P>
12464
12465If you want to set default values for <CODE>configure</CODE> scripts to
12466share, you can create a site shell script called
12467<CODE>config.site</CODE> that gives default values for variables like
12468<CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>. <CODE>configure</CODE>
12469looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then
12470<TT>`PREFIX/etc/config.site'</TT> if it exists. Or, you can set the
12471<CODE>CONFIG_SITE</CODE> environment variable to the location of the site
12472script. A warning: the Bash <CODE>configure</CODE> looks for a site script,
12473but not all <CODE>configure</CODE> scripts do.
12474</P><P>
12475
12476<A NAME="Operation Controls"></A>
12477<HR SIZE="6">
12478<A NAME="SEC133"></A>
12479<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12480<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &lt; </A>]</TD>
12481<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &gt; </A>]</TD>
12482<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &lt;&lt; </A>]</TD>
12483<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12484<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12485<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12486<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12487<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12488<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12489</TR></TABLE>
12490<H2> 10.7 Operation Controls </H2>
12491<!--docid::SEC133::-->
12492<P>
12493
12494<CODE>configure</CODE> recognizes the following options to control how it
12495operates.
12496</P><P>
12497
12498<DL COMPACT>
12499
12500<DT><CODE>--cache-file=<VAR>file</VAR></CODE>
12501<DD>Use and save the results of the tests in
12502<VAR>file</VAR> instead of <TT>`./config.cache'</TT>. Set <VAR>file</VAR> to
12503<TT>`/dev/null'</TT> to disable caching, for debugging
12504<CODE>configure</CODE>.
12505<P>
12506
12507<DT><CODE>--help</CODE>
12508<DD>Print a summary of the options to <CODE>configure</CODE>, and exit.
12509<P>
12510
12511<DT><CODE>--quiet</CODE>
12512<DD><DT><CODE>--silent</CODE>
12513<DD><DT><CODE>-q</CODE>
12514<DD>Do not print messages saying which checks are being made.
12515<P>
12516
12517<DT><CODE>--srcdir=<VAR>dir</VAR></CODE>
12518<DD>Look for the Bash source code in directory <VAR>dir</VAR>. Usually
12519<CODE>configure</CODE> can determine that directory automatically.
12520<P>
12521
12522<DT><CODE>--version</CODE>
12523<DD>Print the version of Autoconf used to generate the <CODE>configure</CODE>
12524script, and exit.
12525</DL>
12526<P>
12527
12528<CODE>configure</CODE> also accepts some other, not widely used, boilerplate
12529options. <SAMP>`configure --help'</SAMP> prints the complete list.
12530</P><P>
12531
12532<A NAME="Optional Features"></A>
12533<HR SIZE="6">
12534<A NAME="SEC134"></A>
12535<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12536<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &lt; </A>]</TD>
12537<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt; </A>]</TD>
12538<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt;&lt; </A>]</TD>
12539<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12540<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12541<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12542<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12543<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12544<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12545</TR></TABLE>
12546<H2> 10.8 Optional Features </H2>
12547<!--docid::SEC134::-->
12548<P>
12549
12550The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP>
12551options, where <VAR>feature</VAR> indicates an optional part of Bash.
12552There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options,
12553where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>.
12554To turn off the default use of a package, use
12555<SAMP>`--without-<VAR>package</VAR>'</SAMP>. To configure Bash without a feature
12556that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>.
12557</P><P>
12558
12559Here is a complete list of the <SAMP>`--enable-'</SAMP> and
12560<SAMP>`--with-'</SAMP> options that the Bash <CODE>configure</CODE> recognizes.
12561</P><P>
12562
12563<DL COMPACT>
12564<DT><CODE>--with-afs</CODE>
12565<DD>Define if you are using the Andrew File System from Transarc.
12566<P>
12567
12568<DT><CODE>--with-bash-malloc</CODE>
12569<DD>Use the Bash version of
12570<CODE>malloc</CODE> in the directory <TT>`lib/malloc'</TT>. This is not the same
12571<CODE>malloc</CODE> that appears in GNU libc, but an older version
12572originally derived from the 4.2 BSD <CODE>malloc</CODE>. This <CODE>malloc</CODE>
12573is very fast, but wastes some space on each allocation.
12574This option is enabled by default.
12575The <TT>`NOTES'</TT> file contains a list of systems for
12576which this should be turned off, and <CODE>configure</CODE> disables this
12577option automatically for a number of systems.
12578<P>
12579
12580<DT><CODE>--with-curses</CODE>
12581<DD>Use the curses library instead of the termcap library. This should
12582be supplied if your system has an inadequate or incomplete termcap
12583database.
12584<P>
12585
12586<DT><CODE>--with-gnu-malloc</CODE>
12587<DD>A synonym for <CODE>--with-bash-malloc</CODE>.
12588<P>
12589
12590<DT><CODE>--with-installed-readline[=<VAR>PREFIX</VAR>]</CODE>
12591<DD>Define this to make Bash link with a locally-installed version of Readline
12592rather than the version in <TT>`lib/readline'</TT>. This works only with
12593Readline 5.0 and later versions. If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not
12594supplied, <CODE>configure</CODE> uses the values of the make variables
12595<CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE>
12596by default, to find the installed version of Readline if it is not in
12597the standard system include and library directories.
12598If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in
12599<TT>`lib/readline'</TT>.
12600If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as
12601a directory pathname and looks for
12602the installed version of Readline in subdirectories of that directory
12603(include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in
12604<VAR>PREFIX</VAR>/<CODE>lib</CODE>).
12605<P>
12606
12607<DT><CODE>--with-purify</CODE>
12608<DD>Define this to use the Purify memory allocation checker from Rational
12609Software.
12610<P>
12611
12612<DT><CODE>--enable-minimal-config</CODE>
12613<DD>This produces a shell with minimal features, close to the historical
12614Bourne shell.
12615</DL>
12616<P>
12617
12618There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is
12619compiled and linked, rather than changing run-time features.
12620</P><P>
12621
12622<DL COMPACT>
12623<DT><CODE>--enable-largefile</CODE>
12624<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
12625to build programs which can access large files. This is enabled by
12626default, if the operating system provides large file support.
12627<P>
12628
12629<DT><CODE>--enable-profiling</CODE>
12630<DD>This builds a Bash binary that produces profiling information to be
12631processed by <CODE>gprof</CODE> each time it is executed.
12632<P>
12633
12634<DT><CODE>--enable-static-link</CODE>
12635<DD>This causes Bash to be linked statically, if <CODE>gcc</CODE> is being used.
12636This could be used to build a version to use as root's shell.
12637</DL>
12638<P>
12639
12640The <SAMP>`minimal-config'</SAMP> option can be used to disable all of
12641the following options, but it is processed first, so individual
12642options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>.
12643</P><P>
12644
12645All of the following options except for <SAMP>`disabled-builtins'</SAMP> and
12646<SAMP>`xpg-echo-default'</SAMP> are
12647enabled by default, unless the operating system does not provide the
12648necessary support.
12649</P><P>
12650
12651<DL COMPACT>
12652<DT><CODE>--enable-alias</CODE>
12653<DD>Allow alias expansion and include the <CODE>alias</CODE> and <CODE>unalias</CODE>
12654builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
12655<P>
12656
12657<DT><CODE>--enable-arith-for-command</CODE>
12658<DD>Include support for the alternate form of the <CODE>for</CODE> command
12659that behaves like the C language <CODE>for</CODE> statement
12660(see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
12661<P>
12662
12663<DT><CODE>--enable-array-variables</CODE>
12664<DD>Include support for one-dimensional array shell variables
12665(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
12666<P>
12667
12668<DT><CODE>--enable-bang-history</CODE>
12669<DD>Include support for <CODE>csh</CODE>-like history substitution
12670(see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
12671<P>
12672
12673<DT><CODE>--enable-brace-expansion</CODE>
12674<DD>Include <CODE>csh</CODE>-like brace expansion
12675( <CODE>b{a,b}c</CODE> ==> <CODE>bac bbc</CODE> ).
12676See <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>, for a complete description.
12677<P>
12678
12679<DT><CODE>--enable-casemod-attributes</CODE>
12680<DD>Include support for case-modifying attributes in the <CODE>declare</CODE> builtin
12681and assignment statements. Variables with the <VAR>uppercase</VAR> attribute,
12682for example, will have their values converted to uppercase upon assignment.
12683<P>
12684
12685<DT><CODE>--enable-casemod-expansion</CODE>
12686<DD>Include support for case-modifying word expansions.
12687<P>
12688
12689<DT><CODE>--enable-command-timing</CODE>
12690<DD>Include support for recognizing <CODE>time</CODE> as a reserved word and for
12691displaying timing statistics for the pipeline following <CODE>time</CODE>
12692(see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12693This allows pipelines as well as shell builtins and functions to be timed.
12694<P>
12695
12696<DT><CODE>--enable-cond-command</CODE>
12697<DD>Include support for the <CODE>[[</CODE> conditional command.
12698(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12699<P>
12700
12701<DT><CODE>--enable-cond-regexp</CODE>
12702<DD>Include support for matching POSIX regular expressions using the
12703<SAMP>`=~'</SAMP> binary operator in the <CODE>[[</CODE> conditional command.
12704(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12705<P>
12706
12707<DT><CODE>--enable-coprocesses</CODE>
12708<DD>Include support for coprocesses and the <CODE>coproc</CODE> reserved word
12709(see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12710<P>
12711
12712<DT><CODE>--enable-debugger</CODE>
12713<DD>Include support for the bash debugger (distributed separately).
12714<P>
12715
12716<DT><CODE>--enable-directory-stack</CODE>
12717<DD>Include support for a <CODE>csh</CODE>-like directory stack and the
12718<CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins
12719(see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
12720<P>
12721
12722<DT><CODE>--enable-disabled-builtins</CODE>
12723<DD>Allow builtin commands to be invoked via <SAMP>`builtin xxx'</SAMP>
12724even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>.
12725See <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and
12726<CODE>enable</CODE> builtin commands.
12727<P>
12728
12729<DT><CODE>--enable-dparen-arithmetic</CODE>
12730<DD>Include support for the <CODE>((<small>...</small>))</CODE> command
12731(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12732<P>
12733
12734<DT><CODE>--enable-extended-glob</CODE>
12735<DD>Include support for the extended pattern matching features described
12736above under <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>.
12737<P>
12738
12739<DT><CODE>--enable-help-builtin</CODE>
12740<DD>Include the <CODE>help</CODE> builtin, which displays help on shell builtins and
12741variables (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
12742<P>
12743
12744<DT><CODE>--enable-history</CODE>
12745<DD>Include command history and the <CODE>fc</CODE> and <CODE>history</CODE>
12746builtin commands (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>).
12747<P>
12748
12749<DT><CODE>--enable-job-control</CODE>
12750<DD>This enables the job control features (see section <A HREF="bashref.html#SEC91">7. Job Control</A>),
12751if the operating system supports them.
12752<P>
12753
12754<DT><CODE>--enable-multibyte</CODE>
12755<DD>This enables support for multibyte characters if the operating
12756system provides the necessary support.
12757<P>
12758
12759<DT><CODE>--enable-net-redirections</CODE>
12760<DD>This enables the special handling of filenames of the form
12761<CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> and
12762<CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
12763when used in redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
12764<P>
12765
12766<DT><CODE>--enable-process-substitution</CODE>
12767<DD>This enables process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>) if
12768the operating system provides the necessary support.
12769<P>
12770
12771<DT><CODE>--enable-progcomp</CODE>
12772<DD>Enable the programmable completion facilities
12773(see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
12774If Readline is not enabled, this option has no effect.
12775<P>
12776
12777<DT><CODE>--enable-prompt-string-decoding</CODE>
12778<DD>Turn on the interpretation of a number of backslash-escaped characters
12779in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt
12780strings. See <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for a complete list of prompt
12781string escape sequences.
12782<P>
12783
12784<DT><CODE>--enable-readline</CODE>
12785<DD>Include support for command-line editing and history with the Bash
12786version of the Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>).
12787<P>
12788
12789<DT><CODE>--enable-restricted</CODE>
12790<DD>Include support for a <EM>restricted shell</EM>. If this is enabled, Bash,
12791when called as <CODE>rbash</CODE>, enters a restricted mode. See
12792<A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>, for a description of restricted mode.
12793<P>
12794
12795<DT><CODE>--enable-select</CODE>
12796<DD>Include the <CODE>select</CODE> builtin, which allows the generation of simple
12797menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12798<P>
12799
12800<DT><CODE>--enable-separate-helpfiles</CODE>
12801<DD>Use external files for the documentation displayed by the <CODE>help</CODE> builtin
12802instead of storing the text internally.
12803<P>
12804
12805<DT><CODE>--enable-single-help-strings</CODE>
12806<DD>Store the text displayed by the <CODE>help</CODE> builtin as a single string for
12807each help topic. This aids in translating the text to different languages.
12808You may need to disable this if your compiler cannot handle very long string
12809literals.
12810<P>
12811
12812<DT><CODE>--enable-strict-posix-default</CODE>
12813<DD>Make Bash POSIX-conformant by default (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
12814<P>
12815
12816<DT><CODE>--enable-usg-echo-default</CODE>
12817<DD>A synonym for <CODE>--enable-xpg-echo-default</CODE>.
12818<P>
12819
12820<DT><CODE>--enable-xpg-echo-default</CODE>
12821<DD>Make the <CODE>echo</CODE> builtin expand backslash-escaped characters by default,
12822without requiring the <SAMP>`-e'</SAMP> option.
12823This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>,
12824which makes the Bash <CODE>echo</CODE> behave more like the version specified in
12825the Single Unix Specification, version 3.
12826See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that
12827<CODE>echo</CODE> recognizes.
12828<P>
12829
12830</DL>
12831<P>
12832
12833The file <TT>`config-top.h'</TT> contains C Preprocessor
12834<SAMP>`#define'</SAMP> statements for options which are not settable from
12835<CODE>configure</CODE>.
12836Some of these are not meant to be changed; beware of the consequences if
12837you do.
12838Read the comments associated with each definition for more
12839information about its effect.
12840</P><P>
12841
12842<A NAME="Reporting Bugs"></A>
12843<HR SIZE="6">
12844<A NAME="SEC135"></A>
12845<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12846<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &lt; </A>]</TD>
12847<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &gt; </A>]</TD>
12848<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt;&lt; </A>]</TD>
12849<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12850<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &gt;&gt; </A>]</TD>
12851<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12852<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12853<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12854<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12855</TR></TABLE>
12856<H1> A. Reporting Bugs </H1>
12857<!--docid::SEC135::-->
12858<P>
12859
12860Please report all bugs you find in Bash.
12861But first, you should
12862make sure that it really is a bug, and that it appears in the latest
12863version of Bash.
12864The latest version of Bash is always available for FTP from
12865<A HREF="ftp://ftp.gnu.org/pub/bash/">ftp://ftp.gnu.org/pub/bash/</A>.
12866</P><P>
12867
12868Once you have determined that a bug actually exists, use the
12869<CODE>bashbug</CODE> command to submit a bug report.
12870If you have a fix, you are encouraged to mail that as well!
12871Suggestions and `philosophical' bug reports may be mailed
12872to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet
12873newsgroup <CODE>gnu.bash.bug</CODE>.
12874</P><P>
12875
12876All bug reports should include:
12877<UL>
12878<LI>
12879The version number of Bash.
12880<LI>
12881The hardware and operating system.
12882<LI>
12883The compiler used to compile Bash.
12884<LI>
12885A description of the bug behaviour.
12886<LI>
12887A short script or `recipe' which exercises the bug and may be used
12888to reproduce it.
12889</UL>
12890<P>
12891
12892<CODE>bashbug</CODE> inserts the first three items automatically into
12893the template it provides for filing a bug report.
12894</P><P>
12895
12896Please send all reports concerning this manual to
12897<A HREF="mailto:chet@po.CWRU.Edu">chet@po.CWRU.Edu</A>.
12898</P><P>
12899
12900<A NAME="Major Differences From The Bourne Shell"></A>
12901<HR SIZE="6">
12902<A NAME="SEC136"></A>
12903<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12904<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &lt; </A>]</TD>
12905<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt; </A>]</TD>
12906<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &lt;&lt; </A>]</TD>
12907<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12908<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt;&gt; </A>]</TD>
12909<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12910<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12911<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12912<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12913</TR></TABLE>
12914<H1> B. Major Differences From The Bourne Shell </H1>
12915<!--docid::SEC136::-->
12916<P>
12917
12918Bash implements essentially the same grammar, parameter and
12919variable expansion, redirection, and quoting as the Bourne Shell.
12920Bash uses the POSIX standard as the specification of
12921how these features are to be implemented. There are some
12922differences between the traditional Bourne shell and Bash; this
12923section quickly details the differences of significance. A
12924number of these differences are explained in greater depth in
12925previous sections.
12926This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the
12927last version of the historical Bourne shell) as the baseline reference.
12928</P><P>
12929
12930<UL>
12931
12932<LI>
12933Bash is POSIX-conformant, even where the POSIX specification
12934differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
12935<P>
12936
12937<LI>
12938Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
12939<P>
12940
12941<LI>
12942Bash has command-line editing (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) and
12943the <CODE>bind</CODE> builtin.
12944<P>
12945
12946<LI>
12947Bash provides a programmable word completion mechanism
12948(see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>), and builtin commands
12949<CODE>complete</CODE>, <CODE>compgen</CODE>, and <CODE>compopt</CODE>, to
12950manipulate it.
12951<P>
12952
12953<LI>
12954Bash has command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) and the
12955<CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it.
12956The Bash history list maintains timestamp information and uses the
12957value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it.
12958<P>
12959
12960<LI>
12961Bash implements <CODE>csh</CODE>-like history expansion
12962(see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
12963<P>
12964
12965<LI>
12966Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), and the
12967appropriate variable expansions and assignment syntax to use them.
12968Several of the Bash builtins take options to act on arrays.
12969Bash provides a number of built-in array variables.
12970<P>
12971
12972<LI>
12973The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C
12974backslash-escaped characters in the text between the single quotes,
12975is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>).
12976<P>
12977
12978<LI>
12979Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do
12980locale-specific translation of the characters between the double
12981quotes. The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP>
12982invocation options list the translatable strings found in a script
12983(see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
12984<P>
12985
12986<LI>
12987Bash implements the <CODE>!</CODE> keyword to negate the return value of
12988a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12989Very useful when an <CODE>if</CODE> statement needs to act only if a test fails.
12990The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to
12991return a failure status if any command fails.
12992<P>
12993
12994<LI>
12995Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12996The display of the timing statistics may be controlled with the
12997<CODE>TIMEFORMAT</CODE> variable.
12998<P>
12999
13000<LI>
13001Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE>
13002arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
13003<P>
13004
13005<LI>
13006Bash includes the <CODE>select</CODE> compound command, which allows the
13007generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13008<P>
13009
13010<LI>
13011Bash includes the <CODE>[[</CODE> compound command, which makes conditional
13012testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including
13013optional regular expression matching.
13014<P>
13015
13016<LI>
13017Bash provides optional case-insensitive matching for the <CODE>case</CODE> and
13018<CODE>[[</CODE> constructs.
13019<P>
13020
13021<LI>
13022Bash includes brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>) and tilde
13023expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
13024<P>
13025
13026<LI>
13027Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE>
13028builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
13029<P>
13030
13031<LI>
13032Bash provides shell arithmetic, the <CODE>((</CODE> compound command
13033(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>),
13034and arithmetic expansion (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
13035<P>
13036
13037<LI>
13038Variables present in the shell's initial environment are automatically
13039exported to child processes. The Bourne shell does not normally do
13040this unless the variables are explicitly marked using the <CODE>export</CODE>
13041command.
13042<P>
13043
13044<LI>
13045Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value
13046of the variable named on the left hand side.
13047<P>
13048
13049<LI>
13050Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP>
13051and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from
13052variable values (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13053<P>
13054
13055<LI>
13056The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>,
13057is supported (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13058<P>
13059
13060<LI>
13061The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>,
13062which expands to the substring of <CODE>var</CODE>'s value of length
13063<VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present
13064(see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13065<P>
13066
13067<LI>
13068The expansion
13069<CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>,
13070which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in
13071the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13072<P>
13073
13074<LI>
13075The expansion <CODE>${!<VAR>prefix}*</VAR></CODE> expansion, which expands to
13076the names of all shell variables whose names begin with <VAR>prefix</VAR>,
13077is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13078<P>
13079
13080<LI>
13081Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE>
13082(see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13083<P>
13084
13085<LI>
13086Bash can expand positional parameters beyond <CODE>$9</CODE> using
13087<CODE>${<VAR>num</VAR>}</CODE>.
13088<P>
13089
13090<LI>
13091The POSIX <CODE>$()</CODE> form of command substitution
13092is implemented (see section <A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>),
13093and preferred to the Bourne shell's <CODE>"</CODE> (which
13094is also implemented for backwards compatibility).
13095<P>
13096
13097<LI>
13098Bash has process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>).
13099<P>
13100
13101<LI>
13102Bash automatically assigns variables that provide information about the
13103current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host
13104(<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>),
13105and the instance of Bash that is running (<CODE>BASH</CODE>,
13106<CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>). See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>,
13107for details.
13108<P>
13109
13110<LI>
13111The <CODE>IFS</CODE> variable is used to split only the results of expansion,
13112not all words (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>).
13113This closes a longstanding shell security hole.
13114<P>
13115
13116<LI>
13117Bash implements the full set of POSIX filename expansion operators,
13118including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and
13119<VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
13120<P>
13121
13122<LI>
13123Bash implements extended pattern matching features when the <CODE>extglob</CODE>
13124shell option is enabled (see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>).
13125<P>
13126
13127<LI>
13128It is possible to have a variable and a function with the same name;
13129<CODE>sh</CODE> does not separate the two name spaces.
13130<P>
13131
13132<LI>
13133Bash functions are permitted to have local variables using the
13134<CODE>local</CODE> builtin, and thus useful recursive functions may be written
13135(see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13136<P>
13137
13138<LI>
13139Variable assignments preceding commands affect only that command, even
13140builtins and functions (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>).
13141In <CODE>sh</CODE>, all variable assignments
13142preceding commands are global unless the command is executed from the
13143file system.
13144<P>
13145
13146<LI>
13147Bash performs filename expansion on filenames specified as operands
13148to input and output redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13149<P>
13150
13151<LI>
13152Bash contains the <SAMP>`&#60;&#62;'</SAMP> redirection operator, allowing a file to be
13153opened for both reading and writing, and the <SAMP>`&#38;&#62;'</SAMP> redirection
13154operator, for directing standard output and standard error to the same
13155file (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13156<P>
13157
13158<LI>
13159Bash includes the <SAMP>`&#60;&#60;&#60;'</SAMP> redirection operator, allowing a string to
13160be used as the standard input to a command.
13161<P>
13162
13163<LI>
13164Bash implements the <SAMP>`[n]&#60;&#38;<VAR>word</VAR>'</SAMP> and <SAMP>`[n]&#62;&#38;<VAR>word</VAR>'</SAMP>
13165redirection operators, which move one file descriptor to another.
13166<P>
13167
13168<LI>
13169Bash treats a number of filenames specially when they are
13170used in redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13171<P>
13172
13173<LI>
13174Bash can open network connections to arbitrary machines and services
13175with the redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13176<P>
13177
13178<LI>
13179The <CODE>noclobber</CODE> option is available to avoid overwriting existing
13180files with output redirection (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13181The <SAMP>`&#62;|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>.
13182<P>
13183
13184<LI>
13185The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
13186each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and
13187physical modes.
13188<P>
13189
13190<LI>
13191Bash allows a function to override a builtin with the same name, and provides
13192access to that builtin's functionality within the function via the
13193<CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13194<P>
13195
13196<LI>
13197The <CODE>command</CODE> builtin allows selective disabling of functions
13198when command lookup is performed (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13199<P>
13200
13201<LI>
13202Individual builtins may be enabled or disabled using the <CODE>enable</CODE>
13203builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13204<P>
13205
13206<LI>
13207The Bash <CODE>exec</CODE> builtin takes additional options that allow users
13208to control the contents of the environment passed to the executed
13209command, and what the zeroth argument to the command is to be
13210(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13211<P>
13212
13213<LI>
13214Shell functions may be exported to children via the environment
13215using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
13216<P>
13217
13218<LI>
13219The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can
13220take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to
13221display variables with various attributes set in a format that can be
13222used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable
13223attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes
13224and values simultaneously.
13225<P>
13226
13227<LI>
13228The Bash <CODE>hash</CODE> builtin allows a name to be associated with
13229an arbitrary filename, even when that filename cannot be found by
13230searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP>
13231(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13232<P>
13233
13234<LI>
13235Bash includes a <CODE>help</CODE> builtin for quick reference to shell
13236facilities (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13237<P>
13238
13239<LI>
13240The <CODE>printf</CODE> builtin is available to display formatted output
13241(see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13242<P>
13243
13244<LI>
13245The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>)
13246will read a line ending in <SAMP>`\'</SAMP> with
13247the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a
13248default if no non-option arguments are supplied.
13249The Bash <CODE>read</CODE> builtin
13250also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use
13251Readline to obtain the line when given the <SAMP>`-e'</SAMP> option.
13252The <CODE>read</CODE> builtin also has additional options to control input:
13253the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as
13254they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out
13255if input does not arrive within a specified number of seconds, the
13256<SAMP>`-n'</SAMP> option will allow reading only a specified number of
13257characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read
13258until a particular character rather than newline.
13259<P>
13260
13261<LI>
13262The <CODE>return</CODE> builtin may be used to abort execution of scripts
13263executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins
13264(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13265<P>
13266
13267<LI>
13268Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell
13269optional capabilities (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), and allows these options
13270to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
13271<P>
13272
13273<LI>
13274Bash has much more optional behavior controllable with the <CODE>set</CODE>
13275builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13276<P>
13277
13278<LI>
13279The <SAMP>`-x'</SAMP> (<CODE>xtrace</CODE>) option displays commands other than
13280simple commands when performing an execution trace
13281(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13282<P>
13283
13284<LI>
13285The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
13286is slightly different, as it implements the POSIX algorithm,
13287which specifies the behavior based on the number of arguments.
13288<P>
13289
13290<LI>
13291Bash includes the <CODE>caller</CODE> builtin, which displays the context of
13292any active subroutine call (a shell function or a script executed with
13293the <CODE>.</CODE> or <CODE>source</CODE> builtins). This supports the bash
13294debugger.
13295<P>
13296
13297<LI>
13298The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a
13299<CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>.
13300Commands specified with a <CODE>DEBUG</CODE> trap are executed before every
13301simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
13302<CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
13303the first command executes in a shell function.
13304The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the
13305function has been given the <CODE>trace</CODE> attribute or the
13306<CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13307The <CODE>extdebug</CODE> shell option has additional effects on the
13308<CODE>DEBUG</CODE> trap.
13309<P>
13310
13311The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows an
13312<CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13313Commands specified with an <CODE>ERR</CODE> trap are executed after a simple
13314command fails, with a few exceptions.
13315The <CODE>ERR</CODE> trap is not inherited by shell functions unless the
13316<CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled.
13317</P><P>
13318
13319The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a
13320<CODE>RETURN</CODE> pseudo-signal specification, similar to
13321<CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13322Commands specified with an <CODE>RETURN</CODE> trap are executed before
13323execution resumes after a shell function or a shell script executed with
13324<CODE>.</CODE> or <CODE>source</CODE> returns.
13325The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the
13326function has been given the <CODE>trace</CODE> attribute or the
13327<CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13328</P><P>
13329
13330<LI>
13331The Bash <CODE>type</CODE> builtin is more extensive and gives more information
13332about the names it finds (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13333<P>
13334
13335<LI>
13336The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause
13337the output to be displayed in the form of a <CODE>umask</CODE> command
13338that may be reused as input (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13339<P>
13340
13341<LI>
13342Bash implements a <CODE>csh</CODE>-like directory stack, and provides the
13343<CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it
13344(see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
13345Bash also makes the directory stack visible as the value of the
13346<CODE>DIRSTACK</CODE> shell variable.
13347<P>
13348
13349<LI>
13350Bash interprets special backslash-escaped characters in the prompt
13351strings when interactive (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
13352<P>
13353
13354<LI>
13355The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>);
13356the SVR4.2 shell restricted mode is too limited.
13357<P>
13358
13359<LI>
13360The <CODE>disown</CODE> builtin can remove a job from the internal shell
13361job table (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or suppress the sending
13362of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a
13363<CODE>SIGHUP</CODE>.
13364<P>
13365
13366<LI>
13367Bash includes a number of features to support a separate debugger for
13368shell scripts.
13369<P>
13370
13371<LI>
13372The SVR4.2 shell has two privilege-related builtins
13373(<CODE>mldmode</CODE> and <CODE>priv</CODE>) not present in Bash.
13374<P>
13375
13376<LI>
13377Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins.
13378<P>
13379
13380<LI>
13381Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting.
13382<P>
13383
13384<LI>
13385The SVR4.2 <CODE>sh</CODE> uses a <CODE>TIMEOUT</CODE> variable like Bash uses
13386<CODE>TMOUT</CODE>.
13387<P>
13388
13389</UL>
13390<P>
13391
13392More features unique to Bash may be found in <A HREF="bashref.html#SEC68">6. Bash Features</A>.
13393</P><P>
13394
13395<HR SIZE="6">
13396<A NAME="SEC137"></A>
13397<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13398<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &lt; </A>]</TD>
13399<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt; </A>]</TD>
13400<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &lt;&lt; </A>]</TD>
13401<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> Up </A>]</TD>
13402<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt;&gt; </A>]</TD>
13403<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13404<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13405<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13406<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13407</TR></TABLE>
13408<H2> B.1 Implementation Differences From The SVR4.2 Shell </H2>
13409<!--docid::SEC137::-->
13410<P>
13411
13412Since Bash is a completely new implementation, it does not suffer from
13413many of the limitations of the SVR4.2 shell. For instance:
13414</P><P>
13415
13416<UL>
13417
13418<LI>
13419Bash does not fork a subshell when redirecting into or out of
13420a shell control structure such as an <CODE>if</CODE> or <CODE>while</CODE>
13421statement.
13422<P>
13423
13424<LI>
13425Bash does not allow unbalanced quotes. The SVR4.2 shell will silently
13426insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances.
13427This can be the cause of some hard-to-find errors.
13428<P>
13429
13430<LI>
13431The SVR4.2 shell uses a baroque memory management scheme based on
13432trapping <CODE>SIGSEGV</CODE>. If the shell is started from a process with
13433<CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library
13434function call), it misbehaves badly.
13435<P>
13436
13437<LI>
13438In a questionable attempt at security, the SVR4.2 shell,
13439when invoked without the <SAMP>`-p'</SAMP> option, will alter its real
13440and effective UID and GID if they are less than some
13441magic threshold value, commonly 100.
13442This can lead to unexpected results.
13443<P>
13444
13445<LI>
13446The SVR4.2 shell does not allow users to trap <CODE>SIGSEGV</CODE>,
13447<CODE>SIGALRM</CODE>, or <CODE>SIGCHLD</CODE>.
13448<P>
13449
13450<LI>
13451The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>,
13452<CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset.
13453<P>
13454
13455<LI>
13456The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of
13457<SAMP>`|'</SAMP>.
13458<P>
13459
13460<LI>
13461Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>);
13462the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>). In
13463fact, some versions of the shell dump core if the second argument begins
13464with a <SAMP>`-'</SAMP>.
13465<P>
13466
13467<LI>
13468The SVR4.2 shell exits a script if any builtin fails; Bash exits
13469a script only if one of the POSIX special builtins fails, and
13470only for certain failures, as enumerated in the POSIX standard.
13471<P>
13472
13473<LI>
13474The SVR4.2 shell behaves differently when invoked as <CODE>jsh</CODE>
13475(it turns on job control).
13476</UL>
13477<P>
13478
13479<A NAME="GNU Free Documentation License"></A>
13480<HR SIZE="6">
13481<A NAME="SEC138"></A>
13482<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13483<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &lt; </A>]</TD>
13484<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &gt; </A>]</TD>
13485<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &lt;&lt; </A>]</TD>
13486<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13487<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &gt;&gt; </A>]</TD>
13488<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13489<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13490<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13491<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13492</TR></TABLE>
13493<H1> C. GNU Free Documentation License </H1>
13494<!--docid::SEC138::-->
13495<P>
13496
13497<center>
13498 Version 1.2, November 2002
13499</center>
13500</P><P>
13501
13502<TABLE><tr><td>&nbsp;</td><td class=display><pre style="font-family: serif">Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
1350351 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
13504
13505Everyone is permitted to copy and distribute verbatim copies
13506of this license document, but changing it is not allowed.
13507</pre></td></tr></table></P><P>
13508
13509<OL>
13510<LI>
13511PREAMBLE
13512<P>
13513
13514The purpose of this License is to make a manual, textbook, or other
13515functional and useful document <EM>free</EM> in the sense of freedom: to
13516assure everyone the effective freedom to copy and redistribute it,
13517with or without modifying it, either commercially or noncommercially.
13518Secondarily, this License preserves for the author and publisher a way
13519to get credit for their work, while not being considered responsible
13520for modifications made by others.
13521</P><P>
13522
13523This License is a kind of "copyleft", which means that derivative
13524works of the document must themselves be free in the same sense. It
13525complements the GNU General Public License, which is a copyleft
13526license designed for free software.
13527</P><P>
13528
13529We have designed this License in order to use it for manuals for free
13530software, because free software needs free documentation: a free
13531program should come with manuals providing the same freedoms that the
13532software does. But this License is not limited to software manuals;
13533it can be used for any textual work, regardless of subject matter or
13534whether it is published as a printed book. We recommend this License
13535principally for works whose purpose is instruction or reference.
13536</P><P>
13537
13538<LI>
13539APPLICABILITY AND DEFINITIONS
13540<P>
13541
13542This License applies to any manual or other work, in any medium, that
13543contains a notice placed by the copyright holder saying it can be
13544distributed under the terms of this License. Such a notice grants a
13545world-wide, royalty-free license, unlimited in duration, to use that
13546work under the conditions stated herein. The "Document", below,
13547refers to any such manual or work. Any member of the public is a
13548licensee, and is addressed as "you". You accept the license if you
13549copy, modify or distribute the work in a way requiring permission
13550under copyright law.
13551</P><P>
13552
13553A "Modified Version" of the Document means any work containing the
13554Document or a portion of it, either copied verbatim, or with
13555modifications and/or translated into another language.
13556</P><P>
13557
13558A "Secondary Section" is a named appendix or a front-matter section
13559of the Document that deals exclusively with the relationship of the
13560publishers or authors of the Document to the Document's overall
13561subject (or to related matters) and contains nothing that could fall
13562directly within that overall subject. (Thus, if the Document is in
13563part a textbook of mathematics, a Secondary Section may not explain
13564any mathematics.) The relationship could be a matter of historical
13565connection with the subject or with related matters, or of legal,
13566commercial, philosophical, ethical or political position regarding
13567them.
13568</P><P>
13569
13570The "Invariant Sections" are certain Secondary Sections whose titles
13571are designated, as being those of Invariant Sections, in the notice
13572that says that the Document is released under this License. If a
13573section does not fit the above definition of Secondary then it is not
13574allowed to be designated as Invariant. The Document may contain zero
13575Invariant Sections. If the Document does not identify any Invariant
13576Sections then there are none.
13577</P><P>
13578
13579The "Cover Texts" are certain short passages of text that are listed,
13580as Front-Cover Texts or Back-Cover Texts, in the notice that says that
13581the Document is released under this License. A Front-Cover Text may
13582be at most 5 words, and a Back-Cover Text may be at most 25 words.
13583</P><P>
13584
13585A "Transparent" copy of the Document means a machine-readable copy,
13586represented in a format whose specification is available to the
13587general public, that is suitable for revising the document
13588straightforwardly with generic text editors or (for images composed of
13589pixels) generic paint programs or (for drawings) some widely available
13590drawing editor, and that is suitable for input to text formatters or
13591for automatic translation to a variety of formats suitable for input
13592to text formatters. A copy made in an otherwise Transparent file
13593format whose markup, or absence of markup, has been arranged to thwart
13594or discourage subsequent modification by readers is not Transparent.
13595An image format is not Transparent if used for any substantial amount
13596of text. A copy that is not "Transparent" is called "Opaque".
13597</P><P>
13598
13599Examples of suitable formats for Transparent copies include plain
13600ASCII without markup, Texinfo input format, LaTeX input
13601format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available
13602<FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>,
13603PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification. Examples
13604of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and
13605<FONT SIZE="-1">JPG</FONT>. Opaque formats include proprietary formats that can be
13606read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or
13607<FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are
13608not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>,
13609PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for
13610output purposes only.
13611</P><P>
13612
13613The "Title Page" means, for a printed book, the title page itself,
13614plus such following pages as are needed to hold, legibly, the material
13615this License requires to appear in the title page. For works in
13616formats which do not have any title page as such, "Title Page" means
13617the text near the most prominent appearance of the work's title,
13618preceding the beginning of the body of the text.
13619</P><P>
13620
13621A section "Entitled XYZ" means a named subunit of the Document whose
13622title either is precisely XYZ or contains XYZ in parentheses following
13623text that translates XYZ in another language. (Here XYZ stands for a
13624specific section name mentioned below, such as "Acknowledgements",
13625"Dedications", "Endorsements", or "History".) To "Preserve the Title"
13626of such a section when you modify the Document means that it remains a
13627section "Entitled XYZ" according to this definition.
13628</P><P>
13629
13630The Document may include Warranty Disclaimers next to the notice which
13631states that this License applies to the Document. These Warranty
13632Disclaimers are considered to be included by reference in this
13633License, but only as regards disclaiming warranties: any other
13634implication that these Warranty Disclaimers may have is void and has
13635no effect on the meaning of this License.
13636</P><P>
13637
13638<LI>
13639VERBATIM COPYING
13640<P>
13641
13642You may copy and distribute the Document in any medium, either
13643commercially or noncommercially, provided that this License, the
13644copyright notices, and the license notice saying this License applies
13645to the Document are reproduced in all copies, and that you add no other
13646conditions whatsoever to those of this License. You may not use
13647technical measures to obstruct or control the reading or further
13648copying of the copies you make or distribute. However, you may accept
13649compensation in exchange for copies. If you distribute a large enough
13650number of copies you must also follow the conditions in section 3.
13651</P><P>
13652
13653You may also lend copies, under the same conditions stated above, and
13654you may publicly display copies.
13655</P><P>
13656
13657<LI>
13658COPYING IN QUANTITY
13659<P>
13660
13661If you publish printed copies (or copies in media that commonly have
13662printed covers) of the Document, numbering more than 100, and the
13663Document's license notice requires Cover Texts, you must enclose the
13664copies in covers that carry, clearly and legibly, all these Cover
13665Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
13666the back cover. Both covers must also clearly and legibly identify
13667you as the publisher of these copies. The front cover must present
13668the full title with all words of the title equally prominent and
13669visible. You may add other material on the covers in addition.
13670Copying with changes limited to the covers, as long as they preserve
13671the title of the Document and satisfy these conditions, can be treated
13672as verbatim copying in other respects.
13673</P><P>
13674
13675If the required texts for either cover are too voluminous to fit
13676legibly, you should put the first ones listed (as many as fit
13677reasonably) on the actual cover, and continue the rest onto adjacent
13678pages.
13679</P><P>
13680
13681If you publish or distribute Opaque copies of the Document numbering
13682more than 100, you must either include a machine-readable Transparent
13683copy along with each Opaque copy, or state in or with each Opaque copy
13684a computer-network location from which the general network-using
13685public has access to download using public-standard network protocols
13686a complete Transparent copy of the Document, free of added material.
13687If you use the latter option, you must take reasonably prudent steps,
13688when you begin distribution of Opaque copies in quantity, to ensure
13689that this Transparent copy will remain thus accessible at the stated
13690location until at least one year after the last time you distribute an
13691Opaque copy (directly or through your agents or retailers) of that
13692edition to the public.
13693</P><P>
13694
13695It is requested, but not required, that you contact the authors of the
13696Document well before redistributing any large number of copies, to give
13697them a chance to provide you with an updated version of the Document.
13698</P><P>
13699
13700<LI>
13701MODIFICATIONS
13702<P>
13703
13704You may copy and distribute a Modified Version of the Document under
13705the conditions of sections 2 and 3 above, provided that you release
13706the Modified Version under precisely this License, with the Modified
13707Version filling the role of the Document, thus licensing distribution
13708and modification of the Modified Version to whoever possesses a copy
13709of it. In addition, you must do these things in the Modified Version:
13710</P><P>
13711
13712<OL>
13713<LI>
13714Use in the Title Page (and on the covers, if any) a title distinct
13715from that of the Document, and from those of previous versions
13716(which should, if there were any, be listed in the History section
13717of the Document). You may use the same title as a previous version
13718if the original publisher of that version gives permission.
13719<P>
13720
13721<LI>
13722List on the Title Page, as authors, one or more persons or entities
13723responsible for authorship of the modifications in the Modified
13724Version, together with at least five of the principal authors of the
13725Document (all of its principal authors, if it has fewer than five),
13726unless they release you from this requirement.
13727<P>
13728
13729<LI>
13730State on the Title page the name of the publisher of the
13731Modified Version, as the publisher.
13732<P>
13733
13734<LI>
13735Preserve all the copyright notices of the Document.
13736<P>
13737
13738<LI>
13739Add an appropriate copyright notice for your modifications
13740adjacent to the other copyright notices.
13741<P>
13742
13743<LI>
13744Include, immediately after the copyright notices, a license notice
13745giving the public permission to use the Modified Version under the
13746terms of this License, in the form shown in the Addendum below.
13747<P>
13748
13749<LI>
13750Preserve in that license notice the full lists of Invariant Sections
13751and required Cover Texts given in the Document's license notice.
13752<P>
13753
13754<LI>
13755Include an unaltered copy of this License.
13756<P>
13757
13758<LI>
13759Preserve the section Entitled "History", Preserve its Title, and add
13760to it an item stating at least the title, year, new authors, and
13761publisher of the Modified Version as given on the Title Page. If
13762there is no section Entitled "History" in the Document, create one
13763stating the title, year, authors, and publisher of the Document as
13764given on its Title Page, then add an item describing the Modified
13765Version as stated in the previous sentence.
13766<P>
13767
13768<LI>
13769Preserve the network location, if any, given in the Document for
13770public access to a Transparent copy of the Document, and likewise
13771the network locations given in the Document for previous versions
13772it was based on. These may be placed in the "History" section.
13773You may omit a network location for a work that was published at
13774least four years before the Document itself, or if the original
13775publisher of the version it refers to gives permission.
13776<P>
13777
13778<LI>
13779For any section Entitled "Acknowledgements" or "Dedications", Preserve
13780the Title of the section, and preserve in the section all the
13781substance and tone of each of the contributor acknowledgements and/or
13782dedications given therein.
13783<P>
13784
13785<LI>
13786Preserve all the Invariant Sections of the Document,
13787unaltered in their text and in their titles. Section numbers
13788or the equivalent are not considered part of the section titles.
13789<P>
13790
13791<LI>
13792Delete any section Entitled "Endorsements". Such a section
13793may not be included in the Modified Version.
13794<P>
13795
13796<LI>
13797Do not retitle any existing section to be Entitled "Endorsements" or
13798to conflict in title with any Invariant Section.
13799<P>
13800
13801<LI>
13802Preserve any Warranty Disclaimers.
13803</OL>
13804<P>
13805
13806If the Modified Version includes new front-matter sections or
13807appendices that qualify as Secondary Sections and contain no material
13808copied from the Document, you may at your option designate some or all
13809of these sections as invariant. To do this, add their titles to the
13810list of Invariant Sections in the Modified Version's license notice.
13811These titles must be distinct from any other section titles.
13812</P><P>
13813
13814You may add a section Entitled "Endorsements", provided it contains
13815nothing but endorsements of your Modified Version by various
13816parties--for example, statements of peer review or that the text has
13817been approved by an organization as the authoritative definition of a
13818standard.
13819</P><P>
13820
13821You may add a passage of up to five words as a Front-Cover Text, and a
13822passage of up to 25 words as a Back-Cover Text, to the end of the list
13823of Cover Texts in the Modified Version. Only one passage of
13824Front-Cover Text and one of Back-Cover Text may be added by (or
13825through arrangements made by) any one entity. If the Document already
13826includes a cover text for the same cover, previously added by you or
13827by arrangement made by the same entity you are acting on behalf of,
13828you may not add another; but you may replace the old one, on explicit
13829permission from the previous publisher that added the old one.
13830</P><P>
13831
13832The author(s) and publisher(s) of the Document do not by this License
13833give permission to use their names for publicity for or to assert or
13834imply endorsement of any Modified Version.
13835</P><P>
13836
13837<LI>
13838COMBINING DOCUMENTS
13839<P>
13840
13841You may combine the Document with other documents released under this
13842License, under the terms defined in section 4 above for modified
13843versions, provided that you include in the combination all of the
13844Invariant Sections of all of the original documents, unmodified, and
13845list them all as Invariant Sections of your combined work in its
13846license notice, and that you preserve all their Warranty Disclaimers.
13847</P><P>
13848
13849The combined work need only contain one copy of this License, and
13850multiple identical Invariant Sections may be replaced with a single
13851copy. If there are multiple Invariant Sections with the same name but
13852different contents, make the title of each such section unique by
13853adding at the end of it, in parentheses, the name of the original
13854author or publisher of that section if known, or else a unique number.
13855Make the same adjustment to the section titles in the list of
13856Invariant Sections in the license notice of the combined work.
13857</P><P>
13858
13859In the combination, you must combine any sections Entitled "History"
13860in the various original documents, forming one section Entitled
13861"History"; likewise combine any sections Entitled "Acknowledgements",
13862and any sections Entitled "Dedications". You must delete all
13863sections Entitled "Endorsements."
13864</P><P>
13865
13866<LI>
13867COLLECTIONS OF DOCUMENTS
13868<P>
13869
13870You may make a collection consisting of the Document and other documents
13871released under this License, and replace the individual copies of this
13872License in the various documents with a single copy that is included in
13873the collection, provided that you follow the rules of this License for
13874verbatim copying of each of the documents in all other respects.
13875</P><P>
13876
13877You may extract a single document from such a collection, and distribute
13878it individually under this License, provided you insert a copy of this
13879License into the extracted document, and follow this License in all
13880other respects regarding verbatim copying of that document.
13881</P><P>
13882
13883<LI>
13884AGGREGATION WITH INDEPENDENT WORKS
13885<P>
13886
13887A compilation of the Document or its derivatives with other separate
13888and independent documents or works, in or on a volume of a storage or
13889distribution medium, is called an "aggregate" if the copyright
13890resulting from the compilation is not used to limit the legal rights
13891of the compilation's users beyond what the individual works permit.
13892When the Document is included in an aggregate, this License does not
13893apply to the other works in the aggregate which are not themselves
13894derivative works of the Document.
13895</P><P>
13896
13897If the Cover Text requirement of section 3 is applicable to these
13898copies of the Document, then if the Document is less than one half of
13899the entire aggregate, the Document's Cover Texts may be placed on
13900covers that bracket the Document within the aggregate, or the
13901electronic equivalent of covers if the Document is in electronic form.
13902Otherwise they must appear on printed covers that bracket the whole
13903aggregate.
13904</P><P>
13905
13906<LI>
13907TRANSLATION
13908<P>
13909
13910Translation is considered a kind of modification, so you may
13911distribute translations of the Document under the terms of section 4.
13912Replacing Invariant Sections with translations requires special
13913permission from their copyright holders, but you may include
13914translations of some or all Invariant Sections in addition to the
13915original versions of these Invariant Sections. You may include a
13916translation of this License, and all the license notices in the
13917Document, and any Warranty Disclaimers, provided that you also include
13918the original English version of this License and the original versions
13919of those notices and disclaimers. In case of a disagreement between
13920the translation and the original version of this License or a notice
13921or disclaimer, the original version will prevail.
13922</P><P>
13923
13924If a section in the Document is Entitled "Acknowledgements",
13925"Dedications", or "History", the requirement (section 4) to Preserve
13926its Title (section 1) will typically require changing the actual
13927title.
13928</P><P>
13929
13930<LI>
13931TERMINATION
13932<P>
13933
13934You may not copy, modify, sublicense, or distribute the Document except
13935as expressly provided for under this License. Any other attempt to
13936copy, modify, sublicense or distribute the Document is void, and will
13937automatically terminate your rights under this License. However,
13938parties who have received copies, or rights, from you under this
13939License will not have their licenses terminated so long as such
13940parties remain in full compliance.
13941</P><P>
13942
13943<LI>
13944FUTURE REVISIONS OF THIS LICENSE
13945<P>
13946
13947The Free Software Foundation may publish new, revised versions
13948of the GNU Free Documentation License from time to time. Such new
13949versions will be similar in spirit to the present version, but may
13950differ in detail to address new problems or concerns. See
13951<A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>.
13952</P><P>
13953
13954Each version of the License is given a distinguishing version number.
13955If the Document specifies that a particular numbered version of this
13956License "or any later version" applies to it, you have the option of
13957following the terms and conditions either of that specified version or
13958of any later version that has been published (not as a draft) by the
13959Free Software Foundation. If the Document does not specify a version
13960number of this License, you may choose any version ever published (not
13961as a draft) by the Free Software Foundation.
13962</OL>
13963<P>
13964
13965<A NAME="SEC139"></A>
13966<H2> ADDENDUM: How to use this License for your documents </H2>
13967<!--docid::SEC139::-->
13968<P>
13969
13970To use this License in a document you have written, include a copy of
13971the License in the document and put the following copyright and
13972license notices just after the title page:
13973</P><P>
13974
13975<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre> Copyright (C) <VAR>year</VAR> <VAR>your name</VAR>.
13976 Permission is granted to copy, distribute and/or modify this document
13977 under the terms of the GNU Free Documentation License, Version 1.2
13978 or any later version published by the Free Software Foundation;
13979 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
13980 Texts. A copy of the license is included in the section entitled ``GNU
13981 Free Documentation License''.
13982</FONT></pre></td></tr></table></P><P>
13983
13984If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
13985replace the "with<small>...</small>Texts." line with this:
13986</P><P>
13987
13988<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre> with the Invariant Sections being <VAR>list their titles</VAR>, with
13989 the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts
13990 being <VAR>list</VAR>.
13991</FONT></pre></td></tr></table></P><P>
13992
13993If you have Invariant Sections without Cover Texts, or some other
13994combination of the three, merge those two alternatives to suit the
13995situation.
13996</P><P>
13997
13998If your document contains nontrivial examples of program code, we
13999recommend releasing these examples in parallel under your choice of
14000free software license, such as the GNU General Public License,
14001to permit their use in free software.
14002</P><P>
14003
14004<A NAME="Indexes"></A>
14005<HR SIZE="6">
14006<A NAME="SEC140"></A>
14007<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14008<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &lt; </A>]</TD>
14009<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> &gt; </A>]</TD>
14010<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
14011<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
14012<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14013<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14014<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14015<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14016<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14017</TR></TABLE>
14018<H1> D. Indexes </H1>
14019<!--docid::SEC140::-->
14020<P>
14021
14022<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
14023<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR>
14024<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR>
14025<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the
14026 variable you want.</TD></TR>
14027<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC144">D.4 Function Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR>
14028<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC145">D.5 Concept Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in
14029 this manual.</TD></TR>
14030</TABLE></BLOCKQUOTE>
14031<P>
14032
14033<A NAME="Builtin Index"></A>
14034<HR SIZE="6">
14035<A NAME="SEC141"></A>
14036<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14037<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &lt; </A>]</TD>
14038<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &gt; </A>]</TD>
14039<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
14040<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14041<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14042<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14043<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14044<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14045<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14046</TR></TABLE>
14047<H2> D.1 Index of Shell Builtin Commands </H2>
14048<!--docid::SEC141::-->
14049<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
14050 &nbsp;
14051<A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14052 &nbsp;
14053<A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14054 &nbsp;
14055<BR>
14056<A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14057 &nbsp;
14058<A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14059 &nbsp;
14060<A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14061 &nbsp;
14062<A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14063 &nbsp;
14064<A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14065 &nbsp;
14066<A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14067 &nbsp;
14068<A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14069 &nbsp;
14070<A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14071 &nbsp;
14072<A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14073 &nbsp;
14074<A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14075 &nbsp;
14076<A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14077 &nbsp;
14078<A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14079 &nbsp;
14080<A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14081 &nbsp;
14082<A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14083 &nbsp;
14084<A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14085 &nbsp;
14086<A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14087 &nbsp;
14088<A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14089 &nbsp;
14090<A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14091 &nbsp;
14092</td></tr></table><br><P></P>
14093<TABLE border=0>
14094<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14095<TR><TD COLSPAN=3> <HR></TD></TR>
14096<TR><TH><A NAME="bt_."></A>.</TH><TD></TD><TD></TD></TR>
14097<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>
14098<TR><TD COLSPAN=3> <HR></TD></TR>
14099<TR><TH><A NAME="bt_:"></A>:</TH><TD></TD><TD></TD></TR>
14100<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>
14101<TR><TD COLSPAN=3> <HR></TD></TR>
14102<TR><TH><A NAME="bt_["></A>[</TH><TD></TD><TD></TD></TR>
14103<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>
14104<TR><TD COLSPAN=3> <HR></TD></TR>
14105<TR><TH><A NAME="bt_A"></A>A</TH><TD></TD><TD></TD></TR>
14106<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>
14107<TR><TD COLSPAN=3> <HR></TD></TR>
14108<TR><TH><A NAME="bt_B"></A>B</TH><TD></TD><TD></TD></TR>
14109<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX289"><CODE>bg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14110<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>
14111<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>
14112<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>
14113<TR><TD COLSPAN=3> <HR></TD></TR>
14114<TR><TH><A NAME="bt_C"></A>C</TH><TD></TD><TD></TD></TR>
14115<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>
14116<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>
14117<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>
14118<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX531"><CODE>compgen</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14119<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX532"><CODE>complete</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14120<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX533"><CODE>compopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14121<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>
14122<TR><TD COLSPAN=3> <HR></TD></TR>
14123<TR><TH><A NAME="bt_D"></A>D</TH><TD></TD><TD></TD></TR>
14124<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>
14125<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX286"><CODE>dirs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
14126<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX294"><CODE>disown</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14127<TR><TD COLSPAN=3> <HR></TD></TR>
14128<TR><TH><A NAME="bt_E"></A>E</TH><TD></TD><TD></TD></TR>
14129<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>
14130<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>
14131<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>
14132<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>
14133<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>
14134<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>
14135<TR><TD COLSPAN=3> <HR></TD></TR>
14136<TR><TH><A NAME="bt_F"></A>F</TH><TD></TD><TD></TD></TR>
14137<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX535"><CODE>fc</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
14138<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX290"><CODE>fg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14139<TR><TD COLSPAN=3> <HR></TD></TR>
14140<TR><TH><A NAME="bt_G"></A>G</TH><TD></TD><TD></TD></TR>
14141<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>
14142<TR><TD COLSPAN=3> <HR></TD></TR>
14143<TR><TH><A NAME="bt_H"></A>H</TH><TD></TD><TD></TD></TR>
14144<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>
14145<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>
14146<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX536"><CODE>history</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
14147<TR><TD COLSPAN=3> <HR></TD></TR>
14148<TR><TH><A NAME="bt_J"></A>J</TH><TD></TD><TD></TD></TR>
14149<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX291"><CODE>jobs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14150<TR><TD COLSPAN=3> <HR></TD></TR>
14151<TR><TH><A NAME="bt_K"></A>K</TH><TD></TD><TD></TD></TR>
14152<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX292"><CODE>kill</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14153<TR><TD COLSPAN=3> <HR></TD></TR>
14154<TR><TH><A NAME="bt_L"></A>L</TH><TD></TD><TD></TD></TR>
14155<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>
14156<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>
14157<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>
14158<TR><TD COLSPAN=3> <HR></TD></TR>
14159<TR><TH><A NAME="bt_M"></A>M</TH><TD></TD><TD></TD></TR>
14160<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>
14161<TR><TD COLSPAN=3> <HR></TD></TR>
14162<TR><TH><A NAME="bt_P"></A>P</TH><TD></TD><TD></TD></TR>
14163<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX287"><CODE>popd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
14164<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>
14165<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX288"><CODE>pushd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
14166<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>
14167<TR><TD COLSPAN=3> <HR></TD></TR>
14168<TR><TH><A NAME="bt_R"></A>R</TH><TD></TD><TD></TD></TR>
14169<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>
14170<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>
14171<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>
14172<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>
14173<TR><TD COLSPAN=3> <HR></TD></TR>
14174<TR><TH><A NAME="bt_S"></A>S</TH><TD></TD><TD></TD></TR>
14175<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>
14176<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>
14177<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>
14178<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>
14179<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX295"><CODE>suspend</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14180<TR><TD COLSPAN=3> <HR></TD></TR>
14181<TR><TH><A NAME="bt_T"></A>T</TH><TD></TD><TD></TD></TR>
14182<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>
14183<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>
14184<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>
14185<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>
14186<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>
14187<TR><TD COLSPAN=3> <HR></TD></TR>
14188<TR><TH><A NAME="bt_U"></A>U</TH><TD></TD><TD></TD></TR>
14189<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>
14190<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>
14191<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>
14192<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>
14193<TR><TD COLSPAN=3> <HR></TD></TR>
14194<TR><TH><A NAME="bt_W"></A>W</TH><TD></TD><TD></TD></TR>
14195<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX293"><CODE>wait</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
14196<TR><TD COLSPAN=3> <HR></TD></TR>
14197</TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
14198 &nbsp;
14199<A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14200 &nbsp;
14201<A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14202 &nbsp;
14203<BR>
14204<A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14205 &nbsp;
14206<A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14207 &nbsp;
14208<A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14209 &nbsp;
14210<A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14211 &nbsp;
14212<A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14213 &nbsp;
14214<A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14215 &nbsp;
14216<A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14217 &nbsp;
14218<A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14219 &nbsp;
14220<A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14221 &nbsp;
14222<A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14223 &nbsp;
14224<A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14225 &nbsp;
14226<A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14227 &nbsp;
14228<A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14229 &nbsp;
14230<A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14231 &nbsp;
14232<A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14233 &nbsp;
14234<A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14235 &nbsp;
14236<A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14237 &nbsp;
14238<A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14239 &nbsp;
14240</td></tr></table><br><P>
14241
14242<A NAME="Reserved Word Index"></A>
14243<HR SIZE="6">
14244<A NAME="SEC142"></A>
14245<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14246<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> &lt; </A>]</TD>
14247<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &gt; </A>]</TD>
14248<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &lt;&lt; </A>]</TD>
14249<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14250<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14251<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14252<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14253<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14254<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14255</TR></TABLE>
14256<H2> D.2 Index of Shell Reserved Words </H2>
14257<!--docid::SEC142::-->
14258<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14259 &nbsp;
14260<A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14261 &nbsp;
14262<A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14263 &nbsp;
14264<A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14265 &nbsp;
14266<A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14267 &nbsp;
14268<BR>
14269<A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14270 &nbsp;
14271<A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14272 &nbsp;
14273<A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14274 &nbsp;
14275<A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14276 &nbsp;
14277<A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14278 &nbsp;
14279<A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14280 &nbsp;
14281<A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14282 &nbsp;
14283<A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14284 &nbsp;
14285<A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14286 &nbsp;
14287</td></tr></table><br><P></P>
14288<TABLE border=0>
14289<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14290<TR><TD COLSPAN=3> <HR></TD></TR>
14291<TR><TH><A NAME="rw_!"></A>!</TH><TD></TD><TD></TD></TR>
14292<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>
14293<TR><TD COLSPAN=3> <HR></TD></TR>
14294<TR><TH><A NAME="rw_["></A>[</TH><TD></TD><TD></TD></TR>
14295<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>
14296<TR><TD COLSPAN=3> <HR></TD></TR>
14297<TR><TH><A NAME="rw_]"></A>]</TH><TD></TD><TD></TD></TR>
14298<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>
14299<TR><TD COLSPAN=3> <HR></TD></TR>
14300<TR><TH><A NAME="rw_{"></A>{</TH><TD></TD><TD></TD></TR>
14301<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>
14302<TR><TD COLSPAN=3> <HR></TD></TR>
14303<TR><TH><A NAME="rw_}"></A>}</TH><TD></TD><TD></TD></TR>
14304<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>
14305<TR><TD COLSPAN=3> <HR></TD></TR>
14306<TR><TH><A NAME="rw_C"></A>C</TH><TD></TD><TD></TD></TR>
14307<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>
14308<TR><TD COLSPAN=3> <HR></TD></TR>
14309<TR><TH><A NAME="rw_D"></A>D</TH><TD></TD><TD></TD></TR>
14310<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>
14311<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>
14312<TR><TD COLSPAN=3> <HR></TD></TR>
14313<TR><TH><A NAME="rw_E"></A>E</TH><TD></TD><TD></TD></TR>
14314<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>
14315<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>
14316<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>
14317<TR><TD COLSPAN=3> <HR></TD></TR>
14318<TR><TH><A NAME="rw_F"></A>F</TH><TD></TD><TD></TD></TR>
14319<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>
14320<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>
14321<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>
14322<TR><TD COLSPAN=3> <HR></TD></TR>
14323<TR><TH><A NAME="rw_I"></A>I</TH><TD></TD><TD></TD></TR>
14324<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>
14325<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>
14326<TR><TD COLSPAN=3> <HR></TD></TR>
14327<TR><TH><A NAME="rw_S"></A>S</TH><TD></TD><TD></TD></TR>
14328<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>
14329<TR><TD COLSPAN=3> <HR></TD></TR>
14330<TR><TH><A NAME="rw_T"></A>T</TH><TD></TD><TD></TD></TR>
14331<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>
14332<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>
14333<TR><TD COLSPAN=3> <HR></TD></TR>
14334<TR><TH><A NAME="rw_U"></A>U</TH><TD></TD><TD></TD></TR>
14335<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>
14336<TR><TD COLSPAN=3> <HR></TD></TR>
14337<TR><TH><A NAME="rw_W"></A>W</TH><TD></TD><TD></TD></TR>
14338<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>
14339<TR><TD COLSPAN=3> <HR></TD></TR>
14340</TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14341 &nbsp;
14342<A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14343 &nbsp;
14344<A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14345 &nbsp;
14346<A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14347 &nbsp;
14348<A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14349 &nbsp;
14350<BR>
14351<A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14352 &nbsp;
14353<A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14354 &nbsp;
14355<A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14356 &nbsp;
14357<A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14358 &nbsp;
14359<A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14360 &nbsp;
14361<A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14362 &nbsp;
14363<A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14364 &nbsp;
14365<A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14366 &nbsp;
14367<A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14368 &nbsp;
14369</td></tr></table><br><P>
14370
14371<A NAME="Variable Index"></A>
14372<HR SIZE="6">
14373<A NAME="SEC143"></A>
14374<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14375<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &lt; </A>]</TD>
14376<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &gt; </A>]</TD>
14377<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &lt;&lt; </A>]</TD>
14378<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14379<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14380<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14381<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14382<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14383<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14384</TR></TABLE>
14385<H2> D.3 Parameter and Variable Index </H2>
14386<!--docid::SEC143::-->
14387<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
14388 &nbsp;
14389<A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
14390 &nbsp;
14391<A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
14392 &nbsp;
14393<A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
14394 &nbsp;
14395<A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
14396 &nbsp;
14397<A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
14398 &nbsp;
14399<A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
14400 &nbsp;
14401<A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
14402 &nbsp;
14403<A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
14404 &nbsp;
14405<BR>
14406<A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
14407 &nbsp;
14408<A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
14409 &nbsp;
14410<A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
14411 &nbsp;
14412<A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
14413 &nbsp;
14414<A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
14415 &nbsp;
14416<A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
14417 &nbsp;
14418<A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
14419 &nbsp;
14420<A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
14421 &nbsp;
14422<A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
14423 &nbsp;
14424<A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
14425 &nbsp;
14426<A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
14427 &nbsp;
14428<A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
14429 &nbsp;
14430<A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
14431 &nbsp;
14432<A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
14433 &nbsp;
14434<A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
14435 &nbsp;
14436<A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
14437 &nbsp;
14438<A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
14439 &nbsp;
14440<A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
14441 &nbsp;
14442<A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
14443 &nbsp;
14444</td></tr></table><br><P></P>
14445<TABLE border=0>
14446<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14447<TR><TD COLSPAN=3> <HR></TD></TR>
14448<TR><TH><A NAME="vr_!"></A>!</TH><TD></TD><TD></TD></TR>
14449<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>
14450<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>
14451<TR><TD COLSPAN=3> <HR></TD></TR>
14452<TR><TH><A NAME="vr_#"></A>#</TH><TD></TD><TD></TD></TR>
14453<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>
14454<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>
14455<TR><TD COLSPAN=3> <HR></TD></TR>
14456<TR><TH><A NAME="vr_$"></A>$</TH><TD></TD><TD></TD></TR>
14457<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>
14458<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>
14459<TR><TD COLSPAN=3> <HR></TD></TR>
14460<TR><TH><A NAME="vr_*"></A>*</TH><TD></TD><TD></TD></TR>
14461<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>
14462<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>
14463<TR><TD COLSPAN=3> <HR></TD></TR>
14464<TR><TH><A NAME="vr_-"></A>-</TH><TD></TD><TD></TD></TR>
14465<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>
14466<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>
14467<TR><TD COLSPAN=3> <HR></TD></TR>
14468<TR><TH><A NAME="vr_0"></A>0</TH><TD></TD><TD></TD></TR>
14469<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>
14470<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>
14471<TR><TD COLSPAN=3> <HR></TD></TR>
14472<TR><TH><A NAME="vr_?"></A>?</TH><TD></TD><TD></TD></TR>
14473<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>
14474<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>
14475<TR><TD COLSPAN=3> <HR></TD></TR>
14476<TR><TH><A NAME="vr_@"></A>@</TH><TD></TD><TD></TD></TR>
14477<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>
14478<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>
14479<TR><TD COLSPAN=3> <HR></TD></TR>
14480<TR><TH><A NAME="vr__"></A>_</TH><TD></TD><TD></TD></TR>
14481<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>
14482<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>
14483<TR><TD COLSPAN=3> <HR></TD></TR>
14484<TR><TH><A NAME="vr_A"></A>A</TH><TD></TD><TD></TD></TR>
14485<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX296"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
14486<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX297"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
14487<TR><TD COLSPAN=3> <HR></TD></TR>
14488<TR><TH><A NAME="vr_B"></A>B</TH><TD></TD><TD></TD></TR>
14489<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>
14490<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>
14491<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX136"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14492<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX137"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14493<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX138"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14494<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX139"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14495<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX140"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14496<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX141"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14497<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX142"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14498<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX143"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14499<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX144"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14500<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX145"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14501<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX146"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14502<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX147"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14503<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX148"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14504<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX149"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14505<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX150"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14506<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX151"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14507<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX152"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14508<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX153"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14509<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX154"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14510<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX155"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14511<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX156"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14512<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX157"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14513<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX158"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14514<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX159"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14515<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX160"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14516<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX161"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14517<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX134"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14518<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX135"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14519<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX303"><CODE>bell-style</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14520<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX304"><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>
14521<TR><TD COLSPAN=3> <HR></TD></TR>
14522<TR><TH><A NAME="vr_C"></A>C</TH><TD></TD><TD></TD></TR>
14523<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>
14524<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>
14525<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX162"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14526<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX163"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14527<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX305"><CODE>comment-begin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14528<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX164"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14529<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX165"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14530<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX172"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14531<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX173"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14532<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX166"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14533<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX167"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14534<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX168"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14535<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX169"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14536<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX170"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14537<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX171"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14538<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX174"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14539<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX175"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14540<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX176"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14541<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX177"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14542<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX306"><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>
14543<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX307"><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>
14544<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX178"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14545<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX179"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14546<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX308"><CODE>convert-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14547<TR><TD COLSPAN=3> <HR></TD></TR>
14548<TR><TH><A NAME="vr_D"></A>D</TH><TD></TD><TD></TD></TR>
14549<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX180"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14550<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX181"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14551<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX309"><CODE>disable-completion</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14552<TR><TD COLSPAN=3> <HR></TD></TR>
14553<TR><TH><A NAME="vr_E"></A>E</TH><TD></TD><TD></TD></TR>
14554<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX310"><CODE>editing-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14555<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX182"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14556<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX183"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14557<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX311"><CODE>enable-keypad</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14558<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX184"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14559<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX185"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14560<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX312"><CODE>expand-tilde</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14561<TR><TD COLSPAN=3> <HR></TD></TR>
14562<TR><TH><A NAME="vr_F"></A>F</TH><TD></TD><TD></TD></TR>
14563<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX186"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14564<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX187"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14565<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX188"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14566<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX189"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14567<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX190"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14568<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX191"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14569<TR><TD COLSPAN=3> <HR></TD></TR>
14570<TR><TH><A NAME="vr_G"></A>G</TH><TD></TD><TD></TD></TR>
14571<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX192"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14572<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX193"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14573<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX194"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14574<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX195"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14575<TR><TD COLSPAN=3> <HR></TD></TR>
14576<TR><TH><A NAME="vr_H"></A>H</TH><TD></TD><TD></TD></TR>
14577<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX196"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14578<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX197"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14579<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX198"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14580<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX199"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14581<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX200"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14582<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX201"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14583<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX202"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14584<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX203"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14585<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX204"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14586<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX205"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14587<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX206"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14588<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX207"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14589<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX313"><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>
14590<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX314"><CODE>history-size</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14591<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX208"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14592<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX209"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14593<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX210"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14594<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX211"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14595<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>
14596<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>
14597<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX315"><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>
14598<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX212"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14599<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX213"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14600<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX214"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14601<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX215"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14602<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX216"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14603<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX217"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14604<TR><TD COLSPAN=3> <HR></TD></TR>
14605<TR><TH><A NAME="vr_I"></A>I</TH><TD></TD><TD></TD></TR>
14606<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>
14607<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>
14608<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX218"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14609<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX219"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14610<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX316"><CODE>input-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14611<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX220"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14612<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX221"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14613<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX318"><CODE>isearch-terminators</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14614<TR><TD COLSPAN=3> <HR></TD></TR>
14615<TR><TH><A NAME="vr_K"></A>K</TH><TD></TD><TD></TD></TR>
14616<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX319"><CODE>keymap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14617<TR><TD COLSPAN=3> <HR></TD></TR>
14618<TR><TH><A NAME="vr_L"></A>L</TH><TD></TD><TD></TD></TR>
14619<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX222"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14620<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX223"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14621<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX224"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14622<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX225"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14623<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX226"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14624<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX227"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14625<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX228"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14626<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX229"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14627<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>
14628<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX230"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14629<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX231"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14630<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX232"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14631<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX233"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14632<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX234"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14633<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX235"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14634<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX236"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14635<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX237"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14636<TR><TD COLSPAN=3> <HR></TD></TR>
14637<TR><TH><A NAME="vr_M"></A>M</TH><TD></TD><TD></TD></TR>
14638<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX238"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14639<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX239"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14640<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>
14641<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>
14642<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX240"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14643<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX241"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14644<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>
14645<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>
14646<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX320"><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>
14647<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX321"><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>
14648<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX322"><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>
14649<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX317"><CODE>meta-flag</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14650<TR><TD COLSPAN=3> <HR></TD></TR>
14651<TR><TH><A NAME="vr_O"></A>O</TH><TD></TD><TD></TD></TR>
14652<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX242"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14653<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX243"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14654<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>
14655<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>
14656<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX244"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14657<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX245"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14658<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>
14659<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>
14660<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX246"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14661<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX247"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14662<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX323"><CODE>output-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14663<TR><TD COLSPAN=3> <HR></TD></TR>
14664<TR><TH><A NAME="vr_P"></A>P</TH><TD></TD><TD></TD></TR>
14665<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX324"><CODE>page-completions</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14666<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>
14667<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>
14668<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX248"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14669<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX249"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14670<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX250"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14671<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX251"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14672<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX252"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14673<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX253"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14674<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX254"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14675<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX255"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14676<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX256"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14677<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX257"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14678<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>
14679<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>
14680<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>
14681<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>
14682<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX258"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14683<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX259"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14684<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX260"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14685<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX261"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14686<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX262"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14687<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX263"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14688<TR><TD COLSPAN=3> <HR></TD></TR>
14689<TR><TH><A NAME="vr_R"></A>R</TH><TD></TD><TD></TD></TR>
14690<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX264"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14691<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX265"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14692<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX266"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14693<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX267"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14694<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX325"><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>
14695<TR><TD COLSPAN=3> <HR></TD></TR>
14696<TR><TH><A NAME="vr_S"></A>S</TH><TD></TD><TD></TD></TR>
14697<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX268"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14698<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX269"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14699<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX270"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14700<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX271"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14701<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX272"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14702<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX273"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14703<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX274"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14704<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX275"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14705<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX326"><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>
14706<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX327"><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>
14707<TR><TD COLSPAN=3> <HR></TD></TR>
14708<TR><TH><A NAME="vr_T"></A>T</TH><TD></TD><TD></TD></TR>
14709<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>
14710<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>
14711<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX276"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14712<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX277"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14713<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX278"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14714<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX279"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14715<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX280"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14716<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX281"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14717<TR><TD COLSPAN=3> <HR></TD></TR>
14718<TR><TH><A NAME="vr_U"></A>U</TH><TD></TD><TD></TD></TR>
14719<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX282"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14720<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX283"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14721<TR><TD COLSPAN=3> <HR></TD></TR>
14722<TR><TH><A NAME="vr_V"></A>V</TH><TD></TD><TD></TD></TR>
14723<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX328"><CODE>visible-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14724<TR><TD COLSPAN=3> <HR></TD></TR>
14725</TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
14726 &nbsp;
14727<A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
14728 &nbsp;
14729<A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
14730 &nbsp;
14731<A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
14732 &nbsp;
14733<A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
14734 &nbsp;
14735<A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
14736 &nbsp;
14737<A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
14738 &nbsp;
14739<A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
14740 &nbsp;
14741<A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
14742 &nbsp;
14743<BR>
14744<A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
14745 &nbsp;
14746<A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
14747 &nbsp;
14748<A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
14749 &nbsp;
14750<A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
14751 &nbsp;
14752<A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
14753 &nbsp;
14754<A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
14755 &nbsp;
14756<A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
14757 &nbsp;
14758<A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
14759 &nbsp;
14760<A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
14761 &nbsp;
14762<A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
14763 &nbsp;
14764<A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
14765 &nbsp;
14766<A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
14767 &nbsp;
14768<A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
14769 &nbsp;
14770<A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
14771 &nbsp;
14772<A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
14773 &nbsp;
14774<A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
14775 &nbsp;
14776<A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
14777 &nbsp;
14778<A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
14779 &nbsp;
14780<A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
14781 &nbsp;
14782</td></tr></table><br><P>
14783
14784<A NAME="Function Index"></A>
14785<HR SIZE="6">
14786<A NAME="SEC144"></A>
14787<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14788<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &lt; </A>]</TD>
14789<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> &gt; </A>]</TD>
14790<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> &lt;&lt; </A>]</TD>
14791<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14792<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14793<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14794<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14795<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14796<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14797</TR></TABLE>
14798<H2> D.4 Function Index </H2>
14799<!--docid::SEC144::-->
14800<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
14801 &nbsp;
14802<A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
14803 &nbsp;
14804<A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
14805 &nbsp;
14806<A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
14807 &nbsp;
14808<A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
14809 &nbsp;
14810<A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
14811 &nbsp;
14812<A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
14813 &nbsp;
14814<A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
14815 &nbsp;
14816<A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
14817 &nbsp;
14818<A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
14819 &nbsp;
14820<A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
14821 &nbsp;
14822<A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
14823 &nbsp;
14824<A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
14825 &nbsp;
14826<A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
14827 &nbsp;
14828<A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
14829 &nbsp;
14830<A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
14831 &nbsp;
14832<A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
14833 &nbsp;
14834<A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
14835 &nbsp;
14836<A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
14837 &nbsp;
14838<A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
14839 &nbsp;
14840</td></tr></table><br><P></P>
14841<TABLE border=0>
14842<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14843<TR><TD COLSPAN=3> <HR></TD></TR>
14844<TR><TH><A NAME="fn_A"></A>A</TH><TD></TD><TD></TD></TR>
14845<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14846<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX480"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14847<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><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>
14848<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX350"><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>
14849<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX521"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14850<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX522"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14851<TR><TD COLSPAN=3> <HR></TD></TR>
14852<TR><TH><A NAME="fn_B"></A>B</TH><TD></TD><TD></TD></TR>
14853<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><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>
14854<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><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>
14855<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX377"><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>
14856<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX378"><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>
14857<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX399"><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>
14858<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX400"><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>
14859<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX411"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14860<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX412"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14861<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX407"><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>
14862<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX408"><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>
14863<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX339"><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>
14864<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX340"><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>
14865<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX355"><CODE>beginning-of-history (M-&#38;#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
14866<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX356"><CODE>beginning-of-history (M-&#38;#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
14867<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX329"><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>
14868<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX330"><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>
14869<TR><TD COLSPAN=3> <HR></TD></TR>
14870<TR><TH><A NAME="fn_C"></A>C</TH><TD></TD><TD></TD></TR>
14871<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX475"><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>
14872<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX476"><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>
14873<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><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>
14874<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX394"><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>
14875<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX495"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14876<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX496"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14877<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><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>
14878<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><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>
14879<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX345"><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>
14880<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><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>
14881<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX435"><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>
14882<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX436"><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>
14883<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX461"><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>
14884<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX462"><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>
14885<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX445"><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>
14886<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX446"><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>
14887<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX457"><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>
14888<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX458"><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>
14889<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX469"><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>
14890<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX470"><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>
14891<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX449"><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>
14892<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX450"><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>
14893<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX453"><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>
14894<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX454"><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>
14895<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX423"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14896<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX424"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14897<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX425"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14898<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX426"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14899<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX421"><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>
14900<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX422"><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>
14901<TR><TD COLSPAN=3> <HR></TD></TR>
14902<TR><TH><A NAME="fn_D"></A>D</TH><TD></TD><TD></TD></TR>
14903<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX467"><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>
14904<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX468"><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>
14905<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX375"><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>
14906<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX376"><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>
14907<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX443"><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>
14908<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX444"><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>
14909<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX417"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14910<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX418"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14911<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX431"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, &#60;small&#62;...&#60;/small&#62; <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
14912<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX432"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, &#60;small&#62;...&#60;/small&#62; <KBD>M--</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
14913<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX513"><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>
14914<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX514"><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>
14915<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX481"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14916<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX482"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14917<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><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>
14918<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><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>
14919<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14920<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX502"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14921<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX505"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14922<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14923<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX503"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14924<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX504"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14925<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX465"><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>
14926<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX466"><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>
14927<TR><TD COLSPAN=3> <HR></TD></TR>
14928<TR><TH><A NAME="fn_E"></A>E</TH><TD></TD><TD></TD></TR>
14929<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX529"><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>
14930<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX530"><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>
14931<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><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>
14932<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX474"><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>
14933<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX357"><CODE>end-of-history (M-&#38;#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
14934<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX358"><CODE>end-of-history (M-&#38;#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
14935<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX331"><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>
14936<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX332"><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>
14937<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX493"><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>
14938<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX494"><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>
14939<TR><TD COLSPAN=3> <HR></TD></TR>
14940<TR><TH><A NAME="fn_F"></A>F</TH><TD></TD><TD></TD></TR>
14941<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX379"><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>
14942<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX380"><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>
14943<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX333"><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>
14944<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><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>
14945<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><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>
14946<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX362"><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>
14947<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><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>
14948<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX338"><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>
14949<TR><TD COLSPAN=3> <HR></TD></TR>
14950<TR><TH><A NAME="fn_G"></A>G</TH><TD></TD><TD></TD></TR>
14951<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><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>
14952<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX508"><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>
14953<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX509"><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>
14954<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510"><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>
14955<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX511"><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>
14956<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX512"><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>
14957<TR><TD COLSPAN=3> <HR></TD></TR>
14958<TR><TH><A NAME="fn_H"></A>H</TH><TD></TD><TD></TD></TR>
14959<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX523"><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>
14960<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX524"><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>
14961<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX517"><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>
14962<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX518"><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>
14963<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX369"><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>
14964<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX370"><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>
14965<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX367"><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>
14966<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX368"><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>
14967<TR><TD COLSPAN=3> <HR></TD></TR>
14968<TR><TH><A NAME="fn_I"></A>I</TH><TD></TD><TD></TD></TR>
14969<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14970<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14971<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX439"><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>
14972<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX440"><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>
14973<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX525"><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>
14974<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX526"><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>
14975<TR><TD COLSPAN=3> <HR></TD></TR>
14976<TR><TH><A NAME="fn_K"></A>K</TH><TD></TD><TD></TD></TR>
14977<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><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>
14978<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX398"><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>
14979<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX419"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14980<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX420"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14981<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX403"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14982<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX404"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
14983<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX405"><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>
14984<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX406"><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>
14985<TR><TD COLSPAN=3> <HR></TD></TR>
14986<TR><TH><A NAME="fn_M"></A>M</TH><TD></TD><TD></TD></TR>
14987<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX519"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14988<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX520"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
14989<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX441"><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>
14990<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX442"><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>
14991<TR><TD COLSPAN=3> <HR></TD></TR>
14992<TR><TH><A NAME="fn_N"></A>N</TH><TD></TD><TD></TD></TR>
14993<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX353"><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>
14994<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX354"><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>
14995<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX365"><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>
14996<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX366"><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>
14997<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><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>
14998<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX364"><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>
14999<TR><TD COLSPAN=3> <HR></TD></TR>
15000<TR><TH><A NAME="fn_O"></A>O</TH><TD></TD><TD></TD></TR>
15001<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX527"><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>
15002<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX528"><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>
15003<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX395"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15004<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15005<TR><TD COLSPAN=3> <HR></TD></TR>
15006<TR><TH><A NAME="fn_P"></A>P</TH><TD></TD><TD></TD></TR>
15007<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX463"><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>
15008<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX464"><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>
15009<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><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>
15010<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX438"><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>
15011<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX447"><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>
15012<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX448"><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>
15013<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX459"><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>
15014<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX460"><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>
15015<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX451"><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>
15016<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX452"><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>
15017<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX455"><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>
15018<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX456"><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>
15019<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX483"><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>
15020<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX484"><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>
15021<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX351"><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>
15022<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX352"><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>
15023<TR><TD COLSPAN=3> <HR></TD></TR>
15024<TR><TH><A NAME="fn_Q"></A>Q</TH><TD></TD><TD></TD></TR>
15025<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX381"><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>
15026<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX382"><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>
15027<TR><TD COLSPAN=3> <HR></TD></TR>
15028<TR><TH><A NAME="fn_R"></A>R</TH><TD></TD><TD></TD></TR>
15029<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX477"><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>
15030<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><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>
15031<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15032<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15033<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX359"><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>
15034<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX360"><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>
15035<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX487"><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>
15036<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><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>
15037<TR><TD COLSPAN=3> <HR></TD></TR>
15038<TR><TH><A NAME="fn_S"></A>S</TH><TD></TD><TD></TD></TR>
15039<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX383"><CODE>self-insert (a, b, A, 1, !, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15040<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX384"><CODE>self-insert (a, b, A, 1, !, &#60;small&#62;...&#60;/small&#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15041<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX491"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15042<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX492"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15043<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX343"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15044<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX344"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15045<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX515"><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>
15046<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX516"><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>
15047<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX341"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15048<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX342"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15049<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX409"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15050<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX410"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15051<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX471"><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>
15052<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><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>
15053<TR><TD COLSPAN=3> <HR></TD></TR>
15054<TR><TH><A NAME="fn_T"></A>T</TH><TD></TD><TD></TD></TR>
15055<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><CODE>tilde-expand (M-&#38;#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15056<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX490"><CODE>tilde-expand (M-&#38;#38;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15057<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX385"><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>
15058<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX386"><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>
15059<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX387"><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>
15060<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX388"><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>
15061<TR><TD COLSPAN=3> <HR></TD></TR>
15062<TR><TH><A NAME="fn_U"></A>U</TH><TD></TD><TD></TD></TR>
15063<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX485"><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>
15064<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX486"><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>
15065<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX433"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15066<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX434"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15067<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15068<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX416"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15069<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX401"><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>
15070<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX402"><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>
15071<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX413"><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>
15072<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><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>
15073<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><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>
15074<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><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>
15075<TR><TD COLSPAN=3> <HR></TD></TR>
15076<TR><TH><A NAME="fn_Y"></A>Y</TH><TD></TD><TD></TD></TR>
15077<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX427"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15078<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX428"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15079<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX373"><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>
15080<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX374"><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>
15081<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX371"><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>
15082<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX372"><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>
15083<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX429"><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>
15084<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX430"><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>
15085<TR><TD COLSPAN=3> <HR></TD></TR>
15086</TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
15087 &nbsp;
15088<A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
15089 &nbsp;
15090<A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
15091 &nbsp;
15092<A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
15093 &nbsp;
15094<A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
15095 &nbsp;
15096<A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
15097 &nbsp;
15098<A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
15099 &nbsp;
15100<A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
15101 &nbsp;
15102<A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
15103 &nbsp;
15104<A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
15105 &nbsp;
15106<A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
15107 &nbsp;
15108<A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
15109 &nbsp;
15110<A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
15111 &nbsp;
15112<A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
15113 &nbsp;
15114<A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
15115 &nbsp;
15116<A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
15117 &nbsp;
15118<A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
15119 &nbsp;
15120<A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
15121 &nbsp;
15122<A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
15123 &nbsp;
15124<A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
15125 &nbsp;
15126</td></tr></table><br><P>
15127
15128<A NAME="Concept Index"></A>
15129<HR SIZE="6">
15130<A NAME="SEC145"></A>
15131<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15132<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &lt; </A>]</TD>
15133<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt; ]</TD>
15134<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
15135<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
15136<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
15137<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15138<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15139<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15140<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15141</TR></TABLE>
15142<H2> D.5 Concept Index </H2>
15143<!--docid::SEC145::-->
15144<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
15145 &nbsp;
15146<A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15147 &nbsp;
15148<A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15149 &nbsp;
15150<A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15151 &nbsp;
15152<A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15153 &nbsp;
15154<A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15155 &nbsp;
15156<A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15157 &nbsp;
15158<A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15159 &nbsp;
15160<A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15161 &nbsp;
15162<A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15163 &nbsp;
15164<A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15165 &nbsp;
15166<A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15167 &nbsp;
15168<A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15169 &nbsp;
15170<A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15171 &nbsp;
15172<A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15173 &nbsp;
15174<A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15175 &nbsp;
15176<A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15177 &nbsp;
15178<A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15179 &nbsp;
15180<A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15181 &nbsp;
15182<A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15183 &nbsp;
15184<A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15185 &nbsp;
15186<A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15187 &nbsp;
15188</td></tr></table><br><P></P>
15189<TABLE border=0>
15190<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15191<TR><TD COLSPAN=3> <HR></TD></TR>
15192<TR><TH><A NAME="cp_A"></A>A</TH><TD></TD><TD></TD></TR>
15193<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>
15194<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>
15195<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>
15196<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>
15197<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>
15198<TR><TD COLSPAN=3> <HR></TD></TR>
15199<TR><TH><A NAME="cp_B"></A>B</TH><TD></TD><TD></TD></TR>
15200<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>
15201<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>
15202<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>
15203<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>
15204<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>
15205<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>
15206<TR><TD COLSPAN=3> <HR></TD></TR>
15207<TR><TH><A NAME="cp_C"></A>C</TH><TD></TD><TD></TD></TR>
15208<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>
15209<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>
15210<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>
15211<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>
15212<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>
15213<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>
15214<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>
15215<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>
15216<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>
15217<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>
15218<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>
15219<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>
15220<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>
15221<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>
15222<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>
15223<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>
15224<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>
15225<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>
15226<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>
15227<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>
15228<TR><TD COLSPAN=3> <HR></TD></TR>
15229<TR><TH><A NAME="cp_D"></A>D</TH><TD></TD><TD></TD></TR>
15230<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>
15231<TR><TD COLSPAN=3> <HR></TD></TR>
15232<TR><TH><A NAME="cp_E"></A>E</TH><TD></TD><TD></TD></TR>
15233<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>
15234<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>
15235<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>
15236<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>
15237<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>
15238<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>
15239<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>
15240<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>
15241<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>
15242<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>
15243<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>
15244<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>
15245<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>
15246<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>
15247<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>
15248<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>
15249<TR><TD COLSPAN=3> <HR></TD></TR>
15250<TR><TH><A NAME="cp_F"></A>F</TH><TD></TD><TD></TD></TR>
15251<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>
15252<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>
15253<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>
15254<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>
15255<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>
15256<TR><TD COLSPAN=3> <HR></TD></TR>
15257<TR><TH><A NAME="cp_H"></A>H</TH><TD></TD><TD></TD></TR>
15258<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>
15259<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX537">history events</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD></TR>
15260<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>
15261<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>
15262<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX534">History, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
15263<TR><TD COLSPAN=3> <HR></TD></TR>
15264<TR><TH><A NAME="cp_I"></A>I</TH><TD></TD><TD></TD></TR>
15265<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>
15266<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>
15267<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>
15268<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>
15269<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX285">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR>
15270<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>
15271<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>
15272<TR><TD COLSPAN=3> <HR></TD></TR>
15273<TR><TH><A NAME="cp_J"></A>J</TH><TD></TD><TD></TD></TR>
15274<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>
15275<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>
15276<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>
15277<TR><TD COLSPAN=3> <HR></TD></TR>
15278<TR><TH><A NAME="cp_K"></A>K</TH><TD></TD><TD></TD></TR>
15279<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX301">kill ring</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
15280<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX299">killing text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
15281<TR><TD COLSPAN=3> <HR></TD></TR>
15282<TR><TH><A NAME="cp_L"></A>L</TH><TD></TD><TD></TD></TR>
15283<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>
15284<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX284">login shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR>
15285<TR><TD COLSPAN=3> <HR></TD></TR>
15286<TR><TH><A NAME="cp_M"></A>M</TH><TD></TD><TD></TD></TR>
15287<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>
15288<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>
15289<TR><TD COLSPAN=3> <HR></TD></TR>
15290<TR><TH><A NAME="cp_N"></A>N</TH><TD></TD><TD></TD></TR>
15291<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>
15292<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>
15293<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>
15294<TR><TD COLSPAN=3> <HR></TD></TR>
15295<TR><TH><A NAME="cp_O"></A>O</TH><TD></TD><TD></TD></TR>
15296<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>
15297<TR><TD COLSPAN=3> <HR></TD></TR>
15298<TR><TH><A NAME="cp_P"></A>P</TH><TD></TD><TD></TD></TR>
15299<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>
15300<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>
15301<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>
15302<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>
15303<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>
15304<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>
15305<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>
15306<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>
15307<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>
15308<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>
15309<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>
15310<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>
15311<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>
15312<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>
15313<TR><TD COLSPAN=3> <HR></TD></TR>
15314<TR><TH><A NAME="cp_Q"></A>Q</TH><TD></TD><TD></TD></TR>
15315<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>
15316<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>
15317<TR><TD COLSPAN=3> <HR></TD></TR>
15318<TR><TH><A NAME="cp_R"></A>R</TH><TD></TD><TD></TD></TR>
15319<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX298">Readline, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
15320<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>
15321<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>
15322<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>
15323<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>
15324<TR><TD COLSPAN=3> <HR></TD></TR>
15325<TR><TH><A NAME="cp_S"></A>S</TH><TD></TD><TD></TD></TR>
15326<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>
15327<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>
15328<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>
15329<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>
15330<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>
15331<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>
15332<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>
15333<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>
15334<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>
15335<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>
15336<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>
15337<TR><TD COLSPAN=3> <HR></TD></TR>
15338<TR><TH><A NAME="cp_T"></A>T</TH><TD></TD><TD></TD></TR>
15339<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>
15340<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>
15341<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>
15342<TR><TD COLSPAN=3> <HR></TD></TR>
15343<TR><TH><A NAME="cp_V"></A>V</TH><TD></TD><TD></TD></TR>
15344<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>
15345<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX302">variables, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
15346<TR><TD COLSPAN=3> <HR></TD></TR>
15347<TR><TH><A NAME="cp_W"></A>W</TH><TD></TD><TD></TD></TR>
15348<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>
15349<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>
15350<TR><TD COLSPAN=3> <HR></TD></TR>
15351<TR><TH><A NAME="cp_Y"></A>Y</TH><TD></TD><TD></TD></TR>
15352<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX300">yanking text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
15353<TR><TD COLSPAN=3> <HR></TD></TR>
15354</TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
15355 &nbsp;
15356<A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15357 &nbsp;
15358<A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15359 &nbsp;
15360<A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15361 &nbsp;
15362<A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15363 &nbsp;
15364<A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15365 &nbsp;
15366<A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15367 &nbsp;
15368<A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15369 &nbsp;
15370<A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15371 &nbsp;
15372<A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15373 &nbsp;
15374<A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15375 &nbsp;
15376<A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15377 &nbsp;
15378<A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15379 &nbsp;
15380<A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15381 &nbsp;
15382<A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15383 &nbsp;
15384<A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15385 &nbsp;
15386<A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15387 &nbsp;
15388<A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15389 &nbsp;
15390<A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15391 &nbsp;
15392<A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15393 &nbsp;
15394<A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15395 &nbsp;
15396<A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15397 &nbsp;
15398</td></tr></table><br><P>
15399
15400<HR SIZE="6">
15401<A NAME="SEC_Contents"></A>
15402<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15403<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15404<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15405<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15406<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15407</TR></TABLE>
15408<H1>Table of Contents</H1>
15409<UL>
15410<A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
15411<BR>
15412<UL>
15413<A NAME="TOC2" HREF="bashref.html#SEC2">1.1 What is Bash?</A>
15414<BR>
15415<A NAME="TOC3" HREF="bashref.html#SEC3">1.2 What is a shell?</A>
15416<BR>
15417</UL>
15418<A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
15419<BR>
15420<A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
15421<BR>
15422<UL>
15423<A NAME="TOC6" HREF="bashref.html#SEC6">3.1 Shell Syntax</A>
15424<BR>
15425<UL>
15426<A NAME="TOC7" HREF="bashref.html#SEC7">3.1.1 Shell Operation</A>
15427<BR>
15428<A NAME="TOC8" HREF="bashref.html#SEC8">3.1.2 Quoting</A>
15429<BR>
15430<UL>
15431<A NAME="TOC9" HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A>
15432<BR>
15433<A NAME="TOC10" HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A>
15434<BR>
15435<A NAME="TOC11" HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A>
15436<BR>
15437<A NAME="TOC12" HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>
15438<BR>
15439<A NAME="TOC13" HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>
15440<BR>
15441</UL>
15442<A NAME="TOC14" HREF="bashref.html#SEC14">3.1.3 Comments</A>
15443<BR>
15444</UL>
15445<A NAME="TOC15" HREF="bashref.html#SEC15">3.2 Shell Commands</A>
15446<BR>
15447<UL>
15448<A NAME="TOC16" HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>
15449<BR>
15450<A NAME="TOC17" HREF="bashref.html#SEC17">3.2.2 Pipelines</A>
15451<BR>
15452<A NAME="TOC18" HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>
15453<BR>
15454<A NAME="TOC19" HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>
15455<BR>
15456<UL>
15457<A NAME="TOC20" HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>
15458<BR>
15459<A NAME="TOC21" HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>
15460<BR>
15461<A NAME="TOC22" HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>
15462<BR>
15463</UL>
15464<A NAME="TOC23" HREF="bashref.html#SEC23">3.2.5 Coprocesses</A>
15465<BR>
15466</UL>
15467<A NAME="TOC24" HREF="bashref.html#SEC24">3.3 Shell Functions</A>
15468<BR>
15469<A NAME="TOC25" HREF="bashref.html#SEC25">3.4 Shell Parameters</A>
15470<BR>
15471<UL>
15472<A NAME="TOC26" HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>
15473<BR>
15474<A NAME="TOC27" HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>
15475<BR>
15476</UL>
15477<A NAME="TOC28" HREF="bashref.html#SEC28">3.5 Shell Expansions</A>
15478<BR>
15479<UL>
15480<A NAME="TOC29" HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>
15481<BR>
15482<A NAME="TOC30" HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>
15483<BR>
15484<A NAME="TOC31" HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>
15485<BR>
15486<A NAME="TOC32" HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>
15487<BR>
15488<A NAME="TOC33" HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>
15489<BR>
15490<A NAME="TOC34" HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>
15491<BR>
15492<A NAME="TOC35" HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>
15493<BR>
15494<A NAME="TOC36" HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>
15495<BR>
15496<UL>
15497<A NAME="TOC37" HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>
15498<BR>
15499</UL>
15500<A NAME="TOC38" HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>
15501<BR>
15502</UL>
15503<A NAME="TOC39" HREF="bashref.html#SEC39">3.6 Redirections</A>
15504<BR>
15505<UL>
15506<A NAME="TOC40" HREF="bashref.html#SEC40">3.6.1 Redirecting Input</A>
15507<BR>
15508<A NAME="TOC41" HREF="bashref.html#SEC41">3.6.2 Redirecting Output</A>
15509<BR>
15510<A NAME="TOC42" HREF="bashref.html#SEC42">3.6.3 Appending Redirected Output</A>
15511<BR>
15512<A NAME="TOC43" HREF="bashref.html#SEC43">3.6.4 Redirecting Standard Output and Standard Error</A>
15513<BR>
15514<A NAME="TOC44" HREF="bashref.html#SEC44">3.6.5 Appending Standard Output and Standard Error</A>
15515<BR>
15516<A NAME="TOC45" HREF="bashref.html#SEC45">3.6.6 Here Documents</A>
15517<BR>
15518<A NAME="TOC46" HREF="bashref.html#SEC46">3.6.7 Here Strings</A>
15519<BR>
15520<A NAME="TOC47" HREF="bashref.html#SEC47">3.6.8 Duplicating File Descriptors</A>
15521<BR>
15522<A NAME="TOC48" HREF="bashref.html#SEC48">3.6.9 Moving File Descriptors</A>
15523<BR>
15524<A NAME="TOC49" HREF="bashref.html#SEC49">3.6.10 Opening File Descriptors for Reading and Writing</A>
15525<BR>
15526</UL>
15527<A NAME="TOC50" HREF="bashref.html#SEC50">3.7 Executing Commands</A>
15528<BR>
15529<UL>
15530<A NAME="TOC51" HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A>
15531<BR>
15532<A NAME="TOC52" HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A>
15533<BR>
15534<A NAME="TOC53" HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>
15535<BR>
15536<A NAME="TOC54" HREF="bashref.html#SEC54">3.7.4 Environment</A>
15537<BR>
15538<A NAME="TOC55" HREF="bashref.html#SEC55">3.7.5 Exit Status</A>
15539<BR>
15540<A NAME="TOC56" HREF="bashref.html#SEC56">3.7.6 Signals</A>
15541<BR>
15542</UL>
15543<A NAME="TOC57" HREF="bashref.html#SEC57">3.8 Shell Scripts</A>
15544<BR>
15545</UL>
15546<A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>
15547<BR>
15548<UL>
15549<A NAME="TOC59" HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>
15550<BR>
15551<A NAME="TOC60" HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>
15552<BR>
15553<A NAME="TOC61" HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A>
15554<BR>
15555<UL>
15556<A NAME="TOC62" HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>
15557<BR>
15558<A NAME="TOC63" HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
15559<BR>
15560</UL>
15561<A NAME="TOC64" HREF="bashref.html#SEC64">4.4 Special Builtins</A>
15562<BR>
15563</UL>
15564<A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A>
15565<BR>
15566<UL>
15567<A NAME="TOC66" HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A>
15568<BR>
15569<A NAME="TOC67" HREF="bashref.html#SEC67">5.2 Bash Variables</A>
15570<BR>
15571</UL>
15572<A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A>
15573<BR>
15574<UL>
15575<A NAME="TOC69" HREF="bashref.html#SEC69">6.1 Invoking Bash</A>
15576<BR>
15577<A NAME="TOC70" HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>
15578<BR>
15579<A NAME="TOC78" HREF="bashref.html#SEC78">6.3 Interactive Shells</A>
15580<BR>
15581<UL>
15582<A NAME="TOC79" HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A>
15583<BR>
15584<A NAME="TOC80" HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A>
15585<BR>
15586<A NAME="TOC81" HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A>
15587<BR>
15588</UL>
15589<A NAME="TOC82" HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>
15590<BR>
15591<A NAME="TOC83" HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>
15592<BR>
15593<A NAME="TOC84" HREF="bashref.html#SEC84">6.6 Aliases</A>
15594<BR>
15595<A NAME="TOC85" HREF="bashref.html#SEC85">6.7 Arrays</A>
15596<BR>
15597<A NAME="TOC86" HREF="bashref.html#SEC86">6.8 The Directory Stack</A>
15598<BR>
15599<UL>
15600<A NAME="TOC87" HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>
15601<BR>
15602</UL>
15603<A NAME="TOC88" HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>
15604<BR>
15605<A NAME="TOC89" HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>
15606<BR>
15607<A NAME="TOC90" HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>
15608<BR>
15609</UL>
15610<A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A>
15611<BR>
15612<UL>
15613<A NAME="TOC92" HREF="bashref.html#SEC92">7.1 Job Control Basics</A>
15614<BR>
15615<A NAME="TOC93" HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>
15616<BR>
15617<A NAME="TOC94" HREF="bashref.html#SEC94">7.3 Job Control Variables</A>
15618<BR>
15619</UL>
15620<A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A>
15621<BR>
15622<UL>
15623<A NAME="TOC96" HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A>
15624<BR>
15625<A NAME="TOC97" HREF="bashref.html#SEC97">8.2 Readline Interaction</A>
15626<BR>
15627<UL>
15628<A NAME="TOC98" HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A>
15629<BR>
15630<A NAME="TOC99" HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A>
15631<BR>
15632<A NAME="TOC100" HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A>
15633<BR>
15634<A NAME="TOC101" HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A>
15635<BR>
15636<A NAME="TOC102" HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>
15637<BR>
15638</UL>
15639<A NAME="TOC103" HREF="bashref.html#SEC103">8.3 Readline Init File</A>
15640<BR>
15641<UL>
15642<A NAME="TOC104" HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A>
15643<BR>
15644<A NAME="TOC105" HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>
15645<BR>
15646<A NAME="TOC106" HREF="bashref.html#SEC106">8.3.3 Sample Init File</A>
15647<BR>
15648</UL>
15649<A NAME="TOC107" HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A>
15650<BR>
15651<UL>
15652<A NAME="TOC108" HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A>
15653<BR>
15654<A NAME="TOC109" HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>
15655<BR>
15656<A NAME="TOC110" HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A>
15657<BR>
15658<A NAME="TOC111" HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A>
15659<BR>
15660<A NAME="TOC112" HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A>
15661<BR>
15662<A NAME="TOC113" HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>
15663<BR>
15664<A NAME="TOC114" HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A>
15665<BR>
15666<A NAME="TOC115" HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A>
15667<BR>
15668</UL>
15669<A NAME="TOC116" HREF="bashref.html#SEC116">8.5 Readline vi Mode</A>
15670<BR>
15671<A NAME="TOC117" HREF="bashref.html#SEC117">8.6 Programmable Completion</A>
15672<BR>
15673<A NAME="TOC118" HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>
15674<BR>
15675</UL>
15676<A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A>
15677<BR>
15678<UL>
15679<A NAME="TOC120" HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>
15680<BR>
15681<A NAME="TOC121" HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>
15682<BR>
15683<A NAME="TOC122" HREF="bashref.html#SEC122">9.3 History Expansion</A>
15684<BR>
15685<UL>
15686<A NAME="TOC123" HREF="bashref.html#SEC123">9.3.1 Event Designators</A>
15687<BR>
15688<A NAME="TOC124" HREF="bashref.html#SEC124">9.3.2 Word Designators</A>
15689<BR>
15690<A NAME="TOC125" HREF="bashref.html#SEC125">9.3.3 Modifiers</A>
15691<BR>
15692</UL>
15693</UL>
15694<A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A>
15695<BR>
15696<UL>
15697<A NAME="TOC127" HREF="bashref.html#SEC127">10.1 Basic Installation</A>
15698<BR>
15699<A NAME="TOC128" HREF="bashref.html#SEC128">10.2 Compilers and Options</A>
15700<BR>
15701<A NAME="TOC129" HREF="bashref.html#SEC129">10.3 Compiling For Multiple Architectures</A>
15702<BR>
15703<A NAME="TOC130" HREF="bashref.html#SEC130">10.4 Installation Names</A>
15704<BR>
15705<A NAME="TOC131" HREF="bashref.html#SEC131">10.5 Specifying the System Type</A>
15706<BR>
15707<A NAME="TOC132" HREF="bashref.html#SEC132">10.6 Sharing Defaults</A>
15708<BR>
15709<A NAME="TOC133" HREF="bashref.html#SEC133">10.7 Operation Controls</A>
15710<BR>
15711<A NAME="TOC134" HREF="bashref.html#SEC134">10.8 Optional Features</A>
15712<BR>
15713</UL>
15714<A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A>
15715<BR>
15716<A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A>
15717<BR>
15718<UL>
15719<A NAME="TOC137" HREF="bashref.html#SEC137">B.1 Implementation Differences From The SVR4.2 Shell</A>
15720<BR>
15721</UL>
15722<A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A>
15723<BR>
15724<A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A>
15725<BR>
15726<UL>
15727<A NAME="TOC141" HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A>
15728<BR>
15729<A NAME="TOC142" HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A>
15730<BR>
15731<A NAME="TOC143" HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A>
15732<BR>
15733<A NAME="TOC144" HREF="bashref.html#SEC144">D.4 Function Index</A>
15734<BR>
15735<A NAME="TOC145" HREF="bashref.html#SEC145">D.5 Concept Index</A>
15736<BR>
15737</UL>
15738</UL>
15739<HR SIZE=1>
15740<A NAME="SEC_OVERVIEW"></A>
15741<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15742<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15743<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15744<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15745<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15746</TR></TABLE>
15747<H1>Short Table of Contents</H1>
15748<BLOCKQUOTE>
15749<A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
15750<BR>
15751<A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
15752<BR>
15753<A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
15754<BR>
15755<A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>
15756<BR>
15757<A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A>
15758<BR>
15759<A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A>
15760<BR>
15761<A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A>
15762<BR>
15763<A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A>
15764<BR>
15765<A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A>
15766<BR>
15767<A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A>
15768<BR>
15769<A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A>
15770<BR>
15771<A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A>
15772<BR>
15773<A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A>
15774<BR>
15775<A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A>
15776<BR>
15777
15778</BLOCKQUOTE>
15779<HR SIZE=1>
15780<A NAME="SEC_About"></A>
15781<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15782<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15783<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15784<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15785<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15786</TR></TABLE>
15787<H1>About this document</H1>
15788This document was generated by <I>Chet Ramey</I> on <I>February, 5 2009</I>
15789using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
15790"><I>texi2html</I></A>
15791<P></P>
15792The buttons in the navigation panels have the following meaning:
15793<P></P>
15794<table border = "1">
15795<TR>
15796<TH> Button </TH>
15797<TH> Name </TH>
15798<TH> Go to </TH>
15799<TH> From 1.2.3 go to</TH>
15800</TR>
15801<TR>
15802<TD ALIGN="CENTER">
15803 [ &lt; ] </TD>
15804<TD ALIGN="CENTER">
15805Back
15806</TD>
15807<TD>
15808previous section in reading order
15809</TD>
15810<TD>
158111.2.2
15812</TD>
15813</TR>
15814<TR>
15815<TD ALIGN="CENTER">
15816 [ &gt; ] </TD>
15817<TD ALIGN="CENTER">
15818Forward
15819</TD>
15820<TD>
15821next section in reading order
15822</TD>
15823<TD>
158241.2.4
15825</TD>
15826</TR>
15827<TR>
15828<TD ALIGN="CENTER">
15829 [ &lt;&lt; ] </TD>
15830<TD ALIGN="CENTER">
15831FastBack
15832</TD>
15833<TD>
15834previous or up-and-previous section
15835</TD>
15836<TD>
158371.1
15838</TD>
15839</TR>
15840<TR>
15841<TD ALIGN="CENTER">
15842 [ Up ] </TD>
15843<TD ALIGN="CENTER">
15844Up
15845</TD>
15846<TD>
15847up section
15848</TD>
15849<TD>
158501.2
15851</TD>
15852</TR>
15853<TR>
15854<TD ALIGN="CENTER">
15855 [ &gt;&gt; ] </TD>
15856<TD ALIGN="CENTER">
15857FastForward
15858</TD>
15859<TD>
15860next or up-and-next section
15861</TD>
15862<TD>
158631.3
15864</TD>
15865</TR>
15866<TR>
15867<TD ALIGN="CENTER">
15868 [Top] </TD>
15869<TD ALIGN="CENTER">
15870Top
15871</TD>
15872<TD>
15873cover (top) of document
15874</TD>
15875<TD>
15876 &nbsp;
15877</TD>
15878</TR>
15879<TR>
15880<TD ALIGN="CENTER">
15881 [Contents] </TD>
15882<TD ALIGN="CENTER">
15883Contents
15884</TD>
15885<TD>
15886table of contents
15887</TD>
15888<TD>
15889 &nbsp;
15890</TD>
15891</TR>
15892<TR>
15893<TD ALIGN="CENTER">
15894 [Index] </TD>
15895<TD ALIGN="CENTER">
15896Index
15897</TD>
15898<TD>
15899concept index
15900</TD>
15901<TD>
15902 &nbsp;
15903</TD>
15904</TR>
15905<TR>
15906<TD ALIGN="CENTER">
15907 [ ? ] </TD>
15908<TD ALIGN="CENTER">
15909About
15910</TD>
15911<TD>
15912this page
15913</TD>
15914<TD>
15915 &nbsp;
15916</TD>
15917</TR>
15918</TABLE>
15919<P></P>
15920where the <STRONG> Example </STRONG> assumes that the current position
15921is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
15922the following structure:
15923<UL>
15924<LI> 1. Section One </LI>
15925<UL>
15926<LI>1.1 Subsection One-One</LI>
15927<UL>
15928<LI> ... </LI>
15929</UL>
15930<LI>1.2 Subsection One-Two</LI>
15931<UL>
15932<LI>1.2.1 Subsubsection One-Two-One
15933</LI><LI>1.2.2 Subsubsection One-Two-Two
15934</LI><LI>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp; <STRONG>
15935&lt;== Current Position </STRONG>
15936</LI><LI>1.2.4 Subsubsection One-Two-Four
15937</LI></UL>
15938<LI>1.3 Subsection One-Three</LI>
15939<UL>
15940<LI> ... </LI>
15941</UL>
15942<LI>1.4 Subsection One-Four</LI>
15943</UL>
15944</UL>
15945
15946<HR SIZE=1>
15947<BR>
15948<FONT SIZE="-1">
15949This document was generated
15950by <I>Chet Ramey</I> on <I>February, 5 2009</I>
15951using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
15952"><I>texi2html</I></A>
15953
15954</BODY>
15955</HTML>