]> git.ipfire.org Git - thirdparty/bash.git/blame - doc/bashref.html
Bash-4.1 distribution source
[thirdparty/bash.git] / doc / bashref.html
CommitLineData
17345e5a
JA
1<HTML>
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
0001803f 3<!-- Created on December, 29 2009 by texi2html 1.64 -->
17345e5a
JA
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
0001803f 36the Bash shell (version 4.1, 23 December 2009).
17345e5a
JA
37</P><P>
38
0001803f 39This is Edition 4.1, last updated 23 December 2009,
17345e5a 40of <CITE>The GNU Bash Reference Manual</CITE>,
0001803f 41for <CODE>Bash</CODE>, Version 4.1.
17345e5a
JA
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>
0001803f 691<DD><DT><CODE>\E</CODE>
17345e5a
JA
692<DD>an escape character (not ANSI C)
693<DT><CODE>\f</CODE>
694<DD>form feed
695<DT><CODE>\n</CODE>
696<DD>newline
697<DT><CODE>\r</CODE>
698<DD>carriage return
699<DT><CODE>\t</CODE>
700<DD>horizontal tab
701<DT><CODE>\v</CODE>
702<DD>vertical tab
703<DT><CODE>\\</CODE>
704<DD>backslash
705<DT><CODE>\'</CODE>
706<DD>single quote
0001803f
CR
707<DT><CODE>\"</CODE>
708<DD>double quote
17345e5a
JA
709<DT><CODE>\<VAR>nnn</VAR></CODE>
710<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
711(one to three digits)
712<DT><CODE>\x<VAR>HH</VAR></CODE>
713<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
714(one or two hex digits)
715<DT><CODE>\c<VAR>x</VAR></CODE>
716<DD>a control-<VAR>x</VAR> character
717</DL>
718<P>
719
720The expanded result is single-quoted, as if the dollar sign had not
721been present.
722</P><P>
723
724<A NAME="Locale Translation"></A>
725<HR SIZE="6">
726<A NAME="SEC13"></A>
727<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
728<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC12"> &lt; </A>]</TD>
729<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt; </A>]</TD>
730<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt;&lt; </A>]</TD>
731<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC8"> Up </A>]</TD>
732<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &gt;&gt; </A>]</TD>
733<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
734<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
735<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
736<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
737</TR></TABLE>
738<H4> 3.1.2.5 Locale-Specific Translation </H4>
739<!--docid::SEC13::-->
740<P>
741
742A double-quoted string preceded by a dollar sign (<SAMP>`$'</SAMP>) will cause
743the string to be translated according to the current locale.
744If the current locale is <CODE>C</CODE> or <CODE>POSIX</CODE>, the dollar sign
745is ignored.
746If the string is translated and replaced, the replacement is
747double-quoted.
748</P><P>
749
750<A NAME="IDX21"></A>
751<A NAME="IDX22"></A>
752<A NAME="IDX23"></A>
753Some systems use the message catalog selected by the <CODE>LC_MESSAGES</CODE>
754shell variable. Others create the name of the message catalog from the
755value of the <CODE>TEXTDOMAIN</CODE> shell variable, possibly adding a
756suffix of <SAMP>`.mo'</SAMP>. If you use the <CODE>TEXTDOMAIN</CODE> variable, you
757may need to set the <CODE>TEXTDOMAINDIR</CODE> variable to the location of
758the message catalog files. Still others use both variables in this
759fashion:
760<CODE>TEXTDOMAINDIR</CODE>/<CODE>LC_MESSAGES</CODE>/LC_MESSAGES/<CODE>TEXTDOMAIN</CODE>.mo.
761</P><P>
762
763<A NAME="Comments"></A>
764<HR SIZE="6">
765<A NAME="SEC14"></A>
766<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
767<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC13"> &lt; </A>]</TD>
768<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt; </A>]</TD>
769<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC6"> Up </A>]</TD>
771<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &gt;&gt; </A>]</TD>
772<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
773<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
774<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
775<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
776</TR></TABLE>
777<H3> 3.1.3 Comments </H3>
778<!--docid::SEC14::-->
779<P>
780
781In a non-interactive shell, or an interactive shell in which the
782<CODE>interactive_comments</CODE> option to the <CODE>shopt</CODE>
783builtin is enabled (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>),
784a word beginning with <SAMP>`#'</SAMP>
785causes that word and all remaining characters on that line to
786be ignored. An interactive shell without the <CODE>interactive_comments</CODE>
787option enabled does not allow comments. The <CODE>interactive_comments</CODE>
788option is on by default in interactive shells.
789See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for a description of what makes
790a shell interactive.
791</P><P>
792
793<A NAME="Shell Commands"></A>
794<HR SIZE="6">
795<A NAME="SEC15"></A>
796<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
797<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC14"> &lt; </A>]</TD>
798<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> &gt; </A>]</TD>
799<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt;&lt; </A>]</TD>
800<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
801<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
802<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
803<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
804<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
805<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
806</TR></TABLE>
807<H2> 3.2 Shell Commands </H2>
808<!--docid::SEC15::-->
809<P>
810
811A simple shell command such as <CODE>echo a b c</CODE> consists of the command
812itself followed by arguments, separated by spaces.
813</P><P>
814
815More complex shell commands are composed of simple commands arranged together
816in a variety of ways: in a pipeline in which the output of one command
817becomes the input of a second, in a loop or conditional construct, or in
818some other grouping.
819</P><P>
820
821<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
822<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The most common type of command.</TD></TR>
823<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Connecting the input and output of several
824 commands.</TD></TR>
825<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>
826<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>
827<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>
828</TABLE></BLOCKQUOTE>
829<P>
830
831<A NAME="Simple Commands"></A>
832<HR SIZE="6">
833<A NAME="SEC16"></A>
834<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
835<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> &lt; </A>]</TD>
836<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> &gt; </A>]</TD>
837<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt;&lt; </A>]</TD>
838<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
839<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
840<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
841<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
842<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
843<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
844</TR></TABLE>
845<H3> 3.2.1 Simple Commands </H3>
846<!--docid::SEC16::-->
847<P>
848
849A simple command is the kind of command encountered most often.
850It's just a sequence of words separated by <CODE>blank</CODE>s, terminated
851by one of the shell's control operators (see section <A HREF="bashref.html#SEC4">2. Definitions</A>). The
852first word generally specifies a command to be executed, with the
853rest of the words being that command's arguments.
854</P><P>
855
856The return status (see section <A HREF="bashref.html#SEC55">3.7.5 Exit Status</A>) of a simple command is
857its exit status as provided
858by the POSIX 1003.1 <CODE>waitpid</CODE> function, or 128+<VAR>n</VAR> if
859the command was terminated by signal <VAR>n</VAR>.
860</P><P>
861
862<A NAME="Pipelines"></A>
863<HR SIZE="6">
864<A NAME="SEC17"></A>
865<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
866<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC16"> &lt; </A>]</TD>
867<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &gt; </A>]</TD>
868<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &lt;&lt; </A>]</TD>
869<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
870<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
871<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
872<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
873<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
874<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
875</TR></TABLE>
876<H3> 3.2.2 Pipelines </H3>
877<!--docid::SEC17::-->
878<P>
879
880A <CODE>pipeline</CODE> is a sequence of simple commands separated by one of
881the control operators <SAMP>`|'</SAMP> or <SAMP>`|&#38;'</SAMP>.
882</P><P>
883
884<A NAME="IDX24"></A>
885<A NAME="IDX25"></A>
886<A NAME="IDX26"></A>
887The format for a pipeline is
888<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>]
889</pre></td></tr></table></P><P>
890
891The output of each command in the pipeline is connected via a pipe
892to the input of the next command.
893That is, each command reads the previous command's output. This
894connection is performed before any redirections specified by the
895command.
896</P><P>
897
898If <SAMP>`|&#38;'</SAMP> is used, the standard error of <VAR>command1</VAR> is connected to
899<VAR>command2</VAR>'s standard input through the pipe; it is shorthand for
900<CODE>2&#62;&#38;1 |</CODE>. This implicit redirection of the standard error is
901performed after any redirections specified by the command.
902</P><P>
903
904The reserved word <CODE>time</CODE> causes timing statistics
905to be printed for the pipeline once it finishes.
906The statistics currently consist of elapsed (wall-clock) time and
907user and system time consumed by the command's execution.
908The <SAMP>`-p'</SAMP> option changes the output format to that specified
909by POSIX.
910The <CODE>TIMEFORMAT</CODE> variable may be set to a format string that
911specifies how the timing information should be displayed.
912See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of the available formats.
913The use of <CODE>time</CODE> as a reserved word permits the timing of
914shell builtins, shell functions, and pipelines. An external
915<CODE>time</CODE> command cannot time these easily.
916</P><P>
917
918If the pipeline is not executed asynchronously (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the
919shell waits for all commands in the pipeline to complete.
920</P><P>
921
922Each command in a pipeline is executed in its own subshell
923(see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>). The exit
924status of a pipeline is the exit status of the last command in the
925pipeline, unless the <CODE>pipefail</CODE> option is enabled
926(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
927If <CODE>pipefail</CODE> is enabled, the pipeline's return status is the
928value of the last (rightmost) command to exit with a non-zero status,
929or zero if all commands exit successfully.
930If the reserved word <SAMP>`!'</SAMP> precedes the pipeline, the
931exit status is the logical negation of the exit status as described
932above.
933The shell waits for all commands in the pipeline to terminate before
934returning a value.
935</P><P>
936
937<A NAME="Lists"></A>
938<HR SIZE="6">
939<A NAME="SEC18"></A>
940<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
941<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC17"> &lt; </A>]</TD>
942<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &gt; </A>]</TD>
943<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &lt;&lt; </A>]</TD>
944<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
945<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
946<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
947<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
948<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
949<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
950</TR></TABLE>
951<H3> 3.2.3 Lists of Commands </H3>
952<!--docid::SEC18::-->
953<P>
954
955A <CODE>list</CODE> is a sequence of one or more pipelines separated by one
956of the operators <SAMP>`;'</SAMP>, <SAMP>`&#38;'</SAMP>, <SAMP>`&#38;&#38;'</SAMP>, or <SAMP>`||'</SAMP>,
957and optionally terminated by one of <SAMP>`;'</SAMP>, <SAMP>`&#38;'</SAMP>, or a
958<CODE>newline</CODE>.
959</P><P>
960
961Of these list operators, <SAMP>`&#38;&#38;'</SAMP> and <SAMP>`||'</SAMP>
962have equal precedence, followed by <SAMP>`;'</SAMP> and <SAMP>`&#38;'</SAMP>,
963which have equal precedence.
964</P><P>
965
966A sequence of one or more newlines may appear in a <CODE>list</CODE>
967to delimit commands, equivalent to a semicolon.
968</P><P>
969
970If a command is terminated by the control operator <SAMP>`&#38;'</SAMP>,
971the shell executes the command asynchronously in a subshell.
972This is known as executing the command in the <VAR>background</VAR>.
973The shell does not wait for the command to finish, and the return
974status is 0 (true).
975When job control is not active (see section <A HREF="bashref.html#SEC91">7. Job Control</A>),
976the standard input for asynchronous commands, in the absence of any
977explicit redirections, is redirected from <CODE>/dev/null</CODE>.
978</P><P>
979
980Commands separated by a <SAMP>`;'</SAMP> are executed sequentially; the shell
981waits for each command to terminate in turn. The return status is the
982exit status of the last command executed.
983</P><P>
984
985AND and OR lists are sequences of one or more pipelines
986separated by the control operators <SAMP>`&#38;&#38;'</SAMP> and <SAMP>`||'</SAMP>,
987respectively. AND and OR lists are executed with left
988associativity.
989</P><P>
990
991An AND list has the form
992<TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>command1</VAR> &#38;&#38; <VAR>command2</VAR>
993</pre></td></tr></table></P><P>
994
995<VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
996returns an exit status of zero.
997</P><P>
998
999An OR list has the form
1000<TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>command1</VAR> || <VAR>command2</VAR>
1001</pre></td></tr></table></P><P>
1002
1003<VAR>command2</VAR> is executed if, and only if, <VAR>command1</VAR>
1004returns a non-zero exit status.
1005</P><P>
1006
1007The return status of
1008AND and OR lists is the exit status of the last command
1009executed in the list.
1010</P><P>
1011
1012<A NAME="Compound Commands"></A>
1013<HR SIZE="6">
1014<A NAME="SEC19"></A>
1015<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1016<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC18"> &lt; </A>]</TD>
1017<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> &gt; </A>]</TD>
1018<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1019<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1020<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1021<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1022<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1023<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1024<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1025</TR></TABLE>
1026<H3> 3.2.4 Compound Commands </H3>
1027<!--docid::SEC19::-->
1028<P>
1029
1030<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1031<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for iterative action.</TD></TR>
1032<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Shell commands for conditional execution.</TD></TR>
1033<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Ways to group commands.</TD></TR>
1034</TABLE></BLOCKQUOTE>
1035<P>
1036
1037Compound commands are the shell programming constructs.
1038Each construct begins with a reserved word or control operator and is
1039terminated by a corresponding reserved word or operator.
1040Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with a compound command
1041apply to all commands within that compound command unless explicitly overridden.
1042</P><P>
1043
1044Bash provides looping constructs, conditional commands, and mechanisms
1045to group commands and execute them as a unit.
1046</P><P>
1047
1048<A NAME="Looping Constructs"></A>
1049<HR SIZE="6">
1050<A NAME="SEC20"></A>
1051<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1052<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> &lt; </A>]</TD>
1053<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> &gt; </A>]</TD>
1054<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1055<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1056<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1057<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1058<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1059<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1060<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1061</TR></TABLE>
1062<H4> 3.2.4.1 Looping Constructs </H4>
1063<!--docid::SEC20::-->
1064<P>
1065
1066Bash supports the following looping constructs.
1067</P><P>
1068
1069Note that wherever a <SAMP>`;'</SAMP> appears in the description of a
1070command's syntax, it may be replaced with one or more newlines.
1071</P><P>
1072
1073<DL COMPACT>
1074<DT><CODE>until</CODE>
1075<DD><A NAME="IDX27"></A>
1076<A NAME="IDX28"></A>
1077<A NAME="IDX29"></A>
1078The syntax of the <CODE>until</CODE> command is:
1079<TABLE><tr><td>&nbsp;</td><td class=example><pre>until <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1080</pre></td></tr></table>Execute <VAR>consequent-commands</VAR> as long as
1081<VAR>test-commands</VAR> has an exit status which is not zero.
1082The return status is the exit status of the last command executed
1083in <VAR>consequent-commands</VAR>, or zero if none was executed.
1084<P>
1085
1086<DT><CODE>while</CODE>
1087<DD><A NAME="IDX30"></A>
1088The syntax of the <CODE>while</CODE> command is:
1089<TABLE><tr><td>&nbsp;</td><td class=example><pre>while <VAR>test-commands</VAR>; do <VAR>consequent-commands</VAR>; done
1090</pre></td></tr></table><P>
1091
1092Execute <VAR>consequent-commands</VAR> as long as
1093<VAR>test-commands</VAR> has an exit status of zero.
1094The return status is the exit status of the last command executed
1095in <VAR>consequent-commands</VAR>, or zero if none was executed.
1096</P><P>
1097
1098<DT><CODE>for</CODE>
1099<DD><A NAME="IDX31"></A>
1100The syntax of the <CODE>for</CODE> command is:
1101<P>
1102
0001803f 1103<TABLE><tr><td>&nbsp;</td><td class=example><pre>for <VAR>name</VAR> [ [in [<VAR>words</VAR> <small>...</small>] ] ; ] do <VAR>commands</VAR>; done
17345e5a
JA
1104</pre></td></tr></table>Expand <VAR>words</VAR>, and execute <VAR>commands</VAR> once for each member
1105in the resultant list, with <VAR>name</VAR> bound to the current member.
1106If <SAMP>`in <VAR>words</VAR>'</SAMP> is not present, the <CODE>for</CODE> command
1107executes the <VAR>commands</VAR> once for each positional parameter that is
1108set, as if <SAMP>`in "$@"'</SAMP> had been specified
1109(see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>).
1110The return status is the exit status of the last command that executes.
1111If there are no items in the expansion of <VAR>words</VAR>, no commands are
1112executed, and the return status is zero.
1113</P><P>
1114
1115An alternate form of the <CODE>for</CODE> command is also supported:
1116</P><P>
1117
1118<TABLE><tr><td>&nbsp;</td><td class=example><pre>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> )) ; do <VAR>commands</VAR> ; done
1119</pre></td></tr></table>First, the arithmetic expression <VAR>expr1</VAR> is evaluated according
1120to the rules described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
1121The arithmetic expression <VAR>expr2</VAR> is then evaluated repeatedly
1122until it evaluates to zero.
1123Each time <VAR>expr2</VAR> evaluates to a non-zero value, <VAR>commands</VAR> are
1124executed and the arithmetic expression <VAR>expr3</VAR> is evaluated.
1125If any expression is omitted, it behaves as if it evaluates to 1.
1126The return value is the exit status of the last command in <VAR>list</VAR>
1127that is executed, or false if any of the expressions is invalid.
1128</P><P>
1129
1130</DL>
1131<P>
1132
1133The <CODE>break</CODE> and <CODE>continue</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
1134may be used to control loop execution.
1135</P><P>
1136
1137<A NAME="Conditional Constructs"></A>
1138<HR SIZE="6">
1139<A NAME="SEC21"></A>
1140<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1141<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC20"> &lt; </A>]</TD>
1142<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &gt; </A>]</TD>
1143<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &lt;&lt; </A>]</TD>
1144<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1145<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1146<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1147<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1148<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1149<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1150</TR></TABLE>
1151<H4> 3.2.4.2 Conditional Constructs </H4>
1152<!--docid::SEC21::-->
1153<P>
1154
1155<DL COMPACT>
1156<DT><CODE>if</CODE>
1157<DD><A NAME="IDX32"></A>
1158<A NAME="IDX33"></A>
1159<A NAME="IDX34"></A>
1160<A NAME="IDX35"></A>
1161<A NAME="IDX36"></A>
1162The syntax of the <CODE>if</CODE> command is:
1163<P>
1164
1165<TABLE><tr><td>&nbsp;</td><td class=example><pre>if <VAR>test-commands</VAR>; then
1166 <VAR>consequent-commands</VAR>;
1167[elif <VAR>more-test-commands</VAR>; then
1168 <VAR>more-consequents</VAR>;]
1169[else <VAR>alternate-consequents</VAR>;]
1170fi
1171</pre></td></tr></table></P><P>
1172
1173The <VAR>test-commands</VAR> list is executed, and if its return status is zero,
1174the <VAR>consequent-commands</VAR> list is executed.
1175If <VAR>test-commands</VAR> returns a non-zero status, each <CODE>elif</CODE> list
1176is executed in turn, and if its exit status is zero,
1177the corresponding <VAR>more-consequents</VAR> is executed and the
1178command completes.
1179If <SAMP>`else <VAR>alternate-consequents</VAR>'</SAMP> is present, and
1180the final command in the final <CODE>if</CODE> or <CODE>elif</CODE> clause
1181has a non-zero exit status, then <VAR>alternate-consequents</VAR> is executed.
1182The return status is the exit status of the last command executed, or
1183zero if no condition tested true.
1184</P><P>
1185
1186<DT><CODE>case</CODE>
1187<DD><A NAME="IDX37"></A>
1188<A NAME="IDX38"></A>
1189<A NAME="IDX39"></A>
1190The syntax of the <CODE>case</CODE> command is:
1191<P>
1192
1193<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>
1194</pre></td></tr></table></P><P>
1195
1196<CODE>case</CODE> will selectively execute the <VAR>command-list</VAR> corresponding to
1197the first <VAR>pattern</VAR> that matches <VAR>word</VAR>.
1198If the shell option <CODE>nocasematch</CODE>
1199(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1200is enabled, the match is performed without regard to the case
1201of alphabetic characters.
1202The <SAMP>`|'</SAMP> is used to separate multiple patterns, and the <SAMP>`)'</SAMP>
1203operator terminates a pattern list.
1204A list of patterns and an associated command-list is known
1205as a <VAR>clause</VAR>.
1206</P><P>
1207
0001803f 1208Each clause must be terminated with <SAMP>`;;'</SAMP>, <SAMP>`;&#38;'</SAMP>, or <SAMP>`;;&#38;'</SAMP>.
17345e5a
JA
1209The <VAR>word</VAR> undergoes tilde expansion, parameter expansion, command
1210substitution, arithmetic expansion, and quote removal before matching is
1211attempted. Each <VAR>pattern</VAR> undergoes tilde expansion, parameter
1212expansion, command substitution, and arithmetic expansion.
1213</P><P>
1214
1215There may be an arbitrary number of <CODE>case</CODE> clauses, each terminated
1216by a <SAMP>`;;'</SAMP>, <SAMP>`;&#38;'</SAMP>, or <SAMP>`;;&#38;'</SAMP>.
1217The first pattern that matches determines the
1218command-list that is executed.
1219</P><P>
1220
1221Here is an example using <CODE>case</CODE> in a script that could be used to
1222describe one interesting feature of an animal:
1223</P><P>
1224
1225<TABLE><tr><td>&nbsp;</td><td class=example><pre>echo -n "Enter the name of an animal: "
1226read ANIMAL
1227echo -n "The $ANIMAL has "
1228case $ANIMAL in
1229 horse | dog | cat) echo -n "four";;
1230 man | kangaroo ) echo -n "two";;
1231 *) echo -n "an unknown number of";;
1232esac
1233echo " legs."
1234</pre></td></tr></table></P><P>
1235
1236</P><P>
1237
1238If the <SAMP>`;;'</SAMP> operator is used, no subsequent matches are attempted after
1239the first pattern match.
1240Using <SAMP>`;&#38;'</SAMP> in place of <SAMP>`;;'</SAMP> causes execution to continue with
1241the <VAR>command-list</VAR> associated with the next clause, if any.
1242Using <SAMP>`;;&#38;'</SAMP> in place of <SAMP>`;;'</SAMP> causes the shell to test the patterns
1243in the next clause, if any, and execute any associated <VAR>command-list</VAR>
1244on a successful match.
1245</P><P>
1246
1247The return status is zero if no <VAR>pattern</VAR> is matched. Otherwise, the
1248return status is the exit status of the <VAR>command-list</VAR> executed.
1249</P><P>
1250
1251<DT><CODE>select</CODE>
1252<DD><A NAME="IDX40"></A>
1253<P>
1254
1255The <CODE>select</CODE> construct allows the easy generation of menus.
1256It has almost the same syntax as the <CODE>for</CODE> command:
1257</P><P>
1258
1259<TABLE><tr><td>&nbsp;</td><td class=example><pre>select <VAR>name</VAR> [in <VAR>words</VAR> <small>...</small>]; do <VAR>commands</VAR>; done
1260</pre></td></tr></table></P><P>
1261
1262The list of words following <CODE>in</CODE> is expanded, generating a list
1263of items. The set of expanded words is printed on the standard
1264error output stream, each preceded by a number. If the
1265<SAMP>`in <VAR>words</VAR>'</SAMP> is omitted, the positional parameters are printed,
1266as if <SAMP>`in "$@"'</SAMP> had been specified.
1267The <CODE>PS3</CODE> prompt is then displayed and a line is read from the
1268standard input.
1269If the line consists of a number corresponding to one of the displayed
1270words, then the value of <VAR>name</VAR> is set to that word.
1271If the line is empty, the words and prompt are displayed again.
1272If <CODE>EOF</CODE> is read, the <CODE>select</CODE> command completes.
1273Any other value read causes <VAR>name</VAR> to be set to null.
1274The line read is saved in the variable <CODE>REPLY</CODE>.
1275</P><P>
1276
1277The <VAR>commands</VAR> are executed after each selection until a
1278<CODE>break</CODE> command is executed, at which
1279point the <CODE>select</CODE> command completes.
1280</P><P>
1281
1282Here is an example that allows the user to pick a filename from the
1283current directory, and displays the name and index of the file
1284selected.
1285</P><P>
1286
1287<TABLE><tr><td>&nbsp;</td><td class=example><pre>select fname in *;
1288do
1289 echo you picked $fname \($REPLY\)
1290 break;
1291done
1292</pre></td></tr></table></P><P>
1293
1294<DT><CODE>((<small>...</small>))</CODE>
1295<DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>(( <VAR>expression</VAR> ))
1296</pre></td></tr></table><P>
1297
1298The arithmetic <VAR>expression</VAR> is evaluated according to the rules
1299described below (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
1300If the value of the expression is non-zero, the return status is 0;
1301otherwise the return status is 1. This is exactly equivalent to
1302<TABLE><tr><td>&nbsp;</td><td class=example><pre>let "<VAR>expression</VAR>"
1303</pre></td></tr></table>See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a full description of the <CODE>let</CODE> builtin.
1304</P><P>
1305
1306<DT><CODE>[[<small>...</small>]]</CODE>
1307<DD><A NAME="IDX41"></A>
1308<A NAME="IDX42"></A>
1309<TABLE><tr><td>&nbsp;</td><td class=example><pre>[[ <VAR>expression</VAR> ]]
1310</pre></td></tr></table><P>
1311
1312Return a status of 0 or 1 depending on the evaluation of
1313the conditional expression <VAR>expression</VAR>.
1314Expressions are composed of the primaries described below in
1315<A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>.
1316Word splitting and filename expansion are not performed on the words
1317between the <SAMP>`[['</SAMP> and <SAMP>`]]'</SAMP>; tilde expansion, parameter and
1318variable expansion, arithmetic expansion, command substitution, process
1319substitution, and quote removal are performed.
1320Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognized
1321as primaries.
1322</P><P>
1323
0001803f
CR
1324When used with <SAMP>`[['</SAMP>, The <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
1325lexicographically using the current locale.
1326</P><P>
1327
17345e5a
JA
1328When the <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP> operators are used, the string to the
1329right of the operator is considered a pattern and matched according
1330to the rules described below in <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>.
1331If the shell option <CODE>nocasematch</CODE>
1332(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1333is enabled, the match is performed without regard to the case
1334of alphabetic characters.
1335The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not
1336match (<SAMP>`!='</SAMP>)the pattern, and 1 otherwise.
1337Any part of the pattern may be quoted to force it to be matched as a
1338string.
1339</P><P>
1340
1341An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same
1342precedence as <SAMP>`=='</SAMP> and <SAMP>`!='</SAMP>.
1343When it is used, the string to the right of the operator is considered
1344an extended regular expression and matched accordingly (as in <I>regex</I>3)).
1345The return value is 0 if the string matches
1346the pattern, and 1 otherwise.
1347If the regular expression is syntactically incorrect, the conditional
1348expression's return value is 2.
1349If the shell option <CODE>nocasematch</CODE>
1350(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
1351is enabled, the match is performed without regard to the case
1352of alphabetic characters.
1353Any part of the pattern may be quoted to force it to be matched as a
1354string.
1355Substrings matched by parenthesized subexpressions within the regular
1356expression are saved in the array variable <CODE>BASH_REMATCH</CODE>.
1357The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string
1358matching the entire regular expression.
1359The element of <CODE>BASH_REMATCH</CODE> with index <VAR>n</VAR> is the portion of the
1360string matching the <VAR>n</VAR>th parenthesized subexpression.
1361</P><P>
1362
1363Expressions may be combined using the following operators, listed
1364in decreasing order of precedence:
1365</P><P>
1366
1367<DL COMPACT>
1368<DT><CODE>( <VAR>expression</VAR> )</CODE>
1369<DD>Returns the value of <VAR>expression</VAR>.
1370This may be used to override the normal precedence of operators.
1371<P>
1372
1373<DT><CODE>! <VAR>expression</VAR></CODE>
1374<DD>True if <VAR>expression</VAR> is false.
1375<P>
1376
1377<DT><CODE><VAR>expression1</VAR> &#38;&#38; <VAR>expression2</VAR></CODE>
1378<DD>True if both <VAR>expression1</VAR> and <VAR>expression2</VAR> are true.
1379<P>
1380
1381<DT><CODE><VAR>expression1</VAR> || <VAR>expression2</VAR></CODE>
1382<DD>True if either <VAR>expression1</VAR> or <VAR>expression2</VAR> is true.
1383</DL>
1384The <CODE>&#38;&#38;</CODE> and <CODE>||</CODE> operators do not evaluate <VAR>expression2</VAR> if the
1385value of <VAR>expression1</VAR> is sufficient to determine the return
1386value of the entire conditional expression.
1387<P>
1388
1389</DL>
1390<P>
1391
1392<A NAME="Command Grouping"></A>
1393<HR SIZE="6">
1394<A NAME="SEC22"></A>
1395<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1396<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC21"> &lt; </A>]</TD>
1397<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt; </A>]</TD>
1398<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt;&lt; </A>]</TD>
1399<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC19"> Up </A>]</TD>
1400<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &gt;&gt; </A>]</TD>
1401<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1402<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1403<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1404<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1405</TR></TABLE>
1406<H4> 3.2.4.3 Grouping Commands </H4>
1407<!--docid::SEC22::-->
1408<P>
1409
1410Bash provides two ways to group a list of commands to be executed
1411as a unit. When commands are grouped, redirections may be applied
1412to the entire command list. For example, the output of all the
1413commands in the list may be redirected to a single stream.
1414</P><P>
1415
1416<DL COMPACT>
1417<DT><CODE>()</CODE>
1418<DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>( <VAR>list</VAR> )
1419</pre></td></tr></table><P>
1420
1421Placing a list of commands between parentheses causes a subshell
1422environment to be created (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and each
1423of the commands in <VAR>list</VAR> to be executed in that subshell. Since the
1424<VAR>list</VAR> is executed in a subshell, variable assignments do not remain in
1425effect after the subshell completes.
1426</P><P>
1427
1428<DT><CODE>{}</CODE>
1429<DD><A NAME="IDX43"></A>
1430<A NAME="IDX44"></A>
1431<TABLE><tr><td>&nbsp;</td><td class=example><pre>{ <VAR>list</VAR>; }
1432</pre></td></tr></table><P>
1433
1434Placing a list of commands between curly braces causes the list to
1435be executed in the current shell context. No subshell is created.
1436The semicolon (or newline) following <VAR>list</VAR> is required.
1437</DL>
1438<P>
1439
1440In addition to the creation of a subshell, there is a subtle difference
1441between these two constructs due to historical reasons. The braces
1442are <CODE>reserved words</CODE>, so they must be separated from the <VAR>list</VAR>
1443by <CODE>blank</CODE>s or other shell metacharacters.
1444The parentheses are <CODE>operators</CODE>, and are
1445recognized as separate tokens by the shell even if they are not separated
1446from the <VAR>list</VAR> by whitespace.
1447</P><P>
1448
1449The exit status of both of these constructs is the exit status of
1450<VAR>list</VAR>.
1451</P><P>
1452
1453<A NAME="Coprocesses"></A>
1454<HR SIZE="6">
1455<A NAME="SEC23"></A>
1456<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1457<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC22"> &lt; </A>]</TD>
1458<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt; </A>]</TD>
1459<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt;&lt; </A>]</TD>
1460<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC15"> Up </A>]</TD>
1461<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &gt;&gt; </A>]</TD>
1462<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1463<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1464<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1465<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1466</TR></TABLE>
1467<H3> 3.2.5 Coprocesses </H3>
1468<!--docid::SEC23::-->
1469<P>
1470
1471A <CODE>coprocess</CODE> is a shell command preceded by the <CODE>coproc</CODE>
1472reserved word.
1473A coprocess is executed asynchronously in a subshell, as if the command
1474had been terminated with the <SAMP>`&#38;'</SAMP> control operator, with a two-way pipe
1475established between the executing shell and the coprocess.
1476</P><P>
1477
1478The format for a coprocess is:
1479<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>coproc</CODE> [<VAR>NAME</VAR>] <VAR>command</VAR> [<VAR>redirections</VAR>]
1480</pre></td></tr></table></P><P>
1481
1482This creates a coprocess named <VAR>NAME</VAR>.
1483If <VAR>NAME</VAR> is not supplied, the default name is <VAR>COPROC</VAR>.
1484<VAR>NAME</VAR> must not be supplied if <VAR>command</VAR> is a simple
1485command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>); otherwise, it is interpreted as
1486the first word of the simple command.
1487</P><P>
1488
1489When the coproc is executed, the shell creates an array variable
1490(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
1491named <VAR>NAME</VAR> in the context of the executing shell.
1492The standard output of <VAR>command</VAR>
1493is connected via a pipe to a file descriptor in the executing shell,
1494and that file descriptor is assigned to <VAR>NAME</VAR>[0].
1495The standard input of <VAR>command</VAR>
1496is connected via a pipe to a file descriptor in the executing shell,
1497and that file descriptor is assigned to <VAR>NAME</VAR>[1].
1498This pipe is established before any redirections specified by the
1499command (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
1500The file descriptors can be utilized as arguments to shell commands
1501and redirections using standard word expansions.
1502</P><P>
1503
1504The process id of the shell spawned to execute the coprocess is
1505available as the value of the variable <VAR>NAME</VAR>_PID.
1506The <CODE>wait</CODE>
1507builtin command may be used to wait for the coprocess to terminate.
1508</P><P>
1509
1510The return status of a coprocess is the exit status of <VAR>command</VAR>.
1511</P><P>
1512
1513<A NAME="Shell Functions"></A>
1514<HR SIZE="6">
1515<A NAME="SEC24"></A>
1516<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1517<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC23"> &lt; </A>]</TD>
1518<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &gt; </A>]</TD>
1519<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt;&lt; </A>]</TD>
1520<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1521<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
1522<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1523<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1524<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1525<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1526</TR></TABLE>
1527<H2> 3.3 Shell Functions </H2>
1528<!--docid::SEC24::-->
1529<P>
1530
1531Shell functions are a way to group commands for later execution
1532using a single name for the group. They are executed just like
1533a "regular" command.
1534When the name of a shell function is used as a simple command name,
1535the list of commands associated with that function name is executed.
1536Shell functions are executed in the current
1537shell context; no new process is created to interpret them.
1538</P><P>
1539
1540Functions are declared using this syntax:
1541<A NAME="IDX45"></A>
1542<TABLE><tr><td>&nbsp;</td><td class=example><pre>[ <CODE>function</CODE> ] <VAR>name</VAR> () <VAR>compound-command</VAR> [ <VAR>redirections</VAR> ]
1543</pre></td></tr></table></P><P>
1544
1545This defines a shell function named <VAR>name</VAR>. The reserved
1546word <CODE>function</CODE> is optional.
1547If the <CODE>function</CODE> reserved
1548word is supplied, the parentheses are optional.
1549The <VAR>body</VAR> of the function is the compound command
1550<VAR>compound-command</VAR> (see section <A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>).
1551That command is usually a <VAR>list</VAR> enclosed between { and }, but
1552may be any compound command listed above.
1553<VAR>compound-command</VAR> is executed whenever <VAR>name</VAR> is specified as the
1554name of a command.
1555Any redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>) associated with the shell function
1556are performed when the function is executed.
1557</P><P>
1558
1559A function definition may be deleted using the <SAMP>`-f'</SAMP> option to the
1560<CODE>unset</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
1561</P><P>
1562
1563The exit status of a function definition is zero unless a syntax error
1564occurs or a readonly function with the same name already exists.
1565When executed, the exit status of a function is the exit status of the
1566last command executed in the body.
1567</P><P>
1568
1569Note that for historical reasons, in the most common usage the curly braces
1570that surround the body of the function must be separated from the body by
1571<CODE>blank</CODE>s or newlines.
1572This is because the braces are reserved words and are only recognized
1573as such when they are separated from the command list
1574by whitespace or another shell metacharacter.
1575Also, when using the braces, the <VAR>list</VAR> must be terminated by a semicolon,
1576a <SAMP>`&#38;'</SAMP>, or a newline.
1577</P><P>
1578
1579When a function is executed, the arguments to the
1580function become the positional parameters
1581during its execution (see section <A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>).
1582The special parameter <SAMP>`#'</SAMP> that expands to the number of
1583positional parameters is updated to reflect the change.
1584Special parameter <CODE>0</CODE> is unchanged.
1585The first element of the <CODE>FUNCNAME</CODE> variable is set to the
1586name of the function while the function is executing.
0001803f
CR
1587</P><P>
1588
17345e5a
JA
1589All other aspects of the shell execution
1590environment are identical between a function and its caller
0001803f
CR
1591with these exceptions:
1592the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps
17345e5a
JA
1593are not inherited unless the function has been given the
1594<CODE>trace</CODE> attribute using the <CODE>declare</CODE> builtin or
1595the <CODE>-o functrace</CODE> option has been enabled with
1596the <CODE>set</CODE> builtin,
0001803f
CR
1597(in which case all functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps),
1598and the <CODE>ERR</CODE> trap is not inherited unless the <CODE>-o errtrace</CODE>
1599shell option has been enabled.
17345e5a
JA
1600See section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>, for the description of the
1601<CODE>trap</CODE> builtin.
1602</P><P>
1603
1604If the builtin command <CODE>return</CODE>
1605is executed in a function, the function completes and
1606execution resumes with the next command after the function
1607call.
1608Any command associated with the <CODE>RETURN</CODE> trap is executed
1609before execution resumes.
1610When a function completes, the values of the
1611positional parameters and the special parameter <SAMP>`#'</SAMP>
1612are restored to the values they had prior to the function's
1613execution. If a numeric argument is given to <CODE>return</CODE>,
1614that is the function's return status; otherwise the function's
1615return status is the exit status of the last command executed
1616before the <CODE>return</CODE>.
1617</P><P>
1618
1619Variables local to the function may be declared with the
1620<CODE>local</CODE> builtin. These variables are visible only to
1621the function and the commands it invokes.
1622</P><P>
1623
1624Function names and definitions may be listed with the
1625<SAMP>`-f'</SAMP> option to the <CODE>declare</CODE> or <CODE>typeset</CODE>
1626builtin commands (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
1627The <SAMP>`-F'</SAMP> option to <CODE>declare</CODE> or <CODE>typeset</CODE>
1628will list the function names only
1629(and optionally the source file and line number, if the <CODE>extdebug</CODE>
1630shell option is enabled).
1631Functions may be exported so that subshells
1632automatically have them defined with the
1633<SAMP>`-f'</SAMP> option to the <CODE>export</CODE> builtin
1634(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
1635Note that shell functions and variables with the same name may result
1636in multiple identically-named entries in the environment passed to the
1637shell's children.
1638Care should be taken in cases where this may cause a problem.
1639</P><P>
1640
1641Functions may be recursive. No limit is placed on the number of
1642recursive calls.
1643</P><P>
1644
1645<A NAME="Shell Parameters"></A>
1646<HR SIZE="6">
1647<A NAME="SEC25"></A>
1648<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1649<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC24"> &lt; </A>]</TD>
1650<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> &gt; </A>]</TD>
1651<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt;&lt; </A>]</TD>
1652<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1653<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt;&gt; </A>]</TD>
1654<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1655<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1656<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1657<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1658</TR></TABLE>
1659<H2> 3.4 Shell Parameters </H2>
1660<!--docid::SEC25::-->
1661<P>
1662
1663<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1664<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The shell's command-line arguments.</TD></TR>
1665<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Parameters denoted by special characters.</TD></TR>
1666</TABLE></BLOCKQUOTE>
1667<P>
1668
1669A <VAR>parameter</VAR> is an entity that stores values.
1670It can be a <CODE>name</CODE>, a number, or one of the special characters
1671listed below.
1672A <VAR>variable</VAR> is a parameter denoted by a <CODE>name</CODE>.
1673A variable has a <VAR>value</VAR> and zero or more <VAR>attributes</VAR>.
1674Attributes are assigned using the <CODE>declare</CODE> builtin command
1675(see the description of the <CODE>declare</CODE> builtin in <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
1676</P><P>
1677
1678A parameter is set if it has been assigned a value. The null string is
1679a valid value. Once a variable is set, it may be unset only by using
1680the <CODE>unset</CODE> builtin command.
1681</P><P>
1682
1683A variable may be assigned to by a statement of the form
1684<TABLE><tr><td>&nbsp;</td><td class=example><pre><VAR>name</VAR>=[<VAR>value</VAR>]
1685</pre></td></tr></table>If <VAR>value</VAR>
1686is not given, the variable is assigned the null string. All
1687<VAR>value</VAR>s undergo tilde expansion, parameter and variable expansion,
1688command substitution, arithmetic expansion, and quote
1689removal (detailed below). If the variable has its <CODE>integer</CODE>
1690attribute set, then <VAR>value</VAR>
1691is evaluated as an arithmetic expression even if the <CODE>$((<small>...</small>))</CODE>
1692expansion is not used (see section <A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>).
1693Word splitting is not performed, with the exception
1694of <CODE>"$@"</CODE> as explained below.
1695Filename expansion is not performed.
1696Assignment statements may also appear as arguments to the
1697<CODE>alias</CODE>,
1698<CODE>declare</CODE>, <CODE>typeset</CODE>, <CODE>export</CODE>, <CODE>readonly</CODE>,
1699and <CODE>local</CODE> builtin commands.
1700</P><P>
1701
1702In the context where an assignment statement is assigning a value
1703to a shell variable or array index (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the <SAMP>`+='</SAMP>
1704operator can be used to
1705append to or add to the variable's previous value.
1706When <SAMP>`+='</SAMP> is applied to a variable for which the integer attribute
1707has been set, <VAR>value</VAR> is evaluated as an arithmetic expression and
1708added to the variable's current value, which is also evaluated.
1709When <SAMP>`+='</SAMP> is applied to an array variable using compound assignment
1710(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), the
1711variable's value is not unset (as it is when using <SAMP>`='</SAMP>), and new
1712values are appended to the array beginning at one greater than the array's
1713maximum index (for indexed arrays), or added as additional key-value pairs
1714in an associative array.
1715When applied to a string-valued variable, <VAR>value</VAR> is expanded and
1716appended to the variable's value.
1717</P><P>
1718
1719<A NAME="Positional Parameters"></A>
1720<HR SIZE="6">
1721<A NAME="SEC26"></A>
1722<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1723<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> &lt; </A>]</TD>
1724<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> &gt; </A>]</TD>
1725<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt;&lt; </A>]</TD>
1726<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD>
1727<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt;&gt; </A>]</TD>
1728<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1729<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1730<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1731<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1732</TR></TABLE>
1733<H3> 3.4.1 Positional Parameters </H3>
1734<!--docid::SEC26::-->
1735<P>
1736
1737A <VAR>positional parameter</VAR> is a parameter denoted by one or more
1738digits, other than the single digit <CODE>0</CODE>. Positional parameters are
1739assigned from the shell's arguments when it is invoked,
1740and may be reassigned using the <CODE>set</CODE> builtin command.
1741Positional parameter <CODE>N</CODE> may be referenced as <CODE>${N}</CODE>, or
1742as <CODE>$N</CODE> when <CODE>N</CODE> consists of a single digit.
1743Positional parameters may not be assigned to with assignment statements.
1744The <CODE>set</CODE> and <CODE>shift</CODE> builtins are used to set and
1745unset them (see section <A HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>).
1746The positional parameters are
1747temporarily replaced when a shell function is executed
1748(see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
1749</P><P>
1750
1751When a positional parameter consisting of more than a single
1752digit is expanded, it must be enclosed in braces.
1753</P><P>
1754
1755<A NAME="Special Parameters"></A>
1756<HR SIZE="6">
1757<A NAME="SEC27"></A>
1758<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1759<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC26"> &lt; </A>]</TD>
1760<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt; </A>]</TD>
1761<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt;&lt; </A>]</TD>
1762<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC25"> Up </A>]</TD>
1763<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &gt;&gt; </A>]</TD>
1764<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1765<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1766<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1767<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1768</TR></TABLE>
1769<H3> 3.4.2 Special Parameters </H3>
1770<!--docid::SEC27::-->
1771<P>
1772
1773The shell treats several parameters specially. These parameters may
1774only be referenced; assignment to them is not allowed.
1775</P><P>
1776
1777<DL COMPACT>
1778
1779<A NAME="IDX46"></A>
1780<DT><CODE>*</CODE>
1781<DD><A NAME="IDX47"></A>
1782Expands to the positional parameters, starting from one. When the
1783expansion occurs within double quotes, it expands to a single word
1784with the value of each parameter separated by the first character
1785of the <CODE>IFS</CODE>
1786special variable. That is, <CODE>"$*"</CODE> is equivalent
1787to <CODE>"$1<VAR>c</VAR>$2<VAR>c</VAR><small>...</small>"</CODE>, where <VAR>c</VAR>
1788is the first character of the value of the <CODE>IFS</CODE>
1789variable.
1790If <CODE>IFS</CODE> is unset, the parameters are separated by spaces.
1791If <CODE>IFS</CODE> is null, the parameters are joined without intervening
1792separators.
1793<P>
1794
1795<A NAME="IDX48"></A>
1796<DT><CODE>@</CODE>
1797<DD><A NAME="IDX49"></A>
1798Expands to the positional parameters, starting from one. When the
1799expansion occurs within double quotes, each parameter expands to a
1800separate word. That is, <CODE>"$@"</CODE> is equivalent to
1801<CODE>"$1" "$2" <small>...</small></CODE>.
1802If the double-quoted expansion occurs within a word, the expansion of
1803the first parameter is joined with the beginning part of the original
1804word, and the expansion of the last parameter is joined with the last
1805part of the original word.
1806When there are no positional parameters, <CODE>"$@"</CODE> and
1807<CODE>$@</CODE>
1808expand to nothing (i.e., they are removed).
1809<P>
1810
1811<A NAME="IDX50"></A>
1812<DT><CODE>#</CODE>
1813<DD><A NAME="IDX51"></A>
1814Expands to the number of positional parameters in decimal.
1815<P>
1816
1817<A NAME="IDX52"></A>
1818<DT><CODE>?</CODE>
1819<DD><A NAME="IDX53"></A>
1820Expands to the exit status of the most recently executed foreground
1821pipeline.
1822<P>
1823
1824<A NAME="IDX54"></A>
1825<DT><CODE>-</CODE>
1826<DD><A NAME="IDX55"></A>
1827(A hyphen.) Expands to the current option flags as specified upon
1828invocation, by the <CODE>set</CODE>
1829builtin command, or those set by the shell itself
1830(such as the <SAMP>`-i'</SAMP> option).
1831<P>
1832
1833<A NAME="IDX56"></A>
1834<DT><CODE>$</CODE>
1835<DD><A NAME="IDX57"></A>
1836Expands to the process ID of the shell. In a <CODE>()</CODE> subshell, it
1837expands to the process ID of the invoking shell, not the subshell.
1838<P>
1839
1840<A NAME="IDX58"></A>
1841<DT><CODE>!</CODE>
1842<DD><A NAME="IDX59"></A>
1843Expands to the process ID of the most recently executed background
1844(asynchronous) command.
1845<P>
1846
1847<A NAME="IDX60"></A>
1848<DT><CODE>0</CODE>
1849<DD><A NAME="IDX61"></A>
1850Expands to the name of the shell or shell script. This is set at
1851shell initialization. If Bash is invoked with a file of commands
1852(see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>$0</CODE> is set to the name of that file.
1853If Bash is started with the <SAMP>`-c'</SAMP> option (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>),
1854then <CODE>$0</CODE> is set to the first argument after the string to be
1855executed, if one is present. Otherwise, it is set
1856to the filename used to invoke Bash, as given by argument zero.
1857<P>
1858
1859<A NAME="IDX62"></A>
1860<DT><CODE>_</CODE>
1861<DD><A NAME="IDX63"></A>
1862(An underscore.)
1863At shell startup, set to the absolute pathname used to invoke the
1864shell or shell script being executed as passed in the environment
1865or argument list.
1866Subsequently, expands to the last argument to the previous command,
1867after expansion.
1868Also set to the full pathname used to invoke each command executed
1869and placed in the environment exported to that command.
1870When checking mail, this parameter holds the name of the mail file.
1871</DL>
1872<P>
1873
1874<A NAME="Shell Expansions"></A>
1875<HR SIZE="6">
1876<A NAME="SEC28"></A>
1877<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1878<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC27"> &lt; </A>]</TD>
1879<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &gt; </A>]</TD>
1880<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
1881<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
1882<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
1883<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1884<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1885<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1886<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1887</TR></TABLE>
1888<H2> 3.5 Shell Expansions </H2>
1889<!--docid::SEC28::-->
1890<P>
1891
1892Expansion is performed on the command line after it has been split into
1893<CODE>token</CODE>s. There are seven kinds of expansion performed:
1894<UL>
1895<LI>brace expansion
1896<LI>tilde expansion
1897<LI>parameter and variable expansion
1898<LI>command substitution
1899<LI>arithmetic expansion
1900<LI>word splitting
1901<LI>filename expansion
1902</UL>
1903<P>
1904
1905<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
1906<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Expansion of expressions within braces.</TD></TR>
1907<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Expansion of the ~ character.</TD></TR>
1908<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash expands variables to their values.</TD></TR>
1909<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Using the output of a command as an argument.</TD></TR>
1910<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to use arithmetic in shell expansions.</TD></TR>
1911<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A way to write and read to and from a
1912 command.</TD></TR>
1913<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
1914 arguments.</TD></TR>
1915<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>
1916<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
1917 words.</TD></TR>
1918</TABLE></BLOCKQUOTE>
1919<P>
1920
1921The order of expansions is: brace expansion, tilde expansion,
1922parameter, variable, and arithmetic expansion and
1923command substitution
1924(done in a left-to-right fashion), word splitting, and filename
1925expansion.
1926</P><P>
1927
1928On systems that can support it, there is an additional expansion
1929available: <VAR>process substitution</VAR>. This is performed at the
1930same time as parameter, variable, and arithmetic expansion and
1931command substitution.
1932</P><P>
1933
1934Only brace expansion, word splitting, and filename expansion
1935can change the number of words of the expansion; other expansions
1936expand a single word to a single word.
1937The only exceptions to this are the expansions of
1938<CODE>"$@"</CODE> (see section <A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>) and <CODE>"${<VAR>name</VAR>[@]}"</CODE>
1939(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
1940</P><P>
1941
1942After all expansions, <CODE>quote removal</CODE> (see section <A HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>)
1943is performed.
1944</P><P>
1945
1946<A NAME="Brace Expansion"></A>
1947<HR SIZE="6">
1948<A NAME="SEC29"></A>
1949<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1950<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> &lt; </A>]</TD>
1951<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> &gt; </A>]</TD>
1952<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
1953<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
1954<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
1955<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
1956<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
1957<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
1958<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
1959</TR></TABLE>
1960<H3> 3.5.1 Brace Expansion </H3>
1961<!--docid::SEC29::-->
1962<P>
1963
1964Brace expansion is a mechanism by which arbitrary strings may be generated.
1965This mechanism is similar to
1966<VAR>filename expansion</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>),
1967but the file names generated need not exist.
1968Patterns to be brace expanded take the form of an optional <VAR>preamble</VAR>,
1969followed by either a series of comma-separated strings or a seqeunce expression
1970between a pair of braces,
1971followed by an optional <VAR>postscript</VAR>.
1972The preamble is prefixed to each string contained within the braces, and
1973the postscript is then appended to each resulting string, expanding left
1974to right.
1975</P><P>
1976
1977Brace expansions may be nested.
1978The results of each expanded string are not sorted; left to right order
1979is preserved.
1980For example,
1981<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash$ echo a{d,c,b}e
1982ade ace abe
1983</pre></td></tr></table></P><P>
1984
0001803f 1985A sequence expression takes the form <CODE>{<VAR>x</VAR>..<VAR>y</VAR>[..<VAR>incr</VAR>]}</CODE>,
17345e5a
JA
1986where <VAR>x</VAR> and <VAR>y</VAR> are either integers or single characters,
1987and <VAR>incr</VAR>, an optional increment, is an integer.
1988When integers are supplied, the expression expands to each number between
1989<VAR>x</VAR> and <VAR>y</VAR>, inclusive.
1990Supplied integers may be prefixed with <SAMP>`0'</SAMP> to force each term to have the
1991same width. When either <VAR>x</VAR> or <VAR>y</VAR> begins with a zero, the shell
1992attempts to force all generated terms to contain the same number of digits,
1993zero-padding where necessary.
1994When characters are supplied, the expression expands to each character
1995lexicographically between <VAR>x</VAR> and <VAR>y</VAR>, inclusive. Note that
1996both <VAR>x</VAR> and <VAR>y</VAR> must be of the same type.
1997When the increment is supplied, it is used as the difference between
1998each term. The default increment is 1 or -1 as appropriate.
1999</P><P>
2000
2001Brace expansion is performed before any other expansions,
2002and any characters special to other expansions are preserved
2003in the result. It is strictly textual. Bash
2004does not apply any syntactic interpretation to the context of the
2005expansion or the text between the braces.
2006To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2007is not considered eligible for brace expansion.
2008</P><P>
2009
2010A correctly-formed brace expansion must contain unquoted opening
2011and closing braces, and at least one unquoted comma or a valid
2012sequence expression.
2013Any incorrectly formed brace expansion is left unchanged.
2014</P><P>
2015
2016A { or <SAMP>`,'</SAMP> may be quoted with a backslash to prevent its
2017being considered part of a brace expression.
2018To avoid conflicts with parameter expansion, the string <SAMP>`${'</SAMP>
2019is not considered eligible for brace expansion.
2020</P><P>
2021
2022This construct is typically used as shorthand when the common
2023prefix of the strings to be generated is longer than in the
2024above example:
2025<TABLE><tr><td>&nbsp;</td><td class=example><pre>mkdir /usr/local/src/bash/{old,new,dist,bugs}
2026</pre></td></tr></table>or
2027<TABLE><tr><td>&nbsp;</td><td class=example><pre>chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
2028</pre></td></tr></table></P><P>
2029
2030<A NAME="Tilde Expansion"></A>
2031<HR SIZE="6">
2032<A NAME="SEC30"></A>
2033<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2034<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC29"> &lt; </A>]</TD>
2035<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &gt; </A>]</TD>
2036<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &lt;&lt; </A>]</TD>
2037<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2038<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2039<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2040<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2041<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2042<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2043</TR></TABLE>
2044<H3> 3.5.2 Tilde Expansion </H3>
2045<!--docid::SEC30::-->
2046<P>
2047
2048If a word begins with an unquoted tilde character (<SAMP>`~'</SAMP>), all of the
2049characters up to the first unquoted slash (or all characters,
2050if there is no unquoted slash) are considered a <VAR>tilde-prefix</VAR>.
2051If none of the characters in the tilde-prefix are quoted, the
2052characters in the tilde-prefix following the tilde are treated as a
2053possible <VAR>login name</VAR>.
2054If this login name is the null string, the tilde is replaced with the
2055value of the <CODE>HOME</CODE> shell variable.
2056If <CODE>HOME</CODE> is unset, the home directory of the user executing the
2057shell is substituted instead.
2058Otherwise, the tilde-prefix is replaced with the home directory
2059associated with the specified login name.
2060</P><P>
2061
2062If the tilde-prefix is <SAMP>`~+'</SAMP>, the value of
2063the shell variable <CODE>PWD</CODE> replaces the tilde-prefix.
2064If the tilde-prefix is <SAMP>`~-'</SAMP>, the value of the shell variable
2065<CODE>OLDPWD</CODE>, if it is set, is substituted.
2066</P><P>
2067
2068If the characters following the tilde in the tilde-prefix consist of a
2069number <VAR>N</VAR>, optionally prefixed by a <SAMP>`+'</SAMP> or a <SAMP>`-'</SAMP>,
2070the tilde-prefix is replaced with the
2071corresponding element from the directory stack, as it would be displayed
2072by the <CODE>dirs</CODE> builtin invoked with the characters following tilde
2073in the tilde-prefix as an argument (see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
2074If the tilde-prefix, sans the tilde, consists of a number without a
2075leading <SAMP>`+'</SAMP> or <SAMP>`-'</SAMP>, <SAMP>`+'</SAMP> is assumed.
2076</P><P>
2077
2078If the login name is invalid, or the tilde expansion fails, the word is
2079left unchanged.
2080</P><P>
2081
2082Each variable assignment is checked for unquoted tilde-prefixes immediately
2083following a <SAMP>`:'</SAMP> or the first <SAMP>`='</SAMP>.
2084In these cases, tilde expansion is also performed.
2085Consequently, one may use file names with tildes in assignments to
2086<CODE>PATH</CODE>, <CODE>MAILPATH</CODE>, and <CODE>CDPATH</CODE>,
2087and the shell assigns the expanded value.
2088</P><P>
2089
2090The following table shows how Bash treats unquoted tilde-prefixes:
2091</P><P>
2092
2093<DL COMPACT>
2094<DT><CODE>~</CODE>
2095<DD>The value of <CODE>$HOME</CODE>
2096<DT><CODE>~/foo</CODE>
2097<DD><TT>`$HOME/foo'</TT>
2098<P>
2099
2100<DT><CODE>~fred/foo</CODE>
2101<DD>The subdirectory <CODE>foo</CODE> of the home directory of the user
2102<CODE>fred</CODE>
2103<P>
2104
2105<DT><CODE>~+/foo</CODE>
2106<DD><TT>`$PWD/foo'</TT>
2107<P>
2108
2109<DT><CODE>~-/foo</CODE>
2110<DD><TT>`${OLDPWD-'~-'}/foo'</TT>
2111<P>
2112
2113<DT><CODE>~<VAR>N</VAR></CODE>
2114<DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2115<P>
2116
2117<DT><CODE>~+<VAR>N</VAR></CODE>
2118<DD>The string that would be displayed by <SAMP>`dirs +<VAR>N</VAR>'</SAMP>
2119<P>
2120
2121<DT><CODE>~-<VAR>N</VAR></CODE>
2122<DD>The string that would be displayed by <SAMP>`dirs -<VAR>N</VAR>'</SAMP>
2123<P>
2124
2125</DL>
2126<P>
2127
2128<A NAME="Shell Parameter Expansion"></A>
2129<HR SIZE="6">
2130<A NAME="SEC31"></A>
2131<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2132<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC30"> &lt; </A>]</TD>
2133<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &gt; </A>]</TD>
2134<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &lt;&lt; </A>]</TD>
2135<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2136<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2137<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2138<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2139<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2140<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2141</TR></TABLE>
2142<H3> 3.5.3 Shell Parameter Expansion </H3>
2143<!--docid::SEC31::-->
2144<P>
2145
2146The <SAMP>`$'</SAMP> character introduces parameter expansion,
2147command substitution, or arithmetic expansion. The parameter name
2148or symbol to be expanded may be enclosed in braces, which
2149are optional but serve to protect the variable to be expanded from
2150characters immediately following it which could be
2151interpreted as part of the name.
2152</P><P>
2153
2154When braces are used, the matching ending brace is the first <SAMP>`}'</SAMP>
2155not escaped by a backslash or within a quoted string, and not within an
2156embedded arithmetic expansion, command substitution, or parameter
2157expansion.
2158</P><P>
2159
2160The basic form of parameter expansion is ${<VAR>parameter</VAR>}.
2161The value of <VAR>parameter</VAR> is substituted. The braces are required
2162when <VAR>parameter</VAR>
2163is a positional parameter with more than one digit,
2164or when <VAR>parameter</VAR>
2165is followed by a character that is not to be
2166interpreted as part of its name.
2167</P><P>
2168
0001803f 2169If the first character of <VAR>parameter</VAR> is an exclamation point (!),
17345e5a
JA
2170a level of variable indirection is introduced.
2171Bash uses the value of the variable formed from the rest of
2172<VAR>parameter</VAR> as the name of the variable; this variable is then
2173expanded and that value is used in the rest of the substitution, rather
2174than the value of <VAR>parameter</VAR> itself.
2175This is known as <CODE>indirect expansion</CODE>.
2176The exceptions to this are the expansions of ${!<VAR>prefix*</VAR>}
2177and ${!<VAR>name</VAR>[@]}
2178described below.
2179The exclamation point must immediately follow the left brace in order to
2180introduce indirection.
2181</P><P>
2182
2183In each of the cases below, <VAR>word</VAR> is subject to tilde expansion,
2184parameter expansion, command substitution, and arithmetic expansion.
2185</P><P>
2186
2187When not performing substring expansion, using the form described
2188below, Bash tests for a parameter that is unset or null.
2189Omitting the colon results in a test only for a parameter that is unset.
2190Put another way, if the colon is included,
2191the operator tests for both <VAR>parameter</VAR>'s existence and that its value
2192is not null; if the colon is omitted, the operator tests only for existence.
2193</P><P>
2194
2195<DL COMPACT>
2196
2197<DT><CODE>${<VAR>parameter</VAR>:-<VAR>word</VAR>}</CODE>
2198<DD>If <VAR>parameter</VAR> is unset or null, the expansion of
2199<VAR>word</VAR> is substituted. Otherwise, the value of
2200<VAR>parameter</VAR> is substituted.
2201<P>
2202
2203<DT><CODE>${<VAR>parameter</VAR>:=<VAR>word</VAR>}</CODE>
2204<DD>If <VAR>parameter</VAR>
2205is unset or null, the expansion of <VAR>word</VAR>
2206is assigned to <VAR>parameter</VAR>.
2207The value of <VAR>parameter</VAR> is then substituted.
2208Positional parameters and special parameters may not be assigned to
2209in this way.
2210<P>
2211
2212<DT><CODE>${<VAR>parameter</VAR>:?<VAR>word</VAR>}</CODE>
2213<DD>If <VAR>parameter</VAR>
2214is null or unset, the expansion of <VAR>word</VAR> (or a message
2215to that effect if <VAR>word</VAR>
2216is not present) is written to the standard error and the shell, if it
2217is not interactive, exits. Otherwise, the value of <VAR>parameter</VAR> is
2218substituted.
2219<P>
2220
2221<DT><CODE>${<VAR>parameter</VAR>:+<VAR>word</VAR>}</CODE>
2222<DD>If <VAR>parameter</VAR>
2223is null or unset, nothing is substituted, otherwise the expansion of
2224<VAR>word</VAR> is substituted.
2225<P>
2226
2227<DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>}</CODE>
2228<DD><DT><CODE>${<VAR>parameter</VAR>:<VAR>offset</VAR>:<VAR>length</VAR>}</CODE>
2229<DD>Expands to up to <VAR>length</VAR> characters of <VAR>parameter</VAR>
2230starting at the character specified by <VAR>offset</VAR>.
2231If <VAR>length</VAR> is omitted, expands to the substring of
2232<VAR>parameter</VAR> starting at the character specified by <VAR>offset</VAR>.
2233<VAR>length</VAR> and <VAR>offset</VAR> are arithmetic expressions
2234(see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
2235This is referred to as Substring Expansion.
2236<P>
2237
2238<VAR>length</VAR> must evaluate to a number greater than or equal to zero.
2239If <VAR>offset</VAR> evaluates to a number less than zero, the value
2240is used as an offset from the end of the value of <VAR>parameter</VAR>.
2241If <VAR>parameter</VAR> is <SAMP>`@'</SAMP>, the result is <VAR>length</VAR> positional
2242parameters beginning at <VAR>offset</VAR>.
2243If <VAR>parameter</VAR> is an indexed array name subscripted
2244by <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the result is the <VAR>length</VAR>
2245members of the array beginning with <CODE>${<VAR>parameter</VAR>[<VAR>offset</VAR>]}</CODE>.
2246A negative <VAR>offset</VAR> is taken relative to one greater than the maximum
2247index of the specified array.
2248Substring expansion applied to an associative array produces undefined
2249results.
2250</P><P>
2251
2252Note that a negative offset must be separated from the colon by at least
2253one space to avoid being confused with the <SAMP>`:-'</SAMP> expansion.
2254Substring indexing is zero-based unless the positional parameters
2255are used, in which case the indexing starts at 1 by default.
2256If <VAR>offset</VAR> is 0, and the positional parameters are used, <CODE>$@</CODE> is
2257prefixed to the list.
2258</P><P>
2259
2260<DT><CODE>${!<VAR>prefix</VAR>*}</CODE>
2261<DD><DT><CODE>${!<VAR>prefix</VAR>@}</CODE>
2262<DD>Expands to the names of variables whose names begin with <VAR>prefix</VAR>,
2263separated by the first character of the <CODE>IFS</CODE> special variable.
2264When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2265variable name expands to a separate word.
2266<P>
2267
2268<DT><CODE>${!<VAR>name</VAR>[@]}</CODE>
2269<DD><DT><CODE>${!<VAR>name</VAR>[*]}</CODE>
2270<DD>If <VAR>name</VAR> is an array variable, expands to the list of array indices
2271(keys) assigned in <VAR>name</VAR>.
2272If <VAR>name</VAR> is not an array, expands to 0 if <VAR>name</VAR> is set and null
2273otherwise.
2274When <SAMP>`@'</SAMP> is used and the expansion appears within double quotes, each
2275key expands to a separate word.
2276<P>
2277
2278<DT><CODE>${#<VAR>parameter</VAR>}</CODE>
2279<DD>The length in characters of the expanded value of <VAR>parameter</VAR> is
2280substituted.
2281If <VAR>parameter</VAR> is <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>, the value substituted
2282is the number of positional parameters.
2283If <VAR>parameter</VAR> is an array name subscripted by <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP>,
2284the value substituted is the number of elements in the array.
2285<P>
2286
2287<DT><CODE>${<VAR>parameter</VAR>#<VAR>word</VAR>}</CODE>
2288<DD><DT><CODE>${<VAR>parameter</VAR>##<VAR>word</VAR>}</CODE>
2289<DD>The <VAR>word</VAR>
2290is expanded to produce a pattern just as in filename
2291expansion (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>). If the pattern matches
2292the beginning of the expanded value of <VAR>parameter</VAR>,
2293then the result of the expansion is the expanded value of <VAR>parameter</VAR>
2294with the shortest matching pattern (the <SAMP>`#'</SAMP> case) or the
2295longest matching pattern (the <SAMP>`##'</SAMP> case) deleted.
2296If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2297the pattern removal operation is applied to each positional
2298parameter in turn, and the expansion is the resultant list.
2299If <VAR>parameter</VAR> is an array variable subscripted with
2300<SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2301the pattern removal operation is applied to each member of the
2302array in turn, and the expansion is the resultant list.
2303<P>
2304
2305<DT><CODE>${<VAR>parameter</VAR>%<VAR>word</VAR>}</CODE>
2306<DD><DT><CODE>${<VAR>parameter</VAR>%%<VAR>word</VAR>}</CODE>
2307<DD>The <VAR>word</VAR> is expanded to produce a pattern just as in
2308filename expansion.
2309If the pattern matches a trailing portion of the expanded value of
2310<VAR>parameter</VAR>, then the result of the expansion is the value of
2311<VAR>parameter</VAR> with the shortest matching pattern (the <SAMP>`%'</SAMP> case)
2312or the longest matching pattern (the <SAMP>`%%'</SAMP> case) deleted.
2313If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2314the pattern removal operation is applied to each positional
2315parameter in turn, and the expansion is the resultant list.
2316If <VAR>parameter</VAR>
2317is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2318the pattern removal operation is applied to each member of the
2319array in turn, and the expansion is the resultant list.
2320<P>
2321
2322<DT><CODE>${<VAR>parameter</VAR>/<VAR>pattern</VAR>/<VAR>string</VAR>}</CODE>
2323<DD><P>
2324
2325The <VAR>pattern</VAR> is expanded to produce a pattern just as in
2326filename expansion.
2327<VAR>Parameter</VAR> is expanded and the longest match of <VAR>pattern</VAR>
2328against its value is replaced with <VAR>string</VAR>.
2329If <VAR>pattern</VAR> begins with <SAMP>`/'</SAMP>, all matches of <VAR>pattern</VAR> are
2330replaced with <VAR>string</VAR>. Normally only the first match is replaced.
2331If <VAR>pattern</VAR> begins with <SAMP>`#'</SAMP>, it must match at the beginning
2332of the expanded value of <VAR>parameter</VAR>.
2333If <VAR>pattern</VAR> begins with <SAMP>`%'</SAMP>, it must match at the end
2334of the expanded value of <VAR>parameter</VAR>.
2335If <VAR>string</VAR> is null, matches of <VAR>pattern</VAR> are deleted
2336and the <CODE>/</CODE> following <VAR>pattern</VAR> may be omitted.
2337If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2338the substitution operation is applied to each positional
2339parameter in turn, and the expansion is the resultant list.
2340If <VAR>parameter</VAR>
2341is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2342the substitution operation is applied to each member of the
2343array in turn, and the expansion is the resultant list.
2344</P><P>
2345
2346<DT><CODE>${<VAR>parameter</VAR>^<VAR>pattern</VAR>}</CODE>
2347<DD><DT><CODE>${<VAR>parameter</VAR>^^<VAR>pattern</VAR>}</CODE>
2348<DD><DT><CODE>${<VAR>parameter</VAR>,<VAR>pattern</VAR>}</CODE>
2349<DD><DT><CODE>${<VAR>parameter</VAR>,,<VAR>pattern</VAR>}</CODE>
2350<DD>This expansion modifies the case of alphabetic characters in <VAR>parameter</VAR>.
2351The <VAR>pattern</VAR> is expanded to produce a pattern just as in
0001803f 2352filename expansion.
17345e5a
JA
2353The <SAMP>`^'</SAMP> operator converts lowercase letters matching <VAR>pattern</VAR>
2354to uppercase; the <SAMP>`,'</SAMP> operator converts matching uppercase letters
2355to lowercase.
2356The <SAMP>`^^'</SAMP> and <SAMP>`,,'</SAMP> expansions convert each matched character in the
2357expanded value; the <SAMP>`^'</SAMP> and <SAMP>`,'</SAMP> expansions match and convert only
2358the first character in the expanded value.
2359If <VAR>pattern</VAR> is omitted, it is treated like a <SAMP>`?'</SAMP>, which matches
2360every character.
2361If <VAR>parameter</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2362the case modification operation is applied to each positional
2363parameter in turn, and the expansion is the resultant list.
2364If <VAR>parameter</VAR>
2365is an array variable subscripted with <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>,
2366the case modification operation is applied to each member of the
2367array in turn, and the expansion is the resultant list.
2368<P>
2369
2370</DL>
2371<P>
2372
2373<A NAME="Command Substitution"></A>
2374<HR SIZE="6">
2375<A NAME="SEC32"></A>
2376<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2377<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC31"> &lt; </A>]</TD>
2378<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &gt; </A>]</TD>
2379<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &lt;&lt; </A>]</TD>
2380<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2381<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2382<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2383<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2384<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2385<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2386</TR></TABLE>
2387<H3> 3.5.4 Command Substitution </H3>
2388<!--docid::SEC32::-->
2389<P>
2390
2391Command substitution allows the output of a command to replace
2392the command itself.
2393Command substitution occurs when a command is enclosed as follows:
2394<TABLE><tr><td>&nbsp;</td><td class=example><pre>$(<VAR>command</VAR>)
2395</pre></td></tr></table>or
2396<TABLE><tr><td>&nbsp;</td><td class=example><pre>`<VAR>command</VAR>`
2397</pre></td></tr></table></P><P>
2398
2399Bash performs the expansion by executing <VAR>command</VAR> and
2400replacing the command substitution with the standard output of the
2401command, with any trailing newlines deleted.
2402Embedded newlines are not deleted, but they may be removed during
2403word splitting.
2404The command substitution <CODE>$(cat <VAR>file</VAR>)</CODE> can be
2405replaced by the equivalent but faster <CODE>$(&#60; <VAR>file</VAR>)</CODE>.
2406</P><P>
2407
2408When the old-style backquote form of substitution is used,
2409backslash retains its literal meaning except when followed by
2410<SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, or <SAMP>`\'</SAMP>.
2411The first backquote not preceded by a backslash terminates the
2412command substitution.
2413When using the <CODE>$(<VAR>command</VAR>)</CODE> form, all characters between
2414the parentheses make up the command; none are treated specially.
2415</P><P>
2416
2417Command substitutions may be nested. To nest when using the backquoted
2418form, escape the inner backquotes with backslashes.
2419</P><P>
2420
2421If the substitution appears within double quotes, word splitting and
2422filename expansion are not performed on the results.
2423</P><P>
2424
2425<A NAME="Arithmetic Expansion"></A>
2426<HR SIZE="6">
2427<A NAME="SEC33"></A>
2428<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2429<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC32"> &lt; </A>]</TD>
2430<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &gt; </A>]</TD>
2431<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &lt;&lt; </A>]</TD>
2432<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2433<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2434<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2435<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2436<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2437<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2438</TR></TABLE>
2439<H3> 3.5.5 Arithmetic Expansion </H3>
2440<!--docid::SEC33::-->
2441<P>
2442
2443Arithmetic expansion allows the evaluation of an arithmetic expression
2444and the substitution of the result. The format for arithmetic expansion is:
2445</P><P>
2446
2447<TABLE><tr><td>&nbsp;</td><td class=example><pre>$(( <VAR>expression</VAR> ))
2448</pre></td></tr></table></P><P>
2449
2450The expression is treated as if it were within double quotes, but
2451a double quote inside the parentheses is not treated specially.
2452All tokens in the expression undergo parameter expansion, command
2453substitution, and quote removal.
2454Arithmetic expansions may be nested.
2455</P><P>
2456
2457The evaluation is performed according to the rules listed below
2458(see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
2459If the expression is invalid, Bash prints a message indicating
2460failure to the standard error and no substitution occurs.
2461</P><P>
2462
2463<A NAME="Process Substitution"></A>
2464<HR SIZE="6">
2465<A NAME="SEC34"></A>
2466<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2467<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC33"> &lt; </A>]</TD>
2468<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &gt; </A>]</TD>
2469<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &lt;&lt; </A>]</TD>
2470<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2471<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2472<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2473<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2474<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2475<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2476</TR></TABLE>
2477<H3> 3.5.6 Process Substitution </H3>
2478<!--docid::SEC34::-->
2479<P>
2480
2481Process substitution is supported on systems that support named
2482pipes (FIFOs) or the <TT>`/dev/fd'</TT> method of naming open files.
2483It takes the form of
2484<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;(<VAR>list</VAR>)
2485</pre></td></tr></table>or
2486<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;(<VAR>list</VAR>)
2487</pre></td></tr></table>The process <VAR>list</VAR> is run with its input or output connected to a
2488FIFO or some file in <TT>`/dev/fd'</TT>. The name of this file is
2489passed as an argument to the current command as the result of the
2490expansion. If the <CODE>&#62;(<VAR>list</VAR>)</CODE> form is used, writing to
2491the file will provide input for <VAR>list</VAR>. If the
2492<CODE>&#60;(<VAR>list</VAR>)</CODE> form is used, the file passed as an
2493argument should be read to obtain the output of <VAR>list</VAR>.
2494Note that no space may appear between the <CODE>&#60;</CODE> or <CODE>&#62;</CODE>
2495and the left parenthesis, otherwise the construct would be interpreted
2496as a redirection.
2497</P><P>
2498
2499When available, process substitution is performed simultaneously with
2500parameter and variable expansion, command substitution, and arithmetic
2501expansion.
2502</P><P>
2503
2504<A NAME="Word Splitting"></A>
2505<HR SIZE="6">
2506<A NAME="SEC35"></A>
2507<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2508<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC34"> &lt; </A>]</TD>
2509<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &gt; </A>]</TD>
2510<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &lt;&lt; </A>]</TD>
2511<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2512<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2513<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2514<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2515<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2516<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2517</TR></TABLE>
2518<H3> 3.5.7 Word Splitting </H3>
2519<!--docid::SEC35::-->
2520<P>
2521
2522The shell scans the results of parameter expansion, command substitution,
2523and arithmetic expansion that did not occur within double quotes for
2524word splitting.
2525</P><P>
2526
2527The shell treats each character of <CODE>$IFS</CODE> as a delimiter, and splits
2528the results of the other expansions into words on these characters.
2529If <CODE>IFS</CODE> is unset, or its value is exactly <CODE>&#60;space&#62;&#60;tab&#62;&#60;newline&#62;</CODE>,
2530the default, then sequences of
2531<CODE> &#60;space&#62;</CODE>, <CODE>&#60;tab&#62;</CODE>, and <CODE>&#60;newline&#62;</CODE>
2532at the beginning and end of the results of the previous
2533expansions are ignored, and any sequence of <CODE>IFS</CODE>
2534characters not at the beginning or end serves to delimit words.
2535If <CODE>IFS</CODE> has a value other than the default, then sequences of
2536the whitespace characters <CODE>space</CODE> and <CODE>tab</CODE>
2537are ignored at the beginning and end of the
2538word, as long as the whitespace character is in the
2539value of <CODE>IFS</CODE> (an <CODE>IFS</CODE> whitespace character).
2540Any character in <CODE>IFS</CODE> that is not <CODE>IFS</CODE>
2541whitespace, along with any adjacent <CODE>IFS</CODE>
2542whitespace characters, delimits a field. A sequence of <CODE>IFS</CODE>
2543whitespace characters is also treated as a delimiter.
2544If the value of <CODE>IFS</CODE> is null, no word splitting occurs.
2545</P><P>
2546
2547Explicit null arguments (<CODE>""</CODE> or <CODE>"</CODE>) are retained.
2548Unquoted implicit null arguments, resulting from the expansion of
2549parameters that have no values, are removed.
2550If a parameter with no value is expanded within double quotes, a
2551null argument results and is retained.
2552</P><P>
2553
2554Note that if no expansion occurs, no splitting
2555is performed.
2556</P><P>
2557
2558<A NAME="Filename Expansion"></A>
2559<HR SIZE="6">
2560<A NAME="SEC36"></A>
2561<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2562<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC35"> &lt; </A>]</TD>
2563<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> &gt; </A>]</TD>
2564<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &lt;&lt; </A>]</TD>
2565<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2566<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &gt;&gt; </A>]</TD>
2567<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2568<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2569<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2570<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2571</TR></TABLE>
2572<H3> 3.5.8 Filename Expansion </H3>
2573<!--docid::SEC36::-->
2574<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
2575<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How the shell matches patterns.</TD></TR>
2576</TABLE></BLOCKQUOTE>
2577<A NAME="IDX64"></A>
2578<A NAME="IDX65"></A>
2579<A NAME="IDX66"></A>
2580<A NAME="IDX67"></A>
2581<P>
2582
2583After word splitting, unless the <SAMP>`-f'</SAMP> option has been set
2584(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), Bash scans each word for the characters
2585<SAMP>`*'</SAMP>, <SAMP>`?'</SAMP>, and <SAMP>`['</SAMP>.
2586If one of these characters appears, then the word is
2587regarded as a <VAR>pattern</VAR>,
2588and replaced with an alphabetically sorted list of
2589file names matching the pattern. If no matching file names are found,
2590and the shell option <CODE>nullglob</CODE> is disabled, the word is left
2591unchanged.
2592If the <CODE>nullglob</CODE> option is set, and no matches are found, the word
2593is removed.
2594If the <CODE>failglob</CODE> shell option is set, and no matches are found,
2595an error message is printed and the command is not executed.
2596If the shell option <CODE>nocaseglob</CODE> is enabled, the match is performed
2597without regard to the case of alphabetic characters.
2598</P><P>
2599
0001803f 2600When a pattern is used for filename expansion, the character <SAMP>`.'</SAMP>
17345e5a
JA
2601at the start of a filename or immediately following a slash
2602must be matched explicitly, unless the shell option <CODE>dotglob</CODE> is set.
2603When matching a file name, the slash character must always be
2604matched explicitly.
2605In other cases, the <SAMP>`.'</SAMP> character is not treated specially.
2606</P><P>
2607
2608See the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>,
2609for a description of the <CODE>nocaseglob</CODE>, <CODE>nullglob</CODE>,
2610<CODE>failglob</CODE>, and <CODE>dotglob</CODE> options.
2611</P><P>
2612
2613The <CODE>GLOBIGNORE</CODE>
2614shell variable may be used to restrict the set of filenames matching a
2615pattern. If <CODE>GLOBIGNORE</CODE>
2616is set, each matching filename that also matches one of the patterns in
2617<CODE>GLOBIGNORE</CODE> is removed from the list of matches. The filenames
2618<TT>`.'</TT> and <TT>`..'</TT>
2619are always ignored when <CODE>GLOBIGNORE</CODE>
2620is set and not null.
2621However, setting <CODE>GLOBIGNORE</CODE> to a non-null value has the effect of
2622enabling the <CODE>dotglob</CODE>
2623shell option, so all other filenames beginning with a
2624<SAMP>`.'</SAMP> will match.
2625To get the old behavior of ignoring filenames beginning with a
2626<SAMP>`.'</SAMP>, make <SAMP>`.*'</SAMP> one of the patterns in <CODE>GLOBIGNORE</CODE>.
2627The <CODE>dotglob</CODE> option is disabled when <CODE>GLOBIGNORE</CODE>
2628is unset.
2629</P><P>
2630
2631<A NAME="Pattern Matching"></A>
2632<HR SIZE="6">
2633<A NAME="SEC37"></A>
2634<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2635<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> &lt; </A>]</TD>
2636<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &gt; </A>]</TD>
2637<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &lt;&lt; </A>]</TD>
2638<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC36"> Up </A>]</TD>
2639<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &gt;&gt; </A>]</TD>
2640<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2641<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2642<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2643<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2644</TR></TABLE>
2645<H4> 3.5.8.1 Pattern Matching </H4>
2646<!--docid::SEC37::-->
2647<P>
2648
2649Any character that appears in a pattern, other than the special pattern
2650characters described below, matches itself.
2651The NUL character may not occur in a pattern.
2652A backslash escapes the following character; the
2653escaping backslash is discarded when matching.
2654The special pattern characters must be quoted if they are to be matched
2655literally.
2656</P><P>
2657
2658The special pattern characters have the following meanings:
2659<DL COMPACT>
2660<DT><CODE>*</CODE>
2661<DD>Matches any string, including the null string.
2662When the <CODE>globstar</CODE> shell option is enabled, and <SAMP>`*'</SAMP> is used in
2663a filename expansion context, two adjacent <SAMP>`*'</SAMP>s used as a single
2664pattern will match all files and zero or more directories and
2665subdirectories.
2666If followed by a <SAMP>`/'</SAMP>, two adjacent <SAMP>`*'</SAMP>s will match only
2667directories and subdirectories.
2668<DT><CODE>?</CODE>
2669<DD>Matches any single character.
2670<DT><CODE>[<small>...</small>]</CODE>
2671<DD>Matches any one of the enclosed characters. A pair of characters
2672separated by a hyphen denotes a <VAR>range expression</VAR>;
2673any character that sorts between those two characters, inclusive,
2674using the current locale's collating sequence and character set,
2675is matched. If the first character following the
2676<SAMP>`['</SAMP> is a <SAMP>`!'</SAMP> or a <SAMP>`^'</SAMP>
2677then any character not enclosed is matched. A <SAMP>`-'</SAMP>
2678may be matched by including it as the first or last character
2679in the set. A <SAMP>`]'</SAMP> may be matched by including it as the first
2680character in the set.
2681The sorting order of characters in range expressions is determined by
2682the current locale and the value of the <CODE>LC_COLLATE</CODE> shell variable,
2683if set.
2684<P>
2685
2686For example, in the default C locale, <SAMP>`[a-dx-z]'</SAMP> is equivalent to
2687<SAMP>`[abcdxyz]'</SAMP>. Many locales sort characters in dictionary order, and in
2688these locales <SAMP>`[a-dx-z]'</SAMP> is typically not equivalent to <SAMP>`[abcdxyz]'</SAMP>;
2689it might be equivalent to <SAMP>`[aBbCcDdxXyYz]'</SAMP>, for example. To obtain
2690the traditional interpretation of ranges in bracket expressions, you can
2691force the use of the C locale by setting the <CODE>LC_COLLATE</CODE> or
2692<CODE>LC_ALL</CODE> environment variable to the value <SAMP>`C'</SAMP>.
2693</P><P>
2694
2695Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, <VAR>character classes</VAR> can be specified
2696using the syntax
2697<CODE>[:</CODE><VAR>class</VAR><CODE>:]</CODE>, where <VAR>class</VAR> is one of the
2698following classes defined in the POSIX standard:
2699<TABLE><tr><td>&nbsp;</td><td class=example><pre>alnum alpha ascii blank cntrl digit graph lower
2700print punct space upper word xdigit
2701</pre></td></tr></table>A character class matches any character belonging to that class.
2702The <CODE>word</CODE> character class matches letters, digits, and the character
2703<SAMP>`_'</SAMP>.
2704</P><P>
2705
2706Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, an <VAR>equivalence class</VAR> can be
2707specified using the syntax <CODE>[=</CODE><VAR>c</VAR><CODE>=]</CODE>, which
2708matches all characters with the same collation weight (as defined
2709by the current locale) as the character <VAR>c</VAR>.
2710</P><P>
2711
2712Within <SAMP>`['</SAMP> and <SAMP>`]'</SAMP>, the syntax <CODE>[.</CODE><VAR>symbol</VAR><CODE>.]</CODE>
2713matches the collating symbol <VAR>symbol</VAR>.
2714</DL>
2715<P>
2716
2717If the <CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE>
2718builtin, several extended pattern matching operators are recognized.
2719In the following description, a <VAR>pattern-list</VAR> is a list of one
2720or more patterns separated by a <SAMP>`|'</SAMP>.
2721Composite patterns may be formed using one or more of the following
2722sub-patterns:
2723</P><P>
2724
2725<DL COMPACT>
2726<DT><CODE>?(<VAR>pattern-list</VAR>)</CODE>
2727<DD>Matches zero or one occurrence of the given patterns.
2728<P>
2729
2730<DT><CODE>*(<VAR>pattern-list</VAR>)</CODE>
2731<DD>Matches zero or more occurrences of the given patterns.
2732<P>
2733
2734<DT><CODE>+(<VAR>pattern-list</VAR>)</CODE>
2735<DD>Matches one or more occurrences of the given patterns.
2736<P>
2737
2738<DT><CODE>@(<VAR>pattern-list</VAR>)</CODE>
2739<DD>Matches one of the given patterns.
2740<P>
2741
2742<DT><CODE>!(<VAR>pattern-list</VAR>)</CODE>
2743<DD>Matches anything except one of the given patterns.
2744</DL>
2745<P>
2746
2747<A NAME="Quote Removal"></A>
2748<HR SIZE="6">
2749<A NAME="SEC38"></A>
2750<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2751<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC37"> &lt; </A>]</TD>
2752<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt; </A>]</TD>
2753<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt;&lt; </A>]</TD>
2754<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC28"> Up </A>]</TD>
2755<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &gt;&gt; </A>]</TD>
2756<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2757<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2758<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2759<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2760</TR></TABLE>
2761<H3> 3.5.9 Quote Removal </H3>
2762<!--docid::SEC38::-->
2763<P>
2764
2765After the preceding expansions, all unquoted occurrences of the
2766characters <SAMP>`\'</SAMP>, <SAMP>`''</SAMP>, and <SAMP>`"'</SAMP> that did not
2767result from one of the above expansions are removed.
2768</P><P>
2769
2770<A NAME="Redirections"></A>
2771<HR SIZE="6">
2772<A NAME="SEC39"></A>
2773<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2774<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC38"> &lt; </A>]</TD>
2775<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &gt; </A>]</TD>
2776<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt;&lt; </A>]</TD>
2777<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
2778<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2779<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2780<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2781<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2782<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2783</TR></TABLE>
2784<H2> 3.6 Redirections </H2>
2785<!--docid::SEC39::-->
2786<P>
2787
2788Before a command is executed, its input and output
2789may be <VAR>redirected</VAR>
2790using a special notation interpreted by the shell.
2791Redirection may also be used to open and close files for the
2792current shell execution environment. The following redirection
2793operators may precede or appear anywhere within a
2794simple command or may follow a command.
2795Redirections are processed in the order they appear, from
2796left to right.
2797</P><P>
2798
0001803f
CR
2799Each redirection that may be preceded by a file descriptor number
2800may instead be preceded by a word of the form {<VAR>varname</VAR>}.
2801In this case, for each redirection operator except
2802&#62;&#38;- and &#60;&#38;-, the shell will allocate a file descriptor greater
2803than 10 and assign it to {<VAR>varname</VAR>}. If &#62;&#38;- or &#60;&#38;- is preceded
2804by {<VAR>varname</VAR>}, the value of <VAR>varname</VAR> defines the file
2805descriptor to close.
2806</P><P>
2807
17345e5a
JA
2808In the following descriptions, if the file descriptor number is
2809omitted, and the first character of the redirection operator is
2810<SAMP>`&#60;'</SAMP>, the redirection refers to the standard input (file
2811descriptor 0). If the first character of the redirection operator
2812is <SAMP>`&#62;'</SAMP>, the redirection refers to the standard output (file
2813descriptor 1).
2814</P><P>
2815
2816The word following the redirection operator in the following
2817descriptions, unless otherwise noted, is subjected to brace expansion,
2818tilde expansion, parameter expansion, command substitution, arithmetic
2819expansion, quote removal, filename expansion, and word splitting.
2820If it expands to more than one word, Bash reports an error.
2821</P><P>
2822
2823Note that the order of redirections is significant. For example,
2824the command
2825<TABLE><tr><td>&nbsp;</td><td class=example><pre>ls &#62; <VAR>dirlist</VAR> 2&#62;&#38;1
2826</pre></td></tr></table>directs both standard output (file descriptor 1) and standard error
2827(file descriptor 2) to the file <VAR>dirlist</VAR>, while the command
2828<TABLE><tr><td>&nbsp;</td><td class=example><pre>ls 2&#62;&#38;1 &#62; <VAR>dirlist</VAR>
2829</pre></td></tr></table>directs only the standard output to file <VAR>dirlist</VAR>,
0001803f 2830because the standard error was made a copy of the standard output
17345e5a
JA
2831before the standard output was redirected to <VAR>dirlist</VAR>.
2832</P><P>
2833
2834Bash handles several filenames specially when they are used in
2835redirections, as described in the following table:
2836</P><P>
2837
2838<DL COMPACT>
2839<DT><CODE>/dev/fd/<VAR>fd</VAR></CODE>
2840<DD>If <VAR>fd</VAR> is a valid integer, file descriptor <VAR>fd</VAR> is duplicated.
2841<P>
2842
2843<DT><CODE>/dev/stdin</CODE>
2844<DD>File descriptor 0 is duplicated.
2845<P>
2846
2847<DT><CODE>/dev/stdout</CODE>
2848<DD>File descriptor 1 is duplicated.
2849<P>
2850
2851<DT><CODE>/dev/stderr</CODE>
2852<DD>File descriptor 2 is duplicated.
2853<P>
2854
2855<DT><CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2856<DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2857is an integer port number or service name, Bash attempts to open a TCP
2858connection to the corresponding socket.
2859<P>
2860
2861<DT><CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
2862<DD>If <VAR>host</VAR> is a valid hostname or Internet address, and <VAR>port</VAR>
2863is an integer port number or service name, Bash attempts to open a UDP
2864connection to the corresponding socket.
2865<P>
2866
2867</DL>
2868<P>
2869
2870A failure to open or create a file causes the redirection to fail.
2871</P><P>
2872
2873Redirections using file descriptors greater than 9 should be used with
2874care, as they may conflict with file descriptors the shell uses
2875internally.
2876</P><P>
2877
2878<HR SIZE="6">
2879<A NAME="SEC40"></A>
2880<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2881<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> &lt; </A>]</TD>
2882<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &gt; </A>]</TD>
2883<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt;&lt; </A>]</TD>
2884<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2885<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2886<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2887<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2888<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2889<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2890</TR></TABLE>
2891<H3> 3.6.1 Redirecting Input </H3>
2892<!--docid::SEC40::-->
2893Redirection of input causes the file whose name results from
2894the expansion of <VAR>word</VAR>
2895to be opened for reading on file descriptor <CODE>n</CODE>,
2896or the standard input (file descriptor 0) if <CODE>n</CODE>
2897is not specified.
2898<P>
2899
2900The general format for redirecting input is:
2901<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;<VAR>word</VAR>
2902</pre></td></tr></table></P><P>
2903
2904<HR SIZE="6">
2905<A NAME="SEC41"></A>
2906<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2907<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC40"> &lt; </A>]</TD>
2908<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &gt; </A>]</TD>
2909<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &lt;&lt; </A>]</TD>
2910<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2911<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2912<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2913<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2914<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2915<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2916</TR></TABLE>
2917<H3> 3.6.2 Redirecting Output </H3>
2918<!--docid::SEC41::-->
2919Redirection of output causes the file whose name results from
2920the expansion of <VAR>word</VAR>
2921to be opened for writing on file descriptor <VAR>n</VAR>,
2922or the standard output (file descriptor 1) if <VAR>n</VAR>
2923is not specified. If the file does not exist it is created;
2924if it does exist it is truncated to zero size.
2925<P>
2926
2927The general format for redirecting output is:
2928<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;[|]<VAR>word</VAR>
2929</pre></td></tr></table></P><P>
2930
2931If the redirection operator is <SAMP>`&#62;'</SAMP>, and the <CODE>noclobber</CODE>
2932option to the <CODE>set</CODE> builtin has been enabled, the redirection
2933will fail if the file whose name results from the expansion of
2934<VAR>word</VAR> exists and is a regular file.
2935If the redirection operator is <SAMP>`&#62;|'</SAMP>, or the redirection operator is
2936<SAMP>`&#62;'</SAMP> and the <CODE>noclobber</CODE> option is not enabled, the redirection
2937is attempted even if the file named by <VAR>word</VAR> exists.
2938</P><P>
2939
2940<HR SIZE="6">
2941<A NAME="SEC42"></A>
2942<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2943<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &lt; </A>]</TD>
2944<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &gt; </A>]</TD>
2945<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &lt;&lt; </A>]</TD>
2946<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2947<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2948<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2949<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2950<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2951<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2952</TR></TABLE>
2953<H3> 3.6.3 Appending Redirected Output </H3>
2954<!--docid::SEC42::-->
2955Redirection of output in this fashion
2956causes the file whose name results from
2957the expansion of <VAR>word</VAR>
2958to be opened for appending on file descriptor <VAR>n</VAR>,
2959or the standard output (file descriptor 1) if <VAR>n</VAR>
2960is not specified. If the file does not exist it is created.
2961<P>
2962
2963The general format for appending output is:
2964<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#62;<VAR>word</VAR>
2965</pre></td></tr></table></P><P>
2966
2967<HR SIZE="6">
2968<A NAME="SEC43"></A>
2969<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
2970<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC42"> &lt; </A>]</TD>
2971<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &gt; </A>]</TD>
2972<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &lt;&lt; </A>]</TD>
2973<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
2974<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
2975<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
2976<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
2977<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
2978<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
2979</TR></TABLE>
2980<H3> 3.6.4 Redirecting Standard Output and Standard Error </H3>
2981<!--docid::SEC43::-->
2982This construct allows both the
2983standard output (file descriptor 1) and
2984the standard error output (file descriptor 2)
2985to be redirected to the file whose name is the
2986expansion of <VAR>word</VAR>.
2987<P>
2988
2989There are two formats for redirecting standard output and
2990standard error:
2991<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#38;&#62;<VAR>word</VAR>
2992</pre></td></tr></table>and
2993<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;&#38;<VAR>word</VAR>
2994</pre></td></tr></table>Of the two forms, the first is preferred.
2995This is semantically equivalent to
2996<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;<VAR>word</VAR> 2&#62;&#38;1
2997</pre></td></tr></table></P><P>
2998
2999<HR SIZE="6">
3000<A NAME="SEC44"></A>
3001<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3002<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC43"> &lt; </A>]</TD>
3003<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &gt; </A>]</TD>
3004<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &lt;&lt; </A>]</TD>
3005<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3006<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3007<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3008<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3009<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3010<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3011</TR></TABLE>
3012<H3> 3.6.5 Appending Standard Output and Standard Error </H3>
3013<!--docid::SEC44::-->
3014This construct allows both the
3015standard output (file descriptor 1) and
3016the standard error output (file descriptor 2)
3017to be appended to the file whose name is the
3018expansion of <VAR>word</VAR>.
3019<P>
3020
3021The format for appending standard output and standard error is:
3022<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#38;&#62;&#62;<VAR>word</VAR>
3023</pre></td></tr></table>This is semantically equivalent to
3024<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#62;&#62;<VAR>word</VAR> 2&#62;&#38;1
3025</pre></td></tr></table></P><P>
3026
3027<HR SIZE="6">
3028<A NAME="SEC45"></A>
3029<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3030<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC44"> &lt; </A>]</TD>
3031<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &gt; </A>]</TD>
3032<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &lt;&lt; </A>]</TD>
3033<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3034<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3035<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3036<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3037<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3038<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3039</TR></TABLE>
3040<H3> 3.6.6 Here Documents </H3>
3041<!--docid::SEC45::-->
3042This type of redirection instructs the shell to read input from the
3043current source until a line containing only <VAR>word</VAR>
3044(with no trailing blanks) is seen. All of
3045the lines read up to that point are then used as the standard
3046input for a command.
3047<P>
3048
3049The format of here-documents is:
3050<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;&#60;[-]<VAR>word</VAR>
3051 <VAR>here-document</VAR>
3052<VAR>delimiter</VAR>
3053</pre></td></tr></table></P><P>
3054
3055No parameter expansion, command substitution, arithmetic expansion,
3056or filename expansion is performed on
3057<VAR>word</VAR>. If any characters in <VAR>word</VAR> are quoted, the
3058<VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>,
3059and the lines in the here-document are not expanded.
3060If <VAR>word</VAR> is unquoted,
3061all lines of the here-document are subjected to parameter expansion,
3062command substitution, and arithmetic expansion. In the latter
3063case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP>
3064must be used to quote the characters
3065<SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>.
3066</P><P>
3067
3068If the redirection operator is <SAMP>`&#60;&#60;-'</SAMP>,
3069then all leading tab characters are stripped from input lines and the
3070line containing <VAR>delimiter</VAR>.
3071This allows here-documents within shell scripts to be indented in a
3072natural fashion.
3073</P><P>
3074
3075<HR SIZE="6">
3076<A NAME="SEC46"></A>
3077<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3078<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC45"> &lt; </A>]</TD>
3079<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &gt; </A>]</TD>
3080<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &lt;&lt; </A>]</TD>
3081<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3082<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3083<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3084<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3085<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3086<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3087</TR></TABLE>
3088<H3> 3.6.7 Here Strings </H3>
3089<!--docid::SEC46::-->
3090A variant of here documents, the format is:
3091<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;&#60;&#60; <VAR>word</VAR>
3092</pre></td></tr></table><P>
3093
3094The <VAR>word</VAR> is expanded and supplied to the command on its standard
3095input.
3096</P><P>
3097
3098<HR SIZE="6">
3099<A NAME="SEC47"></A>
3100<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3101<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC46"> &lt; </A>]</TD>
3102<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &gt; </A>]</TD>
3103<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &lt;&lt; </A>]</TD>
3104<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3105<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3106<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3107<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3108<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3109<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3110</TR></TABLE>
3111<H3> 3.6.8 Duplicating File Descriptors </H3>
3112<!--docid::SEC47::-->
3113The redirection operator
3114<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#38;<VAR>word</VAR>
3115</pre></td></tr></table>is used to duplicate input file descriptors.
3116If <VAR>word</VAR>
3117expands to one or more digits, the file descriptor denoted by <VAR>n</VAR>
3118is made to be a copy of that file descriptor.
3119If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3120input, a redirection error occurs.
3121If <VAR>word</VAR>
3122evaluates to <SAMP>`-'</SAMP>, file descriptor <VAR>n</VAR> is closed. If
3123<VAR>n</VAR> is not specified, the standard input (file descriptor 0) is used.
3124<P>
3125
3126The operator
3127<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#38;<VAR>word</VAR>
3128</pre></td></tr></table>is used similarly to duplicate output file descriptors. If
3129<VAR>n</VAR> is not specified, the standard output (file descriptor 1) is used.
3130If the digits in <VAR>word</VAR> do not specify a file descriptor open for
3131output, a redirection error occurs.
3132As a special case, if <VAR>n</VAR> is omitted, and <VAR>word</VAR> does not
3133expand to one or more digits, the standard output and standard
3134error are redirected as described previously.
3135</P><P>
3136
3137<HR SIZE="6">
3138<A NAME="SEC48"></A>
3139<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3140<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC47"> &lt; </A>]</TD>
3141<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> &gt; </A>]</TD>
3142<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt;&lt; </A>]</TD>
3143<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3144<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3145<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3146<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3147<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3148<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3149</TR></TABLE>
3150<H3> 3.6.9 Moving File Descriptors </H3>
3151<!--docid::SEC48::-->
3152The redirection operator
3153<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#38;<VAR>digit</VAR>-
3154</pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3155or the standard input (file descriptor 0) if <VAR>n</VAR> is not specified.
3156<VAR>digit</VAR> is closed after being duplicated to <VAR>n</VAR>.
3157<P>
3158
3159Similarly, the redirection operator
3160<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#62;&#38;<VAR>digit</VAR>-
3161</pre></td></tr></table>moves the file descriptor <VAR>digit</VAR> to file descriptor <VAR>n</VAR>,
3162or the standard output (file descriptor 1) if <VAR>n</VAR> is not specified.
3163</P><P>
3164
3165<HR SIZE="6">
3166<A NAME="SEC49"></A>
3167<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3168<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC48"> &lt; </A>]</TD>
3169<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt; </A>]</TD>
3170<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC41"> &lt;&lt; </A>]</TD>
3171<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC39"> Up </A>]</TD>
3172<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &gt;&gt; </A>]</TD>
3173<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3174<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3175<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3176<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3177</TR></TABLE>
3178<H3> 3.6.10 Opening File Descriptors for Reading and Writing </H3>
3179<!--docid::SEC49::-->
3180The redirection operator
3181<TABLE><tr><td>&nbsp;</td><td class=example><pre>[<VAR>n</VAR>]&#60;&#62;<VAR>word</VAR>
3182</pre></td></tr></table>causes the file whose name is the expansion of <VAR>word</VAR>
3183to be opened for both reading and writing on file descriptor
3184<VAR>n</VAR>, or on file descriptor 0 if <VAR>n</VAR>
3185is not specified. If the file does not exist, it is created.
3186<P>
3187
3188<A NAME="Executing Commands"></A>
3189<HR SIZE="6">
3190<A NAME="SEC50"></A>
3191<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3192<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC49"> &lt; </A>]</TD>
3193<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &gt; </A>]</TD>
3194<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt;&lt; </A>]</TD>
3195<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3196<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3197<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3198<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3199<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3200<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3201</TR></TABLE>
3202<H2> 3.7 Executing Commands </H2>
3203<!--docid::SEC50::-->
3204<P>
3205
3206<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3207<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash expands simple commands before
3208 executing them.</TD></TR>
3209<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash finds commands and runs them.</TD></TR>
3210<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The environment in which Bash
3211 executes commands that are not
3212 shell builtins.</TD></TR>
3213<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The environment given to a command.</TD></TR>
3214<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The status returned by commands and how Bash
3215 interprets it.</TD></TR>
3216<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What happens when Bash or a command it runs
3217 receives a signal.</TD></TR>
3218</TABLE></BLOCKQUOTE>
3219<P>
3220
3221<A NAME="Simple Command Expansion"></A>
3222<HR SIZE="6">
3223<A NAME="SEC51"></A>
3224<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3225<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> &lt; </A>]</TD>
3226<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> &gt; </A>]</TD>
3227<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt;&lt; </A>]</TD>
3228<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3229<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3230<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3231<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3232<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3233<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3234</TR></TABLE>
3235<H3> 3.7.1 Simple Command Expansion </H3>
3236<!--docid::SEC51::-->
3237<P>
3238
3239When a simple command is executed, the shell performs the following
3240expansions, assignments, and redirections, from left to right.
3241</P><P>
3242
3243<OL>
3244<LI>
3245The words that the parser has marked as variable assignments (those
3246preceding the command name) and redirections are saved for later
3247processing.
3248<P>
3249
3250<LI>
3251The words that are not variable assignments or redirections are
3252expanded (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
3253If any words remain after expansion, the first word
3254is taken to be the name of the command and the remaining words are
3255the arguments.
3256<P>
3257
3258<LI>
3259Redirections are performed as described above (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
3260<P>
3261
3262<LI>
3263The text after the <SAMP>`='</SAMP> in each variable assignment undergoes tilde
3264expansion, parameter expansion, command substitution, arithmetic expansion,
3265and quote removal before being assigned to the variable.
3266</OL>
3267<P>
3268
3269If no command name results, the variable assignments affect the current
3270shell environment. Otherwise, the variables are added to the environment
3271of the executed command and do not affect the current shell environment.
3272If any of the assignments attempts to assign a value to a readonly variable,
3273an error occurs, and the command exits with a non-zero status.
3274</P><P>
3275
3276If no command name results, redirections are performed, but do not
3277affect the current shell environment. A redirection error causes the
3278command to exit with a non-zero status.
3279</P><P>
3280
3281If there is a command name left after expansion, execution proceeds as
3282described below. Otherwise, the command exits. If one of the expansions
3283contained a command substitution, the exit status of the command is
3284the exit status of the last command substitution performed. If there
3285were no command substitutions, the command exits with a status of zero.
3286</P><P>
3287
3288<A NAME="Command Search and Execution"></A>
3289<HR SIZE="6">
3290<A NAME="SEC52"></A>
3291<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3292<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC51"> &lt; </A>]</TD>
3293<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &gt; </A>]</TD>
3294<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &lt;&lt; </A>]</TD>
3295<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3296<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3297<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3298<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3299<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3300<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3301</TR></TABLE>
3302<H3> 3.7.2 Command Search and Execution </H3>
3303<!--docid::SEC52::-->
3304<P>
3305
3306After a command has been split into words, if it results in a
3307simple command and an optional list of arguments, the following
3308actions are taken.
3309</P><P>
3310
3311<OL>
3312<LI>
3313If the command name contains no slashes, the shell attempts to
3314locate it. If there exists a shell function by that name, that
3315function is invoked as described in <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>.
3316<P>
3317
3318<LI>
3319If the name does not match a function, the shell searches for
3320it in the list of shell builtins. If a match is found, that
3321builtin is invoked.
3322<P>
3323
3324<LI>
3325If the name is neither a shell function nor a builtin,
3326and contains no slashes, Bash searches each element of
3327<CODE>$PATH</CODE> for a directory containing an executable file
3328by that name. Bash uses a hash table to remember the full
3329pathnames of executable files to avoid multiple <CODE>PATH</CODE> searches
3330(see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
3331A full search of the directories in <CODE>$PATH</CODE>
3332is performed only if the command is not found in the hash table.
3333If the search is unsuccessful, the shell searches for a defined shell
3334function named <CODE>command_not_found_handle</CODE>.
3335If that function exists, it is invoked with the original command and
3336the original command's arguments as its arguments, and the function's
3337exit status becomes the exit status of the shell.
3338If that function is not defined, the shell prints an error
3339message and returns an exit status of 127.
3340<P>
3341
3342<LI>
3343If the search is successful, or if the command name contains
3344one or more slashes, the shell executes the named program in
3345a separate execution environment.
3346Argument 0 is set to the name given, and the remaining arguments
3347to the command are set to the arguments supplied, if any.
3348<P>
3349
3350<LI>
3351If this execution fails because the file is not in executable
3352format, and the file is not a directory, it is assumed to be a
3353<VAR>shell script</VAR> and the shell executes it as described in
3354<A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>.
3355<P>
3356
3357<LI>
3358If the command was not begun asynchronously, the shell waits for
3359the command to complete and collects its exit status.
3360<P>
3361
3362</OL>
3363<P>
3364
3365<A NAME="Command Execution Environment"></A>
3366<HR SIZE="6">
3367<A NAME="SEC53"></A>
3368<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3369<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC52"> &lt; </A>]</TD>
3370<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &gt; </A>]</TD>
3371<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &lt;&lt; </A>]</TD>
3372<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3373<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3374<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3375<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3376<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3377<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3378</TR></TABLE>
3379<H3> 3.7.3 Command Execution Environment </H3>
3380<!--docid::SEC53::-->
3381<P>
3382
3383The shell has an <VAR>execution environment</VAR>, which consists of the
3384following:
3385</P><P>
3386
3387<UL>
3388<LI>
3389open files inherited by the shell at invocation, as modified by
3390redirections supplied to the <CODE>exec</CODE> builtin
3391<P>
3392
3393<LI>
3394the current working directory as set by <CODE>cd</CODE>, <CODE>pushd</CODE>, or
3395<CODE>popd</CODE>, or inherited by the shell at invocation
3396<P>
3397
3398<LI>
3399the file creation mode mask as set by <CODE>umask</CODE> or inherited from
3400the shell's parent
3401<P>
3402
3403<LI>
3404current traps set by <CODE>trap</CODE>
3405<P>
3406
3407<LI>
3408shell parameters that are set by variable assignment or with <CODE>set</CODE>
3409or inherited from the shell's parent in the environment
3410<P>
3411
3412<LI>
3413shell functions defined during execution or inherited from the shell's
3414parent in the environment
3415<P>
3416
3417<LI>
3418options enabled at invocation (either by default or with command-line
3419arguments) or by <CODE>set</CODE>
3420<P>
3421
3422<LI>
3423options enabled by <CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>)
3424<P>
3425
3426<LI>
3427shell aliases defined with <CODE>alias</CODE> (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>)
3428<P>
3429
3430<LI>
3431various process IDs, including those of background jobs
3432(see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>), the value of <CODE>$$</CODE>, and the value of
3433<CODE>$PPID</CODE>
3434<P>
3435
3436</UL>
3437<P>
3438
3439When a simple command other than a builtin or shell function
3440is to be executed, it
3441is invoked in a separate execution environment that consists of
3442the following. Unless otherwise noted, the values are inherited
3443from the shell.
3444</P><P>
3445
3446<UL>
3447<LI>
3448the shell's open files, plus any modifications and additions specified
3449by redirections to the command
3450<P>
3451
3452<LI>
3453the current working directory
3454<P>
3455
3456<LI>
3457the file creation mode mask
3458<P>
3459
3460<LI>
3461shell variables and functions marked for export, along with variables
3462exported for the command, passed in the environment (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>)
3463<P>
3464
3465<LI>
3466traps caught by the shell are reset to the values inherited from the
3467shell's parent, and traps ignored by the shell are ignored
3468<P>
3469
3470</UL>
3471<P>
3472
3473A command invoked in this separate environment cannot affect the
3474shell's execution environment.
3475</P><P>
3476
3477Command substitution, commands grouped with parentheses,
3478and asynchronous commands are invoked in a
3479subshell environment that is a duplicate of the shell environment,
3480except that traps caught by the shell are reset to the values
3481that the shell inherited from its parent at invocation. Builtin
3482commands that are invoked as part of a pipeline are also executed
3483in a subshell environment. Changes made to the subshell environment
3484cannot affect the shell's execution environment.
3485</P><P>
3486
3487Subshells spawned to execute command substitutions inherit the value of
3488the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
3489Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
3490</P><P>
3491
3492If a command is followed by a <SAMP>`&#38;'</SAMP> and job control is not active, the
3493default standard input for the command is the empty file <TT>`/dev/null'</TT>.
3494Otherwise, the invoked command inherits the file descriptors of the calling
3495shell as modified by redirections.
3496</P><P>
3497
3498<A NAME="Environment"></A>
3499<HR SIZE="6">
3500<A NAME="SEC54"></A>
3501<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3502<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC53"> &lt; </A>]</TD>
3503<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &gt; </A>]</TD>
3504<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &lt;&lt; </A>]</TD>
3505<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3506<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3507<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3508<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3509<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3510<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3511</TR></TABLE>
3512<H3> 3.7.4 Environment </H3>
3513<!--docid::SEC54::-->
3514<P>
3515
3516When a program is invoked it is given an array of strings
3517called the <VAR>environment</VAR>.
3518This is a list of name-value pairs, of the form <CODE>name=value</CODE>.
3519</P><P>
3520
3521Bash provides several ways to manipulate the environment.
3522On invocation, the shell scans its own environment and
3523creates a parameter for each name found, automatically marking
3524it for <VAR>export</VAR>
3525to child processes. Executed commands inherit the environment.
3526The <CODE>export</CODE> and <SAMP>`declare -x'</SAMP>
3527commands allow parameters and functions to be added to and
3528deleted from the environment. If the value of a parameter
3529in the environment is modified, the new value becomes part
3530of the environment, replacing the old. The environment
3531inherited by any executed command consists of the shell's
3532initial environment, whose values may be modified in the shell,
3533less any pairs removed by the <CODE>unset</CODE> and <SAMP>`export -n'</SAMP>
3534commands, plus any additions via the <CODE>export</CODE> and
3535<SAMP>`declare -x'</SAMP> commands.
3536</P><P>
3537
3538The environment for any simple command
3539or function may be augmented temporarily by prefixing it with
3540parameter assignments, as described in <A HREF="bashref.html#SEC25">3.4 Shell Parameters</A>.
3541These assignment statements affect only the environment seen
3542by that command.
3543</P><P>
3544
3545If the <SAMP>`-k'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), then all
3546parameter assignments are placed in the environment for a command,
3547not just those that precede the command name.
3548</P><P>
3549
3550When Bash invokes an external command, the variable <SAMP>`$_'</SAMP>
3551is set to the full path name of the command and passed to that
3552command in its environment.
3553</P><P>
3554
3555<A NAME="Exit Status"></A>
3556<HR SIZE="6">
3557<A NAME="SEC55"></A>
3558<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3559<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC54"> &lt; </A>]</TD>
3560<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &gt; </A>]</TD>
3561<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &lt;&lt; </A>]</TD>
3562<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3563<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3564<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3565<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3566<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3567<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3568</TR></TABLE>
3569<H3> 3.7.5 Exit Status </H3>
3570<!--docid::SEC55::-->
3571<P>
3572
3573The exit status of an executed command is the value returned by the
3574<VAR>waitpid</VAR> system call or equivalent function. Exit statuses
3575fall between 0 and 255, though, as explained below, the shell may
3576use values above 125 specially. Exit statuses from shell builtins and
3577compound commands are also limited to this range. Under certain
3578circumstances, the shell will use special values to indicate specific
3579failure modes.
3580</P><P>
3581
3582For the shell's purposes, a command which exits with a
3583zero exit status has succeeded.
3584A non-zero exit status indicates failure.
3585This seemingly counter-intuitive scheme is used so there
3586is one well-defined way to indicate success and a variety of
3587ways to indicate various failure modes.
3588When a command terminates on a fatal signal whose number is <VAR>N</VAR>,
3589Bash uses the value 128+<VAR>N</VAR> as the exit status.
3590</P><P>
3591
3592If a command is not found, the child process created to
3593execute it returns a status of 127. If a command is found
3594but is not executable, the return status is 126.
3595</P><P>
3596
3597If a command fails because of an error during expansion or redirection,
3598the exit status is greater than zero.
3599</P><P>
3600
3601The exit status is used by the Bash conditional commands
3602(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) and some of the list
3603constructs (see section <A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>).
3604</P><P>
3605
3606All of the Bash builtins return an exit status of zero if they succeed
3607and a non-zero status on failure, so they may be used by the
3608conditional and list constructs.
3609All builtins return an exit status of 2 to indicate incorrect usage.
3610</P><P>
3611
3612<A NAME="Signals"></A>
3613<HR SIZE="6">
3614<A NAME="SEC56"></A>
3615<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3616<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC55"> &lt; </A>]</TD>
3617<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt; </A>]</TD>
3618<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt;&lt; </A>]</TD>
3619<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC50"> Up </A>]</TD>
3620<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &gt;&gt; </A>]</TD>
3621<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3622<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3623<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3624<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3625</TR></TABLE>
3626<H3> 3.7.6 Signals </H3>
3627<!--docid::SEC56::-->
3628<P>
3629
3630When Bash is interactive, in the absence of any traps, it ignores
3631<CODE>SIGTERM</CODE> (so that <SAMP>`kill 0'</SAMP> does not kill an interactive shell),
3632and <CODE>SIGINT</CODE>
3633is caught and handled (so that the <CODE>wait</CODE> builtin is interruptible).
3634When Bash receives a <CODE>SIGINT</CODE>, it breaks out of any executing loops.
3635In all cases, Bash ignores <CODE>SIGQUIT</CODE>.
3636If job control is in effect (see section <A HREF="bashref.html#SEC91">7. Job Control</A>), Bash
3637ignores <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3638</P><P>
3639
3640Non-builtin commands started by Bash have signal handlers set to the
3641values inherited by the shell from its parent.
3642When job control is not in effect, asynchronous commands
3643ignore <CODE>SIGINT</CODE> and <CODE>SIGQUIT</CODE> in addition to these inherited
3644handlers.
3645Commands run as a result of
3646command substitution ignore the keyboard-generated job control signals
3647<CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
3648</P><P>
3649
3650The shell exits by default upon receipt of a <CODE>SIGHUP</CODE>.
3651Before exiting, an interactive shell resends the <CODE>SIGHUP</CODE> to
3652all jobs, running or stopped.
3653Stopped jobs are sent <CODE>SIGCONT</CODE> to ensure that they receive
3654the <CODE>SIGHUP</CODE>.
3655To prevent the shell from sending the <CODE>SIGHUP</CODE> signal to a
3656particular job, it should be removed
3657from the jobs table with the <CODE>disown</CODE>
3658builtin (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or marked
3659to not receive <CODE>SIGHUP</CODE> using <CODE>disown -h</CODE>.
3660</P><P>
3661
3662If the <CODE>huponexit</CODE> shell option has been set with <CODE>shopt</CODE>
3663(see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), Bash sends a <CODE>SIGHUP</CODE> to all jobs when
3664an interactive login shell exits.
3665</P><P>
3666
3667If Bash is waiting for a command to complete and receives a signal
3668for which a trap has been set, the trap will not be executed until
3669the command completes.
3670When Bash is waiting for an asynchronous
3671command via the <CODE>wait</CODE> builtin, the reception of a signal for
3672which a trap has been set will cause the <CODE>wait</CODE> builtin to return
3673immediately with an exit status greater than 128, immediately after
3674which the trap is executed.
3675</P><P>
3676
3677<A NAME="Shell Scripts"></A>
3678<HR SIZE="6">
3679<A NAME="SEC57"></A>
3680<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3681<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC56"> &lt; </A>]</TD>
3682<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt; </A>]</TD>
3683<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> &lt;&lt; </A>]</TD>
3684<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC5"> Up </A>]</TD>
3685<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &gt;&gt; </A>]</TD>
3686<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3687<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3688<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3689<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3690</TR></TABLE>
3691<H2> 3.8 Shell Scripts </H2>
3692<!--docid::SEC57::-->
3693<P>
3694
3695A shell script is a text file containing shell commands. When such
3696a file is used as the first non-option argument when invoking Bash,
3697and neither the <SAMP>`-c'</SAMP> nor <SAMP>`-s'</SAMP> option is supplied
3698(see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>),
3699Bash reads and executes commands from the file, then exits. This
3700mode of operation creates a non-interactive shell. The shell first
3701searches for the file in the current directory, and looks in the
3702directories in <CODE>$PATH</CODE> if not found there.
3703</P><P>
3704
3705When Bash runs
3706a shell script, it sets the special parameter <CODE>0</CODE> to the name
3707of the file, rather than the name of the shell, and the positional
3708parameters are set to the remaining arguments, if any are given.
3709If no additional arguments are supplied, the positional parameters
3710are unset.
3711</P><P>
3712
3713A shell script may be made executable by using the <CODE>chmod</CODE> command
3714to turn on the execute bit. When Bash finds such a file while
3715searching the <CODE>$PATH</CODE> for a command, it spawns a subshell to
3716execute it. In other words, executing
3717<TABLE><tr><td>&nbsp;</td><td class=example><pre>filename <VAR>arguments</VAR>
3718</pre></td></tr></table>is equivalent to executing
3719<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash filename <VAR>arguments</VAR>
3720</pre></td></tr></table></P><P>
3721
3722if <CODE>filename</CODE> is an executable shell script.
3723This subshell reinitializes itself, so that the effect is as if a
3724new shell had been invoked to interpret the script, with the
3725exception that the locations of commands remembered by the parent
3726(see the description of <CODE>hash</CODE> in <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
3727are retained by the child.
3728</P><P>
3729
3730Most versions of Unix make this a part of the operating system's command
3731execution mechanism. If the first line of a script begins with
3732the two characters <SAMP>`#!'</SAMP>, the remainder of the line specifies
3733an interpreter for the program.
3734Thus, you can specify Bash, <CODE>awk</CODE>, Perl, or some other
3735interpreter and write the rest of the script file in that language.
3736</P><P>
3737
3738The arguments to the interpreter
3739consist of a single optional argument following the interpreter
3740name on the first line of the script file, followed by the name of
3741the script file, followed by the rest of the arguments. Bash
3742will perform this action on operating systems that do not handle it
3743themselves. Note that some older versions of Unix limit the interpreter
3744name and argument to a maximum of 32 characters.
3745</P><P>
3746
3747Bash scripts often begin with <CODE>#! /bin/bash</CODE> (assuming that
3748Bash has been installed in <TT>`/bin'</TT>), since this ensures that
3749Bash will be used to interpret the script, even if it is executed
3750under another shell.
3751</P><P>
3752
3753<A NAME="Shell Builtin Commands"></A>
3754<HR SIZE="6">
3755<A NAME="SEC58"></A>
3756<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3757<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC57"> &lt; </A>]</TD>
3758<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &gt; </A>]</TD>
3759<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
3760<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
3761<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
3762<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3763<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3764<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3765<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3766</TR></TABLE>
3767<H1> 4. Shell Builtin Commands </H1>
3768<!--docid::SEC58::-->
3769<P>
3770
3771<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
3772<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands inherited from the Bourne
3773 Shell.</TD></TR>
3774<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>
3775<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
3776 optional behavior.</TD></TR>
3777<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
3778 POSIX.</TD></TR>
3779</TABLE></BLOCKQUOTE>
3780<P>
3781
3782Builtin commands are contained within the shell itself.
3783When the name of a builtin command is used as the first word of
3784a simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>), the shell executes
3785the command directly, without invoking another program.
3786Builtin commands are necessary to implement functionality impossible
3787or inconvenient to obtain with separate utilities.
3788</P><P>
3789
3790This section briefly describes the builtins which Bash inherits from
3791the Bourne Shell, as well as the builtin commands which are unique
3792to or have been extended in Bash.
3793</P><P>
3794
3795Several builtin commands are described in other chapters: builtin
3796commands which provide the Bash interface to the job control
3797facilities (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>), the directory stack
3798(see section <A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>), the command history
3799(see section <A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>), and the programmable completion
3800facilities (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>).
3801</P><P>
3802
3803Many of the builtins have been extended by POSIX or Bash.
3804</P><P>
3805
3806Unless otherwise noted, each builtin command documented as accepting
3807options preceded by <SAMP>`-'</SAMP> accepts <SAMP>`--'</SAMP>
3808to signify the end of the options.
0001803f
CR
3809The <CODE>:</CODE>, <CODE>true</CODE>, <CODE>false</CODE>, and <CODE>test</CODE>
3810builtins do not accept options and do not treat <SAMP>`--'</SAMP> specially.
3811The <CODE>exit</CODE>, <CODE>logout</CODE>, <CODE>break</CODE>, <CODE>continue</CODE>, <CODE>let</CODE>,
3812and <CODE>shift</CODE> builtins accept and process arguments beginning
3813with <SAMP>`-'</SAMP> without requiring <SAMP>`--'</SAMP>.
3814Other builtins that accept arguments but are not specified as accepting
3815options interpret arguments beginning with <SAMP>`-'</SAMP> as invalid options and
3816require <SAMP>`--'</SAMP> to prevent this interpretation.
17345e5a
JA
3817</P><P>
3818
3819<A NAME="Bourne Shell Builtins"></A>
3820<HR SIZE="6">
3821<A NAME="SEC59"></A>
3822<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
3823<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt; </A>]</TD>
3824<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> &gt; </A>]</TD>
3825<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </A>]</TD>
3826<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
3827<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
3828<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
3829<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
3830<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
3831<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
3832</TR></TABLE>
3833<H2> 4.1 Bourne Shell Builtins </H2>
3834<!--docid::SEC59::-->
3835<P>
3836
3837The following shell builtin commands are inherited from the Bourne Shell.
3838These commands are implemented as specified by the POSIX standard.
3839</P><P>
3840
3841<DL COMPACT>
3842<DT><CODE>: (a colon)</CODE>
3843<DD><A NAME="IDX68"></A>
3844<TABLE><tr><td>&nbsp;</td><td class=example><pre>: [<VAR>arguments</VAR>]
3845</pre></td></tr></table>Do nothing beyond expanding <VAR>arguments</VAR> and performing redirections.
3846The return status is zero.
3847<P>
3848
3849<DT><CODE>. (a period)</CODE>
3850<DD><A NAME="IDX69"></A>
3851<TABLE><tr><td>&nbsp;</td><td class=example><pre>. <VAR>filename</VAR> [<VAR>arguments</VAR>]
3852</pre></td></tr></table>Read and execute commands from the <VAR>filename</VAR> argument in the
3853current shell context. If <VAR>filename</VAR> does not contain a slash,
3854the <CODE>PATH</CODE> variable is used to find <VAR>filename</VAR>.
3855When Bash is not in POSIX mode, the current directory is searched
3856if <VAR>filename</VAR> is not found in <CODE>$PATH</CODE>.
3857If any <VAR>arguments</VAR> are supplied, they become the positional
3858parameters when <VAR>filename</VAR> is executed. Otherwise the positional
3859parameters are unchanged.
3860The return status is the exit status of the last command executed, or
3861zero if no commands are executed. If <VAR>filename</VAR> is not found, or
3862cannot be read, the return status is non-zero.
3863This builtin is equivalent to <CODE>source</CODE>.
3864<P>
3865
3866<DT><CODE>break</CODE>
3867<DD><A NAME="IDX70"></A>
3868<TABLE><tr><td>&nbsp;</td><td class=example><pre>break [<VAR>n</VAR>]
3869</pre></td></tr></table>Exit from a <CODE>for</CODE>, <CODE>while</CODE>, <CODE>until</CODE>, or <CODE>select</CODE> loop.
3870If <VAR>n</VAR> is supplied, the <VAR>n</VAR>th enclosing loop is exited.
3871<VAR>n</VAR> must be greater than or equal to 1.
3872The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
3873<P>
3874
3875<DT><CODE>cd</CODE>
3876<DD><A NAME="IDX71"></A>
3877<TABLE><tr><td>&nbsp;</td><td class=example><pre>cd [-L|-P] [<VAR>directory</VAR>]
3878</pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>.
3879If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell
3880variable is used.
3881If the shell variable <CODE>CDPATH</CODE> exists, it is used as a search path.
3882If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used.
3883<P>
3884
3885The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic
3886links are followed by default or with the <SAMP>`-L'</SAMP> option.
3887If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>.
3888</P><P>
3889
3890If a non-empty directory name from <CODE>CDPATH</CODE> is used, or if
3891<SAMP>`-'</SAMP> is the first argument, and the directory change is
3892successful, the absolute pathname of the new working directory is
3893written to the standard output.
3894</P><P>
3895
3896The return status is zero if the directory is successfully changed,
3897non-zero otherwise.
3898</P><P>
3899
3900<DT><CODE>continue</CODE>
3901<DD><A NAME="IDX72"></A>
3902<TABLE><tr><td>&nbsp;</td><td class=example><pre>continue [<VAR>n</VAR>]
3903</pre></td></tr></table>Resume the next iteration of an enclosing <CODE>for</CODE>, <CODE>while</CODE>,
3904<CODE>until</CODE>, or <CODE>select</CODE> loop.
3905If <VAR>n</VAR> is supplied, the execution of the <VAR>n</VAR>th enclosing loop
3906is resumed.
3907<VAR>n</VAR> must be greater than or equal to 1.
3908The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
3909<P>
3910
3911<DT><CODE>eval</CODE>
3912<DD><A NAME="IDX73"></A>
3913<TABLE><tr><td>&nbsp;</td><td class=example><pre>eval [<VAR>arguments</VAR>]
3914</pre></td></tr></table>The arguments are concatenated together into a single command, which is
3915then read and executed, and its exit status returned as the exit status
3916of <CODE>eval</CODE>.
3917If there are no arguments or only empty arguments, the return status is
3918zero.
3919<P>
3920
3921<DT><CODE>exec</CODE>
3922<DD><A NAME="IDX74"></A>
3923<TABLE><tr><td>&nbsp;</td><td class=example><pre>exec [-cl] [-a <VAR>name</VAR>] [<VAR>command</VAR> [<VAR>arguments</VAR>]]
3924</pre></td></tr></table>If <VAR>command</VAR>
3925is supplied, it replaces the shell without creating a new process.
3926If the <SAMP>`-l'</SAMP> option is supplied, the shell places a dash at the
3927beginning of the zeroth argument passed to <VAR>command</VAR>.
3928This is what the <CODE>login</CODE> program does.
3929The <SAMP>`-c'</SAMP> option causes <VAR>command</VAR> to be executed with an empty
3930environment.
3931If <SAMP>`-a'</SAMP> is supplied, the shell passes <VAR>name</VAR> as the zeroth
3932argument to <VAR>command</VAR>.
3933If no <VAR>command</VAR> is specified, redirections may be used to affect
3934the current shell environment. If there are no redirection errors, the
3935return status is zero; otherwise the return status is non-zero.
3936<P>
3937
3938<DT><CODE>exit</CODE>
3939<DD><A NAME="IDX75"></A>
3940<TABLE><tr><td>&nbsp;</td><td class=example><pre>exit [<VAR>n</VAR>]
3941</pre></td></tr></table>Exit the shell, returning a status of <VAR>n</VAR> to the shell's parent.
3942If <VAR>n</VAR> is omitted, the exit status is that of the last command executed.
3943Any trap on <CODE>EXIT</CODE> is executed before the shell terminates.
3944<P>
3945
3946<DT><CODE>export</CODE>
3947<DD><A NAME="IDX76"></A>
3948<TABLE><tr><td>&nbsp;</td><td class=example><pre>export [-fn] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]]
3949</pre></td></tr></table>Mark each <VAR>name</VAR> to be passed to child processes
3950in the environment. If the <SAMP>`-f'</SAMP> option is supplied, the <VAR>name</VAR>s
3951refer to shell functions; otherwise the names refer to shell variables.
3952The <SAMP>`-n'</SAMP> option means to no longer mark each <VAR>name</VAR> for export.
3953If no <VAR>names</VAR> are supplied, or if the <SAMP>`-p'</SAMP> option is given, a
3954list of exported names is displayed.
3955The <SAMP>`-p'</SAMP> option displays output in a form that may be reused as input.
3956If a variable name is followed by =<VAR>value</VAR>, the value of
3957the variable is set to <VAR>value</VAR>.
3958<P>
3959
3960The return status is zero unless an invalid option is supplied, one of
3961the names is not a valid shell variable name, or <SAMP>`-f'</SAMP> is supplied
3962with a name that is not a shell function.
3963</P><P>
3964
3965<DT><CODE>getopts</CODE>
3966<DD><A NAME="IDX77"></A>
3967<TABLE><tr><td>&nbsp;</td><td class=example><pre>getopts <VAR>optstring</VAR> <VAR>name</VAR> [<VAR>args</VAR>]
3968</pre></td></tr></table><CODE>getopts</CODE> is used by shell scripts to parse positional parameters.
3969<VAR>optstring</VAR> contains the option characters to be recognized; if a
3970character is followed by a colon, the option is expected to have an
3971argument, which should be separated from it by white space.
3972The colon (<SAMP>`:'</SAMP>) and question mark (<SAMP>`?'</SAMP>) may not be
3973used as option characters.
3974Each time it is invoked, <CODE>getopts</CODE>
3975places the next option in the shell variable <VAR>name</VAR>, initializing
3976<VAR>name</VAR> if it does not exist,
3977and the index of the next argument to be processed into the
3978variable <CODE>OPTIND</CODE>.
3979<CODE>OPTIND</CODE> is initialized to 1 each time the shell or a shell script
3980is invoked.
3981When an option requires an argument,
3982<CODE>getopts</CODE> places that argument into the variable <CODE>OPTARG</CODE>.
3983The shell does not reset <CODE>OPTIND</CODE> automatically; it must be manually
3984reset between multiple calls to <CODE>getopts</CODE> within the same shell
3985invocation if a new set of parameters is to be used.
3986<P>
3987
3988When the end of options is encountered, <CODE>getopts</CODE> exits with a
3989return value greater than zero.
3990<CODE>OPTIND</CODE> is set to the index of the first non-option argument,
3991and <CODE>name</CODE> is set to <SAMP>`?'</SAMP>.
3992</P><P>
3993
3994<CODE>getopts</CODE>
3995normally parses the positional parameters, but if more arguments are
3996given in <VAR>args</VAR>, <CODE>getopts</CODE> parses those instead.
3997</P><P>
3998
3999<CODE>getopts</CODE> can report errors in two ways. If the first character of
4000<VAR>optstring</VAR> is a colon, <VAR>silent</VAR>
4001error reporting is used. In normal operation diagnostic messages
4002are printed when invalid options or missing option arguments are
4003encountered.
4004If the variable <CODE>OPTERR</CODE>
4005is set to 0, no error messages will be displayed, even if the first
4006character of <CODE>optstring</CODE> is not a colon.
4007</P><P>
4008
4009If an invalid option is seen,
4010<CODE>getopts</CODE> places <SAMP>`?'</SAMP> into <VAR>name</VAR> and, if not silent,
4011prints an error message and unsets <CODE>OPTARG</CODE>.
4012If <CODE>getopts</CODE> is silent, the option character found is placed in
4013<CODE>OPTARG</CODE> and no diagnostic message is printed.
4014</P><P>
4015
4016If a required argument is not found, and <CODE>getopts</CODE>
4017is not silent, a question mark (<SAMP>`?'</SAMP>) is placed in <VAR>name</VAR>,
4018<CODE>OPTARG</CODE> is unset, and a diagnostic message is printed.
4019If <CODE>getopts</CODE> is silent, then a colon (<SAMP>`:'</SAMP>) is placed in
4020<VAR>name</VAR> and <CODE>OPTARG</CODE> is set to the option character found.
4021</P><P>
4022
4023<DT><CODE>hash</CODE>
4024<DD><A NAME="IDX78"></A>
4025<TABLE><tr><td>&nbsp;</td><td class=example><pre>hash [-r] [-p <VAR>filename</VAR>] [-dt] [<VAR>name</VAR>]
4026</pre></td></tr></table>Remember the full pathnames of commands specified as <VAR>name</VAR> arguments,
4027so they need not be searched for on subsequent invocations.
4028The commands are found by searching through the directories listed in
4029<CODE>$PATH</CODE>.
4030The <SAMP>`-p'</SAMP> option inhibits the path search, and <VAR>filename</VAR> is
4031used as the location of <VAR>name</VAR>.
4032The <SAMP>`-r'</SAMP> option causes the shell to forget all remembered locations.
4033The <SAMP>`-d'</SAMP> option causes the shell to forget the remembered location
4034of each <VAR>name</VAR>.
4035If the <SAMP>`-t'</SAMP> option is supplied, the full pathname to which each
4036<VAR>name</VAR> corresponds is printed. If multiple <VAR>name</VAR> arguments are
4037supplied with <SAMP>`-t'</SAMP> the <VAR>name</VAR> is printed before the hashed
4038full pathname.
4039The <SAMP>`-l'</SAMP> option causes output to be displayed in a format
4040that may be reused as input.
4041If no arguments are given, or if only <SAMP>`-l'</SAMP> is supplied,
4042information about remembered commands is printed.
4043The return status is zero unless a <VAR>name</VAR> is not found or an invalid
4044option is supplied.
4045<P>
4046
4047<DT><CODE>pwd</CODE>
4048<DD><A NAME="IDX79"></A>
4049<TABLE><tr><td>&nbsp;</td><td class=example><pre>pwd [-LP]
4050</pre></td></tr></table>Print the absolute pathname of the current working directory.
4051If the <SAMP>`-P'</SAMP> option is supplied, the pathname printed will not
4052contain symbolic links.
4053If the <SAMP>`-L'</SAMP> option is supplied, the pathname printed may contain
4054symbolic links.
4055The return status is zero unless an error is encountered while
4056determining the name of the current directory or an invalid option
4057is supplied.
4058<P>
4059
4060<DT><CODE>readonly</CODE>
4061<DD><A NAME="IDX80"></A>
4062<TABLE><tr><td>&nbsp;</td><td class=example><pre>readonly [-aApf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small>
4063</pre></td></tr></table>Mark each <VAR>name</VAR> as readonly.
4064The values of these names may not be changed by subsequent assignment.
4065If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell
4066function.
4067The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed
4068array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers
4069to an associative array variable.
4070If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP>
4071option is supplied, a list of all readonly names is printed.
4072The <SAMP>`-p'</SAMP> option causes output to be displayed in a format that
4073may be reused as input.
4074If a variable name is followed by =<VAR>value</VAR>, the value of
4075the variable is set to <VAR>value</VAR>.
4076The return status is zero unless an invalid option is supplied, one of
4077the <VAR>name</VAR> arguments is not a valid shell variable or function name,
4078or the <SAMP>`-f'</SAMP> option is supplied with a name that is not a shell function.
4079<P>
4080
4081<DT><CODE>return</CODE>
4082<DD><A NAME="IDX81"></A>
4083<TABLE><tr><td>&nbsp;</td><td class=example><pre>return [<VAR>n</VAR>]
4084</pre></td></tr></table>Cause a shell function to exit with the return value <VAR>n</VAR>.
4085If <VAR>n</VAR> is not supplied, the return value is the exit status of the
4086last command executed in the function.
4087This may also be used to terminate execution of a script being executed
4088with the <CODE>.</CODE> (or <CODE>source</CODE>) builtin, returning either <VAR>n</VAR> or
4089the exit status of the last command executed within the script as the exit
4090status of the script.
4091Any command associated with the <CODE>RETURN</CODE> trap is executed
4092before execution resumes after the function or script.
4093The return status is non-zero if <CODE>return</CODE> is used outside a function
4094and not during the execution of a script by <CODE>.</CODE> or <CODE>source</CODE>.
4095<P>
4096
4097<DT><CODE>shift</CODE>
4098<DD><A NAME="IDX82"></A>
4099<TABLE><tr><td>&nbsp;</td><td class=example><pre>shift [<VAR>n</VAR>]
4100</pre></td></tr></table>Shift the positional parameters to the left by <VAR>n</VAR>.
4101The positional parameters from <VAR>n</VAR>+1 <small>...</small> <CODE>$#</CODE> are
4102renamed to <CODE>$1</CODE> <small>...</small> <CODE>$#</CODE>-<VAR>n</VAR>.
4103Parameters represented by the numbers <CODE>$#</CODE> to <CODE>$#</CODE>-<VAR>n</VAR>+1
4104are unset.
4105<VAR>n</VAR> must be a non-negative number less than or equal to <CODE>$#</CODE>.
4106If <VAR>n</VAR> is zero or greater than <CODE>$#</CODE>, the positional parameters
4107are not changed.
4108If <VAR>n</VAR> is not supplied, it is assumed to be 1.
4109The return status is zero unless <VAR>n</VAR> is greater than <CODE>$#</CODE> or
4110less than zero, non-zero otherwise.
4111<P>
4112
4113<DT><CODE>test</CODE>
4114<DD><DT><CODE>[</CODE>
4115<DD><A NAME="IDX83"></A>
4116<A NAME="IDX84"></A>
4117Evaluate a conditional expression <VAR>expr</VAR>.
4118Each operator and operand must be a separate argument.
4119Expressions are composed of the primaries described below in
4120<A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>.
4121<CODE>test</CODE> does not accept any options, nor does it accept and ignore
4122an argument of <SAMP>`--'</SAMP> as signifying the end of options.
4123<P>
4124
4125When the <CODE>[</CODE> form is used, the last argument to the command must
4126be a <CODE>]</CODE>.
4127</P><P>
4128
4129Expressions may be combined using the following operators, listed in
4130decreasing order of precedence.
4131The evaluation depends on the number of arguments; see below.
4132</P><P>
4133
4134<DL COMPACT>
4135<DT><CODE>! <VAR>expr</VAR></CODE>
4136<DD>True if <VAR>expr</VAR> is false.
4137<P>
4138
4139<DT><CODE>( <VAR>expr</VAR> )</CODE>
4140<DD>Returns the value of <VAR>expr</VAR>.
4141This may be used to override the normal precedence of operators.
4142<P>
4143
4144<DT><CODE><VAR>expr1</VAR> -a <VAR>expr2</VAR></CODE>
4145<DD>True if both <VAR>expr1</VAR> and <VAR>expr2</VAR> are true.
4146<P>
4147
4148<DT><CODE><VAR>expr1</VAR> -o <VAR>expr2</VAR></CODE>
4149<DD>True if either <VAR>expr1</VAR> or <VAR>expr2</VAR> is true.
4150</DL>
4151<P>
4152
4153The <CODE>test</CODE> and <CODE>[</CODE> builtins evaluate conditional
4154expressions using a set of rules based on the number of arguments.
4155</P><P>
4156
4157<DL COMPACT>
4158<DT>0 arguments
4159<DD>The expression is false.
4160<P>
4161
4162<DT>1 argument
4163<DD>The expression is true if and only if the argument is not null.
4164<P>
4165
4166<DT>2 arguments
4167<DD>If the first argument is <SAMP>`!'</SAMP>, the expression is true if and
4168only if the second argument is null.
4169If the first argument is one of the unary conditional operators
4170(see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the expression
4171is true if the unary test is true.
4172If the first argument is not a valid unary operator, the expression is
4173false.
4174<P>
4175
4176<DT>3 arguments
4177<DD>If the second argument is one of the binary conditional
4178operators (see section <A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>), the
4179result of the expression is the result of the binary test using the
4180first and third arguments as operands.
4181The <SAMP>`-a'</SAMP> and <SAMP>`-o'</SAMP> operators are considered binary operators
4182when there are three arguments.
4183If the first argument is <SAMP>`!'</SAMP>, the value is the negation of
4184the two-argument test using the second and third arguments.
4185If the first argument is exactly <SAMP>`('</SAMP> and the third argument is
4186exactly <SAMP>`)'</SAMP>, the result is the one-argument test of the second
4187argument.
4188Otherwise, the expression is false.
4189<P>
4190
4191<DT>4 arguments
4192<DD>If the first argument is <SAMP>`!'</SAMP>, the result is the negation of
4193the three-argument expression composed of the remaining arguments.
4194Otherwise, the expression is parsed and evaluated according to
4195precedence using the rules listed above.
4196<P>
4197
4198<DT>5 or more arguments
4199<DD>The expression is parsed and evaluated according to precedence
4200using the rules listed above.
4201</DL>
4202<P>
4203
4204<DT><CODE>times</CODE>
4205<DD><A NAME="IDX85"></A>
4206<TABLE><tr><td>&nbsp;</td><td class=example><pre>times
4207</pre></td></tr></table>Print out the user and system times used by the shell and its children.
4208The return status is zero.
4209<P>
4210
4211<DT><CODE>trap</CODE>
4212<DD><A NAME="IDX86"></A>
4213<TABLE><tr><td>&nbsp;</td><td class=example><pre>trap [-lp] [<VAR>arg</VAR>] [<VAR>sigspec</VAR> <small>...</small>]
4214</pre></td></tr></table>The commands in <VAR>arg</VAR> are to be read and executed when the
4215shell receives signal <VAR>sigspec</VAR>. If <VAR>arg</VAR> is absent (and
4216there is a single <VAR>sigspec</VAR>) or
4217equal to <SAMP>`-'</SAMP>, each specified signal's disposition is reset
4218to the value it had when the shell was started.
4219If <VAR>arg</VAR> is the null string, then the signal specified by
4220each <VAR>sigspec</VAR> is ignored by the shell and commands it invokes.
4221If <VAR>arg</VAR> is not present and <SAMP>`-p'</SAMP> has been supplied,
4222the shell displays the trap commands associated with each <VAR>sigspec</VAR>.
4223If no arguments are supplied, or
4224only <SAMP>`-p'</SAMP> is given, <CODE>trap</CODE> prints the list of commands
4225associated with each signal number in a form that may be reused as
4226shell input.
4227The <SAMP>`-l'</SAMP> option causes the shell to print a list of signal names
4228and their corresponding numbers.
4229Each <VAR>sigspec</VAR> is either a signal name or a signal number.
4230Signal names are case insensitive and the <CODE>SIG</CODE> prefix is optional.
0001803f
CR
4231<P>
4232
17345e5a
JA
4233If a <VAR>sigspec</VAR>
4234is <CODE>0</CODE> or <CODE>EXIT</CODE>, <VAR>arg</VAR> is executed when the shell exits.
4235If a <VAR>sigspec</VAR> is <CODE>DEBUG</CODE>, the command <VAR>arg</VAR> is executed
4236before every simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
4237<CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
4238the first command executes in a shell function.
0001803f 4239Refer to the description of the <CODE>extdebug</CODE> option to the
17345e5a
JA
4240<CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>) for details of its
4241effect on the <CODE>DEBUG</CODE> trap.
0001803f
CR
4242If a <VAR>sigspec</VAR> is <CODE>RETURN</CODE>, the command <VAR>arg</VAR> is executed
4243each time a shell function or a script executed with the <CODE>.</CODE> or
4244<CODE>source</CODE> builtins finishes executing.
4245</P><P>
4246
17345e5a
JA
4247If a <VAR>sigspec</VAR> is <CODE>ERR</CODE>, the command <VAR>arg</VAR>
4248is executed whenever a simple command has a non-zero exit status,
4249subject to the following conditions.
4250The <CODE>ERR</CODE> trap is not executed if the failed command is part of the
4251command list immediately following an <CODE>until</CODE> or <CODE>while</CODE> keyword,
0001803f 4252part of the test following the <CODE>if</CODE> or <CODE>elif</CODE> reserved words,
17345e5a
JA
4253part of a command executed in a <CODE>&#38;&#38;</CODE> or <CODE>||</CODE> list,
4254or if the command's return
4255status is being inverted using <CODE>!</CODE>.
4256These are the same conditions obeyed by the <CODE>errexit</CODE> option.
0001803f 4257</P><P>
17345e5a
JA
4258
4259Signals ignored upon entry to the shell cannot be trapped or reset.
4260Trapped signals that are not being ignored are reset to their original
0001803f 4261values in a subshell or subshell environment when one is created.
17345e5a
JA
4262</P><P>
4263
4264The return status is zero unless a <VAR>sigspec</VAR> does not specify a
4265valid signal.
4266</P><P>
4267
4268<DT><CODE>umask</CODE>
4269<DD><A NAME="IDX87"></A>
4270<TABLE><tr><td>&nbsp;</td><td class=example><pre>umask [-p] [-S] [<VAR>mode</VAR>]
4271</pre></td></tr></table>Set the shell process's file creation mask to <VAR>mode</VAR>. If
4272<VAR>mode</VAR> begins with a digit, it is interpreted as an octal number;
4273if not, it is interpreted as a symbolic mode mask similar
4274to that accepted by the <CODE>chmod</CODE> command. If <VAR>mode</VAR> is
4275omitted, the current value of the mask is printed. If the <SAMP>`-S'</SAMP>
4276option is supplied without a <VAR>mode</VAR> argument, the mask is printed
4277in a symbolic format.
4278If the <SAMP>`-p'</SAMP> option is supplied, and <VAR>mode</VAR>
4279is omitted, the output is in a form that may be reused as input.
4280The return status is zero if the mode is successfully changed or if
4281no <VAR>mode</VAR> argument is supplied, and non-zero otherwise.
4282<P>
4283
4284Note that when the mode is interpreted as an octal number, each number
4285of the umask is subtracted from <CODE>7</CODE>. Thus, a umask of <CODE>022</CODE>
4286results in permissions of <CODE>755</CODE>.
4287</P><P>
4288
4289<DT><CODE>unset</CODE>
4290<DD><A NAME="IDX88"></A>
4291<TABLE><tr><td>&nbsp;</td><td class=example><pre>unset [-fv] [<VAR>name</VAR>]
4292</pre></td></tr></table>Each variable or function <VAR>name</VAR> is removed.
4293If no options are supplied, or the <SAMP>`-v'</SAMP> option is given, each
4294<VAR>name</VAR> refers to a shell variable.
4295If the <SAMP>`-f'</SAMP> option is given, the <VAR>name</VAR>s refer to shell
4296functions, and the function definition is removed.
4297Readonly variables and functions may not be unset.
4298The return status is zero unless a <VAR>name</VAR> is readonly.
4299</DL>
4300<P>
4301
4302<A NAME="Bash Builtins"></A>
4303<HR SIZE="6">
4304<A NAME="SEC60"></A>
4305<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
4306<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC59"> &lt; </A>]</TD>
4307<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &gt; </A>]</TD>
4308<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &lt;&lt; </A>]</TD>
4309<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
4310<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
4311<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
4312<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
4313<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
4314<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
4315</TR></TABLE>
4316<H2> 4.2 Bash Builtin Commands </H2>
4317<!--docid::SEC60::-->
4318<P>
4319
4320This section describes builtin commands which are unique to
4321or have been extended in Bash.
4322Some of these commands are specified in the POSIX standard.
4323</P><P>
4324
4325<DL COMPACT>
4326
4327<DT><CODE>alias</CODE>
4328<DD><A NAME="IDX89"></A>
4329<TABLE><tr><td>&nbsp;</td><td class=example><pre>alias [<CODE>-p</CODE>] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4330</pre></td></tr></table><P>
4331
4332Without arguments or with the <SAMP>`-p'</SAMP> option, <CODE>alias</CODE> prints
4333the list of aliases on the standard output in a form that allows
4334them to be reused as input.
4335If arguments are supplied, an alias is defined for each <VAR>name</VAR>
4336whose <VAR>value</VAR> is given. If no <VAR>value</VAR> is given, the name
4337and value of the alias is printed.
4338Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>.
4339</P><P>
4340
4341<DT><CODE>bind</CODE>
4342<DD><A NAME="IDX90"></A>
4343<TABLE><tr><td>&nbsp;</td><td class=example><pre>bind [-m <VAR>keymap</VAR>] [-lpsvPSV]
4344bind [-m <VAR>keymap</VAR>] [-q <VAR>function</VAR>] [-u <VAR>function</VAR>] [-r <VAR>keyseq</VAR>]
4345bind [-m <VAR>keymap</VAR>] -f <VAR>filename</VAR>
4346bind [-m <VAR>keymap</VAR>] -x <VAR>keyseq:shell-command</VAR>
4347bind [-m <VAR>keymap</VAR>] <VAR>keyseq:function-name</VAR>
4348bind <VAR>readline-command</VAR>
4349</pre></td></tr></table><P>
4350
4351Display current Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>)
4352key and function bindings,
4353bind a key sequence to a Readline function or macro,
4354or set a Readline variable.
4355Each non-option argument is a command as it would appear in a
4356Readline initialization file (see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>),
4357but each binding or command must be passed as a separate argument; e.g.,
4358<SAMP>`"\C-x\C-r":re-read-init-file'</SAMP>.
4359</P><P>
4360
4361Options, if supplied, have the following meanings:
4362</P><P>
4363
4364<DL COMPACT>
4365<DT><CODE>-m <VAR>keymap</VAR></CODE>
4366<DD>Use <VAR>keymap</VAR> as the keymap to be affected by
4367the subsequent bindings. Acceptable <VAR>keymap</VAR>
4368names are
4369<CODE>emacs</CODE>,
4370<CODE>emacs-standard</CODE>,
4371<CODE>emacs-meta</CODE>,
4372<CODE>emacs-ctlx</CODE>,
4373<CODE>vi</CODE>,
4374<CODE>vi-move</CODE>,
4375<CODE>vi-command</CODE>, and
4376<CODE>vi-insert</CODE>.
4377<CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>;
4378<CODE>emacs</CODE> is equivalent to <CODE>emacs-standard</CODE>.
4379<P>
4380
4381<DT><CODE>-l</CODE>
4382<DD>List the names of all Readline functions.
4383<P>
4384
4385<DT><CODE>-p</CODE>
4386<DD>Display Readline function names and bindings in such a way that they
4387can be used as input or in a Readline initialization file.
4388<P>
4389
4390<DT><CODE>-P</CODE>
4391<DD>List current Readline function names and bindings.
4392<P>
4393
4394<DT><CODE>-v</CODE>
4395<DD>Display Readline variable names and values in such a way that they
4396can be used as input or in a Readline initialization file.
4397<P>
4398
4399<DT><CODE>-V</CODE>
4400<DD>List current Readline variable names and values.
4401<P>
4402
4403<DT><CODE>-s</CODE>
4404<DD>Display Readline key sequences bound to macros and the strings they output
4405in such a way that they can be used as input or in a Readline
4406initialization file.
4407<P>
4408
4409<DT><CODE>-S</CODE>
4410<DD>Display Readline key sequences bound to macros and the strings they output.
4411<P>
4412
4413<DT><CODE>-f <VAR>filename</VAR></CODE>
4414<DD>Read key bindings from <VAR>filename</VAR>.
4415<P>
4416
4417<DT><CODE>-q <VAR>function</VAR></CODE>
4418<DD>Query about which keys invoke the named <VAR>function</VAR>.
4419<P>
4420
4421<DT><CODE>-u <VAR>function</VAR></CODE>
4422<DD>Unbind all keys bound to the named <VAR>function</VAR>.
4423<P>
4424
4425<DT><CODE>-r <VAR>keyseq</VAR></CODE>
4426<DD>Remove any current binding for <VAR>keyseq</VAR>.
4427<P>
4428
4429<DT><CODE>-x <VAR>keyseq:shell-command</VAR></CODE>
4430<DD>Cause <VAR>shell-command</VAR> to be executed whenever <VAR>keyseq</VAR> is
4431entered.
4432When <VAR>shell-command</VAR> is executed, the shell sets the
4433<CODE>READLINE_LINE</CODE> variable to the contents of the Readline line
4434buffer and the <CODE>READLINE_POINT</CODE> variable to the current location
4435of the insertion point.
4436If the executed command changes the value of <CODE>READLINE_LINE</CODE> or
4437<CODE>READLINE_POINT</CODE>, those new values will be reflected in the
4438editing state.
4439</DL>
4440<P>
4441
4442The return status is zero unless an invalid option is supplied or an
4443error occurs.
4444</P><P>
4445
4446<DT><CODE>builtin</CODE>
4447<DD><A NAME="IDX91"></A>
4448<TABLE><tr><td>&nbsp;</td><td class=example><pre>builtin [<VAR>shell-builtin</VAR> [<VAR>args</VAR>]]
4449</pre></td></tr></table>Run a shell builtin, passing it <VAR>args</VAR>, and return its exit status.
4450This is useful when defining a shell function with the same
4451name as a shell builtin, retaining the functionality of the builtin within
4452the function.
4453The return status is non-zero if <VAR>shell-builtin</VAR> is not a shell
4454builtin command.
4455<P>
4456
4457<DT><CODE>caller</CODE>
4458<DD><A NAME="IDX92"></A>
4459<TABLE><tr><td>&nbsp;</td><td class=example><pre>caller [<VAR>expr</VAR>]
4460</pre></td></tr></table>Returns the context of any active subroutine call (a shell function or
4461a script executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins).
4462<P>
4463
4464Without <VAR>expr</VAR>, <CODE>caller</CODE> displays the line number and source
4465filename of the current subroutine call.
4466If a non-negative integer is supplied as <VAR>expr</VAR>, <CODE>caller</CODE>
4467displays the line number, subroutine name, and source file corresponding
4468to that position in the current execution call stack. This extra
4469information may be used, for example, to print a stack trace. The
4470current frame is frame 0.
4471</P><P>
4472
4473The return value is 0 unless the shell is not executing a subroutine
4474call or <VAR>expr</VAR> does not correspond to a valid position in the
4475call stack.
4476</P><P>
4477
4478<DT><CODE>command</CODE>
4479<DD><A NAME="IDX93"></A>
4480<TABLE><tr><td>&nbsp;</td><td class=example><pre>command [-pVv] <VAR>command</VAR> [<VAR>arguments</VAR> <small>...</small>]
4481</pre></td></tr></table>Runs <VAR>command</VAR> with <VAR>arguments</VAR> ignoring any shell function
4482named <VAR>command</VAR>.
4483Only shell builtin commands or commands found by searching the
4484<CODE>PATH</CODE> are executed.
4485If there is a shell function named <CODE>ls</CODE>, running <SAMP>`command ls'</SAMP>
4486within the function will execute the external command <CODE>ls</CODE>
4487instead of calling the function recursively.
4488The <SAMP>`-p'</SAMP> option means to use a default value for <CODE>PATH</CODE>
4489that is guaranteed to find all of the standard utilities.
4490The return status in this case is 127 if <VAR>command</VAR> cannot be
4491found or an error occurred, and the exit status of <VAR>command</VAR>
4492otherwise.
4493<P>
4494
4495If either the <SAMP>`-V'</SAMP> or <SAMP>`-v'</SAMP> option is supplied, a
4496description of <VAR>command</VAR> is printed. The <SAMP>`-v'</SAMP> option
4497causes a single word indicating the command or file name used to
4498invoke <VAR>command</VAR> to be displayed; the <SAMP>`-V'</SAMP> option produces
4499a more verbose description. In this case, the return status is
4500zero if <VAR>command</VAR> is found, and non-zero if not.
4501</P><P>
4502
4503<DT><CODE>declare</CODE>
4504<DD><A NAME="IDX94"></A>
4505<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare [-aAfFilrtux] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4506</pre></td></tr></table><P>
4507
4508Declare variables and give them attributes. If no <VAR>name</VAR>s
4509are given, then display the values of variables instead.
4510</P><P>
4511
4512The <SAMP>`-p'</SAMP> option will display the attributes and values of each
4513<VAR>name</VAR>.
4514When <SAMP>`-p'</SAMP> is used with <VAR>name</VAR> arguments, additional options
4515are ignored.
4516</P><P>
4517
4518When <SAMP>`-p'</SAMP> is supplied without <VAR>name</VAR> arguments, <CODE>declare</CODE>
4519will display the attributes and values of all variables having the
4520attributes specified by the additional options.
4521If no other options are supplied with <SAMP>`-p'</SAMP>, <CODE>declare</CODE> will
4522display the attributes and values of all shell variables. The <SAMP>`-f'</SAMP>
4523option will restrict the display to shell functions.
4524</P><P>
4525
4526The <SAMP>`-F'</SAMP> option inhibits the display of function definitions;
4527only the function name and attributes are printed.
4528If the <CODE>extdebug</CODE> shell option is enabled using <CODE>shopt</CODE>
4529(see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the source file name and line number where
4530the function is defined are displayed as well.
4531<SAMP>`-F'</SAMP> implies <SAMP>`-f'</SAMP>.
4532The following options can be used to restrict output to variables with
4533the specified attributes or to give variables attributes:
4534</P><P>
4535
4536<DL COMPACT>
4537<DT><CODE>-a</CODE>
4538<DD>Each <VAR>name</VAR> is an indexed array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
4539<P>
4540
4541<DT><CODE>-A</CODE>
4542<DD>Each <VAR>name</VAR> is an associative array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
4543<P>
4544
4545<DT><CODE>-f</CODE>
4546<DD>Use function names only.
4547<P>
4548
4549<DT><CODE>-i</CODE>
4550<DD>The variable is to be treated as
4551an integer; arithmetic evaluation (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) is
4552performed when the variable is assigned a value.
4553<P>
4554
4555<DT><CODE>-l</CODE>
4556<DD>When the variable is assigned a value, all upper-case characters are
4557converted to lower-case.
4558The upper-case attribute is disabled.
4559<P>
4560
4561<DT><CODE>-r</CODE>
4562<DD>Make <VAR>name</VAR>s readonly. These names cannot then be assigned values
4563by subsequent assignment statements or unset.
4564<P>
4565
4566<DT><CODE>-t</CODE>
4567<DD>Give each <VAR>name</VAR> the <CODE>trace</CODE> attribute.
4568Traced functions inherit the <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps from
4569the calling shell.
4570The trace attribute has no special meaning for variables.
4571<P>
4572
4573<DT><CODE>-u</CODE>
4574<DD>When the variable is assigned a value, all lower-case characters are
4575converted to upper-case.
4576The lower-case attribute is disabled.
4577<P>
4578
4579<DT><CODE>-x</CODE>
4580<DD>Mark each <VAR>name</VAR> for export to subsequent commands via
4581the environment.
4582</DL>
4583<P>
4584
4585Using <SAMP>`+'</SAMP> instead of <SAMP>`-'</SAMP> turns off the attribute instead,
4586with the exceptions that <SAMP>`+a'</SAMP>
4587may not be used to destroy an array variable and <SAMP>`+r'</SAMP> will not
4588remove the readonly attribute.
4589When used in a function, <CODE>declare</CODE> makes each <VAR>name</VAR> local,
4590as with the <CODE>local</CODE> command. If a variable name is followed by
4591=<VAR>value</VAR>, the value of the variable is set to <VAR>value</VAR>.
4592</P><P>
4593
4594The return status is zero unless an invalid option is encountered,
4595an attempt is made to define a function using <SAMP>`-f foo=bar'</SAMP>,
4596an attempt is made to assign a value to a readonly variable,
4597an attempt is made to assign a value to an array variable without
4598using the compound assignment syntax (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>),
4599one of the <VAR>names</VAR> is not a valid shell variable name,
4600an attempt is made to turn off readonly status for a readonly variable,
4601an attempt is made to turn off array status for an array variable,
4602or an attempt is made to display a non-existent function with <SAMP>`-f'</SAMP>.
4603</P><P>
4604
4605<DT><CODE>echo</CODE>
4606<DD><A NAME="IDX95"></A>
4607<TABLE><tr><td>&nbsp;</td><td class=example><pre>echo [-neE] [<VAR>arg</VAR> <small>...</small>]
4608</pre></td></tr></table>Output the <VAR>arg</VAR>s, separated by spaces, terminated with a
4609newline.
4610The return status is always 0.
4611If <SAMP>`-n'</SAMP> is specified, the trailing newline is suppressed.
4612If the <SAMP>`-e'</SAMP> option is given, interpretation of the following
4613backslash-escaped characters is enabled.
4614The <SAMP>`-E'</SAMP> option disables the interpretation of these escape characters,
4615even on systems where they are interpreted by default.
4616The <CODE>xpg_echo</CODE> shell option may be used to
4617dynamically determine whether or not <CODE>echo</CODE> expands these
4618escape characters by default.
4619<CODE>echo</CODE> does not interpret <SAMP>`--'</SAMP> to mean the end of options.
4620<P>
4621
4622<CODE>echo</CODE> interprets the following escape sequences:
4623<DL COMPACT>
4624<DT><CODE>\a</CODE>
4625<DD>alert (bell)
4626<DT><CODE>\b</CODE>
4627<DD>backspace
4628<DT><CODE>\c</CODE>
4629<DD>suppress further output
4630<DT><CODE>\e</CODE>
4631<DD>escape
4632<DT><CODE>\f</CODE>
4633<DD>form feed
4634<DT><CODE>\n</CODE>
4635<DD>new line
4636<DT><CODE>\r</CODE>
4637<DD>carriage return
4638<DT><CODE>\t</CODE>
4639<DD>horizontal tab
4640<DT><CODE>\v</CODE>
4641<DD>vertical tab
4642<DT><CODE>\\</CODE>
4643<DD>backslash
4644<DT><CODE>\0<VAR>nnn</VAR></CODE>
4645<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
4646(zero to three octal digits)
4647<DT><CODE>\x<VAR>HH</VAR></CODE>
4648<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
4649(one or two hex digits)
4650</DL>
4651<P>
4652
4653<DT><CODE>enable</CODE>
4654<DD><A NAME="IDX96"></A>
4655<TABLE><tr><td>&nbsp;</td><td class=example><pre>enable [-a] [-dnps] [-f <VAR>filename</VAR>] [<VAR>name</VAR> <small>...</small>]
4656</pre></td></tr></table>Enable and disable builtin shell commands.
4657Disabling a builtin allows a disk command which has the same name
4658as a shell builtin to be executed without specifying a full pathname,
4659even though the shell normally searches for builtins before disk commands.
4660If <SAMP>`-n'</SAMP> is used, the <VAR>name</VAR>s become disabled. Otherwise
4661<VAR>name</VAR>s are enabled. For example, to use the <CODE>test</CODE> binary
4662found via <CODE>$PATH</CODE> instead of the shell builtin version, type
4663<SAMP>`enable -n test'</SAMP>.
4664<P>
4665
4666If the <SAMP>`-p'</SAMP> option is supplied, or no <VAR>name</VAR> arguments appear,
4667a list of shell builtins is printed. With no other arguments, the list
4668consists of all enabled shell builtins.
4669The <SAMP>`-a'</SAMP> option means to list
4670each builtin with an indication of whether or not it is enabled.
4671</P><P>
4672
4673The <SAMP>`-f'</SAMP> option means to load the new builtin command <VAR>name</VAR>
4674from shared object <VAR>filename</VAR>, on systems that support dynamic loading.
4675The <SAMP>`-d'</SAMP> option will delete a builtin loaded with <SAMP>`-f'</SAMP>.
4676</P><P>
4677
4678If there are no options, a list of the shell builtins is displayed.
4679The <SAMP>`-s'</SAMP> option restricts <CODE>enable</CODE> to the POSIX special
4680builtins. If <SAMP>`-s'</SAMP> is used with <SAMP>`-f'</SAMP>, the new builtin becomes
4681a special builtin (see section <A HREF="bashref.html#SEC64">4.4 Special Builtins</A>).
4682</P><P>
4683
4684The return status is zero unless a <VAR>name</VAR> is not a shell builtin
4685or there is an error loading a new builtin from a shared object.
4686</P><P>
4687
4688<DT><CODE>help</CODE>
4689<DD><A NAME="IDX97"></A>
4690<TABLE><tr><td>&nbsp;</td><td class=example><pre>help [-dms] [<VAR>pattern</VAR>]
4691</pre></td></tr></table>Display helpful information about builtin commands.
4692If <VAR>pattern</VAR> is specified, <CODE>help</CODE> gives detailed help
4693on all commands matching <VAR>pattern</VAR>, otherwise a list of
4694the builtins is printed.
4695<P>
4696
4697Options, if supplied, have the following meanings:
4698</P><P>
4699
4700<DL COMPACT>
4701<DT><CODE>-d</CODE>
4702<DD>Display a short description of each <VAR>pattern</VAR>
4703<DT><CODE>-m</CODE>
4704<DD>Display the description of each <VAR>pattern</VAR> in a manpage-like format
4705<DT><CODE>-s</CODE>
4706<DD>Display only a short usage synopsis for each <VAR>pattern</VAR>
4707</DL>
4708<P>
4709
4710The return status is zero unless no command matches <VAR>pattern</VAR>.
4711</P><P>
4712
4713<DT><CODE>let</CODE>
4714<DD><A NAME="IDX98"></A>
4715<TABLE><tr><td>&nbsp;</td><td class=example><pre>let <VAR>expression</VAR> [<VAR>expression</VAR>]
4716</pre></td></tr></table>The <CODE>let</CODE> builtin allows arithmetic to be performed on shell
4717variables. Each <VAR>expression</VAR> is evaluated according to the
4718rules given below in <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>. If the
4719last <VAR>expression</VAR> evaluates to 0, <CODE>let</CODE> returns 1;
4720otherwise 0 is returned.
4721<P>
4722
4723<DT><CODE>local</CODE>
4724<DD><A NAME="IDX99"></A>
4725<TABLE><tr><td>&nbsp;</td><td class=example><pre>local [<VAR>option</VAR>] <VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>
4726</pre></td></tr></table>For each argument, a local variable named <VAR>name</VAR> is created,
4727and assigned <VAR>value</VAR>.
4728The <VAR>option</VAR> can be any of the options accepted by <CODE>declare</CODE>.
4729<CODE>local</CODE> can only be used within a function; it makes the variable
4730<VAR>name</VAR> have a visible scope restricted to that function and its
4731children. The return status is zero unless <CODE>local</CODE> is used outside
4732a function, an invalid <VAR>name</VAR> is supplied, or <VAR>name</VAR> is a
4733readonly variable.
4734<P>
4735
4736<DT><CODE>logout</CODE>
4737<DD><A NAME="IDX100"></A>
4738<TABLE><tr><td>&nbsp;</td><td class=example><pre>logout [<VAR>n</VAR>]
4739</pre></td></tr></table>Exit a login shell, returning a status of <VAR>n</VAR> to the shell's
4740parent.
4741<P>
4742
4743<DT><CODE>mapfile</CODE>
4744<DD><A NAME="IDX101"></A>
4745<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>] [
4746-C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
0001803f 4747</pre></td></tr></table>Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
17345e5a
JA
4748or from file descriptor <VAR>fd</VAR>
4749if the <SAMP>`-u'</SAMP> option is supplied.
4750The variable <CODE>MAPFILE</CODE> is the default <VAR>array</VAR>.
4751Options, if supplied, have the following meanings:
4752<DL COMPACT>
4753
4754<DT><CODE>-n</CODE>
4755<DD>Copy at most <VAR>count</VAR> lines. If <VAR>count</VAR> is 0, all lines are copied.
4756<DT><CODE>-O</CODE>
4757<DD>Begin assigning to <VAR>array</VAR> at index <VAR>origin</VAR>.
4758The default index is 0.
4759<DT><CODE>-s</CODE>
4760<DD>Discard the first <VAR>count</VAR> lines read.
4761<DT><CODE>-t</CODE>
0001803f 4762<DD>Remove a trailing newline from each line read.
17345e5a
JA
4763<DT><CODE>-u</CODE>
4764<DD>Read lines from file descriptor <VAR>fd</VAR> instead of the standard input.
4765<DT><CODE>-C</CODE>
4766<DD>Evaluate <VAR>callback</VAR> each time <VAR>quantum</VAR>P lines are read.
4767The <SAMP>`-c'</SAMP> option specifies <VAR>quantum</VAR>.
4768<DT><CODE>-c</CODE>
4769<DD>Specify the number of lines read between each call to <VAR>callback</VAR>.
4770</DL>
4771<P>
4772
4773If <SAMP>`-C'</SAMP> is specified without <SAMP>`-c'</SAMP>,
4774the default quantum is 5000.
4775When <VAR>callback</VAR> is evaluated, it is supplied the index of the next
4776array element to be assigned as an additional argument.
4777<VAR>callback</VAR> is evaluated after the line is read but before the
4778array element is assigned.
4779</P><P>
4780
4781If not supplied with an explicit origin, <CODE>mapfile</CODE> will clear <VAR>array</VAR>
4782before assigning to it.
4783</P><P>
4784
4785<CODE>mapfile</CODE> returns successfully unless an invalid option or option
0001803f
CR
4786argument is supplied, <VAR>array</VAR> is invalid or unassignable, or <VAR>array</VAR>
4787is not an indexed array.
17345e5a
JA
4788</P><P>
4789
4790<DT><CODE>printf</CODE>
4791<DD><A NAME="IDX102"></A>
4792<TABLE><tr><td>&nbsp;</td><td class=example><pre>printf [-v <VAR>var</VAR>] <VAR>format</VAR> [<VAR>arguments</VAR>]
4793</pre></td></tr></table>Write the formatted <VAR>arguments</VAR> to the standard output under the
4794control of the <VAR>format</VAR>.
4795The <VAR>format</VAR> is a character string which contains three types of objects:
4796plain characters, which are simply copied to standard output, character
4797escape sequences, which are converted and copied to the standard output, and
4798format specifications, each of which causes printing of the next successive
4799<VAR>argument</VAR>.
4800In addition to the standard <CODE>printf(1)</CODE> formats, <SAMP>`%b'</SAMP> causes
4801<CODE>printf</CODE> to expand backslash escape sequences in the corresponding
4802<VAR>argument</VAR>,
4803(except that <SAMP>`\c'</SAMP> terminates output, backslashes in
4804<SAMP>`\''</SAMP>, <SAMP>`\"'</SAMP>, and <SAMP>`\?'</SAMP> are not removed, and octal escapes
4805beginning with <SAMP>`\0'</SAMP> may contain up to four digits),
4806and <SAMP>`%q'</SAMP> causes <CODE>printf</CODE> to output the
4807corresponding <VAR>argument</VAR> in a format that can be reused as shell input.
4808<P>
4809
4810The <SAMP>`-v'</SAMP> option causes the output to be assigned to the variable
4811<VAR>var</VAR> rather than being printed to the standard output.
4812</P><P>
4813
4814The <VAR>format</VAR> is reused as necessary to consume all of the <VAR>arguments</VAR>.
4815If the <VAR>format</VAR> requires more <VAR>arguments</VAR> than are supplied, the
4816extra format specifications behave as if a zero value or null string, as
4817appropriate, had been supplied. The return value is zero on success,
4818non-zero on failure.
4819</P><P>
4820
4821<DT><CODE>read</CODE>
4822<DD><A NAME="IDX103"></A>
0001803f 4823<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>] [-N <VAR>nchars</VAR>] [-p <VAR>prompt</VAR>] [-t <VAR>timeout</VAR>] [-u <VAR>fd</VAR>] [<VAR>name</VAR> <small>...</small>]
17345e5a
JA
4824</pre></td></tr></table>One line is read from the standard input, or from the file descriptor
4825<VAR>fd</VAR> supplied as an argument to the <SAMP>`-u'</SAMP> option, and the first word
4826is assigned to the first <VAR>name</VAR>, the second word to the second <VAR>name</VAR>,
4827and so on, with leftover words and their intervening separators assigned
4828to the last <VAR>name</VAR>.
4829If there are fewer words read from the input stream than names,
4830the remaining names are assigned empty values.
4831The characters in the value of the <CODE>IFS</CODE> variable
4832are used to split the line into words.
4833The backslash character <SAMP>`\'</SAMP> may be used to remove any special
4834meaning for the next character read and for line continuation.
4835If no names are supplied, the line read is assigned to the
4836variable <CODE>REPLY</CODE>.
4837The return code is zero, unless end-of-file is encountered, <CODE>read</CODE>
4838times out (in which case the return code is greater than 128), or an
4839invalid file descriptor is supplied as the argument to <SAMP>`-u'</SAMP>.
4840<P>
4841
4842Options, if supplied, have the following meanings:
4843</P><P>
4844
4845<DL COMPACT>
4846<DT><CODE>-a <VAR>aname</VAR></CODE>
4847<DD>The words are assigned to sequential indices of the array variable
4848<VAR>aname</VAR>, starting at 0.
4849All elements are removed from <VAR>aname</VAR> before the assignment.
4850Other <VAR>name</VAR> arguments are ignored.
4851<P>
4852
4853<DT><CODE>-d <VAR>delim</VAR></CODE>
4854<DD>The first character of <VAR>delim</VAR> is used to terminate the input line,
4855rather than newline.
4856<P>
4857
4858<DT><CODE>-e</CODE>
4859<DD>Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to obtain the line.
4860Readline uses the current (or default, if line editing was not previously
4861active) editing settings.
4862<P>
4863
4864<DT><CODE>-i <VAR>text</VAR></CODE>
4865<DD>If Readline is being used to read the line, <VAR>text</VAR> is placed into
4866the editing buffer before editing begins.
4867<P>
4868
4869<DT><CODE>-n <VAR>nchars</VAR></CODE>
4870<DD><CODE>read</CODE> returns after reading <VAR>nchars</VAR> characters rather than
0001803f
CR
4871waiting for a complete line of input, but honor a delimiter if fewer
4872than <VAR>nchars</VAR> characters are read before the delimiter.
4873<P>
4874
4875<DT><CODE>-N <VAR>nchars</VAR></CODE>
4876<DD><CODE>read</CODE> returns after reading exactly <VAR>nchars</VAR> characters rather
4877than waiting for a complete line of input, unless EOF is encountered or
4878<CODE>read</CODE> times out.
4879Delimiter characters encountered in the input are
4880not treated specially and do not cause <CODE>read</CODE> to return until
4881<VAR>nchars</VAR> characters are read.
17345e5a
JA
4882<P>
4883
4884<DT><CODE>-p <VAR>prompt</VAR></CODE>
4885<DD>Display <VAR>prompt</VAR>, without a trailing newline, before attempting
4886to read any input.
4887The prompt is displayed only if input is coming from a terminal.
4888<P>
4889
4890<DT><CODE>-r</CODE>
4891<DD>If this option is given, backslash does not act as an escape character.
4892The backslash is considered to be part of the line.
4893In particular, a backslash-newline pair may not be used as a line
4894continuation.
4895<P>
4896
4897<DT><CODE>-s</CODE>
4898<DD>Silent mode. If input is coming from a terminal, characters are
4899not echoed.
4900<P>
4901
4902<DT><CODE>-t <VAR>timeout</VAR></CODE>
4903<DD>Cause <CODE>read</CODE> to time out and return failure if a complete line of
4904input is not read within <VAR>timeout</VAR> seconds.
4905<VAR>timeout</VAR> may be a decimal number with a fractional portion following
4906the decimal point.
4907This option is only effective if <CODE>read</CODE> is reading input from a
4908terminal, pipe, or other special file; it has no effect when reading
4909from regular files.
4910If <VAR>timeout</VAR> is 0, <CODE>read</CODE> returns success if input is available on
4911the specified file descriptor, failure otherwise.
4912The exit status is greater than 128 if the timeout is exceeded.
4913<P>
4914
4915<DT><CODE>-u <VAR>fd</VAR></CODE>
4916<DD>Read input from file descriptor <VAR>fd</VAR>.
4917<P>
4918
4919</DL>
4920<P>
4921
4922<DT><CODE>readarray</CODE>
4923<DD><A NAME="IDX104"></A>
4924<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>] [
4925-C <VAR>callback</VAR>] [-c <VAR>quantum</VAR>] [<VAR>array</VAR>]
0001803f 4926</pre></td></tr></table>Read lines from the standard input into the indexed array variable <VAR>array</VAR>,
17345e5a
JA
4927or from file descriptor <VAR>fd</VAR>
4928if the <SAMP>`-u'</SAMP> option is supplied.
4929<P>
4930
4931A synonym for <CODE>mapfile</CODE>.
4932</P><P>
4933
4934<DT><CODE>source</CODE>
4935<DD><A NAME="IDX105"></A>
4936<TABLE><tr><td>&nbsp;</td><td class=example><pre>source <VAR>filename</VAR>
4937</pre></td></tr></table>A synonym for <CODE>.</CODE> (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
4938<P>
4939
4940<DT><CODE>type</CODE>
4941<DD><A NAME="IDX106"></A>
4942<TABLE><tr><td>&nbsp;</td><td class=example><pre>type [-afptP] [<VAR>name</VAR> <small>...</small>]
4943</pre></td></tr></table>For each <VAR>name</VAR>, indicate how it would be interpreted if used as a
4944command name.
4945<P>
4946
4947If the <SAMP>`-t'</SAMP> option is used, <CODE>type</CODE> prints a single word
4948which is one of <SAMP>`alias'</SAMP>, <SAMP>`function'</SAMP>, <SAMP>`builtin'</SAMP>,
4949<SAMP>`file'</SAMP> or <SAMP>`keyword'</SAMP>,
4950if <VAR>name</VAR> is an alias, shell function, shell builtin,
4951disk file, or shell reserved word, respectively.
4952If the <VAR>name</VAR> is not found, then nothing is printed, and
4953<CODE>type</CODE> returns a failure status.
4954</P><P>
4955
4956If the <SAMP>`-p'</SAMP> option is used, <CODE>type</CODE> either returns the name
4957of the disk file that would be executed, or nothing if <SAMP>`-t'</SAMP>
4958would not return <SAMP>`file'</SAMP>.
4959</P><P>
4960
4961The <SAMP>`-P'</SAMP> option forces a path search for each <VAR>name</VAR>, even if
4962<SAMP>`-t'</SAMP> would not return <SAMP>`file'</SAMP>.
4963</P><P>
4964
4965If a command is hashed, <SAMP>`-p'</SAMP> and <SAMP>`-P'</SAMP> print the hashed value,
4966not necessarily the file that appears first in <CODE>$PATH</CODE>.
4967</P><P>
4968
4969If the <SAMP>`-a'</SAMP> option is used, <CODE>type</CODE> returns all of the places
4970that contain an executable named <VAR>file</VAR>.
4971This includes aliases and functions, if and only if the <SAMP>`-p'</SAMP> option
4972is not also used.
4973</P><P>
4974
4975If the <SAMP>`-f'</SAMP> option is used, <CODE>type</CODE> does not attempt to find
4976shell functions, as with the <CODE>command</CODE> builtin.
4977</P><P>
4978
4979The return status is zero if all of the <VAR>names</VAR> are found, non-zero
4980if any are not found.
4981</P><P>
4982
4983<DT><CODE>typeset</CODE>
4984<DD><A NAME="IDX107"></A>
4985<TABLE><tr><td>&nbsp;</td><td class=example><pre>typeset [-afFrxi] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>] <small>...</small>]
4986</pre></td></tr></table>The <CODE>typeset</CODE> command is supplied for compatibility with the Korn
4987shell; however, it has been deprecated in favor of the <CODE>declare</CODE>
4988builtin command.
4989<P>
4990
4991<DT><CODE>ulimit</CODE>
4992<DD><A NAME="IDX108"></A>
4993<TABLE><tr><td>&nbsp;</td><td class=example><pre>ulimit [-abcdefilmnpqrstuvxHST] [<VAR>limit</VAR>]
4994</pre></td></tr></table><CODE>ulimit</CODE> provides control over the resources available to processes
4995started by the shell, on systems that allow such control. If an
4996option is given, it is interpreted as follows:
4997<DL COMPACT>
4998<DT><CODE>-S</CODE>
4999<DD>Change and report the soft limit associated with a resource.
5000<P>
5001
5002<DT><CODE>-H</CODE>
5003<DD>Change and report the hard limit associated with a resource.
5004<P>
5005
5006<DT><CODE>-a</CODE>
5007<DD>All current limits are reported.
5008<P>
5009
5010<DT><CODE>-b</CODE>
5011<DD>The maximum socket buffer size.
5012<P>
5013
5014<DT><CODE>-c</CODE>
5015<DD>The maximum size of core files created.
5016<P>
5017
5018<DT><CODE>-d</CODE>
5019<DD>The maximum size of a process's data segment.
5020<P>
5021
5022<DT><CODE>-e</CODE>
5023<DD>The maximum scheduling priority ("nice").
5024<P>
5025
5026<DT><CODE>-f</CODE>
5027<DD>The maximum size of files written by the shell and its children.
5028<P>
5029
5030<DT><CODE>-i</CODE>
5031<DD>The maximum number of pending signals.
5032<P>
5033
5034<DT><CODE>-l</CODE>
5035<DD>The maximum size that may be locked into memory.
5036<P>
5037
5038<DT><CODE>-m</CODE>
0001803f 5039<DD>The maximum resident set size (many systems do not honor this limit).
17345e5a
JA
5040<P>
5041
5042<DT><CODE>-n</CODE>
0001803f
CR
5043<DD>The maximum number of open file descriptors (most systems do not
5044allow this value to be set).
17345e5a
JA
5045<P>
5046
5047<DT><CODE>-p</CODE>
5048<DD>The pipe buffer size.
5049<P>
5050
5051<DT><CODE>-q</CODE>
5052<DD>The maximum number of bytes in POSIX message queues.
5053<P>
5054
5055<DT><CODE>-r</CODE>
5056<DD>The maximum real-time scheduling priority.
5057<P>
5058
5059<DT><CODE>-s</CODE>
5060<DD>The maximum stack size.
5061<P>
5062
5063<DT><CODE>-t</CODE>
5064<DD>The maximum amount of cpu time in seconds.
5065<P>
5066
5067<DT><CODE>-u</CODE>
5068<DD>The maximum number of processes available to a single user.
5069<P>
5070
5071<DT><CODE>-v</CODE>
5072<DD>The maximum amount of virtual memory available to the process.
5073<P>
5074
5075<DT><CODE>-x</CODE>
5076<DD>The maximum number of file locks.
5077<P>
5078
5079<DT><CODE>-T</CODE>
5080<DD>The maximum number of threads.
5081<P>
5082
5083</DL>
5084<P>
5085
5086If <VAR>limit</VAR> is given, it is the new value of the specified resource;
5087the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and
5088<CODE>unlimited</CODE> stand for the current hard limit, the current soft limit,
5089and no limit, respectively.
5090A hard limit cannot be increased by a non-root user once it is set;
5091a soft limit may be increased up to the value of the hard limit.
5092Otherwise, the current value of the soft limit for the specified resource
5093is printed, unless the <SAMP>`-H'</SAMP> option is supplied.
5094When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied,
5095both the hard and soft limits are set.
5096If no option is given, then <SAMP>`-f'</SAMP> is assumed. Values are in 1024-byte
5097increments, except for <SAMP>`-t'</SAMP>, which is in seconds, <SAMP>`-p'</SAMP>,
5098which is in units of 512-byte blocks, and <SAMP>`-n'</SAMP> and <SAMP>`-u'</SAMP>, which
5099are unscaled values.
5100</P><P>
5101
5102The return status is zero unless an invalid option or argument is supplied,
5103or an error occurs while setting a new limit.
5104</P><P>
5105
5106<DT><CODE>unalias</CODE>
5107<DD><A NAME="IDX109"></A>
5108<TABLE><tr><td>&nbsp;</td><td class=example><pre>unalias [-a] [<VAR>name</VAR> <small>...</small> ]
5109</pre></td></tr></table><P>
5110
5111Remove each <VAR>name</VAR> from the list of aliases. If <SAMP>`-a'</SAMP> is
5112supplied, all aliases are removed.
5113Aliases are described in <A HREF="bashref.html#SEC84">6.6 Aliases</A>.
5114</P><P>
5115
5116</DL>
5117<P>
5118
5119<A NAME="Modifying Shell Behavior"></A>
5120<HR SIZE="6">
5121<A NAME="SEC61"></A>
5122<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5123<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC60"> &lt; </A>]</TD>
5124<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> &gt; </A>]</TD>
5125<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt;&lt; </A>]</TD>
5126<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
5127<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt;&gt; </A>]</TD>
5128<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5129<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5130<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5131<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5132</TR></TABLE>
5133<H2> 4.3 Modifying Shell Behavior </H2>
5134<!--docid::SEC61::-->
5135
5136<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
5137<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Change the values of shell attributes and
5138 positional parameters.</TD></TR>
5139<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Modify shell optional behavior.</TD></TR>
5140</TABLE></BLOCKQUOTE>
5141<P>
5142
5143<A NAME="The Set Builtin"></A>
5144<HR SIZE="6">
5145<A NAME="SEC62"></A>
5146<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5147<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> &lt; </A>]</TD>
5148<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> &gt; </A>]</TD>
5149<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt;&lt; </A>]</TD>
5150<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD>
5151<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt;&gt; </A>]</TD>
5152<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5153<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5154<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5155<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5156</TR></TABLE>
5157<H3> 4.3.1 The Set Builtin </H3>
5158<!--docid::SEC62::-->
5159<P>
5160
5161This builtin is so complicated that it deserves its own section. <CODE>set</CODE>
5162allows you to change the values of shell options and set the positional
5163parameters, or to display the names and values of shell variables.
5164</P><P>
5165
5166<DL COMPACT>
5167<DT><CODE>set</CODE>
5168<DD><A NAME="IDX110"></A>
5169<TABLE><tr><td>&nbsp;</td><td class=example><pre>set [--abefhkmnptuvxBCEHPT] [-o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>]
5170set [+abefhkmnptuvxBCEHPT] [+o <VAR>option</VAR>] [<VAR>argument</VAR> <small>...</small>]
5171</pre></td></tr></table><P>
5172
5173If no options or arguments are supplied, <CODE>set</CODE> displays the names
5174and values of all shell variables and functions, sorted according to the
5175current locale, in a format that may be reused as input
5176for setting or resetting the currently-set variables.
5177Read-only variables cannot be reset.
5178In POSIX mode, only shell variables are listed.
5179</P><P>
5180
5181When options are supplied, they set or unset shell attributes.
5182Options, if specified, have the following meanings:
5183</P><P>
5184
5185<DL COMPACT>
5186<DT><CODE>-a</CODE>
5187<DD>Mark variables and function which are modified or created for export
5188to the environment of subsequent commands.
5189<P>
5190
5191<DT><CODE>-b</CODE>
5192<DD>Cause the status of terminated background jobs to be reported
5193immediately, rather than before printing the next primary prompt.
5194<P>
5195
5196<DT><CODE>-e</CODE>
0001803f
CR
5197<DD>Exit immediately if a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>), which may consist
5198of a single simple command (see section <A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>),
5199a subshell command enclosed in parentheses (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>),
5200or one of the commands executed as part of a command list enclosed
5201by braces (see section <A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>)
5202returns a non-zero status.
5203The shell does not exit if the command that fails is part of the
17345e5a
JA
5204command list immediately following a <CODE>while</CODE> or <CODE>until</CODE> keyword,
5205part of the test in an <CODE>if</CODE> statement,
0001803f
CR
5206part of any command executed in a <CODE>&#38;&#38;</CODE> or <CODE>||</CODE> list except
5207the command following the final <CODE>&#38;&#38;</CODE> or <CODE>||</CODE>,
17345e5a 5208any command in a pipeline but the last,
0001803f 5209or if the command's return status is being inverted with <CODE>!</CODE>.
17345e5a
JA
5210A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits.
5211<P>
5212
0001803f
CR
5213This option applies to the shell environment and each subshell environment
5214separately (see section <A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>), and may cause
5215subshells to exit before executing all the commands in the subshell.
5216</P><P>
5217
17345e5a 5218<DT><CODE>-f</CODE>
0001803f 5219<DD>Disable filename expansion (globbing).
17345e5a
JA
5220<P>
5221
5222<DT><CODE>-h</CODE>
5223<DD>Locate and remember (hash) commands as they are looked up for execution.
5224This option is enabled by default.
5225<P>
5226
5227<DT><CODE>-k</CODE>
5228<DD>All arguments in the form of assignment statements are placed
5229in the environment for a command, not just those that precede
5230the command name.
5231<P>
5232
5233<DT><CODE>-m</CODE>
5234<DD>Job control is enabled (see section <A HREF="bashref.html#SEC91">7. Job Control</A>).
5235<P>
5236
5237<DT><CODE>-n</CODE>
5238<DD>Read commands but do not execute them; this may be used to check a
5239script for syntax errors.
5240This option is ignored by interactive shells.
5241<P>
5242
5243<DT><CODE>-o <VAR>option-name</VAR></CODE>
5244<DD><P>
5245
5246Set the option corresponding to <VAR>option-name</VAR>:
5247</P><P>
5248
5249<DL COMPACT>
5250<DT><CODE>allexport</CODE>
5251<DD>Same as <CODE>-a</CODE>.
5252<P>
5253
5254<DT><CODE>braceexpand</CODE>
5255<DD>Same as <CODE>-B</CODE>.
5256<P>
5257
5258<DT><CODE>emacs</CODE>
5259<DD>Use an <CODE>emacs</CODE>-style line editing interface (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>).
5260This also affects the editing interface used for <CODE>read -e</CODE>.
5261<P>
5262
5263<DT><CODE>errexit</CODE>
5264<DD>Same as <CODE>-e</CODE>.
5265<P>
5266
5267<DT><CODE>errtrace</CODE>
5268<DD>Same as <CODE>-E</CODE>.
5269<P>
5270
5271<DT><CODE>functrace</CODE>
5272<DD>Same as <CODE>-T</CODE>.
5273<P>
5274
5275<DT><CODE>hashall</CODE>
5276<DD>Same as <CODE>-h</CODE>.
5277<P>
5278
5279<DT><CODE>histexpand</CODE>
5280<DD>Same as <CODE>-H</CODE>.
5281<P>
5282
5283<DT><CODE>history</CODE>
5284<DD>Enable command history, as described in <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>.
5285This option is on by default in interactive shells.
5286<P>
5287
5288<DT><CODE>ignoreeof</CODE>
5289<DD>An interactive shell will not exit upon reading EOF.
5290<P>
5291
5292<DT><CODE>keyword</CODE>
5293<DD>Same as <CODE>-k</CODE>.
5294<P>
5295
5296<DT><CODE>monitor</CODE>
5297<DD>Same as <CODE>-m</CODE>.
5298<P>
5299
5300<DT><CODE>noclobber</CODE>
5301<DD>Same as <CODE>-C</CODE>.
5302<P>
5303
5304<DT><CODE>noexec</CODE>
5305<DD>Same as <CODE>-n</CODE>.
5306<P>
5307
5308<DT><CODE>noglob</CODE>
5309<DD>Same as <CODE>-f</CODE>.
5310<P>
5311
5312<DT><CODE>nolog</CODE>
5313<DD>Currently ignored.
5314<P>
5315
5316<DT><CODE>notify</CODE>
5317<DD>Same as <CODE>-b</CODE>.
5318<P>
5319
5320<DT><CODE>nounset</CODE>
5321<DD>Same as <CODE>-u</CODE>.
5322<P>
5323
5324<DT><CODE>onecmd</CODE>
5325<DD>Same as <CODE>-t</CODE>.
5326<P>
5327
5328<DT><CODE>physical</CODE>
5329<DD>Same as <CODE>-P</CODE>.
5330<P>
5331
5332<DT><CODE>pipefail</CODE>
5333<DD>If set, the return value of a pipeline is the value of the last
5334(rightmost) command to exit with a non-zero status, or zero if all
5335commands in the pipeline exit successfully.
5336This option is disabled by default.
5337<P>
5338
5339<DT><CODE>posix</CODE>
5340<DD>Change the behavior of Bash where the default operation differs
5341from the POSIX standard to match the standard
5342(see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
5343This is intended to make Bash behave as a strict superset of that
5344standard.
5345<P>
5346
5347<DT><CODE>privileged</CODE>
5348<DD>Same as <CODE>-p</CODE>.
5349<P>
5350
5351<DT><CODE>verbose</CODE>
5352<DD>Same as <CODE>-v</CODE>.
5353<P>
5354
5355<DT><CODE>vi</CODE>
5356<DD>Use a <CODE>vi</CODE>-style line editing interface.
5357This also affects the editing interface used for <CODE>read -e</CODE>.
5358<P>
5359
5360<DT><CODE>xtrace</CODE>
5361<DD>Same as <CODE>-x</CODE>.
5362</DL>
5363<P>
5364
5365<DT><CODE>-p</CODE>
5366<DD>Turn on privileged mode.
5367In this mode, the <CODE>$BASH_ENV</CODE> and <CODE>$ENV</CODE> files are not
5368processed, shell functions are not inherited from the environment,
0001803f
CR
5369and the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE> and <CODE>GLOBIGNORE</CODE>
5370variables, if they appear in the environment, are ignored.
17345e5a
JA
5371If the shell is started with the effective user (group) id not equal to the
5372real user (group) id, and the <CODE>-p</CODE> option is not supplied, these actions
5373are taken and the effective user id is set to the real user id.
5374If the <CODE>-p</CODE> option is supplied at startup, the effective user id is
5375not reset.
5376Turning this option off causes the effective user
5377and group ids to be set to the real user and group ids.
5378<P>
5379
5380<DT><CODE>-t</CODE>
5381<DD>Exit after reading and executing one command.
5382<P>
5383
5384<DT><CODE>-u</CODE>
0001803f
CR
5385<DD>Treat unset variables and parameters other than the special parameters
5386<SAMP>`@'</SAMP> or <SAMP>`*'</SAMP> as an error when performing parameter expansion.
17345e5a
JA
5387An error message will be written to the standard error, and a non-interactive
5388shell will exit.
5389<P>
5390
5391<DT><CODE>-v</CODE>
5392<DD>Print shell input lines as they are read.
5393<P>
5394
5395<DT><CODE>-x</CODE>
5396<DD>Print a trace of simple commands, <CODE>for</CODE> commands, <CODE>case</CODE>
5397commands, <CODE>select</CODE> commands, and arithmetic <CODE>for</CODE> commands
5398and their arguments or associated word lists after they are
5399expanded and before they are executed. The value of the <CODE>PS4</CODE>
5400variable is expanded and the resultant value is printed before
5401the command and its expanded arguments.
5402<P>
5403
5404<DT><CODE>-B</CODE>
5405<DD>The shell will perform brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>).
5406This option is on by default.
5407<P>
5408
5409<DT><CODE>-C</CODE>
5410<DD>Prevent output redirection using <SAMP>`&#62;'</SAMP>, <SAMP>`&#62;&#38;'</SAMP>, and <SAMP>`&#60;&#62;'</SAMP>
5411from overwriting existing files.
5412<P>
5413
5414<DT><CODE>-E</CODE>
5415<DD>If set, any trap on <CODE>ERR</CODE> is inherited by shell functions, command
5416substitutions, and commands executed in a subshell environment.
5417The <CODE>ERR</CODE> trap is normally not inherited in such cases.
5418<P>
5419
5420<DT><CODE>-H</CODE>
5421<DD>Enable <SAMP>`!'</SAMP> style history substitution (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
5422This option is on by default for interactive shells.
5423<P>
5424
5425<DT><CODE>-P</CODE>
5426<DD>If set, do not follow symbolic links when performing commands such as
5427<CODE>cd</CODE> which change the current directory. The physical directory
5428is used instead. By default, Bash follows
5429the logical chain of directories when performing commands
5430which change the current directory.
5431<P>
5432
5433For example, if <TT>`/usr/sys'</TT> is a symbolic link to <TT>`/usr/local/sys'</TT>
5434then:
5435<TABLE><tr><td>&nbsp;</td><td class=example><pre>$ cd /usr/sys; echo $PWD
5436/usr/sys
5437$ cd ..; pwd
5438/usr
5439</pre></td></tr></table></P><P>
5440
5441If <CODE>set -P</CODE> is on, then:
5442<TABLE><tr><td>&nbsp;</td><td class=example><pre>$ cd /usr/sys; echo $PWD
5443/usr/local/sys
5444$ cd ..; pwd
5445/usr/local
5446</pre></td></tr></table></P><P>
5447
5448<DT><CODE>-T</CODE>
5449<DD>If set, any trap on <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> are inherited by
5450shell functions, command substitutions, and commands executed
5451in a subshell environment.
5452The <CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps are normally not inherited
5453in such cases.
5454<P>
5455
5456<DT><CODE>--</CODE>
5457<DD>If no arguments follow this option, then the positional parameters are
5458unset. Otherwise, the positional parameters are set to the
5459<VAR>arguments</VAR>, even if some of them begin with a <SAMP>`-'</SAMP>.
5460<P>
5461
5462<DT><CODE>-</CODE>
5463<DD>Signal the end of options, cause all remaining <VAR>arguments</VAR>
5464to be assigned to the positional parameters. The <SAMP>`-x'</SAMP>
5465and <SAMP>`-v'</SAMP> options are turned off.
5466If there are no arguments, the positional parameters remain unchanged.
5467</DL>
5468<P>
5469
5470Using <SAMP>`+'</SAMP> rather than <SAMP>`-'</SAMP> causes these options to be
5471turned off. The options can also be used upon invocation of the
5472shell. The current set of options may be found in <CODE>$-</CODE>.
5473</P><P>
5474
5475The remaining N <VAR>arguments</VAR> are positional parameters and are
5476assigned, in order, to <CODE>$1</CODE>, <CODE>$2</CODE>, <small>...</small> <CODE>$N</CODE>.
5477The special parameter <CODE>#</CODE> is set to N.
5478</P><P>
5479
5480The return status is always zero unless an invalid option is supplied.
5481</DL>
5482<P>
5483
5484<A NAME="The Shopt Builtin"></A>
5485<HR SIZE="6">
5486<A NAME="SEC63"></A>
5487<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5488<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC62"> &lt; </A>]</TD>
5489<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt; </A>]</TD>
5490<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt;&lt; </A>]</TD>
5491<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC61"> Up </A>]</TD>
5492<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &gt;&gt; </A>]</TD>
5493<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5494<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5495<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5496<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5497</TR></TABLE>
5498<H3> 4.3.2 The Shopt Builtin </H3>
5499<!--docid::SEC63::-->
5500<P>
5501
5502This builtin allows you to change additional shell optional behavior.
5503</P><P>
5504
5505<DL COMPACT>
5506
5507<DT><CODE>shopt</CODE>
5508<DD><A NAME="IDX111"></A>
5509<TABLE><tr><td>&nbsp;</td><td class=example><pre>shopt [-pqsu] [-o] [<VAR>optname</VAR> <small>...</small>]
5510</pre></td></tr></table>Toggle the values of variables controlling optional shell behavior.
5511With no options, or with the <SAMP>`-p'</SAMP> option, a list of all settable
5512options is displayed, with an indication of whether or not each is set.
5513The <SAMP>`-p'</SAMP> option causes output to be displayed in a form that
5514may be reused as input.
5515Other options have the following meanings:
5516<P>
5517
5518<DL COMPACT>
5519<DT><CODE>-s</CODE>
5520<DD>Enable (set) each <VAR>optname</VAR>.
5521<P>
5522
5523<DT><CODE>-u</CODE>
5524<DD>Disable (unset) each <VAR>optname</VAR>.
5525<P>
5526
5527<DT><CODE>-q</CODE>
5528<DD>Suppresses normal output; the return status
5529indicates whether the <VAR>optname</VAR> is set or unset.
5530If multiple <VAR>optname</VAR> arguments are given with <SAMP>`-q'</SAMP>,
5531the return status is zero if all <VAR>optnames</VAR> are enabled;
5532non-zero otherwise.
5533<P>
5534
5535<DT><CODE>-o</CODE>
5536<DD>Restricts the values of
5537<VAR>optname</VAR> to be those defined for the <SAMP>`-o'</SAMP> option to the
5538<CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
5539</DL>
5540<P>
5541
5542If either <SAMP>`-s'</SAMP> or <SAMP>`-u'</SAMP>
5543is used with no <VAR>optname</VAR> arguments, the display is limited to
5544those options which are set or unset, respectively.
5545</P><P>
5546
5547Unless otherwise noted, the <CODE>shopt</CODE> options are disabled (off)
5548by default.
5549</P><P>
5550
5551The return status when listing options is zero if all <VAR>optnames</VAR>
5552are enabled, non-zero otherwise. When setting or unsetting options,
5553the return status is zero unless an <VAR>optname</VAR> is not a valid shell
5554option.
5555</P><P>
5556
5557The list of <CODE>shopt</CODE> options is:
5558<DL COMPACT>
5559
5560<DT><CODE>autocd</CODE>
5561<DD>If set, a command name that is the name of a directory is executed as if
5562it were the argument to the <CODE>cd</CODE> command.
5563This option is only used by interactive shells.
5564<P>
5565
5566<DT><CODE>cdable_vars</CODE>
5567<DD>If this is set, an argument to the <CODE>cd</CODE> builtin command that
5568is not a directory is assumed to be the name of a variable whose
5569value is the directory to change to.
5570<P>
5571
5572<DT><CODE>cdspell</CODE>
5573<DD>If set, minor errors in the spelling of a directory component in a
5574<CODE>cd</CODE> command will be corrected.
5575The errors checked for are transposed characters,
5576a missing character, and a character too many.
5577If a correction is found, the corrected path is printed,
5578and the command proceeds.
5579This option is only used by interactive shells.
5580<P>
5581
5582<DT><CODE>checkhash</CODE>
5583<DD>If this is set, Bash checks that a command found in the hash
5584table exists before trying to execute it. If a hashed command no
5585longer exists, a normal path search is performed.
5586<P>
5587
5588<DT><CODE>checkjobs</CODE>
5589<DD>If set, Bash lists the status of any stopped and running jobs before
5590exiting an interactive shell. If any jobs are running, this causes
5591the exit to be deferred until a second exit is attempted without an
5592intervening command (see section <A HREF="bashref.html#SEC91">7. Job Control</A>).
5593The shell always postpones exiting if any jobs are stopped.
5594<P>
5595
5596<DT><CODE>checkwinsize</CODE>
5597<DD>If set, Bash checks the window size after each command
5598and, if necessary, updates the values of
5599<CODE>LINES</CODE> and <CODE>COLUMNS</CODE>.
5600<P>
5601
5602<DT><CODE>cmdhist</CODE>
5603<DD>If set, Bash
5604attempts to save all lines of a multiple-line
5605command in the same history entry. This allows
5606easy re-editing of multi-line commands.
5607<P>
5608
5609<DT><CODE>compat31</CODE>
5610<DD>If set, Bash
5611changes its behavior to that of version 3.1 with respect to quoted
5612arguments to the conditional command's =~ operator.
5613<P>
5614
5615<DT><CODE>dirspell</CODE>
5616<DD>If set, Bash
5617attempts spelling correction on directory names during word completion
5618if the directory name initially supplied does not exist.
5619<P>
5620
5621<DT><CODE>dotglob</CODE>
5622<DD>If set, Bash includes filenames beginning with a `.' in
5623the results of filename expansion.
5624<P>
5625
5626<DT><CODE>execfail</CODE>
5627<DD>If this is set, a non-interactive shell will not exit if
5628it cannot execute the file specified as an argument to the <CODE>exec</CODE>
5629builtin command. An interactive shell does not exit if <CODE>exec</CODE>
5630fails.
5631<P>
5632
5633<DT><CODE>expand_aliases</CODE>
5634<DD>If set, aliases are expanded as described below under Aliases,
5635<A HREF="bashref.html#SEC84">6.6 Aliases</A>.
5636This option is enabled by default for interactive shells.
5637<P>
5638
5639<DT><CODE>extdebug</CODE>
5640<DD>If set, behavior intended for use by debuggers is enabled:
5641<P>
5642
5643<OL>
5644<LI>
5645The <SAMP>`-F'</SAMP> option to the <CODE>declare</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>)
5646displays the source file name and line number corresponding to each function
5647name supplied as an argument.
5648<P>
5649
5650<LI>
5651If the command run by the <CODE>DEBUG</CODE> trap returns a non-zero value, the
5652next command is skipped and not executed.
5653<P>
5654
5655<LI>
5656If the command run by the <CODE>DEBUG</CODE> trap returns a value of 2, and the
5657shell is executing in a subroutine (a shell function or a shell script
5658executed by the <CODE>.</CODE> or <CODE>source</CODE> builtins), a call to
5659<CODE>return</CODE> is simulated.
5660<P>
5661
5662<LI>
5663<CODE>BASH_ARGC</CODE> and <CODE>BASH_ARGV</CODE> are updated as described in their
5664descriptions (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
5665<P>
5666
5667<LI>
5668Function tracing is enabled: command substitution, shell functions, and
5669subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5670<CODE>DEBUG</CODE> and <CODE>RETURN</CODE> traps.
5671<P>
5672
5673<LI>
5674Error tracing is enabled: command substitution, shell functions, and
5675subshells invoked with <CODE>( <VAR>command</VAR> )</CODE> inherit the
5676<CODE>ERROR</CODE> trap.
5677</OL>
5678<P>
5679
5680<DT><CODE>extglob</CODE>
5681<DD>If set, the extended pattern matching features described above
5682(see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>) are enabled.
5683<P>
5684
5685<DT><CODE>extquote</CODE>
5686<DD>If set, <CODE>$'<VAR>string</VAR>'</CODE> and <CODE>$"<VAR>string</VAR>"</CODE> quoting is
5687performed within <CODE>${<VAR>parameter</VAR>}</CODE> expansions
5688enclosed in double quotes. This option is enabled by default.
5689<P>
5690
5691<DT><CODE>failglob</CODE>
0001803f 5692<DD>If set, patterns which fail to match filenames during filename expansion
17345e5a
JA
5693result in an expansion error.
5694<P>
5695
5696<DT><CODE>force_fignore</CODE>
5697<DD>If set, the suffixes specified by the <CODE>FIGNORE</CODE> shell variable
5698cause words to be ignored when performing word completion even if
5699the ignored words are the only possible completions.
5700See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
5701This option is enabled by default.
5702<P>
5703
5704<DT><CODE>globstar</CODE>
5705<DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename expansion context will
5706match a files and zero or more directories and subdirectories.
5707If the pattern is followed by a <SAMP>`/'</SAMP>, only directories and
5708subdirectories match.
5709<P>
5710
5711<DT><CODE>gnu_errfmt</CODE>
5712<DD>If set, shell error messages are written in the standard GNU error
5713message format.
5714<P>
5715
5716<DT><CODE>histappend</CODE>
5717<DD>If set, the history list is appended to the file named by the value
5718of the <CODE>HISTFILE</CODE>
5719variable when the shell exits, rather than overwriting the file.
5720<P>
5721
5722<DT><CODE>histreedit</CODE>
5723<DD>If set, and Readline
5724is being used, a user is given the opportunity to re-edit a
5725failed history substitution.
5726<P>
5727
5728<DT><CODE>histverify</CODE>
5729<DD>If set, and Readline
5730is being used, the results of history substitution are not immediately
5731passed to the shell parser. Instead, the resulting line is loaded into
5732the Readline editing buffer, allowing further modification.
5733<P>
5734
5735<DT><CODE>hostcomplete</CODE>
5736<DD>If set, and Readline is being used, Bash will attempt to perform
5737hostname completion when a word containing a <SAMP>`@'</SAMP> is being
5738completed (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>). This option is enabled
5739by default.
5740<P>
5741
5742<DT><CODE>huponexit</CODE>
5743<DD>If set, Bash will send <CODE>SIGHUP</CODE> to all jobs when an interactive
5744login shell exits (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
5745<P>
5746
5747<DT><CODE>interactive_comments</CODE>
5748<DD>Allow a word beginning with <SAMP>`#'</SAMP>
5749to cause that word and all remaining characters on that
5750line to be ignored in an interactive shell.
5751This option is enabled by default.
5752<P>
5753
5754<DT><CODE>lithist</CODE>
5755<DD>If enabled, and the <CODE>cmdhist</CODE>
5756option is enabled, multi-line commands are saved to the history with
5757embedded newlines rather than using semicolon separators where possible.
5758<P>
5759
5760<DT><CODE>login_shell</CODE>
5761<DD>The shell sets this option if it is started as a login shell
5762(see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
5763The value may not be changed.
5764<P>
5765
5766<DT><CODE>mailwarn</CODE>
5767<DD>If set, and a file that Bash is checking for mail has been
5768accessed since the last time it was checked, the message
5769<CODE>"The mail in <VAR>mailfile</VAR> has been read"</CODE> is displayed.
5770<P>
5771
5772<DT><CODE>no_empty_cmd_completion</CODE>
5773<DD>If set, and Readline is being used, Bash will not attempt to search
5774the <CODE>PATH</CODE> for possible completions when completion is attempted
5775on an empty line.
5776<P>
5777
5778<DT><CODE>nocaseglob</CODE>
5779<DD>If set, Bash matches filenames in a case-insensitive fashion when
5780performing filename expansion.
5781<P>
5782
5783<DT><CODE>nocasematch</CODE>
5784<DD>If set, Bash matches patterns in a case-insensitive fashion when
5785performing matching while executing <CODE>case</CODE> or <CODE>[[</CODE>
5786conditional commands.
5787<P>
5788
5789<DT><CODE>nullglob</CODE>
5790<DD>If set, Bash allows filename patterns which match no
5791files to expand to a null string, rather than themselves.
5792<P>
5793
5794<DT><CODE>progcomp</CODE>
5795<DD>If set, the programmable completion facilities
5796(see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>) are enabled.
5797This option is enabled by default.
5798<P>
5799
5800<DT><CODE>promptvars</CODE>
5801<DD>If set, prompt strings undergo
5802parameter expansion, command substitution, arithmetic
5803expansion, and quote removal after being expanded
5804as described below (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
5805This option is enabled by default.
5806<P>
5807
5808<DT><CODE>restricted_shell</CODE>
5809<DD>The shell sets this option if it is started in restricted mode
5810(see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
5811The value may not be changed.
5812This is not reset when the startup files are executed, allowing
5813the startup files to discover whether or not a shell is restricted.
5814<P>
5815
5816<DT><CODE>shift_verbose</CODE>
5817<DD>If this is set, the <CODE>shift</CODE>
5818builtin prints an error message when the shift count exceeds the
5819number of positional parameters.
5820<P>
5821
5822<DT><CODE>sourcepath</CODE>
5823<DD>If set, the <CODE>source</CODE> builtin uses the value of <CODE>PATH</CODE>
5824to find the directory containing the file supplied as an argument.
5825This option is enabled by default.
5826<P>
5827
5828<DT><CODE>xpg_echo</CODE>
5829<DD>If set, the <CODE>echo</CODE> builtin expands backslash-escape sequences
5830by default.
5831<P>
5832
5833</DL>
5834<P>
5835
5836The return status when listing options is zero if all <VAR>optnames</VAR>
5837are enabled, non-zero otherwise.
5838When setting or unsetting options, the return status is zero unless an
5839<VAR>optname</VAR> is not a valid shell option.
5840</P><P>
5841
5842</DL>
5843<P>
5844
5845<A NAME="Special Builtins"></A>
5846<HR SIZE="6">
5847<A NAME="SEC64"></A>
5848<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5849<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC63"> &lt; </A>]</TD>
5850<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt; </A>]</TD>
5851<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> &lt;&lt; </A>]</TD>
5852<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC58"> Up </A>]</TD>
5853<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &gt;&gt; </A>]</TD>
5854<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5855<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5856<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5857<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5858</TR></TABLE>
5859<H2> 4.4 Special Builtins </H2>
5860<!--docid::SEC64::-->
5861<P>
5862
5863For historical reasons, the POSIX standard has classified
5864several builtin commands as <EM>special</EM>.
5865When Bash is executing in POSIX mode, the special builtins
5866differ from other builtin commands in three respects:
5867</P><P>
5868
5869<OL>
5870<LI>
5871Special builtins are found before shell functions during command lookup.
5872<P>
5873
5874<LI>
5875If a special builtin returns an error status, a non-interactive shell exits.
5876<P>
5877
5878<LI>
5879Assignment statements preceding the command stay in effect in the shell
5880environment after the command completes.
5881</OL>
5882<P>
5883
5884When Bash is not executing in POSIX mode, these builtins behave no
5885differently than the rest of the Bash builtin commands.
5886The Bash POSIX mode is described in <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>.
5887</P><P>
5888
5889These are the POSIX special builtins:
5890<TABLE><tr><td>&nbsp;</td><td class=example><pre>break : . continue eval exec exit export readonly return set
5891shift trap unset
5892</pre></td></tr></table></P><P>
5893
5894<A NAME="Shell Variables"></A>
5895<HR SIZE="6">
5896<A NAME="SEC65"></A>
5897<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5898<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC64"> &lt; </A>]</TD>
5899<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &gt; </A>]</TD>
5900<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt;&lt; </A>]</TD>
5901<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
5902<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt;&gt; </A>]</TD>
5903<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5904<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5905<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5906<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5907</TR></TABLE>
5908<H1> 5. Shell Variables </H1>
5909<!--docid::SEC65::-->
5910<P>
5911
5912<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
5913<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Variables which Bash uses in the same way
5914 as the Bourne Shell.</TD></TR>
5915<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">List of variables that exist in Bash.</TD></TR>
5916</TABLE></BLOCKQUOTE>
5917<P>
5918
5919This chapter describes the shell variables that Bash uses.
5920Bash automatically assigns default values to a number of variables.
5921</P><P>
5922
5923<A NAME="Bourne Shell Variables"></A>
5924<HR SIZE="6">
5925<A NAME="SEC66"></A>
5926<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
5927<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt; </A>]</TD>
5928<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> &gt; </A>]</TD>
5929<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
5930<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD>
5931<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt;&gt; </A>]</TD>
5932<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
5933<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
5934<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
5935<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
5936</TR></TABLE>
5937<H2> 5.1 Bourne Shell Variables </H2>
5938<!--docid::SEC66::-->
5939<P>
5940
5941Bash uses certain shell variables in the same way as the Bourne shell.
5942In some cases, Bash assigns a default value to the variable.
5943</P><P>
5944
5945<DL COMPACT>
5946
5947<A NAME="IDX112"></A>
5948<DT><CODE>CDPATH</CODE>
5949<DD><A NAME="IDX113"></A>
5950A colon-separated list of directories used as a search path for
5951the <CODE>cd</CODE> builtin command.
5952<P>
5953
5954<A NAME="IDX114"></A>
5955<DT><CODE>HOME</CODE>
5956<DD><A NAME="IDX115"></A>
5957The current user's home directory; the default for the <CODE>cd</CODE> builtin
5958command.
5959The value of this variable is also used by tilde expansion
5960(see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
5961<P>
5962
5963<A NAME="IDX116"></A>
5964<DT><CODE>IFS</CODE>
5965<DD><A NAME="IDX117"></A>
5966A list of characters that separate fields; used when the shell splits
5967words as part of expansion.
5968<P>
5969
5970<A NAME="IDX118"></A>
5971<DT><CODE>MAIL</CODE>
5972<DD><A NAME="IDX119"></A>
5973If this parameter is set to a filename and the <CODE>MAILPATH</CODE> variable
5974is not set, Bash informs the user of the arrival of mail in
5975the specified file.
5976<P>
5977
5978<A NAME="IDX120"></A>
5979<DT><CODE>MAILPATH</CODE>
5980<DD><A NAME="IDX121"></A>
5981A colon-separated list of filenames which the shell periodically checks
5982for new mail.
5983Each list entry can specify the message that is printed when new mail
5984arrives in the mail file by separating the file name from the message with
5985a <SAMP>`?'</SAMP>.
5986When used in the text of the message, <CODE>$_</CODE> expands to the name of
5987the current mail file.
5988<P>
5989
5990<A NAME="IDX122"></A>
5991<DT><CODE>OPTARG</CODE>
5992<DD><A NAME="IDX123"></A>
5993The value of the last option argument processed by the <CODE>getopts</CODE> builtin.
5994<P>
5995
5996<A NAME="IDX124"></A>
5997<DT><CODE>OPTIND</CODE>
5998<DD><A NAME="IDX125"></A>
5999The index of the last option argument processed by the <CODE>getopts</CODE> builtin.
6000<P>
6001
6002<A NAME="IDX126"></A>
6003<DT><CODE>PATH</CODE>
6004<DD><A NAME="IDX127"></A>
6005A colon-separated list of directories in which the shell looks for
6006commands.
6007A zero-length (null) directory name in the value of <CODE>PATH</CODE> indicates the
6008current directory.
6009A null directory name may appear as two adjacent colons, or as an initial
6010or trailing colon.
6011<P>
6012
6013<A NAME="IDX128"></A>
6014<DT><CODE>PS1</CODE>
6015<DD><A NAME="IDX129"></A>
6016The primary prompt string. The default value is <SAMP>`\s-\v\$ '</SAMP>.
6017See section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for the complete list of escape
6018sequences that are expanded before <CODE>PS1</CODE> is displayed.
6019<P>
6020
6021<A NAME="IDX130"></A>
6022<DT><CODE>PS2</CODE>
6023<DD><A NAME="IDX131"></A>
6024The secondary prompt string. The default value is <SAMP>`&#62; '</SAMP>.
6025<P>
6026
6027</DL>
6028<P>
6029
6030<A NAME="Bash Variables"></A>
6031<HR SIZE="6">
6032<A NAME="SEC67"></A>
6033<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6034<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC66"> &lt; </A>]</TD>
6035<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt; </A>]</TD>
6036<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> &lt;&lt; </A>]</TD>
6037<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC65"> Up </A>]</TD>
6038<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &gt;&gt; </A>]</TD>
6039<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6040<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6041<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6042<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6043</TR></TABLE>
6044<H2> 5.2 Bash Variables </H2>
6045<!--docid::SEC67::-->
6046<P>
6047
6048These variables are set or used by Bash, but other shells
6049do not normally treat them specially.
6050</P><P>
6051
6052A few variables used by Bash are described in different chapters:
6053variables for controlling the job control facilities
6054(see section <A HREF="bashref.html#SEC94">7.3 Job Control Variables</A>).
6055</P><P>
6056
6057<DL COMPACT>
6058
6059<A NAME="IDX132"></A>
6060<DT><CODE>BASH</CODE>
6061<DD><A NAME="IDX133"></A>
6062The full pathname used to execute the current instance of Bash.
6063<P>
6064
6065<A NAME="IDX134"></A>
0001803f 6066<DT><CODE>BASHOPTS</CODE>
17345e5a 6067<DD><A NAME="IDX135"></A>
0001803f
CR
6068A colon-separated list of enabled shell options. Each word in
6069the list is a valid argument for the <SAMP>`-s'</SAMP> option to the
6070<CODE>shopt</CODE> builtin command (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
6071The options appearing in <CODE>BASHOPTS</CODE> are those reported
6072as <SAMP>`on'</SAMP> by <SAMP>`shopt'</SAMP>.
6073If this variable is in the environment when Bash
6074starts up, each shell option in the list will be enabled before
6075reading any startup files. This variable is readonly.
6076<P>
6077
6078<A NAME="IDX136"></A>
6079<DT><CODE>BASHPID</CODE>
6080<DD><A NAME="IDX137"></A>
17345e5a
JA
6081Expands to the process id of the current Bash process.
6082This differs from <CODE>$$</CODE> under certain circumstances, such as subshells
6083that do not require Bash to be re-initialized.
6084<P>
6085
0001803f 6086<A NAME="IDX138"></A>
17345e5a 6087<DT><CODE>BASH_ALIASES</CODE>
0001803f 6088<DD><A NAME="IDX139"></A>
17345e5a
JA
6089An associative array variable whose members correspond to the internal
6090list of aliases as maintained by the <CODE>alias</CODE> builtin
6091(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
6092Elements added to this array appear in the alias list; unsetting array
6093elements cause aliases to be removed from the alias list.
6094<P>
6095
0001803f 6096<A NAME="IDX140"></A>
17345e5a 6097<DT><CODE>BASH_ARGC</CODE>
0001803f 6098<DD><A NAME="IDX141"></A>
17345e5a
JA
6099An array variable whose values are the number of parameters in each
6100frame of the current bash execution call stack. The number of
6101parameters to the current subroutine (shell function or script executed
6102with <CODE>.</CODE> or <CODE>source</CODE>) is at the top of the stack. When a
6103subroutine is executed, the number of parameters passed is pushed onto
6104<CODE>BASH_ARGC</CODE>.
6105The shell sets <CODE>BASH_ARGC</CODE> only when in extended debugging mode
6106(see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6107for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6108builtin).
6109<P>
6110
0001803f 6111<A NAME="IDX142"></A>
17345e5a 6112<DT><CODE>BASH_ARGV</CODE>
0001803f 6113<DD><A NAME="IDX143"></A>
17345e5a
JA
6114An array variable containing all of the parameters in the current bash
6115execution call stack. The final parameter of the last subroutine call
6116is at the top of the stack; the first parameter of the initial call is
6117at the bottom. When a subroutine is executed, the parameters supplied
6118are pushed onto <CODE>BASH_ARGV</CODE>.
6119The shell sets <CODE>BASH_ARGV</CODE> only when in extended debugging mode
6120(see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6121for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6122builtin).
6123<P>
6124
0001803f 6125<A NAME="IDX144"></A>
17345e5a 6126<DT><CODE>BASH_CMDS</CODE>
0001803f 6127<DD><A NAME="IDX145"></A>
17345e5a
JA
6128An associative array variable whose members correspond to the internal
6129hash table of commands as maintained by the <CODE>hash</CODE> builtin
6130(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
6131Elements added to this array appear in the hash table; unsetting array
6132elements cause commands to be removed from the hash table.
6133<P>
6134
0001803f 6135<A NAME="IDX146"></A>
17345e5a 6136<DT><CODE>BASH_COMMAND</CODE>
0001803f 6137<DD><A NAME="IDX147"></A>
17345e5a
JA
6138The command currently being executed or about to be executed, unless the
6139shell is executing a command as the result of a trap,
6140in which case it is the command executing at the time of the trap.
6141<P>
6142
0001803f 6143<A NAME="IDX148"></A>
17345e5a 6144<DT><CODE>BASH_ENV</CODE>
0001803f 6145<DD><A NAME="IDX149"></A>
17345e5a
JA
6146If this variable is set when Bash is invoked to execute a shell
6147script, its value is expanded and used as the name of a startup file
6148to read before executing the script. See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>.
6149<P>
6150
0001803f 6151<A NAME="IDX150"></A>
17345e5a 6152<DT><CODE>BASH_EXECUTION_STRING</CODE>
0001803f 6153<DD><A NAME="IDX151"></A>
17345e5a
JA
6154The command argument to the <SAMP>`-c'</SAMP> invocation option.
6155<P>
6156
0001803f 6157<A NAME="IDX152"></A>
17345e5a 6158<DT><CODE>BASH_LINENO</CODE>
0001803f 6159<DD><A NAME="IDX153"></A>
17345e5a
JA
6160An array variable whose members are the line numbers in source files
6161corresponding to each member of <VAR>FUNCNAME</VAR>.
6162<CODE>${BASH_LINENO[$i]}</CODE> is the line number in the source file where
6163<CODE>${FUNCNAME[$i]}</CODE> was called (or <CODE>${BASH_LINENO[$i-1]}</CODE> if
6164referenced within another shell function).
6165The corresponding source file name is <CODE>${BASH_SOURCE[$i]}</CODE>.
6166Use <CODE>LINENO</CODE> to obtain the current line number.
6167<P>
6168
0001803f 6169<A NAME="IDX154"></A>
17345e5a 6170<DT><CODE>BASH_REMATCH</CODE>
0001803f 6171<DD><A NAME="IDX155"></A>
17345e5a
JA
6172An array variable whose members are assigned by the <SAMP>`=~'</SAMP> binary
6173operator to the <CODE>[[</CODE> conditional command
6174(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
6175The element with index 0 is the portion of the string
6176matching the entire regular expression.
6177The element with index <VAR>n</VAR> is the portion of the
6178string matching the <VAR>n</VAR>th parenthesized subexpression.
6179This variable is read-only.
6180<P>
6181
0001803f 6182<A NAME="IDX156"></A>
17345e5a 6183<DT><CODE>BASH_SOURCE</CODE>
0001803f 6184<DD><A NAME="IDX157"></A>
17345e5a
JA
6185An array variable whose members are the source filenames corresponding
6186to the elements in the <CODE>FUNCNAME</CODE> array variable.
6187<P>
6188
0001803f 6189<A NAME="IDX158"></A>
17345e5a 6190<DT><CODE>BASH_SUBSHELL</CODE>
0001803f 6191<DD><A NAME="IDX159"></A>
17345e5a
JA
6192Incremented by one each time a subshell or subshell environment is spawned.
6193The initial value is 0.
6194<P>
6195
0001803f 6196<A NAME="IDX160"></A>
17345e5a 6197<DT><CODE>BASH_VERSINFO</CODE>
0001803f 6198<DD><A NAME="IDX161"></A>
17345e5a
JA
6199A readonly array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
6200whose members hold version information for this instance of Bash.
6201The values assigned to the array members are as follows:
6202<P>
6203
6204<DL COMPACT>
6205
6206<DT><CODE>BASH_VERSINFO[0]</CODE>
6207<DD>The major version number (the <VAR>release</VAR>).
6208<P>
6209
6210<DT><CODE>BASH_VERSINFO[1]</CODE>
6211<DD>The minor version number (the <VAR>version</VAR>).
6212<P>
6213
6214<DT><CODE>BASH_VERSINFO[2]</CODE>
6215<DD>The patch level.
6216<P>
6217
6218<DT><CODE>BASH_VERSINFO[3]</CODE>
6219<DD>The build version.
6220<P>
6221
6222<DT><CODE>BASH_VERSINFO[4]</CODE>
6223<DD>The release status (e.g., <VAR>beta1</VAR>).
6224<P>
6225
6226<DT><CODE>BASH_VERSINFO[5]</CODE>
6227<DD>The value of <CODE>MACHTYPE</CODE>.
6228<P>
6229
6230</DL>
6231<P>
6232
0001803f 6233<A NAME="IDX162"></A>
17345e5a 6234<DT><CODE>BASH_VERSION</CODE>
0001803f 6235<DD><A NAME="IDX163"></A>
17345e5a
JA
6236The version number of the current instance of Bash.
6237<P>
6238
0001803f
CR
6239<A NAME="IDX164"></A>
6240<DT><CODE>BASH_XTRACEFD</CODE>
6241<DD><A NAME="IDX165"></A>
6242If set to an integer corresponding to a valid file descriptor, Bash
6243will write the trace output generated when <SAMP>`set -x'</SAMP>
6244is enabled to that file descriptor.
6245This allows tracing output to be separated from diagnostic and error
6246messages.
6247The file descriptor is closed when <CODE>BASH_XTRACEFD</CODE> is unset or assigned
6248a new value.
6249Unsetting <CODE>BASH_XTRACEFD</CODE> or assigning it the empty string causes the
6250trace output to be sent to the standard error.
6251Note that setting <CODE>BASH_XTRACEFD</CODE> to 2 (the standard error file
6252descriptor) and then unsetting it will result in the standard error
6253being closed.
6254<P>
6255
6256<A NAME="IDX166"></A>
17345e5a 6257<DT><CODE>COLUMNS</CODE>
0001803f 6258<DD><A NAME="IDX167"></A>
17345e5a
JA
6259Used by the <CODE>select</CODE> builtin command to determine the terminal width
6260when printing selection lists. Automatically set upon receipt of a
6261<CODE>SIGWINCH</CODE>.
6262<P>
6263
0001803f 6264<A NAME="IDX168"></A>
17345e5a 6265<DT><CODE>COMP_CWORD</CODE>
0001803f 6266<DD><A NAME="IDX169"></A>
17345e5a
JA
6267An index into <CODE>${COMP_WORDS}</CODE> of the word containing the current
6268cursor position.
6269This variable is available only in shell functions invoked by the
6270programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6271<P>
6272
0001803f 6273<A NAME="IDX170"></A>
17345e5a 6274<DT><CODE>COMP_LINE</CODE>
0001803f 6275<DD><A NAME="IDX171"></A>
17345e5a
JA
6276The current command line.
6277This variable is available only in shell functions and external
6278commands invoked by the
6279programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6280<P>
6281
0001803f 6282<A NAME="IDX172"></A>
17345e5a 6283<DT><CODE>COMP_POINT</CODE>
0001803f 6284<DD><A NAME="IDX173"></A>
17345e5a
JA
6285The index of the current cursor position relative to the beginning of
6286the current command.
6287If the current cursor position is at the end of the current command,
6288the value of this variable is equal to <CODE>${#COMP_LINE}</CODE>.
6289This variable is available only in shell functions and external
6290commands invoked by the
6291programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6292<P>
6293
0001803f 6294<A NAME="IDX174"></A>
17345e5a 6295<DT><CODE>COMP_TYPE</CODE>
0001803f 6296<DD><A NAME="IDX175"></A>
17345e5a
JA
6297Set to an integer value corresponding to the type of completion attempted
6298that caused a completion function to be called:
6299<VAR>TAB</VAR>, for normal completion,
6300<SAMP>`?'</SAMP>, for listing completions after successive tabs,
6301<SAMP>`!'</SAMP>, for listing alternatives on partial word completion,
6302<SAMP>`@'</SAMP>, to list completions if the word is not unmodified,
6303or
6304<SAMP>`%'</SAMP>, for menu completion.
6305This variable is available only in shell functions and external
6306commands invoked by the
6307programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6308<P>
6309
0001803f 6310<A NAME="IDX176"></A>
17345e5a 6311<DT><CODE>COMP_KEY</CODE>
0001803f 6312<DD><A NAME="IDX177"></A>
17345e5a
JA
6313The key (or final key of a key sequence) used to invoke the current
6314completion function.
6315<P>
6316
0001803f 6317<A NAME="IDX178"></A>
17345e5a 6318<DT><CODE>COMP_WORDBREAKS</CODE>
0001803f 6319<DD><A NAME="IDX179"></A>
17345e5a
JA
6320The set of characters that the Readline library treats as word
6321separators when performing word completion.
6322If <CODE>COMP_WORDBREAKS</CODE> is unset, it loses its special properties,
6323even if it is subsequently reset.
6324<P>
6325
0001803f 6326<A NAME="IDX180"></A>
17345e5a 6327<DT><CODE>COMP_WORDS</CODE>
0001803f 6328<DD><A NAME="IDX181"></A>
17345e5a
JA
6329An array variable consisting of the individual
6330words in the current command line.
0001803f
CR
6331The line is split into words as Readline would split it, using
6332<CODE>COMP_WORDBREAKS</CODE> as described above.
17345e5a
JA
6333This variable is available only in shell functions invoked by the
6334programmable completion facilities (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6335<P>
6336
0001803f 6337<A NAME="IDX182"></A>
17345e5a 6338<DT><CODE>COMPREPLY</CODE>
0001803f 6339<DD><A NAME="IDX183"></A>
17345e5a
JA
6340An array variable from which Bash reads the possible completions
6341generated by a shell function invoked by the programmable completion
6342facility (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
6343<P>
6344
0001803f 6345<A NAME="IDX184"></A>
17345e5a 6346<DT><CODE>DIRSTACK</CODE>
0001803f 6347<DD><A NAME="IDX185"></A>
17345e5a
JA
6348An array variable containing the current contents of the directory stack.
6349Directories appear in the stack in the order they are displayed by the
6350<CODE>dirs</CODE> builtin.
6351Assigning to members of this array variable may be used to modify
6352directories already in the stack, but the <CODE>pushd</CODE> and <CODE>popd</CODE>
6353builtins must be used to add and remove directories.
6354Assignment to this variable will not change the current directory.
6355If <CODE>DIRSTACK</CODE> is unset, it loses its special properties, even if
6356it is subsequently reset.
6357<P>
6358
0001803f 6359<A NAME="IDX186"></A>
17345e5a 6360<DT><CODE>EMACS</CODE>
0001803f 6361<DD><A NAME="IDX187"></A>
17345e5a
JA
6362If Bash finds this variable in the environment when the shell
6363starts with value <SAMP>`t'</SAMP>, it assumes that the shell is running in an
6364emacs shell buffer and disables line editing.
6365<P>
6366
0001803f 6367<A NAME="IDX188"></A>
17345e5a 6368<DT><CODE>EUID</CODE>
0001803f 6369<DD><A NAME="IDX189"></A>
17345e5a
JA
6370The numeric effective user id of the current user. This variable
6371is readonly.
6372<P>
6373
0001803f 6374<A NAME="IDX190"></A>
17345e5a 6375<DT><CODE>FCEDIT</CODE>
0001803f 6376<DD><A NAME="IDX191"></A>
17345e5a
JA
6377The editor used as a default by the <SAMP>`-e'</SAMP> option to the <CODE>fc</CODE>
6378builtin command.
6379<P>
6380
0001803f 6381<A NAME="IDX192"></A>
17345e5a 6382<DT><CODE>FIGNORE</CODE>
0001803f 6383<DD><A NAME="IDX193"></A>
17345e5a
JA
6384A colon-separated list of suffixes to ignore when performing
6385filename completion.
6386A file name whose suffix matches one of the entries in
6387<CODE>FIGNORE</CODE>
6388is excluded from the list of matched file names. A sample
6389value is <SAMP>`.o:~'</SAMP>
6390<P>
6391
0001803f 6392<A NAME="IDX194"></A>
17345e5a 6393<DT><CODE>FUNCNAME</CODE>
0001803f 6394<DD><A NAME="IDX195"></A>
17345e5a
JA
6395An array variable containing the names of all shell functions
6396currently in the execution call stack.
6397The element with index 0 is the name of any currently-executing
6398shell function.
6399The bottom-most element is <CODE>"main"</CODE>.
6400This variable exists only when a shell function is executing.
6401Assignments to <CODE>FUNCNAME</CODE> have no effect and return an error status.
6402If <CODE>FUNCNAME</CODE> is unset, it loses its special properties, even if
6403it is subsequently reset.
6404<P>
6405
0001803f 6406<A NAME="IDX196"></A>
17345e5a 6407<DT><CODE>GLOBIGNORE</CODE>
0001803f 6408<DD><A NAME="IDX197"></A>
17345e5a
JA
6409A colon-separated list of patterns defining the set of filenames to
6410be ignored by filename expansion.
6411If a filename matched by a filename expansion pattern also matches one
6412of the patterns in <CODE>GLOBIGNORE</CODE>, it is removed from the list
6413of matches.
6414<P>
6415
0001803f 6416<A NAME="IDX198"></A>
17345e5a 6417<DT><CODE>GROUPS</CODE>
0001803f 6418<DD><A NAME="IDX199"></A>
17345e5a
JA
6419An array variable containing the list of groups of which the current
6420user is a member.
6421Assignments to <CODE>GROUPS</CODE> have no effect and return an error status.
6422If <CODE>GROUPS</CODE> is unset, it loses its special properties, even if it is
6423subsequently reset.
6424<P>
6425
0001803f 6426<A NAME="IDX200"></A>
17345e5a 6427<DT><CODE>histchars</CODE>
0001803f 6428<DD><A NAME="IDX201"></A>
17345e5a
JA
6429Up to three characters which control history expansion, quick
6430substitution, and tokenization (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
6431The first character is the
6432<VAR>history expansion</VAR> character, that is, the character which signifies the
6433start of a history expansion, normally <SAMP>`!'</SAMP>. The second character is the
6434character which signifies `quick substitution' when seen as the first
6435character on a line, normally <SAMP>`^'</SAMP>. The optional third character is the
6436character which indicates that the remainder of the line is a comment when
6437found as the first character of a word, usually <SAMP>`#'</SAMP>. The history
6438comment character causes history substitution to be skipped for the
6439remaining words on the line. It does not necessarily cause the shell
6440parser to treat the rest of the line as a comment.
6441<P>
6442
0001803f 6443<A NAME="IDX202"></A>
17345e5a 6444<DT><CODE>HISTCMD</CODE>
0001803f 6445<DD><A NAME="IDX203"></A>
17345e5a
JA
6446The history number, or index in the history list, of the current
6447command. If <CODE>HISTCMD</CODE> is unset, it loses its special properties,
6448even if it is subsequently reset.
6449<P>
6450
0001803f 6451<A NAME="IDX204"></A>
17345e5a 6452<DT><CODE>HISTCONTROL</CODE>
0001803f 6453<DD><A NAME="IDX205"></A>
17345e5a
JA
6454A colon-separated list of values controlling how commands are saved on
6455the history list.
6456If the list of values includes <SAMP>`ignorespace'</SAMP>, lines which begin
6457with a space character are not saved in the history list.
6458A value of <SAMP>`ignoredups'</SAMP> causes lines which match the previous
6459history entry to not be saved.
6460A value of <SAMP>`ignoreboth'</SAMP> is shorthand for
6461<SAMP>`ignorespace'</SAMP> and <SAMP>`ignoredups'</SAMP>.
6462A value of <SAMP>`erasedups'</SAMP> causes all previous lines matching the
6463current line to be removed from the history list before that line
6464is saved.
6465Any value not in the above list is ignored.
6466If <CODE>HISTCONTROL</CODE> is unset, or does not include a valid value,
6467all lines read by the shell parser are saved on the history list,
6468subject to the value of <CODE>HISTIGNORE</CODE>.
6469The second and subsequent lines of a multi-line compound command are
6470not tested, and are added to the history regardless of the value of
6471<CODE>HISTCONTROL</CODE>.
6472<P>
6473
0001803f 6474<A NAME="IDX206"></A>
17345e5a 6475<DT><CODE>HISTFILE</CODE>
0001803f 6476<DD><A NAME="IDX207"></A>
17345e5a
JA
6477The name of the file to which the command history is saved. The
6478default value is <TT>`~/.bash_history'</TT>.
6479<P>
6480
0001803f 6481<A NAME="IDX208"></A>
17345e5a 6482<DT><CODE>HISTFILESIZE</CODE>
0001803f 6483<DD><A NAME="IDX209"></A>
17345e5a
JA
6484The maximum number of lines contained in the history file. When this
6485variable is assigned a value, the history file is truncated, if
6486necessary, by removing the oldest entries,
6487to contain no more than that number of lines.
6488The history file is also truncated to this size after
6489writing it when an interactive shell exits.
6490The default value is 500.
6491<P>
6492
0001803f 6493<A NAME="IDX210"></A>
17345e5a 6494<DT><CODE>HISTIGNORE</CODE>
0001803f 6495<DD><A NAME="IDX211"></A>
17345e5a
JA
6496A colon-separated list of patterns used to decide which command
6497lines should be saved on the history list. Each pattern is
6498anchored at the beginning of the line and must match the complete
6499line (no implicit <SAMP>`*'</SAMP> is appended). Each pattern is tested
6500against the line after the checks specified by <CODE>HISTCONTROL</CODE>
6501are applied. In addition to the normal shell pattern matching
6502characters, <SAMP>`&#38;'</SAMP> matches the previous history line. <SAMP>`&#38;'</SAMP>
6503may be escaped using a backslash; the backslash is removed
6504before attempting a match.
6505The second and subsequent lines of a multi-line compound command are
6506not tested, and are added to the history regardless of the value of
6507<CODE>HISTIGNORE</CODE>.
6508<P>
6509
6510<CODE>HISTIGNORE</CODE> subsumes the function of <CODE>HISTCONTROL</CODE>. A
6511pattern of <SAMP>`&#38;'</SAMP> is identical to <CODE>ignoredups</CODE>, and a
6512pattern of <SAMP>`[ ]*'</SAMP> is identical to <CODE>ignorespace</CODE>.
6513Combining these two patterns, separating them with a colon,
6514provides the functionality of <CODE>ignoreboth</CODE>.
6515</P><P>
6516
0001803f 6517<A NAME="IDX212"></A>
17345e5a 6518<DT><CODE>HISTSIZE</CODE>
0001803f 6519<DD><A NAME="IDX213"></A>
17345e5a
JA
6520The maximum number of commands to remember on the history list.
6521The default value is 500.
6522<P>
6523
0001803f 6524<A NAME="IDX214"></A>
17345e5a 6525<DT><CODE>HISTTIMEFORMAT</CODE>
0001803f 6526<DD><A NAME="IDX215"></A>
17345e5a
JA
6527If this variable is set and not null, its value is used as a format string
6528for <VAR>strftime</VAR> to print the time stamp associated with each history
6529entry displayed by the <CODE>history</CODE> builtin.
6530If this variable is set, time stamps are written to the history file so
6531they may be preserved across shell sessions.
6532This uses the history comment character to distinguish timestamps from
6533other history lines.
6534<P>
6535
0001803f 6536<A NAME="IDX216"></A>
17345e5a 6537<DT><CODE>HOSTFILE</CODE>
0001803f 6538<DD><A NAME="IDX217"></A>
17345e5a
JA
6539Contains the name of a file in the same format as <TT>`/etc/hosts'</TT> that
6540should be read when the shell needs to complete a hostname.
6541The list of possible hostname completions may be changed while the shell
6542is running;
6543the next time hostname completion is attempted after the
6544value is changed, Bash adds the contents of the new file to the
6545existing list.
0001803f
CR
6546If <CODE>HOSTFILE</CODE> is set, but has no value, or does not name a readable file,
6547Bash attempts to read
17345e5a
JA
6548<TT>`/etc/hosts'</TT> to obtain the list of possible hostname completions.
6549When <CODE>HOSTFILE</CODE> is unset, the hostname list is cleared.
6550<P>
6551
0001803f 6552<A NAME="IDX218"></A>
17345e5a 6553<DT><CODE>HOSTNAME</CODE>
0001803f 6554<DD><A NAME="IDX219"></A>
17345e5a
JA
6555The name of the current host.
6556<P>
6557
0001803f 6558<A NAME="IDX220"></A>
17345e5a 6559<DT><CODE>HOSTTYPE</CODE>
0001803f 6560<DD><A NAME="IDX221"></A>
17345e5a
JA
6561A string describing the machine Bash is running on.
6562<P>
6563
0001803f 6564<A NAME="IDX222"></A>
17345e5a 6565<DT><CODE>IGNOREEOF</CODE>
0001803f 6566<DD><A NAME="IDX223"></A>
17345e5a
JA
6567Controls the action of the shell on receipt of an <CODE>EOF</CODE> character
6568as the sole input. If set, the value denotes the number
6569of consecutive <CODE>EOF</CODE> characters that can be read as the
6570first character on an input line
6571before the shell will exit. If the variable exists but does not
6572have a numeric value (or has no value) then the default is 10.
6573If the variable does not exist, then <CODE>EOF</CODE> signifies the end of
6574input to the shell. This is only in effect for interactive shells.
6575<P>
6576
0001803f 6577<A NAME="IDX224"></A>
17345e5a 6578<DT><CODE>INPUTRC</CODE>
0001803f 6579<DD><A NAME="IDX225"></A>
17345e5a
JA
6580The name of the Readline initialization file, overriding the default
6581of <TT>`~/.inputrc'</TT>.
6582<P>
6583
0001803f 6584<A NAME="IDX226"></A>
17345e5a 6585<DT><CODE>LANG</CODE>
0001803f 6586<DD><A NAME="IDX227"></A>
17345e5a
JA
6587Used to determine the locale category for any category not specifically
6588selected with a variable starting with <CODE>LC_</CODE>.
6589<P>
6590
0001803f 6591<A NAME="IDX228"></A>
17345e5a 6592<DT><CODE>LC_ALL</CODE>
0001803f 6593<DD><A NAME="IDX229"></A>
17345e5a
JA
6594This variable overrides the value of <CODE>LANG</CODE> and any other
6595<CODE>LC_</CODE> variable specifying a locale category.
6596<P>
6597
0001803f 6598<A NAME="IDX230"></A>
17345e5a 6599<DT><CODE>LC_COLLATE</CODE>
0001803f 6600<DD><A NAME="IDX231"></A>
17345e5a
JA
6601This variable determines the collation order used when sorting the
6602results of filename expansion, and
6603determines the behavior of range expressions, equivalence classes,
6604and collating sequences within filename expansion and pattern matching
6605(see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
6606<P>
6607
0001803f 6608<A NAME="IDX232"></A>
17345e5a 6609<DT><CODE>LC_CTYPE</CODE>
0001803f 6610<DD><A NAME="IDX233"></A>
17345e5a
JA
6611This variable determines the interpretation of characters and the
6612behavior of character classes within filename expansion and pattern
6613matching (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
6614<P>
6615
0001803f 6616<A NAME="IDX234"></A>
17345e5a 6617<DT><CODE>LC_MESSAGES</CODE>
0001803f 6618<DD><A NAME="IDX235"></A>
17345e5a
JA
6619This variable determines the locale used to translate double-quoted
6620strings preceded by a <SAMP>`$'</SAMP> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
6621<P>
6622
0001803f 6623<A NAME="IDX236"></A>
17345e5a 6624<DT><CODE>LC_NUMERIC</CODE>
0001803f 6625<DD><A NAME="IDX237"></A>
17345e5a
JA
6626This variable determines the locale category used for number formatting.
6627<P>
6628
0001803f 6629<A NAME="IDX238"></A>
17345e5a 6630<DT><CODE>LINENO</CODE>
0001803f 6631<DD><A NAME="IDX239"></A>
17345e5a
JA
6632The line number in the script or shell function currently executing.
6633<P>
6634
0001803f 6635<A NAME="IDX240"></A>
17345e5a 6636<DT><CODE>LINES</CODE>
0001803f 6637<DD><A NAME="IDX241"></A>
17345e5a
JA
6638Used by the <CODE>select</CODE> builtin command to determine the column length
6639for printing selection lists. Automatically set upon receipt of a
6640<CODE>SIGWINCH</CODE>.
6641<P>
6642
0001803f 6643<A NAME="IDX242"></A>
17345e5a 6644<DT><CODE>MACHTYPE</CODE>
0001803f 6645<DD><A NAME="IDX243"></A>
17345e5a
JA
6646A string that fully describes the system type on which Bash
6647is executing, in the standard GNU <VAR>cpu-company-system</VAR> format.
6648<P>
6649
0001803f 6650<A NAME="IDX244"></A>
17345e5a 6651<DT><CODE>MAILCHECK</CODE>
0001803f 6652<DD><A NAME="IDX245"></A>
17345e5a
JA
6653How often (in seconds) that the shell should check for mail in the
6654files specified in the <CODE>MAILPATH</CODE> or <CODE>MAIL</CODE> variables.
6655The default is 60 seconds. When it is time to check
6656for mail, the shell does so before displaying the primary prompt.
6657If this variable is unset, or set to a value that is not a number
6658greater than or equal to zero, the shell disables mail checking.
6659<P>
6660
0001803f 6661<A NAME="IDX246"></A>
17345e5a 6662<DT><CODE>OLDPWD</CODE>
0001803f 6663<DD><A NAME="IDX247"></A>
17345e5a
JA
6664The previous working directory as set by the <CODE>cd</CODE> builtin.
6665<P>
6666
0001803f 6667<A NAME="IDX248"></A>
17345e5a 6668<DT><CODE>OPTERR</CODE>
0001803f 6669<DD><A NAME="IDX249"></A>
17345e5a
JA
6670If set to the value 1, Bash displays error messages
6671generated by the <CODE>getopts</CODE> builtin command.
6672<P>
6673
0001803f 6674<A NAME="IDX250"></A>
17345e5a 6675<DT><CODE>OSTYPE</CODE>
0001803f 6676<DD><A NAME="IDX251"></A>
17345e5a
JA
6677A string describing the operating system Bash is running on.
6678<P>
6679
0001803f 6680<A NAME="IDX252"></A>
17345e5a 6681<DT><CODE>PIPESTATUS</CODE>
0001803f 6682<DD><A NAME="IDX253"></A>
17345e5a
JA
6683An array variable (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>)
6684containing a list of exit status values from the processes
6685in the most-recently-executed foreground pipeline (which may
6686contain only a single command).
6687<P>
6688
0001803f 6689<A NAME="IDX254"></A>
17345e5a 6690<DT><CODE>POSIXLY_CORRECT</CODE>
0001803f 6691<DD><A NAME="IDX255"></A>
17345e5a
JA
6692If this variable is in the environment when <CODE>bash</CODE> starts, the shell
6693enters POSIX mode (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>) before reading the
6694startup files, as if the <SAMP>`--posix'</SAMP> invocation option had been supplied.
6695If it is set while the shell is running, <CODE>bash</CODE> enables POSIX mode,
6696as if the command
6697<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>set -o posix</CODE>
6698</pre></td></tr></table>had been executed.
6699<P>
6700
0001803f 6701<A NAME="IDX256"></A>
17345e5a 6702<DT><CODE>PPID</CODE>
0001803f 6703<DD><A NAME="IDX257"></A>
17345e5a
JA
6704The process ID of the shell's parent process. This variable
6705is readonly.
6706<P>
6707
0001803f 6708<A NAME="IDX258"></A>
17345e5a 6709<DT><CODE>PROMPT_COMMAND</CODE>
0001803f 6710<DD><A NAME="IDX259"></A>
17345e5a
JA
6711If set, the value is interpreted as a command to execute
6712before the printing of each primary prompt (<CODE>$PS1</CODE>).
6713<P>
6714
0001803f 6715<A NAME="IDX260"></A>
17345e5a 6716<DT><CODE>PROMPT_DIRTRIM</CODE>
0001803f 6717<DD><A NAME="IDX261"></A>
17345e5a
JA
6718If set to a number greater than zero, the value is used as the number of
6719trailing directory components to retain when expanding the <CODE>\w</CODE> and
6720<CODE>\W</CODE> prompt string escapes (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
6721Characters removed are replaced with an ellipsis.
6722<P>
6723
0001803f 6724<A NAME="IDX262"></A>
17345e5a 6725<DT><CODE>PS3</CODE>
0001803f 6726<DD><A NAME="IDX263"></A>
17345e5a
JA
6727The value of this variable is used as the prompt for the
6728<CODE>select</CODE> command. If this variable is not set, the
6729<CODE>select</CODE> command prompts with <SAMP>`#? '</SAMP>
6730<P>
6731
0001803f 6732<A NAME="IDX264"></A>
17345e5a 6733<DT><CODE>PS4</CODE>
0001803f 6734<DD><A NAME="IDX265"></A>
17345e5a
JA
6735The value is the prompt printed before the command line is echoed
6736when the <SAMP>`-x'</SAMP> option is set (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
6737The first character of <CODE>PS4</CODE> is replicated multiple times, as
6738necessary, to indicate multiple levels of indirection.
6739The default is <SAMP>`+ '</SAMP>.
6740<P>
6741
0001803f 6742<A NAME="IDX266"></A>
17345e5a 6743<DT><CODE>PWD</CODE>
0001803f 6744<DD><A NAME="IDX267"></A>
17345e5a
JA
6745The current working directory as set by the <CODE>cd</CODE> builtin.
6746<P>
6747
0001803f 6748<A NAME="IDX268"></A>
17345e5a 6749<DT><CODE>RANDOM</CODE>
0001803f 6750<DD><A NAME="IDX269"></A>
17345e5a
JA
6751Each time this parameter is referenced, a random integer
6752between 0 and 32767 is generated. Assigning a value to this
6753variable seeds the random number generator.
6754<P>
6755
0001803f 6756<A NAME="IDX270"></A>
17345e5a 6757<DT><CODE>REPLY</CODE>
0001803f 6758<DD><A NAME="IDX271"></A>
17345e5a
JA
6759The default variable for the <CODE>read</CODE> builtin.
6760<P>
6761
0001803f 6762<A NAME="IDX272"></A>
17345e5a 6763<DT><CODE>SECONDS</CODE>
0001803f 6764<DD><A NAME="IDX273"></A>
17345e5a
JA
6765This variable expands to the number of seconds since the
6766shell was started. Assignment to this variable resets
6767the count to the value assigned, and the expanded value
6768becomes the value assigned plus the number of seconds
6769since the assignment.
6770<P>
6771
0001803f 6772<A NAME="IDX274"></A>
17345e5a 6773<DT><CODE>SHELL</CODE>
0001803f 6774<DD><A NAME="IDX275"></A>
17345e5a
JA
6775The full pathname to the shell is kept in this environment variable.
6776If it is not set when the shell starts,
6777Bash assigns to it the full pathname of the current user's login shell.
6778<P>
6779
0001803f 6780<A NAME="IDX276"></A>
17345e5a 6781<DT><CODE>SHELLOPTS</CODE>
0001803f 6782<DD><A NAME="IDX277"></A>
17345e5a
JA
6783A colon-separated list of enabled shell options. Each word in
6784the list is a valid argument for the <SAMP>`-o'</SAMP> option to the
6785<CODE>set</CODE> builtin command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
6786The options appearing in <CODE>SHELLOPTS</CODE> are those reported
6787as <SAMP>`on'</SAMP> by <SAMP>`set -o'</SAMP>.
6788If this variable is in the environment when Bash
6789starts up, each shell option in the list will be enabled before
6790reading any startup files. This variable is readonly.
6791<P>
6792
0001803f 6793<A NAME="IDX278"></A>
17345e5a 6794<DT><CODE>SHLVL</CODE>
0001803f 6795<DD><A NAME="IDX279"></A>
17345e5a
JA
6796Incremented by one each time a new instance of Bash is started. This is
6797intended to be a count of how deeply your Bash shells are nested.
6798<P>
6799
0001803f 6800<A NAME="IDX280"></A>
17345e5a 6801<DT><CODE>TIMEFORMAT</CODE>
0001803f 6802<DD><A NAME="IDX281"></A>
17345e5a
JA
6803The value of this parameter is used as a format string specifying
6804how the timing information for pipelines prefixed with the <CODE>time</CODE>
6805reserved word should be displayed.
6806The <SAMP>`%'</SAMP> character introduces an
6807escape sequence that is expanded to a time value or other
6808information.
6809The escape sequences and their meanings are as
6810follows; the braces denote optional portions.
6811<P>
6812
6813<DL COMPACT>
6814
6815<DT><CODE>%%</CODE>
6816<DD>A literal <SAMP>`%'</SAMP>.
6817<P>
6818
6819<DT><CODE>%[<VAR>p</VAR>][l]R</CODE>
6820<DD>The elapsed time in seconds.
6821<P>
6822
6823<DT><CODE>%[<VAR>p</VAR>][l]U</CODE>
6824<DD>The number of CPU seconds spent in user mode.
6825<P>
6826
6827<DT><CODE>%[<VAR>p</VAR>][l]S</CODE>
6828<DD>The number of CPU seconds spent in system mode.
6829<P>
6830
6831<DT><CODE>%P</CODE>
6832<DD>The CPU percentage, computed as (%U + %S) / %R.
6833</DL>
6834<P>
6835
6836The optional <VAR>p</VAR> is a digit specifying the precision, the number of
6837fractional digits after a decimal point.
6838A value of 0 causes no decimal point or fraction to be output.
6839At most three places after the decimal point may be specified; values
6840of <VAR>p</VAR> greater than 3 are changed to 3.
6841If <VAR>p</VAR> is not specified, the value 3 is used.
6842</P><P>
6843
6844The optional <CODE>l</CODE> specifies a longer format, including minutes, of
6845the form <VAR>MM</VAR>m<VAR>SS</VAR>.<VAR>FF</VAR>s.
6846The value of <VAR>p</VAR> determines whether or not the fraction is included.
6847</P><P>
6848
6849If this variable is not set, Bash acts as if it had the value
6850<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'</CODE>
6851</pre></td></tr></table>If the value is null, no timing information is displayed.
6852A trailing newline is added when the format string is displayed.
6853</P><P>
6854
0001803f 6855<A NAME="IDX282"></A>
17345e5a 6856<DT><CODE>TMOUT</CODE>
0001803f 6857<DD><A NAME="IDX283"></A>
17345e5a
JA
6858If set to a value greater than zero, <CODE>TMOUT</CODE> is treated as the
6859default timeout for the <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
6860The <CODE>select</CODE> command (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>) terminates
6861if input does not arrive after <CODE>TMOUT</CODE> seconds when input is coming
6862from a terminal.
6863<P>
6864
6865In an interactive shell, the value is interpreted as
6866the number of seconds to wait for input after issuing the primary
6867prompt when the shell is interactive.
6868Bash terminates after that number of seconds if input does
6869not arrive.
6870</P><P>
6871
0001803f 6872<A NAME="IDX284"></A>
17345e5a 6873<DT><CODE>TMPDIR</CODE>
0001803f 6874<DD><A NAME="IDX285"></A>
17345e5a
JA
6875If set, Bash uses its value as the name of a directory in which
6876Bash creates temporary files for the shell's use.
6877<P>
6878
0001803f 6879<A NAME="IDX286"></A>
17345e5a 6880<DT><CODE>UID</CODE>
0001803f 6881<DD><A NAME="IDX287"></A>
17345e5a
JA
6882The numeric real user id of the current user. This variable is readonly.
6883<P>
6884
6885</DL>
6886<P>
6887
6888<A NAME="Bash Features"></A>
6889<HR SIZE="6">
6890<A NAME="SEC68"></A>
6891<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6892<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC67"> &lt; </A>]</TD>
6893<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &gt; </A>]</TD>
6894<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt;&lt; </A>]</TD>
6895<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
6896<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
6897<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6898<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6899<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6900<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6901</TR></TABLE>
6902<H1> 6. Bash Features </H1>
6903<!--docid::SEC68::-->
6904<P>
6905
6906This section describes features unique to Bash.
6907</P><P>
6908
6909<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
6910<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Command line options that you can give
6911 to Bash.</TD></TR>
6912<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>
6913<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>
6914<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
6915 the <CODE>test</CODE> builtin.</TD></TR>
6916<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Arithmetic on shell variables.</TD></TR>
6917<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Substituting one command for another.</TD></TR>
6918<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Array Variables.</TD></TR>
6919<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">History of visited directories.</TD></TR>
6920<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Controlling the PS1 string.</TD></TR>
6921<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A more controlled mode of shell execution.</TD></TR>
6922<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Making Bash behave more closely to what
6923 the POSIX standard specifies.</TD></TR>
6924</TABLE></BLOCKQUOTE>
6925<P>
6926
6927<A NAME="Invoking Bash"></A>
6928<HR SIZE="6">
6929<A NAME="SEC69"></A>
6930<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
6931<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt; </A>]</TD>
6932<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &gt; </A>]</TD>
6933<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt;&lt; </A>]</TD>
6934<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
6935<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
6936<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
6937<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
6938<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
6939<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
6940</TR></TABLE>
6941<H2> 6.1 Invoking Bash </H2>
6942<!--docid::SEC69::-->
6943<P>
6944
6945<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>]
6946bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] -c <VAR>string</VAR> [<VAR>argument</VAR> <small>...</small>]
6947bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <VAR>option</VAR>] [-O <VAR>shopt_option</VAR>] [<VAR>argument</VAR> <small>...</small>]
6948</pre></td></tr></table></P><P>
6949
6950In addition to the single-character shell command-line options
6951(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), there are several multi-character
6952options that you can use. These options must appear on the command
6953line before the single-character options to be recognized.
6954</P><P>
6955
6956<DL COMPACT>
6957<DT><CODE>--debugger</CODE>
6958<DD>Arrange for the debugger profile to be executed before the shell
6959starts. Turns on extended debugging mode (see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
6960for a description of the <CODE>extdebug</CODE> option to the <CODE>shopt</CODE>
6961builtin) and shell function tracing
6962(see <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A> for a description of the <CODE>-o functrace</CODE>
6963option).
6964<P>
6965
6966<DT><CODE>--dump-po-strings</CODE>
6967<DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
6968is printed on the standard output
6969in the GNU <CODE>gettext</CODE> PO (portable object) file format.
6970Equivalent to <SAMP>`-D'</SAMP> except for the output format.
6971<P>
6972
6973<DT><CODE>--dump-strings</CODE>
6974<DD>Equivalent to <SAMP>`-D'</SAMP>.
6975<P>
6976
6977<DT><CODE>--help</CODE>
6978<DD>Display a usage message on standard output and exit successfully.
6979<P>
6980
6981<DT><CODE>--init-file <VAR>filename</VAR></CODE>
6982<DD><DT><CODE>--rcfile <VAR>filename</VAR></CODE>
6983<DD>Execute commands from <VAR>filename</VAR> (instead of <TT>`~/.bashrc'</TT>)
6984in an interactive shell.
6985<P>
6986
6987<DT><CODE>--login</CODE>
6988<DD>Equivalent to <SAMP>`-l'</SAMP>.
6989<P>
6990
6991<DT><CODE>--noediting</CODE>
6992<DD>Do not use the GNU Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>)
6993to read command lines when the shell is interactive.
6994<P>
6995
6996<DT><CODE>--noprofile</CODE>
6997<DD>Don't load the system-wide startup file <TT>`/etc/profile'</TT>
6998or any of the personal initialization files
6999<TT>`~/.bash_profile'</TT>, <TT>`~/.bash_login'</TT>, or <TT>`~/.profile'</TT>
7000when Bash is invoked as a login shell.
7001<P>
7002
7003<DT><CODE>--norc</CODE>
7004<DD>Don't read the <TT>`~/.bashrc'</TT> initialization file in an
7005interactive shell. This is on by default if the shell is
7006invoked as <CODE>sh</CODE>.
7007<P>
7008
7009<DT><CODE>--posix</CODE>
7010<DD>Change the behavior of Bash where the default operation differs
7011from the POSIX standard to match the standard. This
7012is intended to make Bash behave as a strict superset of that
7013standard. See section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>, for a description of the Bash
7014POSIX mode.
7015<P>
7016
7017<DT><CODE>--restricted</CODE>
7018<DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
7019<P>
7020
7021<DT><CODE>--verbose</CODE>
7022<DD>Equivalent to <SAMP>`-v'</SAMP>. Print shell input lines as they're read.
7023<P>
7024
7025<DT><CODE>--version</CODE>
7026<DD>Show version information for this instance of
7027Bash on the standard output and exit successfully.
7028<P>
7029
7030</DL>
7031<P>
7032
7033There are several single-character options that may be supplied at
7034invocation which are not available with the <CODE>set</CODE> builtin.
7035</P><P>
7036
7037<DL COMPACT>
7038<DT><CODE>-c <VAR>string</VAR></CODE>
7039<DD>Read and execute commands from <VAR>string</VAR> after processing the
7040options, then exit. Any remaining arguments are assigned to the
7041positional parameters, starting with <CODE>$0</CODE>.
7042<P>
7043
7044<DT><CODE>-i</CODE>
7045<DD>Force the shell to run interactively. Interactive shells are
7046described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>.
7047<P>
7048
7049<DT><CODE>-l</CODE>
7050<DD>Make this shell act as if it had been directly invoked by login.
7051When the shell is interactive, this is equivalent to starting a
7052login shell with <SAMP>`exec -l bash'</SAMP>.
7053When the shell is not interactive, the login shell startup files will
7054be executed.
7055<SAMP>`exec bash -l'</SAMP> or <SAMP>`exec bash --login'</SAMP>
7056will replace the current shell with a Bash login shell.
7057See section <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>, for a description of the special behavior
7058of a login shell.
7059<P>
7060
7061<DT><CODE>-r</CODE>
7062<DD>Make the shell a restricted shell (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>).
7063<P>
7064
7065<DT><CODE>-s</CODE>
7066<DD>If this option is present, or if no arguments remain after option
7067processing, then commands are read from the standard input.
7068This option allows the positional parameters to be set
7069when invoking an interactive shell.
7070<P>
7071
7072<DT><CODE>-D</CODE>
7073<DD>A list of all double-quoted strings preceded by <SAMP>`$'</SAMP>
7074is printed on the standard output.
7075These are the strings that
7076are subject to language translation when the current locale
7077is not <CODE>C</CODE> or <CODE>POSIX</CODE> (see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
7078This implies the <SAMP>`-n'</SAMP> option; no commands will be executed.
7079<P>
7080
7081<DT><CODE>[-+]O [<VAR>shopt_option</VAR>]</CODE>
7082<DD><VAR>shopt_option</VAR> is one of the shell options accepted by the
7083<CODE>shopt</CODE> builtin (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7084If <VAR>shopt_option</VAR> is present, <SAMP>`-O'</SAMP> sets the value of that option;
7085<SAMP>`+O'</SAMP> unsets it.
7086If <VAR>shopt_option</VAR> is not supplied, the names and values of the shell
7087options accepted by <CODE>shopt</CODE> are printed on the standard output.
7088If the invocation option is <SAMP>`+O'</SAMP>, the output is displayed in a format
7089that may be reused as input.
7090<P>
7091
7092<DT><CODE>--</CODE>
7093<DD>A <CODE>--</CODE> signals the end of options and disables further option
7094processing.
7095Any arguments after the <CODE>--</CODE> are treated as filenames and arguments.
7096<P>
7097
7098</DL>
7099<P>
7100
0001803f 7101<A NAME="IDX288"></A>
17345e5a
JA
7102A <EM>login</EM> shell is one whose first character of argument zero is
7103<SAMP>`-'</SAMP>, or one invoked with the <SAMP>`--login'</SAMP> option.
7104</P><P>
7105
0001803f 7106<A NAME="IDX289"></A>
17345e5a
JA
7107An <EM>interactive</EM> shell is one started without non-option arguments,
7108unless <SAMP>`-s'</SAMP> is specified,
7109without specifying the <SAMP>`-c'</SAMP> option, and whose input and output are both
7110connected to terminals (as determined by <CODE>isatty(3)</CODE>), or one
7111started with the <SAMP>`-i'</SAMP> option. See section <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>, for more
7112information.
7113</P><P>
7114
7115If arguments remain after option processing, and neither the
7116<SAMP>`-c'</SAMP> nor the <SAMP>`-s'</SAMP>
7117option has been supplied, the first argument is assumed to
7118be the name of a file containing shell commands (see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>).
7119When Bash is invoked in this fashion, <CODE>$0</CODE>
7120is set to the name of the file, and the positional parameters
7121are set to the remaining arguments.
7122Bash reads and executes commands from this file, then exits.
7123Bash's exit status is the exit status of the last command executed
7124in the script. If no commands are executed, the exit status is 0.
7125</P><P>
7126
7127<A NAME="Bash Startup Files"></A>
7128<HR SIZE="6">
7129<A NAME="SEC70"></A>
7130<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7131<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC69"> &lt; </A>]</TD>
7132<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> &gt; </A>]</TD>
7133<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> &lt;&lt; </A>]</TD>
7134<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7135<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7136<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7137<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7138<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7139<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7140</TR></TABLE>
7141<H2> 6.2 Bash Startup Files </H2>
7142<!--docid::SEC70::-->
7143<P>
7144
7145This section describes how Bash executes its startup files.
7146If any of the files exist but cannot be read, Bash reports an error.
7147Tildes are expanded in file names as described above under
7148Tilde Expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
7149</P><P>
7150
7151Interactive shells are described in <A HREF="bashref.html#SEC78">6.3 Interactive Shells</A>.
7152</P><P>
7153
7154<A NAME="SEC71"></A>
7155<H4> Invoked as an interactive login shell, or with <SAMP>`--login'</SAMP> </H4>
7156<!--docid::SEC71::-->
7157<P>
7158
7159When Bash is invoked as an interactive login shell, or as a
7160non-interactive shell with the <SAMP>`--login'</SAMP> option, it first reads and
7161executes commands from the file <TT>`/etc/profile'</TT>, if that file exists.
7162After reading that file, it looks for <TT>`~/.bash_profile'</TT>,
7163<TT>`~/.bash_login'</TT>, and <TT>`~/.profile'</TT>, in that order, and reads
7164and executes commands from the first one that exists and is readable.
7165The <SAMP>`--noprofile'</SAMP> option may be used when the shell is started to
7166inhibit this behavior.
7167</P><P>
7168
7169When a login shell exits, Bash reads and executes commands from
7170the file <TT>`~/.bash_logout'</TT>, if it exists.
7171</P><P>
7172
7173<A NAME="SEC72"></A>
7174<H4> Invoked as an interactive non-login shell </H4>
7175<!--docid::SEC72::-->
7176<P>
7177
7178When an interactive shell that is not a login shell is started, Bash
7179reads and executes commands from <TT>`~/.bashrc'</TT>, if that file exists.
7180This may be inhibited by using the <SAMP>`--norc'</SAMP> option.
7181The <SAMP>`--rcfile <VAR>file</VAR>'</SAMP> option will force Bash to read and
7182execute commands from <VAR>file</VAR> instead of <TT>`~/.bashrc'</TT>.
7183</P><P>
7184
7185So, typically, your <TT>`~/.bash_profile'</TT> contains the line
7186<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>if [ -f ~/.bashrc ]; then . ~/.bashrc; fi</CODE>
7187</pre></td></tr></table>after (or before) any login-specific initializations.
7188</P><P>
7189
7190<A NAME="SEC73"></A>
7191<H4> Invoked non-interactively </H4>
7192<!--docid::SEC73::-->
7193<P>
7194
7195When Bash is started non-interactively, to run a shell script,
7196for example, it looks for the variable <CODE>BASH_ENV</CODE> in the environment,
7197expands its value if it appears there, and uses the expanded value as
7198the name of a file to read and execute. Bash behaves as if the
7199following command were executed:
7200<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi</CODE>
7201</pre></td></tr></table>but the value of the <CODE>PATH</CODE> variable is not used to search for the
7202file name.
7203</P><P>
7204
7205As noted above, if a non-interactive shell is invoked with the
7206<SAMP>`--login'</SAMP> option, Bash attempts to read and execute commands from the
7207login shell startup files.
7208</P><P>
7209
7210<A NAME="SEC74"></A>
7211<H4> Invoked with name <CODE>sh</CODE> </H4>
7212<!--docid::SEC74::-->
7213<P>
7214
7215If Bash is invoked with the name <CODE>sh</CODE>, it tries to mimic the
7216startup behavior of historical versions of <CODE>sh</CODE> as closely as
7217possible, while conforming to the POSIX standard as well.
7218</P><P>
7219
7220When invoked as an interactive login shell, or as a non-interactive
7221shell with the <SAMP>`--login'</SAMP> option, it first attempts to read
7222and execute commands from <TT>`/etc/profile'</TT> and <TT>`~/.profile'</TT>, in
7223that order.
7224The <SAMP>`--noprofile'</SAMP> option may be used to inhibit this behavior.
7225When invoked as an interactive shell with the name <CODE>sh</CODE>, Bash
7226looks for the variable <CODE>ENV</CODE>, expands its value if it is defined,
7227and uses the expanded value as the name of a file to read and execute.
7228Since a shell invoked as <CODE>sh</CODE> does not attempt to read and execute
7229commands from any other startup files, the <SAMP>`--rcfile'</SAMP> option has
7230no effect.
7231A non-interactive shell invoked with the name <CODE>sh</CODE> does not attempt
7232to read any other startup files.
7233</P><P>
7234
7235When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after
7236the startup files are read.
7237</P><P>
7238
7239<A NAME="SEC75"></A>
7240<H4> Invoked in POSIX mode </H4>
7241<!--docid::SEC75::-->
7242<P>
7243
7244When Bash is started in POSIX mode, as with the
7245<SAMP>`--posix'</SAMP> command line option, it follows the POSIX standard
7246for startup files.
7247In this mode, interactive shells expand the <CODE>ENV</CODE> variable
7248and commands are read and executed from the file whose name is the
7249expanded value.
7250No other startup files are read.
7251</P><P>
7252
7253<A NAME="SEC76"></A>
7254<H4> Invoked by remote shell daemon </H4>
7255<!--docid::SEC76::-->
7256<P>
7257
7258Bash attempts to determine when it is being run with its standard input
7259connected to a a network connection, as if by the remote shell
7260daemon, usually <CODE>rshd</CODE>, or the secure shell daemon <CODE>sshd</CODE>.
7261If Bash determines it is being run in
7262this fashion, it reads and executes commands from <TT>`~/.bashrc'</TT>, if that
7263file exists and is readable.
7264It will not do this if invoked as <CODE>sh</CODE>.
7265The <SAMP>`--norc'</SAMP> option may be used to inhibit this behavior, and the
7266<SAMP>`--rcfile'</SAMP> option may be used to force another file to be read, but
7267<CODE>rshd</CODE> does not generally invoke the shell with those options or
7268allow them to be specified.
7269</P><P>
7270
7271<A NAME="SEC77"></A>
7272<H4> Invoked with unequal effective and real UID/GIDs </H4>
7273<!--docid::SEC77::-->
7274<P>
7275
7276If Bash is started with the effective user (group) id not equal to the
7277real user (group) id, and the <CODE>-p</CODE> option is not supplied, no startup
7278files are read, shell functions are not inherited from the environment,
0001803f
CR
7279the <CODE>SHELLOPTS</CODE>, <CODE>BASHOPTS</CODE>, <CODE>CDPATH</CODE>, and <CODE>GLOBIGNORE</CODE>
7280variables, if they appear in the environment, are ignored, and the effective
7281user id is set to the real user id.
17345e5a
JA
7282If the <CODE>-p</CODE> option is supplied at invocation, the startup behavior is
7283the same, but the effective user id is not reset.
7284</P><P>
7285
7286<A NAME="Interactive Shells"></A>
7287<HR SIZE="6">
7288<A NAME="SEC78"></A>
7289<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7290<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &lt; </A>]</TD>
7291<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> &gt; </A>]</TD>
7292<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt;&lt; </A>]</TD>
7293<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7294<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7295<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7296<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7297<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7298<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7299</TR></TABLE>
7300<H2> 6.3 Interactive Shells </H2>
7301<!--docid::SEC78::-->
7302<P>
7303
7304<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
7305<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What determines whether a shell is Interactive.</TD></TR>
7306<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to tell if a shell is interactive.</TD></TR>
7307<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What changes in a interactive shell?</TD></TR>
7308</TABLE></BLOCKQUOTE>
7309<P>
7310
7311<A NAME="What is an Interactive Shell?"></A>
7312<HR SIZE="6">
7313<A NAME="SEC79"></A>
7314<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7315<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> &lt; </A>]</TD>
7316<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> &gt; </A>]</TD>
7317<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt;&lt; </A>]</TD>
7318<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7319<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7320<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7321<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7322<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7323<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7324</TR></TABLE>
7325<H3> 6.3.1 What is an Interactive Shell? </H3>
7326<!--docid::SEC79::-->
7327<P>
7328
7329An interactive shell
7330is one started without non-option arguments, unless <SAMP>`-s'</SAMP> is
7331specified, without specifying the <SAMP>`-c'</SAMP> option, and
7332whose input and error output are both
7333connected to terminals (as determined by <CODE>isatty(3)</CODE>),
7334or one started with the <SAMP>`-i'</SAMP> option.
7335</P><P>
7336
7337An interactive shell generally reads from and writes to a user's
7338terminal.
7339</P><P>
7340
7341The <SAMP>`-s'</SAMP> invocation option may be used to set the positional parameters
7342when an interactive shell is started.
7343</P><P>
7344
7345<A NAME="Is this Shell Interactive?"></A>
7346<HR SIZE="6">
7347<A NAME="SEC80"></A>
7348<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7349<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC79"> &lt; </A>]</TD>
7350<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &gt; </A>]</TD>
7351<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &lt;&lt; </A>]</TD>
7352<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7353<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7354<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7355<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7356<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7357<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7358</TR></TABLE>
7359<H3> 6.3.2 Is this Shell Interactive? </H3>
7360<!--docid::SEC80::-->
7361<P>
7362
7363To determine within a startup script whether or not Bash is
7364running interactively,
7365test the value of the <SAMP>`-'</SAMP> special parameter.
7366It contains <CODE>i</CODE> when the shell is interactive. For example:
7367</P><P>
7368
7369<TABLE><tr><td>&nbsp;</td><td class=example><pre>case "$-" in
7370*i*) echo This shell is interactive ;;
7371*) echo This shell is not interactive ;;
7372esac
7373</pre></td></tr></table></P><P>
7374
7375Alternatively, startup scripts may examine the variable
7376<CODE>PS1</CODE>; it is unset in non-interactive shells, and set in
7377interactive shells. Thus:
7378</P><P>
7379
7380<TABLE><tr><td>&nbsp;</td><td class=example><pre>if [ -z "$PS1" ]; then
7381 echo This shell is not interactive
7382else
7383 echo This shell is interactive
7384fi
7385</pre></td></tr></table></P><P>
7386
7387<A NAME="Interactive Shell Behavior"></A>
7388<HR SIZE="6">
7389<A NAME="SEC81"></A>
7390<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7391<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC80"> &lt; </A>]</TD>
7392<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt; </A>]</TD>
7393<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt;&lt; </A>]</TD>
7394<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC78"> Up </A>]</TD>
7395<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &gt;&gt; </A>]</TD>
7396<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7397<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7398<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7399<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7400</TR></TABLE>
7401<H3> 6.3.3 Interactive Shell Behavior </H3>
7402<!--docid::SEC81::-->
7403<P>
7404
7405When the shell is running interactively, it changes its behavior in
7406several ways.
7407</P><P>
7408
7409<OL>
7410<LI>
7411Startup files are read and executed as described in <A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>.
7412<P>
7413
7414<LI>
7415Job Control (see section <A HREF="bashref.html#SEC91">7. Job Control</A>) is enabled by default. When job
7416control is in effect, Bash ignores the keyboard-generated job control
7417signals <CODE>SIGTTIN</CODE>, <CODE>SIGTTOU</CODE>, and <CODE>SIGTSTP</CODE>.
7418<P>
7419
7420<LI>
7421Bash expands and displays <CODE>PS1</CODE> before reading the first line
7422of a command, and expands and displays <CODE>PS2</CODE> before reading the
7423second and subsequent lines of a multi-line command.
7424<P>
7425
7426<LI>
7427Bash executes the value of the <CODE>PROMPT_COMMAND</CODE> variable as a command
7428before printing the primary prompt, <CODE>$PS1</CODE>
7429(see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7430<P>
7431
7432<LI>
7433Readline (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) is used to read commands from
7434the user's terminal.
7435<P>
7436
7437<LI>
7438Bash inspects the value of the <CODE>ignoreeof</CODE> option to <CODE>set -o</CODE>
7439instead of exiting immediately when it receives an <CODE>EOF</CODE> on its
7440standard input when reading a command (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7441<P>
7442
7443<LI>
7444Command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>)
7445and history expansion (see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>)
7446are enabled by default.
7447Bash will save the command history to the file named by <CODE>$HISTFILE</CODE>
7448when an interactive shell exits.
7449<P>
7450
7451<LI>
7452Alias expansion (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>) is performed by default.
7453<P>
7454
7455<LI>
7456In the absence of any traps, Bash ignores <CODE>SIGTERM</CODE>
7457(see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7458<P>
7459
7460<LI>
7461In the absence of any traps, <CODE>SIGINT</CODE> is caught and handled
7462((see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7463<CODE>SIGINT</CODE> will interrupt some shell builtins.
7464<P>
7465
7466<LI>
7467An interactive login shell sends a <CODE>SIGHUP</CODE> to all jobs on exit
7468if the <CODE>huponexit</CODE> shell option has been enabled (see section <A HREF="bashref.html#SEC56">3.7.6 Signals</A>).
7469<P>
7470
7471<LI>
7472The <SAMP>`-n'</SAMP> invocation option is ignored, and <SAMP>`set -n'</SAMP> has
7473no effect (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7474<P>
7475
7476<LI>
7477Bash will check for mail periodically, depending on the values of the
7478<CODE>MAIL</CODE>, <CODE>MAILPATH</CODE>, and <CODE>MAILCHECK</CODE> shell variables
7479(see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7480<P>
7481
7482<LI>
7483Expansion errors due to references to unbound shell variables after
7484<SAMP>`set -u'</SAMP> has been enabled will not cause the shell to exit
7485(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7486<P>
7487
7488<LI>
7489The shell will not exit on expansion errors caused by <VAR>var</VAR> being unset
7490or null in <CODE>${<VAR>var</VAR>:?<VAR>word</VAR>}</CODE> expansions
7491(see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
7492<P>
7493
7494<LI>
7495Redirection errors encountered by shell builtins will not cause the
7496shell to exit.
7497<P>
7498
7499<LI>
7500When running in POSIX mode, a special builtin returning an error
7501status will not cause the shell to exit (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
7502<P>
7503
7504<LI>
7505A failed <CODE>exec</CODE> will not cause the shell to exit
7506(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
7507<P>
7508
7509<LI>
7510Parser syntax errors will not cause the shell to exit.
7511<P>
7512
7513<LI>
7514Simple spelling correction for directory arguments to the <CODE>cd</CODE>
7515builtin is enabled by default (see the description of the <CODE>cdspell</CODE>
7516option to the <CODE>shopt</CODE> builtin in <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7517<P>
7518
7519<LI>
7520The shell will check the value of the <CODE>TMOUT</CODE> variable and exit
7521if a command is not read within the specified number of seconds after
7522printing <CODE>$PS1</CODE> (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
7523<P>
7524
7525</OL>
7526<P>
7527
7528<A NAME="Bash Conditional Expressions"></A>
7529<HR SIZE="6">
7530<A NAME="SEC82"></A>
7531<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7532<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC81"> &lt; </A>]</TD>
7533<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &gt; </A>]</TD>
7534<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt;&lt; </A>]</TD>
7535<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7536<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7537<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7538<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7539<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7540<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7541</TR></TABLE>
7542<H2> 6.4 Bash Conditional Expressions </H2>
7543<!--docid::SEC82::-->
7544<P>
7545
7546Conditional expressions are used by the <CODE>[[</CODE> compound command
7547and the <CODE>test</CODE> and <CODE>[</CODE> builtin commands.
7548</P><P>
7549
7550Expressions may be unary or binary.
7551Unary expressions are often used to examine the status of a file.
7552There are string operators and numeric comparison operators as well.
7553If the <VAR>file</VAR> argument to one of the primaries is of the form
7554<TT>`/dev/fd/<VAR>N</VAR>'</TT>, then file descriptor <VAR>N</VAR> is checked.
7555If the <VAR>file</VAR> argument to one of the primaries is one of
7556<TT>`/dev/stdin'</TT>, <TT>`/dev/stdout'</TT>, or <TT>`/dev/stderr'</TT>, file
7557descriptor 0, 1, or 2, respectively, is checked.
7558</P><P>
7559
0001803f
CR
7560When used with <SAMP>`[['</SAMP>, The <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
7561lexicographically using the current locale.
7562</P><P>
7563
17345e5a
JA
7564Unless otherwise specified, primaries that operate on files follow symbolic
7565links and operate on the target of the link, rather than the link itself.
7566</P><P>
7567
7568<DL COMPACT>
7569<DT><CODE>-a <VAR>file</VAR></CODE>
7570<DD>True if <VAR>file</VAR> exists.
7571<P>
7572
7573<DT><CODE>-b <VAR>file</VAR></CODE>
7574<DD>True if <VAR>file</VAR> exists and is a block special file.
7575<P>
7576
7577<DT><CODE>-c <VAR>file</VAR></CODE>
7578<DD>True if <VAR>file</VAR> exists and is a character special file.
7579<P>
7580
7581<DT><CODE>-d <VAR>file</VAR></CODE>
7582<DD>True if <VAR>file</VAR> exists and is a directory.
7583<P>
7584
7585<DT><CODE>-e <VAR>file</VAR></CODE>
7586<DD>True if <VAR>file</VAR> exists.
7587<P>
7588
7589<DT><CODE>-f <VAR>file</VAR></CODE>
7590<DD>True if <VAR>file</VAR> exists and is a regular file.
7591<P>
7592
7593<DT><CODE>-g <VAR>file</VAR></CODE>
7594<DD>True if <VAR>file</VAR> exists and its set-group-id bit is set.
7595<P>
7596
7597<DT><CODE>-h <VAR>file</VAR></CODE>
7598<DD>True if <VAR>file</VAR> exists and is a symbolic link.
7599<P>
7600
7601<DT><CODE>-k <VAR>file</VAR></CODE>
7602<DD>True if <VAR>file</VAR> exists and its "sticky" bit is set.
7603<P>
7604
7605<DT><CODE>-p <VAR>file</VAR></CODE>
7606<DD>True if <VAR>file</VAR> exists and is a named pipe (FIFO).
7607<P>
7608
7609<DT><CODE>-r <VAR>file</VAR></CODE>
7610<DD>True if <VAR>file</VAR> exists and is readable.
7611<P>
7612
7613<DT><CODE>-s <VAR>file</VAR></CODE>
7614<DD>True if <VAR>file</VAR> exists and has a size greater than zero.
7615<P>
7616
7617<DT><CODE>-t <VAR>fd</VAR></CODE>
7618<DD>True if file descriptor <VAR>fd</VAR> is open and refers to a terminal.
7619<P>
7620
7621<DT><CODE>-u <VAR>file</VAR></CODE>
7622<DD>True if <VAR>file</VAR> exists and its set-user-id bit is set.
7623<P>
7624
7625<DT><CODE>-w <VAR>file</VAR></CODE>
7626<DD>True if <VAR>file</VAR> exists and is writable.
7627<P>
7628
7629<DT><CODE>-x <VAR>file</VAR></CODE>
7630<DD>True if <VAR>file</VAR> exists and is executable.
7631<P>
7632
7633<DT><CODE>-O <VAR>file</VAR></CODE>
7634<DD>True if <VAR>file</VAR> exists and is owned by the effective user id.
7635<P>
7636
7637<DT><CODE>-G <VAR>file</VAR></CODE>
7638<DD>True if <VAR>file</VAR> exists and is owned by the effective group id.
7639<P>
7640
7641<DT><CODE>-L <VAR>file</VAR></CODE>
7642<DD>True if <VAR>file</VAR> exists and is a symbolic link.
7643<P>
7644
7645<DT><CODE>-S <VAR>file</VAR></CODE>
7646<DD>True if <VAR>file</VAR> exists and is a socket.
7647<P>
7648
7649<DT><CODE>-N <VAR>file</VAR></CODE>
7650<DD>True if <VAR>file</VAR> exists and has been modified since it was last read.
7651<P>
7652
7653<DT><CODE><VAR>file1</VAR> -nt <VAR>file2</VAR></CODE>
7654<DD>True if <VAR>file1</VAR> is newer (according to modification date)
7655than <VAR>file2</VAR>, or if <VAR>file1</VAR> exists and <VAR>file2</VAR> does not.
7656<P>
7657
7658<DT><CODE><VAR>file1</VAR> -ot <VAR>file2</VAR></CODE>
7659<DD>True if <VAR>file1</VAR> is older than <VAR>file2</VAR>,
7660or if <VAR>file2</VAR> exists and <VAR>file1</VAR> does not.
7661<P>
7662
7663<DT><CODE><VAR>file1</VAR> -ef <VAR>file2</VAR></CODE>
7664<DD>True if <VAR>file1</VAR> and <VAR>file2</VAR> refer to the same device and
7665inode numbers.
7666<P>
7667
7668<DT><CODE>-o <VAR>optname</VAR></CODE>
7669<DD>True if shell option <VAR>optname</VAR> is enabled.
7670The list of options appears in the description of the <SAMP>`-o'</SAMP>
7671option to the <CODE>set</CODE> builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
7672<P>
7673
7674<DT><CODE>-z <VAR>string</VAR></CODE>
7675<DD>True if the length of <VAR>string</VAR> is zero.
7676<P>
7677
7678<DT><CODE>-n <VAR>string</VAR></CODE>
7679<DD><DT><CODE><VAR>string</VAR></CODE>
7680<DD>True if the length of <VAR>string</VAR> is non-zero.
7681<P>
7682
7683<DT><CODE><VAR>string1</VAR> == <VAR>string2</VAR></CODE>
0001803f 7684<DD><DT><CODE><VAR>string1</VAR> = <VAR>string2</VAR></CODE>
17345e5a 7685<DD>True if the strings are equal.
0001803f 7686<SAMP>`='</SAMP> should be used with the <CODE>test</CODE> command for POSIX conformance.
17345e5a
JA
7687<P>
7688
7689<DT><CODE><VAR>string1</VAR> != <VAR>string2</VAR></CODE>
7690<DD>True if the strings are not equal.
7691<P>
7692
7693<DT><CODE><VAR>string1</VAR> &#60; <VAR>string2</VAR></CODE>
0001803f 7694<DD>True if <VAR>string1</VAR> sorts before <VAR>string2</VAR> lexicographically.
17345e5a
JA
7695<P>
7696
7697<DT><CODE><VAR>string1</VAR> &#62; <VAR>string2</VAR></CODE>
0001803f 7698<DD>True if <VAR>string1</VAR> sorts after <VAR>string2</VAR> lexicographically.
17345e5a
JA
7699<P>
7700
7701<DT><CODE><VAR>arg1</VAR> OP <VAR>arg2</VAR></CODE>
7702<DD><CODE>OP</CODE> is one of
7703<SAMP>`-eq'</SAMP>, <SAMP>`-ne'</SAMP>, <SAMP>`-lt'</SAMP>, <SAMP>`-le'</SAMP>, <SAMP>`-gt'</SAMP>, or <SAMP>`-ge'</SAMP>.
7704These arithmetic binary operators return true if <VAR>arg1</VAR>
7705is equal to, not equal to, less than, less than or equal to,
7706greater than, or greater than or equal to <VAR>arg2</VAR>,
7707respectively. <VAR>Arg1</VAR> and <VAR>arg2</VAR>
7708may be positive or negative integers.
7709<P>
7710
7711</DL>
7712<P>
7713
7714<A NAME="Shell Arithmetic"></A>
7715<HR SIZE="6">
7716<A NAME="SEC83"></A>
7717<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7718<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC82"> &lt; </A>]</TD>
7719<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &gt; </A>]</TD>
7720<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &lt;&lt; </A>]</TD>
7721<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7722<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7723<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7724<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7725<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7726<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7727</TR></TABLE>
7728<H2> 6.5 Shell Arithmetic </H2>
7729<!--docid::SEC83::-->
7730<P>
7731
7732The shell allows arithmetic expressions to be evaluated, as one of
7733the shell expansions or by the <CODE>let</CODE> and the <SAMP>`-i'</SAMP> option
7734to the <CODE>declare</CODE> builtins.
7735</P><P>
7736
7737Evaluation is done in fixed-width integers with no check for overflow,
7738though division by 0 is trapped and flagged as an error.
7739The operators and their precedence, associativity, and values
7740are the same as in the C language.
7741The following list of operators is grouped into levels of
7742equal-precedence operators.
7743The levels are listed in order of decreasing precedence.
7744</P><P>
7745
7746<DL COMPACT>
7747
7748<DT><CODE><VAR>id</VAR>++ <VAR>id</VAR>--</CODE>
7749<DD>variable post-increment and post-decrement
7750<P>
7751
7752<DT><CODE>++<VAR>id</VAR> --<VAR>id</VAR></CODE>
7753<DD>variable pre-increment and pre-decrement
7754<P>
7755
7756<DT><CODE>- +</CODE>
7757<DD>unary minus and plus
7758<P>
7759
7760<DT><CODE>! ~</CODE>
7761<DD>logical and bitwise negation
7762<P>
7763
7764<DT><CODE>**</CODE>
7765<DD>exponentiation
7766<P>
7767
7768<DT><CODE>* / %</CODE>
7769<DD>multiplication, division, remainder
7770<P>
7771
7772<DT><CODE>+ -</CODE>
7773<DD>addition, subtraction
7774<P>
7775
7776<DT><CODE>&#60;&#60; &#62;&#62;</CODE>
7777<DD>left and right bitwise shifts
7778<P>
7779
7780<DT><CODE>&#60;= &#62;= &#60; &#62;</CODE>
7781<DD>comparison
7782<P>
7783
7784<DT><CODE>== !=</CODE>
7785<DD>equality and inequality
7786<P>
7787
7788<DT><CODE>&#38;</CODE>
7789<DD>bitwise AND
7790<P>
7791
7792<DT><CODE>^</CODE>
7793<DD>bitwise exclusive OR
7794<P>
7795
7796<DT><CODE>|</CODE>
7797<DD>bitwise OR
7798<P>
7799
7800<DT><CODE>&#38;&#38;</CODE>
7801<DD>logical AND
7802<P>
7803
7804<DT><CODE>||</CODE>
7805<DD>logical OR
7806<P>
7807
7808<DT><CODE>expr ? expr : expr</CODE>
7809<DD>conditional operator
7810<P>
7811
7812<DT><CODE>= *= /= %= += -= &#60;&#60;= &#62;&#62;= &#38;= ^= |=</CODE>
7813<DD>assignment
7814<P>
7815
7816<DT><CODE>expr1 , expr2</CODE>
7817<DD>comma
7818</DL>
7819<P>
7820
7821Shell variables are allowed as operands; parameter expansion is
7822performed before the expression is evaluated.
7823Within an expression, shell variables may also be referenced by name
7824without using the parameter expansion syntax.
7825A shell variable that is null or unset evaluates to 0 when referenced
7826by name without using the parameter expansion syntax.
7827The value of a variable is evaluated as an arithmetic expression
7828when it is referenced, or when a variable which has been given the
7829<VAR>integer</VAR> attribute using <SAMP>`declare -i'</SAMP> is assigned a value.
7830A null value evaluates to 0.
7831A shell variable need not have its integer attribute turned on
7832to be used in an expression.
7833</P><P>
7834
7835Constants with a leading 0 are interpreted as octal numbers.
7836A leading <SAMP>`0x'</SAMP> or <SAMP>`0X'</SAMP> denotes hexadecimal. Otherwise,
7837numbers take the form [<VAR>base</VAR><CODE>#</CODE>]<VAR>n</VAR>, where <VAR>base</VAR>
7838is a decimal number between 2 and 64 representing the arithmetic
7839base, and <VAR>n</VAR> is a number in that base. If <VAR>base</VAR><CODE>#</CODE> is
7840omitted, then base 10 is used.
7841The digits greater than 9 are represented by the lowercase letters,
7842the uppercase letters, <SAMP>`@'</SAMP>, and <SAMP>`_'</SAMP>, in that order.
7843If <VAR>base</VAR> is less than or equal to 36, lowercase and uppercase
7844letters may be used interchangeably to represent numbers between 10
7845and 35.
7846</P><P>
7847
7848Operators are evaluated in order of precedence. Sub-expressions in
7849parentheses are evaluated first and may override the precedence
7850rules above.
7851</P><P>
7852
7853<A NAME="Aliases"></A>
7854<HR SIZE="6">
7855<A NAME="SEC84"></A>
7856<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7857<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC83"> &lt; </A>]</TD>
7858<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &gt; </A>]</TD>
7859<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &lt;&lt; </A>]</TD>
7860<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7861<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7862<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7863<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7864<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7865<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7866</TR></TABLE>
7867<H2> 6.6 Aliases </H2>
7868<!--docid::SEC84::-->
7869<P>
7870
7871<VAR>Aliases</VAR> allow a string to be substituted for a word when it is used
7872as the first word of a simple command.
7873The shell maintains a list of aliases that may be set and unset with
7874the <CODE>alias</CODE> and <CODE>unalias</CODE> builtin commands.
7875</P><P>
7876
7877The first word of each simple command, if unquoted, is checked to see
7878if it has an alias.
7879If so, that word is replaced by the text of the alias.
7880The characters <SAMP>`/'</SAMP>, <SAMP>`$'</SAMP>, <SAMP>``'</SAMP>, <SAMP>`='</SAMP> and any of the
7881shell metacharacters or quoting characters listed above may not appear
7882in an alias name.
7883The replacement text may contain any valid
7884shell input, including shell metacharacters.
7885The first word of the replacement text is tested for
7886aliases, but a word that is identical to an alias being expanded
7887is not expanded a second time.
7888This means that one may alias <CODE>ls</CODE> to <CODE>"ls -F"</CODE>,
7889for instance, and Bash does not try to recursively expand the
7890replacement text. If the last character of the alias value is a
7891space or tab character, then the next command word following the
7892alias is also checked for alias expansion.
7893</P><P>
7894
7895Aliases are created and listed with the <CODE>alias</CODE>
7896command, and removed with the <CODE>unalias</CODE> command.
7897</P><P>
7898
7899There is no mechanism for using arguments in the replacement text,
7900as in <CODE>csh</CODE>.
7901If arguments are needed, a shell function should be used
7902(see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
7903</P><P>
7904
7905Aliases are not expanded when the shell is not interactive,
7906unless the <CODE>expand_aliases</CODE> shell option is set using
7907<CODE>shopt</CODE> (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>).
7908</P><P>
7909
7910The rules concerning the definition and use of aliases are
7911somewhat confusing. Bash
7912always reads at least one complete line
7913of input before executing any
7914of the commands on that line. Aliases are expanded when a
7915command is read, not when it is executed. Therefore, an
7916alias definition appearing on the same line as another
7917command does not take effect until the next line of input is read.
7918The commands following the alias definition
7919on that line are not affected by the new alias.
7920This behavior is also an issue when functions are executed.
7921Aliases are expanded when a function definition is read,
7922not when the function is executed, because a function definition
7923is itself a compound command. As a consequence, aliases
7924defined in a function are not available until after that
7925function is executed. To be safe, always put
7926alias definitions on a separate line, and do not use <CODE>alias</CODE>
7927in compound commands.
7928</P><P>
7929
7930For almost every purpose, shell functions are preferred over aliases.
7931</P><P>
7932
7933<A NAME="Arrays"></A>
7934<HR SIZE="6">
7935<A NAME="SEC85"></A>
7936<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
7937<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC84"> &lt; </A>]</TD>
7938<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &gt; </A>]</TD>
7939<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &lt;&lt; </A>]</TD>
7940<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
7941<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
7942<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
7943<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
7944<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
7945<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
7946</TR></TABLE>
7947<H2> 6.7 Arrays </H2>
7948<!--docid::SEC85::-->
7949<P>
7950
7951Bash provides one-dimensional indexed and associative array variables.
7952Any variable may be used as an indexed array;
7953the <CODE>declare</CODE> builtin will explicitly declare an array.
7954There is no maximum
7955limit on the size of an array, nor any requirement that members
7956be indexed or assigned contiguously.
7957Indexed arrays are referenced using integers (including arithmetic
7958expressions (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>) and are zero-based;
7959associative arrays use arbitrary strings.
7960</P><P>
7961
7962An indexed array is created automatically if any variable is assigned to
7963using the syntax
7964<TABLE><tr><td>&nbsp;</td><td class=example><pre>name[<VAR>subscript</VAR>]=<VAR>value</VAR>
7965</pre></td></tr></table></P><P>
7966
7967The <VAR>subscript</VAR>
7968is treated as an arithmetic expression that must evaluate to a number
7969greater than or equal to zero. To explicitly declare an array, use
7970<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -a <VAR>name</VAR>
7971</pre></td></tr></table>The syntax
7972<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -a <VAR>name</VAR>[<VAR>subscript</VAR>]
7973</pre></td></tr></table>is also accepted; the <VAR>subscript</VAR> is ignored.
7974</P><P>
7975
7976Associative arrays are created using
7977<TABLE><tr><td>&nbsp;</td><td class=example><pre>declare -A <VAR>name</VAR>.
7978</pre></td></tr></table></P><P>
7979
7980Attributes may be
7981specified for an array variable using the <CODE>declare</CODE> and
7982<CODE>readonly</CODE> builtins. Each attribute applies to all members of
7983an array.
7984</P><P>
7985
7986Arrays are assigned to using compound assignments of the form
7987<TABLE><tr><td>&nbsp;</td><td class=example><pre>name=(value<VAR>1</VAR> <small>...</small> value<VAR>n</VAR>)
7988</pre></td></tr></table>where each
7989<VAR>value</VAR> is of the form <CODE>[<VAR>subscript</VAR>]=</CODE><VAR>string</VAR>.
7990Indexed array assignments do not require the bracket and subscript.
7991When assigning to indexed arrays, if
7992the optional subscript is supplied, that index is assigned to;
7993otherwise the index of the element assigned is the last index assigned
7994to by the statement plus one. Indexing starts at zero.
7995</P><P>
7996
7997When assigning to an associative array, the subscript is required.
7998</P><P>
7999
8000This syntax is also accepted by the <CODE>declare</CODE>
8001builtin. Individual array elements may be assigned to using the
8002<CODE>name[</CODE><VAR>subscript</VAR><CODE>]=</CODE><VAR>value</VAR> syntax introduced above.
8003</P><P>
8004
8005Any element of an array may be referenced using
8006<CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
8007The braces are required to avoid
8008conflicts with the shell's filename expansion operators. If the
8009<VAR>subscript</VAR> is <SAMP>`@'</SAMP> or <SAMP>`*'</SAMP>, the word expands to all members
8010of the array <VAR>name</VAR>. These subscripts differ only when the word
8011appears within double quotes.
8012If the word is double-quoted,
8013<CODE>${name[*]}</CODE> expands to a single word with
8014the value of each array member separated by the first character of the
8015<CODE>IFS</CODE> variable, and <CODE>${name[@]}</CODE> expands each element of
8016<VAR>name</VAR> to a separate word. When there are no array members,
8017<CODE>${name[@]}</CODE> expands to nothing.
8018If the double-quoted expansion occurs within a word, the expansion of
8019the first parameter is joined with the beginning part of the original
8020word, and the expansion of the last parameter is joined with the last
8021part of the original word.
8022This is analogous to the
8023expansion of the special parameters <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>.
8024<CODE>${#name[</CODE><VAR>subscript</VAR><CODE>]}</CODE> expands to the length of
8025<CODE>${name[</CODE><VAR>subscript</VAR><CODE>]}</CODE>.
8026If <VAR>subscript</VAR> is <SAMP>`@'</SAMP> or
8027<SAMP>`*'</SAMP>, the expansion is the number of elements in the array.
8028Referencing an array variable without a subscript is equivalent to
8029referencing with a subscript of 0.
8030</P><P>
8031
0001803f
CR
8032An array variable is considered set if a subscript has been assigned a
8033value. The null string is a valid value.
8034</P><P>
8035
17345e5a
JA
8036The <CODE>unset</CODE> builtin is used to destroy arrays.
8037<CODE>unset</CODE> <VAR>name</VAR>[<VAR>subscript</VAR>]
8038destroys the array element at index <VAR>subscript</VAR>.
8039Care must be taken to avoid unwanted side effects caused by filename
0001803f 8040expansion.
17345e5a
JA
8041<CODE>unset</CODE> <VAR>name</VAR>, where <VAR>name</VAR> is an array, removes the
8042entire array. A subscript of <SAMP>`*'</SAMP> or <SAMP>`@'</SAMP> also removes the
8043entire array.
8044</P><P>
8045
8046The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE>
8047builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed
8048array and a <SAMP>`-A'</SAMP> option to specify an associative array.
8049The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP>
8050option to assign a list of words read from the standard input
8051to an array, and can read values from the standard input into
8052individual array elements. The <CODE>set</CODE> and <CODE>declare</CODE>
8053builtins display array values in a way that allows them to be
8054reused as input.
8055</P><P>
8056
8057<A NAME="The Directory Stack"></A>
8058<HR SIZE="6">
8059<A NAME="SEC86"></A>
8060<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8061<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC85"> &lt; </A>]</TD>
8062<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> &gt; </A>]</TD>
8063<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &lt;&lt; </A>]</TD>
8064<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8065<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &gt;&gt; </A>]</TD>
8066<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8067<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8068<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8069<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8070</TR></TABLE>
8071<H2> 6.8 The Directory Stack </H2>
8072<!--docid::SEC86::-->
8073<P>
8074
8075<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8076<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands to manipulate
8077 the directory stack.</TD></TR>
8078</TABLE></BLOCKQUOTE>
8079<P>
8080
8081The directory stack is a list of recently-visited directories. The
8082<CODE>pushd</CODE> builtin adds directories to the stack as it changes
8083the current directory, and the <CODE>popd</CODE> builtin removes specified
8084directories from the stack and changes the current directory to
8085the directory removed. The <CODE>dirs</CODE> builtin displays the contents
8086of the directory stack.
8087</P><P>
8088
8089The contents of the directory stack are also visible
8090as the value of the <CODE>DIRSTACK</CODE> shell variable.
8091</P><P>
8092
8093<A NAME="Directory Stack Builtins"></A>
8094<HR SIZE="6">
8095<A NAME="SEC87"></A>
8096<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8097<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> &lt; </A>]</TD>
8098<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &gt; </A>]</TD>
8099<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &lt;&lt; </A>]</TD>
8100<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC86"> Up </A>]</TD>
8101<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &gt;&gt; </A>]</TD>
8102<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8103<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8104<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8105<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8106</TR></TABLE>
8107<H3> 6.8.1 Directory Stack Builtins </H3>
8108<!--docid::SEC87::-->
8109<P>
8110
8111<DL COMPACT>
8112
8113<DT><CODE>dirs</CODE>
0001803f 8114<DD><A NAME="IDX290"></A>
17345e5a
JA
8115<TABLE><tr><td>&nbsp;</td><td class=example><pre>dirs [+<VAR>N</VAR> | -<VAR>N</VAR>] [-clpv]
8116</pre></td></tr></table>Display the list of currently remembered directories. Directories
8117are added to the list with the <CODE>pushd</CODE> command; the
8118<CODE>popd</CODE> command removes directories from the list.
8119<DL COMPACT>
8120<DT><CODE>+<VAR>N</VAR></CODE>
8121<DD>Displays the <VAR>N</VAR>th directory (counting from the left of the
8122list printed by <CODE>dirs</CODE> when invoked without options), starting
8123with zero.
8124<DT><CODE>-<VAR>N</VAR></CODE>
8125<DD>Displays the <VAR>N</VAR>th directory (counting from the right of the
8126list printed by <CODE>dirs</CODE> when invoked without options), starting
8127with zero.
8128<DT><CODE>-c</CODE>
8129<DD>Clears the directory stack by deleting all of the elements.
8130<DT><CODE>-l</CODE>
8131<DD>Produces a longer listing; the default listing format uses a
8132tilde to denote the home directory.
8133<DT><CODE>-p</CODE>
8134<DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8135line.
8136<DT><CODE>-v</CODE>
8137<DD>Causes <CODE>dirs</CODE> to print the directory stack with one entry per
8138line, prefixing each entry with its index in the stack.
8139</DL>
8140<P>
8141
8142<DT><CODE>popd</CODE>
0001803f 8143<DD><A NAME="IDX291"></A>
17345e5a
JA
8144<TABLE><tr><td>&nbsp;</td><td class=example><pre>popd [+<VAR>N</VAR> | -<VAR>N</VAR>] [-n]
8145</pre></td></tr></table><P>
8146
8147Remove the top entry from the directory stack, and <CODE>cd</CODE>
8148to the new top directory.
8149When no arguments are given, <CODE>popd</CODE>
8150removes the top directory from the stack and
8151performs a <CODE>cd</CODE> to the new top directory. The
8152elements are numbered from 0 starting at the first directory listed with
8153<CODE>dirs</CODE>; i.e., <CODE>popd</CODE> is equivalent to <CODE>popd +0</CODE>.
8154<DL COMPACT>
8155<DT><CODE>+<VAR>N</VAR></CODE>
8156<DD>Removes the <VAR>N</VAR>th directory (counting from the left of the
8157list printed by <CODE>dirs</CODE>), starting with zero.
8158<DT><CODE>-<VAR>N</VAR></CODE>
8159<DD>Removes the <VAR>N</VAR>th directory (counting from the right of the
8160list printed by <CODE>dirs</CODE>), starting with zero.
8161<DT><CODE>-n</CODE>
8162<DD>Suppresses the normal change of directory when removing directories
8163from the stack, so that only the stack is manipulated.
8164</DL>
8165<P>
8166
0001803f 8167<A NAME="IDX292"></A>
17345e5a
JA
8168<DT><CODE>pushd</CODE>
8169<DD><TABLE><tr><td>&nbsp;</td><td class=example><pre>pushd [-n] [<VAR>+N</VAR> | <VAR>-N</VAR> | <VAR>dir</VAR> ]
8170</pre></td></tr></table><P>
8171
8172Save the current directory on the top of the directory stack
8173and then <CODE>cd</CODE> to <VAR>dir</VAR>.
8174With no arguments, <CODE>pushd</CODE> exchanges the top two directories.
8175</P><P>
8176
8177<DL COMPACT>
8178<DT><CODE>-n</CODE>
8179<DD>Suppresses the normal change of directory when adding directories
8180to the stack, so that only the stack is manipulated.
8181<DT><CODE>+<VAR>N</VAR></CODE>
8182<DD>Brings the <VAR>N</VAR>th directory (counting from the left of the
8183list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8184the list by rotating the stack.
8185<DT><CODE>-<VAR>N</VAR></CODE>
8186<DD>Brings the <VAR>N</VAR>th directory (counting from the right of the
8187list printed by <CODE>dirs</CODE>, starting with zero) to the top of
8188the list by rotating the stack.
8189<DT><CODE><VAR>dir</VAR></CODE>
8190<DD>Makes the current working directory be the top of the stack, and then
8191executes the equivalent of `<CODE>cd</CODE> <VAR>dir</VAR>'.
8192<CODE>cd</CODE>s to <VAR>dir</VAR>.
8193</DL>
8194<P>
8195
8196</DL>
8197<P>
8198
8199<A NAME="Printing a Prompt"></A>
8200<HR SIZE="6">
8201<A NAME="SEC88"></A>
8202<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8203<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC87"> &lt; </A>]</TD>
8204<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &gt; </A>]</TD>
8205<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> &lt;&lt; </A>]</TD>
8206<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8207<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
8208<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8209<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8210<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8211<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8212</TR></TABLE>
8213<H2> 6.9 Controlling the Prompt </H2>
8214<!--docid::SEC88::-->
8215<P>
8216
8217The value of the variable <CODE>PROMPT_COMMAND</CODE> is examined just before
8218Bash prints each primary prompt. If <CODE>PROMPT_COMMAND</CODE> is set and
8219has a non-null value, then the
8220value is executed just as if it had been typed on the command line.
8221</P><P>
8222
8223In addition, the following table describes the special characters which
8224can appear in the prompt variables:
8225</P><P>
8226
8227<DL COMPACT>
8228<DT><CODE>\a</CODE>
8229<DD>A bell character.
8230<DT><CODE>\d</CODE>
8231<DD>The date, in "Weekday Month Date" format (e.g., "Tue May 26").
8232<DT><CODE>\D{<VAR>format</VAR>}</CODE>
8233<DD>The <VAR>format</VAR> is passed to <CODE>strftime</CODE>(3) and the result is inserted
8234into the prompt string; an empty <VAR>format</VAR> results in a locale-specific
8235time representation. The braces are required.
8236<DT><CODE>\e</CODE>
8237<DD>An escape character.
8238<DT><CODE>\h</CODE>
8239<DD>The hostname, up to the first `.'.
8240<DT><CODE>\H</CODE>
8241<DD>The hostname.
8242<DT><CODE>\j</CODE>
8243<DD>The number of jobs currently managed by the shell.
8244<DT><CODE>\l</CODE>
8245<DD>The basename of the shell's terminal device name.
8246<DT><CODE>\n</CODE>
8247<DD>A newline.
8248<DT><CODE>\r</CODE>
8249<DD>A carriage return.
8250<DT><CODE>\s</CODE>
8251<DD>The name of the shell, the basename of <CODE>$0</CODE> (the portion
8252following the final slash).
8253<DT><CODE>\t</CODE>
8254<DD>The time, in 24-hour HH:MM:SS format.
8255<DT><CODE>\T</CODE>
8256<DD>The time, in 12-hour HH:MM:SS format.
8257<DT><CODE>\@</CODE>
8258<DD>The time, in 12-hour am/pm format.
8259<DT><CODE>\A</CODE>
8260<DD>The time, in 24-hour HH:MM format.
8261<DT><CODE>\u</CODE>
8262<DD>The username of the current user.
8263<DT><CODE>\v</CODE>
8264<DD>The version of Bash (e.g., 2.00)
8265<DT><CODE>\V</CODE>
8266<DD>The release of Bash, version + patchlevel (e.g., 2.00.0)
8267<DT><CODE>\w</CODE>
8268<DD>The current working directory, with <CODE>$HOME</CODE> abbreviated with a tilde
8269(uses the <CODE>$PROMPT_DIRTRIM</CODE> variable).
8270<DT><CODE>\W</CODE>
8271<DD>The basename of <CODE>$PWD</CODE>, with <CODE>$HOME</CODE> abbreviated with a tilde.
8272<DT><CODE>\!</CODE>
8273<DD>The history number of this command.
8274<DT><CODE>\#</CODE>
8275<DD>The command number of this command.
8276<DT><CODE>\$</CODE>
8277<DD>If the effective uid is 0, <CODE>#</CODE>, otherwise <CODE>$</CODE>.
8278<DT><CODE>\<VAR>nnn</VAR></CODE>
8279<DD>The character whose ASCII code is the octal value <VAR>nnn</VAR>.
8280<DT><CODE>\\</CODE>
8281<DD>A backslash.
8282<DT><CODE>\[</CODE>
8283<DD>Begin a sequence of non-printing characters. This could be used to
8284embed a terminal control sequence into the prompt.
8285<DT><CODE>\]</CODE>
8286<DD>End a sequence of non-printing characters.
8287</DL>
8288<P>
8289
8290The command number and the history number are usually different:
8291the history number of a command is its position in the history
8292list, which may include commands restored from the history file
8293(see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>), while the command number is
8294the position in the sequence of commands executed during the current
8295shell session.
8296</P><P>
8297
8298After the string is decoded, it is expanded via
8299parameter expansion, command substitution, arithmetic
8300expansion, and quote removal, subject to the value of the
8301<CODE>promptvars</CODE> shell option (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
8302</P><P>
8303
8304<A NAME="The Restricted Shell"></A>
8305<HR SIZE="6">
8306<A NAME="SEC89"></A>
8307<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8308<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC88"> &lt; </A>]</TD>
8309<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> &gt; </A>]</TD>
8310<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &lt;&lt; </A>]</TD>
8311<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8312<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
8313<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8314<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8315<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8316<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8317</TR></TABLE>
8318<H2> 6.10 The Restricted Shell </H2>
8319<!--docid::SEC89::-->
8320<P>
8321
8322If Bash is started with the name <CODE>rbash</CODE>, or the
8323<SAMP>`--restricted'</SAMP>
8324or
8325<SAMP>`-r'</SAMP>
8326option is supplied at invocation, the shell becomes restricted.
8327A restricted shell is used to
8328set up an environment more controlled than the standard shell.
8329A restricted shell behaves identically to <CODE>bash</CODE>
8330with the exception that the following are disallowed or not performed:
8331</P><P>
8332
8333<UL>
8334<LI>
8335Changing directories with the <CODE>cd</CODE> builtin.
8336<LI>
8337Setting or unsetting the values of the <CODE>SHELL</CODE>, <CODE>PATH</CODE>,
8338<CODE>ENV</CODE>, or <CODE>BASH_ENV</CODE> variables.
8339<LI>
8340Specifying command names containing slashes.
8341<LI>
8342Specifying a filename containing a slash as an argument to the <CODE>.</CODE>
8343builtin command.
8344<LI>
8345Specifying a filename containing a slash as an argument to the <SAMP>`-p'</SAMP>
8346option to the <CODE>hash</CODE> builtin command.
8347<LI>
8348Importing function definitions from the shell environment at startup.
8349<LI>
8350Parsing the value of <CODE>SHELLOPTS</CODE> from the shell environment at startup.
8351<LI>
8352Redirecting output using the <SAMP>`&#62;'</SAMP>, <SAMP>`&#62;|'</SAMP>, <SAMP>`&#60;&#62;'</SAMP>, <SAMP>`&#62;&#38;'</SAMP>,
8353<SAMP>`&#38;&#62;'</SAMP>, and <SAMP>`&#62;&#62;'</SAMP> redirection operators.
8354<LI>
8355Using the <CODE>exec</CODE> builtin to replace the shell with another command.
8356<LI>
8357Adding or deleting builtin commands with the
8358<SAMP>`-f'</SAMP> and <SAMP>`-d'</SAMP> options to the <CODE>enable</CODE> builtin.
8359<LI>
8360Using the <CODE>enable</CODE> builtin command to enable disabled shell builtins.
8361<LI>
8362Specifying the <SAMP>`-p'</SAMP> option to the <CODE>command</CODE> builtin.
8363<LI>
8364Turning off restricted mode with <SAMP>`set +r'</SAMP> or <SAMP>`set +o restricted'</SAMP>.
8365</UL>
8366<P>
8367
8368These restrictions are enforced after any startup files are read.
8369</P><P>
8370
8371When a command that is found to be a shell script is executed
8372(see section <A HREF="bashref.html#SEC57">3.8 Shell Scripts</A>), <CODE>rbash</CODE> turns off any restrictions in
8373the shell spawned to execute the script.
8374</P><P>
8375
8376<A NAME="Bash POSIX Mode"></A>
8377<HR SIZE="6">
8378<A NAME="SEC90"></A>
8379<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8380<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC89"> &lt; </A>]</TD>
8381<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt; </A>]</TD>
8382<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC70"> &lt;&lt; </A>]</TD>
8383<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC68"> Up </A>]</TD>
8384<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &gt;&gt; </A>]</TD>
8385<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8386<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8387<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8388<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8389</TR></TABLE>
8390<H2> 6.11 Bash POSIX Mode </H2>
8391<!--docid::SEC90::-->
8392<P>
8393
8394Starting Bash with the <SAMP>`--posix'</SAMP> command-line option or executing
8395<SAMP>`set -o posix'</SAMP> while Bash is running will cause Bash to conform more
8396closely to the POSIX standard by changing the behavior to
8397match that specified by POSIX in areas where the Bash default differs.
8398</P><P>
8399
8400When invoked as <CODE>sh</CODE>, Bash enters POSIX mode after reading the
8401startup files.
8402</P><P>
8403
8404The following list is what's changed when `POSIX mode' is in effect:
8405</P><P>
8406
8407<OL>
8408<LI>
8409When a command in the hash table no longer exists, Bash will re-search
8410<CODE>$PATH</CODE> to find the new location. This is also available with
8411<SAMP>`shopt -s checkhash'</SAMP>.
8412<P>
8413
8414<LI>
8415The message printed by the job control code and builtins when a job
8416exits with a non-zero status is `Done(status)'.
8417<P>
8418
8419<LI>
8420The message printed by the job control code and builtins when a job
8421is stopped is `Stopped(<VAR>signame</VAR>)', where <VAR>signame</VAR> is, for
8422example, <CODE>SIGTSTP</CODE>.
8423<P>
8424
8425<LI>
8426The <CODE>bg</CODE> builtin uses the required format to describe each job placed
8427in the background, which does not include an indication of whether the job
8428is the current or previous job.
8429<P>
8430
8431<LI>
8432Reserved words appearing in a context where reserved words are recognized
8433do not undergo alias expansion.
8434<P>
8435
8436<LI>
8437The POSIX <CODE>PS1</CODE> and <CODE>PS2</CODE> expansions of <SAMP>`!'</SAMP> to
8438the history number and <SAMP>`!!'</SAMP> to <SAMP>`!'</SAMP> are enabled,
8439and parameter expansion is performed on the values of <CODE>PS1</CODE> and
8440<CODE>PS2</CODE> regardless of the setting of the <CODE>promptvars</CODE> option.
8441<P>
8442
8443<LI>
8444The POSIX startup files are executed (<CODE>$ENV</CODE>) rather than
8445the normal Bash files.
8446<P>
8447
8448<LI>
8449Tilde expansion is only performed on assignments preceding a command
8450name, rather than on all assignment statements on the line.
8451<P>
8452
8453<LI>
8454The default history file is <TT>`~/.sh_history'</TT> (this is the
8455default value of <CODE>$HISTFILE</CODE>).
8456<P>
8457
8458<LI>
8459The output of <SAMP>`kill -l'</SAMP> prints all the signal names on a single line,
8460separated by spaces, without the <SAMP>`SIG'</SAMP> prefix.
8461<P>
8462
8463<LI>
8464The <CODE>kill</CODE> builtin does not accept signal names with a <SAMP>`SIG'</SAMP>
8465prefix.
8466<P>
8467
8468<LI>
8469Non-interactive shells exit if <VAR>filename</VAR> in <CODE>.</CODE> <VAR>filename</VAR>
8470is not found.
8471<P>
8472
8473<LI>
8474Non-interactive shells exit if a syntax error in an arithmetic expansion
8475results in an invalid expression.
8476<P>
8477
8478<LI>
8479Redirection operators do not perform filename expansion on the word
8480in the redirection unless the shell is interactive.
8481<P>
8482
8483<LI>
8484Redirection operators do not perform word splitting on the word in the
8485redirection.
8486<P>
8487
8488<LI>
8489Function names must be valid shell <CODE>name</CODE>s. That is, they may not
8490contain characters other than letters, digits, and underscores, and
8491may not start with a digit. Declaring a function with an invalid name
8492causes a fatal syntax error in non-interactive shells.
8493<P>
8494
8495<LI>
8496POSIX special builtins are found before shell functions
8497during command lookup.
8498<P>
8499
8500<LI>
8501If a POSIX special builtin returns an error status, a
8502non-interactive shell exits. The fatal errors are those listed in
8503the POSIX standard, and include things like passing incorrect options,
8504redirection errors, variable assignment errors for assignments preceding
8505the command name, and so on.
8506<P>
8507
8508<LI>
8509If <CODE>CDPATH</CODE> is set, the <CODE>cd</CODE> builtin will not implicitly
8510append the current directory to it. This means that <CODE>cd</CODE> will
8511fail if no valid directory name can be constructed from
8512any of the entries in <CODE>$CDPATH</CODE>, even if the a directory with
8513the same name as the name given as an argument to <CODE>cd</CODE> exists
8514in the current directory.
8515<P>
8516
8517<LI>
8518A non-interactive shell exits with an error status if a variable
8519assignment error occurs when no command name follows the assignment
8520statements.
8521A variable assignment error occurs, for example, when trying to assign
8522a value to a readonly variable.
8523<P>
8524
8525<LI>
8526A non-interactive shell exits with an error status if the iteration
8527variable in a <CODE>for</CODE> statement or the selection variable in a
8528<CODE>select</CODE> statement is a readonly variable.
8529<P>
8530
8531<LI>
8532Process substitution is not available.
8533<P>
8534
8535<LI>
8536Assignment statements preceding POSIX special builtins
8537persist in the shell environment after the builtin completes.
8538<P>
8539
8540<LI>
8541Assignment statements preceding shell function calls persist in the
8542shell environment after the function returns, as if a POSIX
8543special builtin command had been executed.
8544<P>
8545
8546<LI>
8547The <CODE>export</CODE> and <CODE>readonly</CODE> builtin commands display their
8548output in the format required by POSIX.
8549<P>
8550
8551<LI>
8552The <CODE>trap</CODE> builtin displays signal names without the leading
8553<CODE>SIG</CODE>.
8554<P>
8555
8556<LI>
8557The <CODE>trap</CODE> builtin doesn't check the first argument for a possible
8558signal specification and revert the signal handling to the original
8559disposition if it is, unless that argument consists solely of digits and
8560is a valid signal number. If users want to reset the handler for a given
8561signal to the original disposition, they should use <SAMP>`-'</SAMP> as the
8562first argument.
8563<P>
8564
8565<LI>
8566The <CODE>.</CODE> and <CODE>source</CODE> builtins do not search the current directory
8567for the filename argument if it is not found by searching <CODE>PATH</CODE>.
8568<P>
8569
8570<LI>
8571Subshells spawned to execute command substitutions inherit the value of
8572the <SAMP>`-e'</SAMP> option from the parent shell. When not in POSIX mode,
8573Bash clears the <SAMP>`-e'</SAMP> option in such subshells.
8574<P>
8575
8576<LI>
8577Alias expansion is always enabled, even in non-interactive shells.
8578<P>
8579
8580<LI>
8581When the <CODE>alias</CODE> builtin displays alias definitions, it does not
8582display them with a leading <SAMP>`alias '</SAMP> unless the <SAMP>`-p'</SAMP> option
8583is supplied.
8584<P>
8585
8586<LI>
8587When the <CODE>set</CODE> builtin is invoked without options, it does not display
8588shell function names and definitions.
8589<P>
8590
8591<LI>
8592When the <CODE>set</CODE> builtin is invoked without options, it displays
8593variable values without quotes, unless they contain shell metacharacters,
8594even if the result contains nonprinting characters.
8595<P>
8596
8597<LI>
8598When the <CODE>cd</CODE> builtin is invoked in <VAR>logical</VAR> mode, and the pathname
8599constructed from <CODE>$PWD</CODE> and the directory name supplied as an argument
8600does not refer to an existing directory, <CODE>cd</CODE> will fail instead of
8601falling back to <VAR>physical</VAR> mode.
8602<P>
8603
8604<LI>
8605When the <CODE>pwd</CODE> builtin is supplied the <SAMP>`-P'</SAMP> option, it resets
8606<CODE>$PWD</CODE> to a pathname containing no symlinks.
8607<P>
8608
8609<LI>
8610The <CODE>pwd</CODE> builtin verifies that the value it prints is the same as the
8611current directory, even if it is not asked to check the file system with the
8612<SAMP>`-P'</SAMP> option.
8613<P>
8614
8615<LI>
8616When listing the history, the <CODE>fc</CODE> builtin does not include an
8617indication of whether or not a history entry has been modified.
8618<P>
8619
8620<LI>
8621The default editor used by <CODE>fc</CODE> is <CODE>ed</CODE>.
8622<P>
8623
8624<LI>
8625The <CODE>type</CODE> and <CODE>command</CODE> builtins will not report a non-executable
8626file as having been found, though the shell will attempt to execute such a
8627file if it is the only so-named file found in <CODE>$PATH</CODE>.
8628<P>
8629
8630<LI>
8631The <CODE>vi</CODE> editing mode will invoke the <CODE>vi</CODE> editor directly when
8632the <SAMP>`v'</SAMP> command is run, instead of checking <CODE>$VISUAL</CODE> and
8633<CODE>$EDITOR</CODE>.
8634<P>
8635
8636<LI>
8637When the <CODE>xpg_echo</CODE> option is enabled, Bash does not attempt to interpret
8638any arguments to <CODE>echo</CODE> as options. Each argument is displayed, after
8639escape characters are converted.
8640<P>
8641
8642<LI>
8643The <CODE>ulimit</CODE> builtin uses a block size of 512 bytes for the <SAMP>`-c'</SAMP>
8644and <SAMP>`-f'</SAMP> options.
8645<P>
8646
0001803f
CR
8647<LI>
8648The arrival of <CODE>SIGCHLD</CODE> when a trap is set on <CODE>SIGCHLD</CODE> does
8649not interrupt the <CODE>wait</CODE> builtin and cause it to return immediately.
8650The trap command is run once for each child that exits.
8651<P>
8652
17345e5a
JA
8653</OL>
8654<P>
8655
8656There is other POSIX behavior that Bash does not implement by
8657default even when in POSIX mode.
8658Specifically:
8659</P><P>
8660
8661<OL>
8662
8663<LI>
8664The <CODE>fc</CODE> builtin checks <CODE>$EDITOR</CODE> as a program to edit history
8665entries if <CODE>FCEDIT</CODE> is unset, rather than defaulting directly to
8666<CODE>ed</CODE>. <CODE>fc</CODE> uses <CODE>ed</CODE> if <CODE>EDITOR</CODE> is unset.
8667<P>
8668
8669<LI>
8670As noted above, Bash requires the <CODE>xpg_echo</CODE> option to be enabled for
8671the <CODE>echo</CODE> builtin to be fully conformant.
8672<P>
8673
8674</OL>
8675<P>
8676
8677Bash can be configured to be POSIX-conformant by default, by specifying
8678the <SAMP>`--enable-strict-posix-default'</SAMP> to <CODE>configure</CODE> when building
8679(see section <A HREF="bashref.html#SEC134">10.8 Optional Features</A>).
8680</P><P>
8681
8682<A NAME="Job Control"></A>
8683<HR SIZE="6">
8684<A NAME="SEC91"></A>
8685<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8686<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC90"> &lt; </A>]</TD>
8687<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &gt; </A>]</TD>
8688<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt;&lt; </A>]</TD>
8689<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
8690<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8691<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8692<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8693<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8694<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8695</TR></TABLE>
8696<H1> 7. Job Control </H1>
8697<!--docid::SEC91::-->
8698<P>
8699
8700This chapter discusses what job control is, how it works, and how
8701Bash allows you to access its facilities.
8702</P><P>
8703
8704<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
8705<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How job control works.</TD></TR>
8706<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Bash builtin commands used to interact
8707 with job control.</TD></TR>
8708<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Variables Bash uses to customize job
8709 control.</TD></TR>
8710</TABLE></BLOCKQUOTE>
8711<P>
8712
8713<A NAME="Job Control Basics"></A>
8714<HR SIZE="6">
8715<A NAME="SEC92"></A>
8716<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8717<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt; </A>]</TD>
8718<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> &gt; </A>]</TD>
8719<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt;&lt; </A>]</TD>
8720<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8721<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8722<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8723<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8724<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8725<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8726</TR></TABLE>
8727<H2> 7.1 Job Control Basics </H2>
8728<!--docid::SEC92::-->
8729<P>
8730
8731Job control
8732refers to the ability to selectively stop (suspend)
8733the execution of processes and continue (resume)
8734their execution at a later point. A user typically employs
8735this facility via an interactive interface supplied jointly
0001803f 8736by the operating system kernel's terminal driver and Bash.
17345e5a
JA
8737</P><P>
8738
8739The shell associates a <VAR>job</VAR> with each pipeline. It keeps a
8740table of currently executing jobs, which may be listed with the
8741<CODE>jobs</CODE> command. When Bash starts a job
8742asynchronously, it prints a line that looks
8743like:
8744<TABLE><tr><td>&nbsp;</td><td class=example><pre>[1] 25647
8745</pre></td></tr></table>indicating that this job is job number 1 and that the process ID
8746of the last process in the pipeline associated with this job is
874725647. All of the processes in a single pipeline are members of
8748the same job. Bash uses the <VAR>job</VAR> abstraction as the
8749basis for job control.
8750</P><P>
8751
8752To facilitate the implementation of the user interface to job
8753control, the operating system maintains the notion of a current terminal
8754process group ID. Members of this process group (processes whose
8755process group ID is equal to the current terminal process group
8756ID) receive keyboard-generated signals such as <CODE>SIGINT</CODE>.
8757These processes are said to be in the foreground. Background
8758processes are those whose process group ID differs from the
8759terminal's; such processes are immune to keyboard-generated
0001803f
CR
8760signals. Only foreground processes are allowed to read from or, if
8761the user so specifies with <CODE>stty tostop</CODE>, write to the terminal.
8762Background processes which attempt to
8763read from (write to when <CODE>stty tostop</CODE> is in effect) the
8764terminal are sent a <CODE>SIGTTIN</CODE> (<CODE>SIGTTOU</CODE>)
8765signal by the kernel's terminal driver,
8766which, unless caught, suspends the process.
17345e5a
JA
8767</P><P>
8768
8769If the operating system on which Bash is running supports
8770job control, Bash contains facilities to use it. Typing the
8771<VAR>suspend</VAR> character (typically <SAMP>`^Z'</SAMP>, Control-Z) while a
8772process is running causes that process to be stopped and returns
8773control to Bash. Typing the <VAR>delayed suspend</VAR> character
8774(typically <SAMP>`^Y'</SAMP>, Control-Y) causes the process to be stopped
8775when it attempts to read input from the terminal, and control to
8776be returned to Bash. The user then manipulates the state of
8777this job, using the <CODE>bg</CODE> command to continue it in the
8778background, the <CODE>fg</CODE> command to continue it in the
8779foreground, or the <CODE>kill</CODE> command to kill it. A <SAMP>`^Z'</SAMP>
8780takes effect immediately, and has the additional side effect of
8781causing pending output and typeahead to be discarded.
8782</P><P>
8783
8784There are a number of ways to refer to a job in the shell. The
8785character <SAMP>`%'</SAMP> introduces a job specification (<VAR>jobspec</VAR>).
8786</P><P>
8787
8788Job number <CODE>n</CODE> may be referred to as <SAMP>`%n'</SAMP>.
8789The symbols <SAMP>`%%'</SAMP> and <SAMP>`%+'</SAMP> refer to the shell's notion of the
8790current job, which is the last job stopped while it was in the foreground
8791or started in the background.
8792A single <SAMP>`%'</SAMP> (with no accompanying job specification) also refers
8793to the current job.
8794The previous job may be referenced using <SAMP>`%-'</SAMP>.
8795If there is only a single job, <SAMP>`%+'</SAMP> and <SAMP>`%-'</SAMP> can both be used
8796to refer to that job.
8797In output pertaining to jobs (e.g., the output of the <CODE>jobs</CODE>
8798command), the current job is always flagged with a <SAMP>`+'</SAMP>, and the
8799previous job with a <SAMP>`-'</SAMP>.
8800</P><P>
8801
8802A job may also be referred to
8803using a prefix of the name used to start it, or using a substring
8804that appears in its command line. For example, <SAMP>`%ce'</SAMP> refers
8805to a stopped <CODE>ce</CODE> job. Using <SAMP>`%?ce'</SAMP>, on the
8806other hand, refers to any job containing the string <SAMP>`ce'</SAMP> in
8807its command line. If the prefix or substring matches more than one job,
8808Bash reports an error.
8809</P><P>
8810
8811Simply naming a job can be used to bring it into the foreground:
8812<SAMP>`%1'</SAMP> is a synonym for <SAMP>`fg %1'</SAMP>, bringing job 1 from the
8813background into the foreground. Similarly, <SAMP>`%1 &#38;'</SAMP> resumes
8814job 1 in the background, equivalent to <SAMP>`bg %1'</SAMP>
8815</P><P>
8816
8817The shell learns immediately whenever a job changes state.
8818Normally, Bash waits until it is about to print a prompt
8819before reporting changes in a job's status so as to not interrupt
8820any other output.
8821If the <SAMP>`-b'</SAMP> option to the <CODE>set</CODE> builtin is enabled,
8822Bash reports such changes immediately (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
8823Any trap on <CODE>SIGCHLD</CODE> is executed for each child process
8824that exits.
8825</P><P>
8826
8827If an attempt to exit Bash is made while jobs are stopped, (or running, if
8828the <CODE>checkjobs</CODE> option is enabled -- see <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), the
8829shell prints a warning message, and if the <CODE>checkjobs</CODE> option is
8830enabled, lists the jobs and their statuses.
8831The <CODE>jobs</CODE> command may then be used to inspect their status.
8832If a second attempt to exit is made without an intervening command,
8833Bash does not print another warning, and any stopped jobs are terminated.
8834</P><P>
8835
8836<A NAME="Job Control Builtins"></A>
8837<HR SIZE="6">
8838<A NAME="SEC93"></A>
8839<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8840<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC92"> &lt; </A>]</TD>
8841<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &gt; </A>]</TD>
8842<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &lt;&lt; </A>]</TD>
8843<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8844<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8845<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8846<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
8847<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
8848<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
8849</TR></TABLE>
8850<H2> 7.2 Job Control Builtins </H2>
8851<!--docid::SEC93::-->
8852<P>
8853
8854<DL COMPACT>
8855
8856<DT><CODE>bg</CODE>
0001803f 8857<DD><A NAME="IDX293"></A>
17345e5a
JA
8858<TABLE><tr><td>&nbsp;</td><td class=example><pre>bg [<VAR>jobspec</VAR> <small>...</small>]
8859</pre></td></tr></table>Resume each suspended job <VAR>jobspec</VAR> in the background, as if it
8860had been started with <SAMP>`&#38;'</SAMP>.
8861If <VAR>jobspec</VAR> is not supplied, the current job is used.
8862The return status is zero unless it is run when job control is not
8863enabled, or, when run with job control enabled, any
8864<VAR>jobspec</VAR> was not found or specifies a job
8865that was started without job control.
8866<P>
8867
8868<DT><CODE>fg</CODE>
0001803f 8869<DD><A NAME="IDX294"></A>
17345e5a
JA
8870<TABLE><tr><td>&nbsp;</td><td class=example><pre>fg [<VAR>jobspec</VAR>]
8871</pre></td></tr></table>Resume the job <VAR>jobspec</VAR> in the foreground and make it the current job.
8872If <VAR>jobspec</VAR> is not supplied, the current job is used.
8873The return status is that of the command placed into the foreground,
8874or non-zero if run when job control is disabled or, when run with
8875job control enabled, <VAR>jobspec</VAR> does not specify a valid job or
8876<VAR>jobspec</VAR> specifies a job that was started without job control.
8877<P>
8878
8879<DT><CODE>jobs</CODE>
0001803f 8880<DD><A NAME="IDX295"></A>
17345e5a
JA
8881<TABLE><tr><td>&nbsp;</td><td class=example><pre>jobs [-lnprs] [<VAR>jobspec</VAR>]
8882jobs -x <VAR>command</VAR> [<VAR>arguments</VAR>]
8883</pre></td></tr></table><P>
8884
8885The first form lists the active jobs. The options have the
8886following meanings:
8887</P><P>
8888
8889<DL COMPACT>
8890<DT><CODE>-l</CODE>
8891<DD>List process IDs in addition to the normal information.
8892<P>
8893
8894<DT><CODE>-n</CODE>
8895<DD>Display information only about jobs that have changed status since
8896the user was last notified of their status.
8897<P>
8898
8899<DT><CODE>-p</CODE>
8900<DD>List only the process ID of the job's process group leader.
8901<P>
8902
8903<DT><CODE>-r</CODE>
8904<DD>Restrict output to running jobs.
8905<P>
8906
8907<DT><CODE>-s</CODE>
8908<DD>Restrict output to stopped jobs.
8909</DL>
8910<P>
8911
8912If <VAR>jobspec</VAR> is given,
8913output is restricted to information about that job.
8914If <VAR>jobspec</VAR> is not supplied, the status of all jobs is
8915listed.
8916</P><P>
8917
8918If the <SAMP>`-x'</SAMP> option is supplied, <CODE>jobs</CODE> replaces any
8919<VAR>jobspec</VAR> found in <VAR>command</VAR> or <VAR>arguments</VAR> with the
8920corresponding process group ID, and executes <VAR>command</VAR>,
8921passing it <VAR>argument</VAR>s, returning its exit status.
8922</P><P>
8923
8924<DT><CODE>kill</CODE>
0001803f 8925<DD><A NAME="IDX296"></A>
17345e5a
JA
8926<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>
8927kill -l [<VAR>exit_status</VAR>]
8928</pre></td></tr></table>Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process
8929named by job specification <VAR>jobspec</VAR> or process ID <VAR>pid</VAR>.
8930<VAR>sigspec</VAR> is either a case-insensitive signal name such as
8931<CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix)
8932or a signal number; <VAR>signum</VAR> is a signal number.
8933If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used.
8934The <SAMP>`-l'</SAMP> option lists the signal names.
8935If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the
8936signals corresponding to the arguments are listed, and the return status
8937is zero.
8938<VAR>exit_status</VAR> is a number specifying a signal number or the exit
8939status of a process terminated by a signal.
8940The return status is zero if at least one signal was successfully sent,
8941or non-zero if an error occurs or an invalid option is encountered.
8942<P>
8943
8944<DT><CODE>wait</CODE>
0001803f 8945<DD><A NAME="IDX297"></A>
17345e5a
JA
8946<TABLE><tr><td>&nbsp;</td><td class=example><pre>wait [<VAR>jobspec</VAR> or <VAR>pid</VAR> ...]
8947</pre></td></tr></table>Wait until the child process specified by each process ID <VAR>pid</VAR>
8948or job specification <VAR>jobspec</VAR> exits and return the exit status of the
8949last command waited for.
8950If a job spec is given, all processes in the job are waited for.
8951If no arguments are given, all currently active child processes are
8952waited for, and the return status is zero.
8953If neither <VAR>jobspec</VAR> nor <VAR>pid</VAR> specifies an active child process
8954of the shell, the return status is 127.
8955<P>
8956
8957<DT><CODE>disown</CODE>
0001803f 8958<DD><A NAME="IDX298"></A>
17345e5a
JA
8959<TABLE><tr><td>&nbsp;</td><td class=example><pre>disown [-ar] [-h] [<VAR>jobspec</VAR> <small>...</small>]
8960</pre></td></tr></table>Without options, each <VAR>jobspec</VAR> is removed from the table of
8961active jobs.
8962If the <SAMP>`-h'</SAMP> option is given, the job is not removed from the table,
8963but is marked so that <CODE>SIGHUP</CODE> is not sent to the job if the shell
8964receives a <CODE>SIGHUP</CODE>.
8965If <VAR>jobspec</VAR> is not present, and neither the <SAMP>`-a'</SAMP> nor <SAMP>`-r'</SAMP>
8966option is supplied, the current job is used.
8967If no <VAR>jobspec</VAR> is supplied, the <SAMP>`-a'</SAMP> option means to remove or
8968mark all jobs; the <SAMP>`-r'</SAMP> option without a <VAR>jobspec</VAR>
8969argument restricts operation to running jobs.
8970<P>
8971
8972<DT><CODE>suspend</CODE>
0001803f 8973<DD><A NAME="IDX299"></A>
17345e5a
JA
8974<TABLE><tr><td>&nbsp;</td><td class=example><pre>suspend [-f]
8975</pre></td></tr></table>Suspend the execution of this shell until it receives a
8976<CODE>SIGCONT</CODE> signal.
8977A login shell cannot be suspended; the <SAMP>`-f'</SAMP>
8978option can be used to override this and force the suspension.
8979<P>
8980
8981</DL>
8982<P>
8983
8984When job control is not active, the <CODE>kill</CODE> and <CODE>wait</CODE>
8985builtins do not accept <VAR>jobspec</VAR> arguments. They must be
8986supplied process IDs.
8987</P><P>
8988
8989<A NAME="Job Control Variables"></A>
8990<HR SIZE="6">
8991<A NAME="SEC94"></A>
8992<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
8993<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC93"> &lt; </A>]</TD>
8994<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt; </A>]</TD>
8995<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> &lt;&lt; </A>]</TD>
8996<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC91"> Up </A>]</TD>
8997<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &gt;&gt; </A>]</TD>
8998<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
8999<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9000<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9001<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9002</TR></TABLE>
9003<H2> 7.3 Job Control Variables </H2>
9004<!--docid::SEC94::-->
9005<P>
9006
9007<DL COMPACT>
9008
0001803f 9009<A NAME="IDX300"></A>
17345e5a 9010<DT><CODE>auto_resume</CODE>
0001803f 9011<DD><A NAME="IDX301"></A>
17345e5a
JA
9012This variable controls how the shell interacts with the user and
9013job control. If this variable exists then single word simple
9014commands without redirections are treated as candidates for resumption
9015of an existing job. There is no ambiguity allowed; if there is
9016more than one job beginning with the string typed, then
9017the most recently accessed job will be selected.
9018The name of a stopped job, in this context, is the command line
9019used to start it. If this variable is set to the value <SAMP>`exact'</SAMP>,
9020the string supplied must match the name of a stopped job exactly;
9021if set to <SAMP>`substring'</SAMP>,
9022the string supplied needs to match a substring of the name of a
9023stopped job. The <SAMP>`substring'</SAMP> value provides functionality
9024analogous to the <SAMP>`%?'</SAMP> job ID (see section <A HREF="bashref.html#SEC92">7.1 Job Control Basics</A>).
9025If set to any other value, the supplied string must
9026be a prefix of a stopped job's name; this provides functionality
9027analogous to the <SAMP>`%'</SAMP> job ID.
9028<P>
9029
9030</DL>
9031<P>
9032
0001803f 9033<A NAME="IDX302"></A>
17345e5a
JA
9034</P><P>
9035
9036<A NAME="Command Line Editing"></A>
9037<HR SIZE="6">
9038<A NAME="SEC95"></A>
9039<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9040<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC94"> &lt; </A>]</TD>
9041<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &gt; </A>]</TD>
9042<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &lt;&lt; </A>]</TD>
9043<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
9044<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
9045<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9046<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9047<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9048<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9049</TR></TABLE>
9050<H1> 8. Command Line Editing </H1>
9051<!--docid::SEC95::-->
9052<P>
9053
9054This chapter describes the basic features of the GNU
9055command line editing interface.
9056Command line editing is provided by the Readline library, which is
9057used by several different programs, including Bash.
9058Command line editing is enabled by default when using an interactive shell,
9059unless the <SAMP>`--noediting'</SAMP> option is supplied at shell invocation.
9060Line editing is also used when using the <SAMP>`-e'</SAMP> option to the
9061<CODE>read</CODE> builtin command (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
9062By default, the line editing commands are similar to those of emacs.
9063A vi-style line editing interface is also available.
9064Line editing can be enabled at any time using the <SAMP>`-o emacs'</SAMP> or
9065<SAMP>`-o vi'</SAMP> options to the <CODE>set</CODE> builtin command
9066(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>), or disabled using the <SAMP>`+o emacs'</SAMP> or
9067<SAMP>`+o vi'</SAMP> options to <CODE>set</CODE>.
9068</P><P>
9069
9070<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9071<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Notation used in this text.</TD></TR>
9072<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The minimum set of commands for editing a line.</TD></TR>
9073<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Customizing Readline from a user's view.</TD></TR>
9074<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A description of most of the Readline commands
9075 available for binding</TD></TR>
9076<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC116">8.5 Readline vi Mode</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">A short description of how to make Readline
9077 behave like the vi editor.</TD></TR>
9078<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify the possible completions for
9079 a specific command.</TD></TR>
9080<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Builtin commands to specify how to
9081 complete arguments for a particular command.</TD></TR>
9082</TABLE></BLOCKQUOTE>
9083<P>
9084
9085<A NAME="Introduction and Notation"></A>
9086<HR SIZE="6">
9087<A NAME="SEC96"></A>
9088<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9089<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt; </A>]</TD>
9090<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> &gt; </A>]</TD>
9091<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt;&lt; </A>]</TD>
9092<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9093<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
9094<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9095<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9096<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9097<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9098</TR></TABLE>
9099<H2> 8.1 Introduction to Line Editing </H2>
9100<!--docid::SEC96::-->
9101<P>
9102
9103The following paragraphs describe the notation used to represent
9104keystrokes.
9105</P><P>
9106
9107The text <KBD>C-k</KBD> is read as `Control-K' and describes the character
9108produced when the <KBD>k</KBD> key is pressed while the Control key
9109is depressed.
9110</P><P>
9111
9112The text <KBD>M-k</KBD> is read as `Meta-K' and describes the character
9113produced when the Meta key (if you have one) is depressed, and the <KBD>k</KBD>
9114key is pressed.
9115The Meta key is labeled <KBD>ALT</KBD> on many keyboards.
9116On keyboards with two keys labeled <KBD>ALT</KBD> (usually to either side of
9117the space bar), the <KBD>ALT</KBD> on the left side is generally set to
9118work as a Meta key.
9119The <KBD>ALT</KBD> key on the right may also be configured to work as a
9120Meta key or may be configured as some other modifier, such as a
9121Compose key for typing accented characters.
9122</P><P>
9123
9124If you do not have a Meta or <KBD>ALT</KBD> key, or another key working as
9125a Meta key, the identical keystroke can be generated by typing <KBD>ESC</KBD>
9126<EM>first</EM>, and then typing <KBD>k</KBD>.
9127Either process is known as <EM>metafying</EM> the <KBD>k</KBD> key.
9128</P><P>
9129
9130The text <KBD>M-C-k</KBD> is read as `Meta-Control-k' and describes the
9131character produced by <EM>metafying</EM> <KBD>C-k</KBD>.
9132</P><P>
9133
9134In addition, several keys have their own names. Specifically,
9135<KBD>DEL</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, <KBD>SPC</KBD>, <KBD>RET</KBD>, and <KBD>TAB</KBD> all
9136stand for themselves when seen in this text, or in an init file
9137(see section <A HREF="bashref.html#SEC103">8.3 Readline Init File</A>).
9138If your keyboard lacks a <KBD>LFD</KBD> key, typing <KBD>C-j</KBD> will
9139produce the desired character.
9140The <KBD>RET</KBD> key may be labeled <KBD>Return</KBD> or <KBD>Enter</KBD> on
9141some keyboards.
9142</P><P>
9143
9144<A NAME="Readline Interaction"></A>
9145<HR SIZE="6">
9146<A NAME="SEC97"></A>
9147<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9148<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC96"> &lt; </A>]</TD>
9149<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> &gt; </A>]</TD>
9150<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt;&lt; </A>]</TD>
9151<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9152<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9153<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9154<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9155<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9156<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9157</TR></TABLE>
9158<H2> 8.2 Readline Interaction </H2>
9159<!--docid::SEC97::-->
9160<P>
9161
9162Often during an interactive session you type in a long line of text,
9163only to notice that the first word on the line is misspelled. The
9164Readline library gives you a set of commands for manipulating the text
9165as you type it in, allowing you to just fix your typo, and not forcing
9166you to retype the majority of the line. Using these editing commands,
9167you move the cursor to the place that needs correction, and delete or
9168insert the text of the corrections. Then, when you are satisfied with
9169the line, you simply press <KBD>RET</KBD>. You do not have to be at the
9170end of the line to press <KBD>RET</KBD>; the entire line is accepted
9171regardless of the location of the cursor within the line.
9172</P><P>
9173
9174<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9175<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The least you need to know about Readline.</TD></TR>
9176<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Moving about the input line.</TD></TR>
9177<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to delete text, and how to get it back!</TD></TR>
9178<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Giving numeric arguments to commands.</TD></TR>
9179<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Searching through previous lines.</TD></TR>
9180</TABLE></BLOCKQUOTE>
9181<P>
9182
9183<A NAME="Readline Bare Essentials"></A>
9184<HR SIZE="6">
9185<A NAME="SEC98"></A>
9186<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9187<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> &lt; </A>]</TD>
9188<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> &gt; </A>]</TD>
9189<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt;&lt; </A>]</TD>
9190<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9191<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9192<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9193<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9194<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9195<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9196</TR></TABLE>
9197<H3> 8.2.1 Readline Bare Essentials </H3>
9198<!--docid::SEC98::-->
9199<P>
9200
9201In order to enter characters into the line, simply type them. The typed
9202character appears where the cursor was, and then the cursor moves one
9203space to the right. If you mistype a character, you can use your
9204erase character to back up and delete the mistyped character.
9205</P><P>
9206
9207Sometimes you may mistype a character, and
9208not notice the error until you have typed several other characters. In
9209that case, you can type <KBD>C-b</KBD> to move the cursor to the left, and then
9210correct your mistake. Afterwards, you can move the cursor to the right
9211with <KBD>C-f</KBD>.
9212</P><P>
9213
9214When you add text in the middle of a line, you will notice that characters
9215to the right of the cursor are `pushed over' to make room for the text
9216that you have inserted. Likewise, when you delete text behind the cursor,
9217characters to the right of the cursor are `pulled back' to fill in the
9218blank space created by the removal of the text. A list of the bare
9219essentials for editing the text of an input line follows.
9220</P><P>
9221
9222<DL COMPACT>
9223<DT><KBD>C-b</KBD>
9224<DD>Move back one character.
9225<DT><KBD>C-f</KBD>
9226<DD>Move forward one character.
9227<DT><KBD>DEL</KBD> or <KBD>Backspace</KBD>
9228<DD>Delete the character to the left of the cursor.
9229<DT><KBD>C-d</KBD>
9230<DD>Delete the character underneath the cursor.
9231<DT>Printing characters
9232<DD>Insert the character into the line at the cursor.
9233<DT><KBD>C-_</KBD> or <KBD>C-x C-u</KBD>
9234<DD>Undo the last editing command. You can undo all the way back to an
9235empty line.
9236</DL>
9237<P>
9238
9239(Depending on your configuration, the <KBD>Backspace</KBD> key be set to
9240delete the character to the left of the cursor and the <KBD>DEL</KBD> key set
9241to delete the character underneath the cursor, like <KBD>C-d</KBD>, rather
9242than the character to the left of the cursor.)
9243</P><P>
9244
9245<A NAME="Readline Movement Commands"></A>
9246<HR SIZE="6">
9247<A NAME="SEC99"></A>
9248<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9249<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC98"> &lt; </A>]</TD>
9250<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &gt; </A>]</TD>
9251<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &lt;&lt; </A>]</TD>
9252<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9253<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9254<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9255<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9256<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9257<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9258</TR></TABLE>
9259<H3> 8.2.2 Readline Movement Commands </H3>
9260<!--docid::SEC99::-->
9261<P>
9262
9263The above table describes the most basic keystrokes that you need
9264in order to do editing of the input line. For your convenience, many
9265other commands have been added in addition to <KBD>C-b</KBD>, <KBD>C-f</KBD>,
9266<KBD>C-d</KBD>, and <KBD>DEL</KBD>. Here are some commands for moving more rapidly
9267about the line.
9268</P><P>
9269
9270<DL COMPACT>
9271<DT><KBD>C-a</KBD>
9272<DD>Move to the start of the line.
9273<DT><KBD>C-e</KBD>
9274<DD>Move to the end of the line.
9275<DT><KBD>M-f</KBD>
9276<DD>Move forward a word, where a word is composed of letters and digits.
9277<DT><KBD>M-b</KBD>
9278<DD>Move backward a word.
9279<DT><KBD>C-l</KBD>
9280<DD>Clear the screen, reprinting the current line at the top.
9281</DL>
9282<P>
9283
9284Notice how <KBD>C-f</KBD> moves forward a character, while <KBD>M-f</KBD> moves
9285forward a word. It is a loose convention that control keystrokes
9286operate on characters while meta keystrokes operate on words.
9287</P><P>
9288
9289<A NAME="Readline Killing Commands"></A>
9290<HR SIZE="6">
9291<A NAME="SEC100"></A>
9292<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9293<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC99"> &lt; </A>]</TD>
9294<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &gt; </A>]</TD>
9295<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &lt;&lt; </A>]</TD>
9296<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9297<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9298<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9299<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9300<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9301<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9302</TR></TABLE>
9303<H3> 8.2.3 Readline Killing Commands </H3>
9304<!--docid::SEC100::-->
9305<P>
9306
0001803f
CR
9307<A NAME="IDX303"></A>
9308<A NAME="IDX304"></A>
17345e5a
JA
9309</P><P>
9310
9311<EM>Killing</EM> text means to delete the text from the line, but to save
9312it away for later use, usually by <EM>yanking</EM> (re-inserting)
9313it back into the line.
9314(`Cut' and `paste' are more recent jargon for `kill' and `yank'.)
9315</P><P>
9316
9317If the description for a command says that it `kills' text, then you can
9318be sure that you can get the text back in a different (or the same)
9319place later.
9320</P><P>
9321
9322When you use a kill command, the text is saved in a <EM>kill-ring</EM>.
9323Any number of consecutive kills save all of the killed text together, so
9324that when you yank it back, you get it all. The kill
9325ring is not line specific; the text that you killed on a previously
9326typed line is available to be yanked back later, when you are typing
9327another line.
0001803f 9328<A NAME="IDX305"></A>
17345e5a
JA
9329</P><P>
9330
9331Here is the list of commands for killing text.
9332</P><P>
9333
9334<DL COMPACT>
9335<DT><KBD>C-k</KBD>
9336<DD>Kill the text from the current cursor position to the end of the line.
9337<P>
9338
9339<DT><KBD>M-d</KBD>
9340<DD>Kill from the cursor to the end of the current word, or, if between
9341words, to the end of the next word.
9342Word boundaries are the same as those used by <KBD>M-f</KBD>.
9343<P>
9344
9345<DT><KBD>M-<KBD>DEL</KBD></KBD>
9346<DD>Kill from the cursor the start of the current word, or, if between
9347words, to the start of the previous word.
9348Word boundaries are the same as those used by <KBD>M-b</KBD>.
9349<P>
9350
9351<DT><KBD>C-w</KBD>
9352<DD>Kill from the cursor to the previous whitespace. This is different than
9353<KBD>M-<KBD>DEL</KBD></KBD> because the word boundaries differ.
9354<P>
9355
9356</DL>
9357<P>
9358
9359Here is how to <EM>yank</EM> the text back into the line. Yanking
9360means to copy the most-recently-killed text from the kill buffer.
9361</P><P>
9362
9363<DL COMPACT>
9364<DT><KBD>C-y</KBD>
9365<DD>Yank the most recently killed text back into the buffer at the cursor.
9366<P>
9367
9368<DT><KBD>M-y</KBD>
9369<DD>Rotate the kill-ring, and yank the new top. You can only do this if
9370the prior command is <KBD>C-y</KBD> or <KBD>M-y</KBD>.
9371</DL>
9372<P>
9373
9374<A NAME="Readline Arguments"></A>
9375<HR SIZE="6">
9376<A NAME="SEC101"></A>
9377<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9378<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC100"> &lt; </A>]</TD>
9379<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &gt; </A>]</TD>
9380<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &lt;&lt; </A>]</TD>
9381<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9382<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9383<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9384<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9385<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9386<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9387</TR></TABLE>
9388<H3> 8.2.4 Readline Arguments </H3>
9389<!--docid::SEC101::-->
9390<P>
9391
9392You can pass numeric arguments to Readline commands. Sometimes the
9393argument acts as a repeat count, other times it is the <I>sign</I> of the
9394argument that is significant. If you pass a negative argument to a
9395command which normally acts in a forward direction, that command will
9396act in a backward direction. For example, to kill text back to the
9397start of the line, you might type <SAMP>`M-- C-k'</SAMP>.
9398</P><P>
9399
9400The general way to pass numeric arguments to a command is to type meta
9401digits before the command. If the first `digit' typed is a minus
9402sign (<SAMP>`-'</SAMP>), then the sign of the argument will be negative. Once
9403you have typed one meta digit to get the argument started, you can type
9404the remainder of the digits, and then the command. For example, to give
9405the <KBD>C-d</KBD> command an argument of 10, you could type <SAMP>`M-1 0 C-d'</SAMP>,
9406which will delete the next ten characters on the input line.
9407</P><P>
9408
9409<A NAME="Searching"></A>
9410<HR SIZE="6">
9411<A NAME="SEC102"></A>
9412<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9413<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC101"> &lt; </A>]</TD>
9414<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt; </A>]</TD>
9415<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt;&lt; </A>]</TD>
9416<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC97"> Up </A>]</TD>
9417<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &gt;&gt; </A>]</TD>
9418<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9419<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9420<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9421<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9422</TR></TABLE>
9423<H3> 8.2.5 Searching for Commands in the History </H3>
9424<!--docid::SEC102::-->
9425<P>
9426
9427Readline provides commands for searching through the command history
9428(see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>)
9429for lines containing a specified string.
9430There are two search modes: <EM>incremental</EM> and <EM>non-incremental</EM>.
9431</P><P>
9432
9433Incremental searches begin before the user has finished typing the
9434search string.
9435As each character of the search string is typed, Readline displays
9436the next entry from the history matching the string typed so far.
9437An incremental search requires only as many characters as needed to
9438find the desired history entry.
9439To search backward in the history for a particular string, type
9440<KBD>C-r</KBD>. Typing <KBD>C-s</KBD> searches forward through the history.
9441The characters present in the value of the <CODE>isearch-terminators</CODE> variable
9442are used to terminate an incremental search.
9443If that variable has not been assigned a value, the <KBD>ESC</KBD> and
9444<KBD>C-J</KBD> characters will terminate an incremental search.
9445<KBD>C-g</KBD> will abort an incremental search and restore the original line.
9446When the search is terminated, the history entry containing the
9447search string becomes the current line.
9448</P><P>
9449
9450To find other matching entries in the history list, type <KBD>C-r</KBD> or
9451<KBD>C-s</KBD> as appropriate.
9452This will search backward or forward in the history for the next
9453entry matching the search string typed so far.
9454Any other key sequence bound to a Readline command will terminate
9455the search and execute that command.
9456For instance, a <KBD>RET</KBD> will terminate the search and accept
9457the line, thereby executing the command from the history list.
9458A movement command will terminate the search, make the last line found
9459the current line, and begin editing.
9460</P><P>
9461
9462Readline remembers the last incremental search string. If two
9463<KBD>C-r</KBD>s are typed without any intervening characters defining a new
9464search string, any remembered search string is used.
9465</P><P>
9466
9467Non-incremental searches read the entire search string before starting
9468to search for matching history lines. The search string may be
9469typed by the user or be part of the contents of the current line.
9470</P><P>
9471
9472<A NAME="Readline Init File"></A>
9473<HR SIZE="6">
9474<A NAME="SEC103"></A>
9475<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9476<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC102"> &lt; </A>]</TD>
9477<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &gt; </A>]</TD>
9478<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt;&lt; </A>]</TD>
9479<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
9480<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
9481<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9482<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9483<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9484<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9485</TR></TABLE>
9486<H2> 8.3 Readline Init File </H2>
9487<!--docid::SEC103::-->
9488<P>
9489
9490Although the Readline library comes with a set of Emacs-like
9491keybindings installed by default, it is possible to use a different set
9492of keybindings.
9493Any user can customize programs that use Readline by putting
9494commands in an <EM>inputrc</EM> file, conventionally in his home directory.
9495The name of this
9496file is taken from the value of the shell variable <CODE>INPUTRC</CODE>. If
9497that variable is unset, the default is <TT>`~/.inputrc'</TT>. If that
9498file does not exist or cannot be read, the ultimate default is
9499<TT>`/etc/inputrc'</TT>.
9500</P><P>
9501
9502When a program which uses the Readline library starts up, the
9503init file is read, and the key bindings are set.
9504</P><P>
9505
9506In addition, the <CODE>C-x C-r</CODE> command re-reads this init file, thus
9507incorporating any changes that you might have made to it.
9508</P><P>
9509
9510<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
9511<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Syntax for the commands in the inputrc file.</TD></TR>
9512</TABLE>
9513
9514<br>
9515<TABLE BORDER=0 CELLSPACING=0>
9516<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Conditional key bindings in the inputrc file.</TD></TR>
9517</TABLE>
9518
9519<br>
9520<TABLE BORDER=0 CELLSPACING=0>
9521<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC106">8.3.3 Sample Init File</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">An example inputrc file.</TD></TR>
9522</TABLE></BLOCKQUOTE>
9523<P>
9524
9525<A NAME="Readline Init File Syntax"></A>
9526<HR SIZE="6">
9527<A NAME="SEC104"></A>
9528<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
9529<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> &lt; </A>]</TD>
9530<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> &gt; </A>]</TD>
9531<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt;&lt; </A>]</TD>
9532<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
9533<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
9534<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
9535<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
9536<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
9537<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
9538</TR></TABLE>
9539<H3> 8.3.1 Readline Init File Syntax </H3>
9540<!--docid::SEC104::-->
9541<P>
9542
9543There are only a few basic constructs allowed in the
9544Readline init file. Blank lines are ignored.
9545Lines beginning with a <SAMP>`#'</SAMP> are comments.
9546Lines beginning with a <SAMP>`$'</SAMP> indicate conditional
9547constructs (see section <A HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>). Other lines
9548denote variable settings and key bindings.
9549</P><P>
9550
9551<DL COMPACT>
9552<DT>Variable Settings
9553<DD>You can modify the run-time behavior of Readline by
9554altering the values of variables in Readline
9555using the <CODE>set</CODE> command within the init file.
9556The syntax is simple:
9557<P>
9558
9559<TABLE><tr><td>&nbsp;</td><td class=example><pre>set <VAR>variable</VAR> <VAR>value</VAR>
9560</pre></td></tr></table></P><P>
9561
9562Here, for example, is how to
9563change from the default Emacs-like key binding to use
9564<CODE>vi</CODE> line editing commands:
9565</P><P>
9566
9567<TABLE><tr><td>&nbsp;</td><td class=example><pre>set editing-mode vi
9568</pre></td></tr></table></P><P>
9569
9570Variable names and values, where appropriate, are recognized without regard
9571to case. Unrecognized variable names are ignored.
9572</P><P>
9573
9574Boolean variables (those that can be set to on or off) are set to on if
9575the value is null or empty, <VAR>on</VAR> (case-insensitive), or 1. Any other
9576value results in the variable being set to off.
9577</P><P>
9578
9579The <CODE>bind -V</CODE> command lists the current Readline variable names
9580and values. See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.
9581</P><P>
9582
9583A great deal of run-time behavior is changeable with the following
9584variables.
9585</P><P>
9586
0001803f 9587<A NAME="IDX306"></A>
17345e5a
JA
9588<DL COMPACT>
9589
9590<DT><CODE>bell-style</CODE>
0001803f 9591<DD><A NAME="IDX307"></A>
17345e5a
JA
9592Controls what happens when Readline wants to ring the terminal bell.
9593If set to <SAMP>`none'</SAMP>, Readline never rings the bell. If set to
9594<SAMP>`visible'</SAMP>, Readline uses a visible bell if one is available.
9595If set to <SAMP>`audible'</SAMP> (the default), Readline attempts to ring
9596the terminal's bell.
9597<P>
9598
9599<DT><CODE>bind-tty-special-chars</CODE>
0001803f 9600<DD><A NAME="IDX308"></A>
17345e5a
JA
9601If set to <SAMP>`on'</SAMP>, Readline attempts to bind the control characters
9602treated specially by the kernel's terminal driver to their Readline
9603equivalents.
9604<P>
9605
9606<DT><CODE>comment-begin</CODE>
0001803f 9607<DD><A NAME="IDX309"></A>
17345e5a
JA
9608The string to insert at the beginning of the line when the
9609<CODE>insert-comment</CODE> command is executed. The default value
9610is <CODE>"#"</CODE>.
9611<P>
9612
9613<DT><CODE>completion-ignore-case</CODE>
9614<DD>If set to <SAMP>`on'</SAMP>, Readline performs filename matching and completion
9615in a case-insensitive fashion.
9616The default value is <SAMP>`off'</SAMP>.
9617<P>
9618
9619<DT><CODE>completion-prefix-display-length</CODE>
0001803f 9620<DD><A NAME="IDX310"></A>
17345e5a
JA
9621The length in characters of the common prefix of a list of possible
9622completions that is displayed without modification. When set to a
9623value greater than zero, common prefixes longer than this value are
9624replaced with an ellipsis when displaying possible completions.
9625<P>
9626
9627<DT><CODE>completion-query-items</CODE>
0001803f 9628<DD><A NAME="IDX311"></A>
17345e5a
JA
9629The number of possible completions that determines when the user is
9630asked whether the list of possibilities should be displayed.
9631If the number of possible completions is greater than this value,
9632Readline will ask the user whether or not he wishes to view
9633them; otherwise, they are simply listed.
9634This variable must be set to an integer value greater than or equal to 0.
9635A negative value means Readline should never ask.
9636The default limit is <CODE>100</CODE>.
9637<P>
9638
9639<DT><CODE>convert-meta</CODE>
0001803f 9640<DD><A NAME="IDX312"></A>
17345e5a
JA
9641If set to <SAMP>`on'</SAMP>, Readline will convert characters with the
9642eighth bit set to an ASCII key sequence by stripping the eighth
9643bit and prefixing an <KBD>ESC</KBD> character, converting them to a
9644meta-prefixed key sequence. The default value is <SAMP>`on'</SAMP>.
9645<P>
9646
9647<DT><CODE>disable-completion</CODE>
0001803f 9648<DD><A NAME="IDX313"></A>
17345e5a
JA
9649If set to <SAMP>`On'</SAMP>, Readline will inhibit word completion.
9650Completion characters will be inserted into the line as if they had
9651been mapped to <CODE>self-insert</CODE>. The default is <SAMP>`off'</SAMP>.
9652<P>
9653
9654<DT><CODE>editing-mode</CODE>
0001803f 9655<DD><A NAME="IDX314"></A>
17345e5a
JA
9656The <CODE>editing-mode</CODE> variable controls which default set of
9657key bindings is used. By default, Readline starts up in Emacs editing
9658mode, where the keystrokes are most similar to Emacs. This variable can be
9659set to either <SAMP>`emacs'</SAMP> or <SAMP>`vi'</SAMP>.
9660<P>
9661
0001803f
CR
9662<DT><CODE>echo-control-characters</CODE>
9663<DD>When set to <SAMP>`on'</SAMP>, on operating systems that indicate they support it,
9664readline echoes a character corresponding to a signal generated from the
9665keyboard. The default is <SAMP>`on'</SAMP>.
9666<P>
9667
17345e5a 9668<DT><CODE>enable-keypad</CODE>
0001803f 9669<DD><A NAME="IDX315"></A>
17345e5a
JA
9670When set to <SAMP>`on'</SAMP>, Readline will try to enable the application
9671keypad when it is called. Some systems need this to enable the
9672arrow keys. The default is <SAMP>`off'</SAMP>.
9673<P>
9674
0001803f
CR
9675<DT><CODE>enable-meta-key</CODE>
9676<DD>When set to <SAMP>`on'</SAMP>, Readline will try to enable any meta modifier
9677key the terminal claims to support when it is called. On many terminals,
9678the meta key is used to send eight-bit characters.
9679The default is <SAMP>`on'</SAMP>.
9680<P>
9681
17345e5a 9682<DT><CODE>expand-tilde</CODE>
0001803f 9683<DD><A NAME="IDX316"></A>
17345e5a
JA
9684If set to <SAMP>`on'</SAMP>, tilde expansion is performed when Readline
9685attempts word completion. The default is <SAMP>`off'</SAMP>.
9686<P>
9687
9688<DT><CODE>history-preserve-point</CODE>
0001803f 9689<DD><A NAME="IDX317"></A>
17345e5a
JA
9690If set to <SAMP>`on'</SAMP>, the history code attempts to place the point (the
9691current cursor position) at the
9692same location on each history line retrieved with <CODE>previous-history</CODE>
9693or <CODE>next-history</CODE>. The default is <SAMP>`off'</SAMP>.
9694<P>
9695
9696<DT><CODE>history-size</CODE>
0001803f 9697<DD><A NAME="IDX318"></A>
17345e5a
JA
9698Set the maximum number of history entries saved in the history list. If
9699set to zero, the number of entries in the history list is not limited.
9700<P>
9701
9702<DT><CODE>horizontal-scroll-mode</CODE>
0001803f 9703<DD><A NAME="IDX319"></A>
17345e5a
JA
9704This variable can be set to either <SAMP>`on'</SAMP> or <SAMP>`off'</SAMP>. Setting it
9705to <SAMP>`on'</SAMP> means that the text of the lines being edited will scroll
9706horizontally on a single screen line when they are longer than the width
9707of the screen, instead of wrapping onto a new screen line. By default,
9708this variable is set to <SAMP>`off'</SAMP>.
9709<P>
9710
9711<DT><CODE>input-meta</CODE>
0001803f
CR
9712<DD><A NAME="IDX320"></A>
9713<A NAME="IDX321"></A>
17345e5a
JA
9714If set to <SAMP>`on'</SAMP>, Readline will enable eight-bit input (it
9715will not clear the eighth bit in the characters it reads),
9716regardless of what the terminal claims it can support. The
9717default value is <SAMP>`off'</SAMP>. The name <CODE>meta-flag</CODE> is a
9718synonym for this variable.
9719<P>
9720
9721<DT><CODE>isearch-terminators</CODE>
0001803f 9722<DD><A NAME="IDX322"></A>
17345e5a
JA
9723The string of characters that should terminate an incremental search without
9724subsequently executing the character as a command (see section <A HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>).
9725If this variable has not been given a value, the characters <KBD>ESC</KBD> and
9726<KBD>C-J</KBD> will terminate an incremental search.
9727<P>
9728
9729<DT><CODE>keymap</CODE>
0001803f 9730<DD><A NAME="IDX323"></A>
17345e5a
JA
9731Sets Readline's idea of the current keymap for key binding commands.
9732Acceptable <CODE>keymap</CODE> names are
9733<CODE>emacs</CODE>,
9734<CODE>emacs-standard</CODE>,
9735<CODE>emacs-meta</CODE>,
9736<CODE>emacs-ctlx</CODE>,
9737<CODE>vi</CODE>,
9738<CODE>vi-move</CODE>,
9739<CODE>vi-command</CODE>, and
9740<CODE>vi-insert</CODE>.
9741<CODE>vi</CODE> is equivalent to <CODE>vi-command</CODE>; <CODE>emacs</CODE> is
9742equivalent to <CODE>emacs-standard</CODE>. The default value is <CODE>emacs</CODE>.
9743The value of the <CODE>editing-mode</CODE> variable also affects the
9744default keymap.
9745<P>
9746
9747<DT><CODE>mark-directories</CODE>
9748<DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash
9749appended. The default is <SAMP>`on'</SAMP>.
9750<P>
9751
9752<DT><CODE>mark-modified-lines</CODE>
0001803f 9753<DD><A NAME="IDX324"></A>
17345e5a
JA
9754This variable, when set to <SAMP>`on'</SAMP>, causes Readline to display an
9755asterisk (<SAMP>`*'</SAMP>) at the start of history lines which have been modified.
9756This variable is <SAMP>`off'</SAMP> by default.
9757<P>
9758
9759<DT><CODE>mark-symlinked-directories</CODE>
0001803f 9760<DD><A NAME="IDX325"></A>
17345e5a
JA
9761If set to <SAMP>`on'</SAMP>, completed names which are symbolic links
9762to directories have a slash appended (subject to the value of
9763<CODE>mark-directories</CODE>).
9764The default is <SAMP>`off'</SAMP>.
9765<P>
9766
9767<DT><CODE>match-hidden-files</CODE>
0001803f 9768<DD><A NAME="IDX326"></A>
17345e5a
JA
9769This variable, when set to <SAMP>`on'</SAMP>, causes Readline to match files whose
9770names begin with a <SAMP>`.'</SAMP> (hidden files) when performing filename
9771completion, unless the leading <SAMP>`.'</SAMP> is
9772supplied by the user in the filename to be completed.
9773This variable is <SAMP>`on'</SAMP> by default.
9774<P>
9775
9776<DT><CODE>output-meta</CODE>
0001803f 9777<DD><A NAME="IDX327"></A>
17345e5a
JA
9778If set to <SAMP>`on'</SAMP>, Readline will display characters with the
9779eighth bit set directly rather than as a meta-prefixed escape
9780sequence. The default is <SAMP>`off'</SAMP>.
9781<P>
9782
9783<DT><CODE>page-completions</CODE>
0001803f 9784<DD><A NAME="IDX328"></A>
17345e5a
JA
9785If set to <SAMP>`on'</SAMP>, Readline uses an internal <CODE>more</CODE>-like pager
9786to display a screenful of possible completions at a time.
9787This variable is <SAMP>`on'</SAMP> by default.
9788<P>
9789
9790<DT><CODE>print-completions-horizontally</CODE>
9791<DD>If set to <SAMP>`on'</SAMP>, Readline will display completions with matches
9792sorted horizontally in alphabetical order, rather than down the screen.
9793The default is <SAMP>`off'</SAMP>.
9794<P>
9795
9796<DT><CODE>revert-all-at-newline</CODE>
0001803f 9797<DD><A NAME="IDX329"></A>
17345e5a
JA
9798If set to <SAMP>`on'</SAMP>, Readline will undo all changes to history lines
9799before returning when <CODE>accept-line</CODE> is executed. By default,
9800history lines may be modified and retain individual undo lists across
9801calls to <CODE>readline</CODE>. The default is <SAMP>`off'</SAMP>.
9802<P>
9803
9804<DT><CODE>show-all-if-ambiguous</CODE>
0001803f 9805<DD><A NAME="IDX330"></A>
17345e5a
JA
9806This alters the default behavior of the completion functions. If
9807set to <SAMP>`on'</SAMP>,
9808words which have more than one possible completion cause the
9809matches to be listed immediately instead of ringing the bell.
9810The default value is <SAMP>`off'</SAMP>.
9811<P>
9812
9813<DT><CODE>show-all-if-unmodified</CODE>
0001803f 9814<DD><A NAME="IDX331"></A>
17345e5a
JA
9815This alters the default behavior of the completion functions in
9816a fashion similar to <VAR>show-all-if-ambiguous</VAR>.
9817If set to <SAMP>`on'</SAMP>,
9818words which have more than one possible completion without any
9819possible partial completion (the possible completions don't share
9820a common prefix) cause the matches to be listed immediately instead
9821of ringing the bell.
9822The default value is <SAMP>`off'</SAMP>.
9823<P>
9824
0001803f
CR
9825<DT><CODE>skip-completed-text</CODE>
9826<DD><A NAME="IDX332"></A>
9827If set to <SAMP>`on'</SAMP>, this alters the default completion behavior when
9828inserting a single match into the line. It's only active when
9829performing completion in the middle of a word. If enabled, readline
9830does not insert characters from the completion that match characters
9831after point in the word being completed, so portions of the word
9832following the cursor are not duplicated.
9833For instance, if this is enabled, attempting completion when the cursor
9834is after the <SAMP>`e'</SAMP> in <SAMP>`Makefile'</SAMP> will result in <SAMP>`Makefile'</SAMP>
9835rather than <SAMP>`Makefilefile'</SAMP>, assuming there is a single possible
9836completion.
9837The default value is <SAMP>`off'</SAMP>.
9838<P>
9839
17345e5a 9840<DT><CODE>visible-stats</CODE>
0001803f 9841<DD><A NAME="IDX333"></A>
17345e5a
JA
9842If set to <SAMP>`on'</SAMP>, a character denoting a file's type
9843is appended to the filename when listing possible
9844completions. The default is <SAMP>`off'</SAMP>.
9845<P>
9846
9847</DL>
9848<P>
9849
9850<DT>Key Bindings
9851<DD>The syntax for controlling key bindings in the init file is
9852simple. First you need to find the name of the command that you
9853want to change. The following sections contain tables of the command
9854name, the default keybinding, if any, and a short description of what
9855the command does.
9856<P>
9857
9858Once you know the name of the command, simply place on a line
9859in the init file the name of the key
9860you wish to bind the command to, a colon, and then the name of the
9861command.
9862There can be no space between the key name and the colon -- that will be
9863interpreted as part of the key name.
9864The name of the key can be expressed in different ways, depending on
9865what you find most comfortable.
9866</P><P>
9867
9868In addition to command names, readline allows keys to be bound
9869to a string that is inserted when the key is pressed (a <VAR>macro</VAR>).
9870</P><P>
9871
9872The <CODE>bind -p</CODE> command displays Readline function names and
9873bindings in a format that can put directly into an initialization file.
9874See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.
9875</P><P>
9876
9877<DL COMPACT>
9878<DT><VAR>keyname</VAR>: <VAR>function-name</VAR> or <VAR>macro</VAR>
9879<DD><VAR>keyname</VAR> is the name of a key spelled out in English. For example:
9880<TABLE><tr><td>&nbsp;</td><td class=example><pre>Control-u: universal-argument
9881Meta-Rubout: backward-kill-word
9882Control-o: "&#62; output"
9883</pre></td></tr></table><P>
9884
9885In the above example, <KBD>C-u</KBD> is bound to the function
9886<CODE>universal-argument</CODE>,
9887<KBD>M-DEL</KBD> is bound to the function <CODE>backward-kill-word</CODE>, and
9888<KBD>C-o</KBD> is bound to run the macro
9889expressed on the right hand side (that is, to insert the text
9890<SAMP>`&#62; output'</SAMP> into the line).
9891</P><P>
9892
9893A number of symbolic character names are recognized while
9894processing this key binding syntax:
9895<VAR>DEL</VAR>,
9896<VAR>ESC</VAR>,
9897<VAR>ESCAPE</VAR>,
9898<VAR>LFD</VAR>,
9899<VAR>NEWLINE</VAR>,
9900<VAR>RET</VAR>,
9901<VAR>RETURN</VAR>,
9902<VAR>RUBOUT</VAR>,
9903<VAR>SPACE</VAR>,
9904<VAR>SPC</VAR>,
9905and
9906<VAR>TAB</VAR>.
9907</P><P>
9908
9909<DT>"<VAR>keyseq</VAR>": <VAR>function-name</VAR> or <VAR>macro</VAR>
9910<DD><VAR>keyseq</VAR> differs from <VAR>keyname</VAR> above in that strings
9911denoting an entire key sequence can be specified, by placing
9912the key sequence in double quotes. Some GNU Emacs style key
9913escapes can be used, as in the following example, but the
9914special character names are not recognized.
9915<P>
9916
9917<TABLE><tr><td>&nbsp;</td><td class=example><pre>"\C-u": universal-argument
9918"\C-x\C-r": re-read-init-file
9919"\e[11~": "Function Key 1"
9920</pre></td></tr></table></P><P>
9921
9922In the above example, <KBD>C-u</KBD> is again bound to the function
9923<CODE>universal-argument</CODE> (just as it was in the first example),
9924<SAMP>`<KBD>C-x</KBD> <KBD>C-r</KBD>'</SAMP> is bound to the function <CODE>re-read-init-file</CODE>,
9925and <SAMP>`<KBD>ESC</KBD> <KBD>[</KBD> <KBD>1</KBD> <KBD>1</KBD> <KBD>~</KBD>'</SAMP> is bound to insert
9926the text <SAMP>`Function Key 1'</SAMP>.
9927</P><P>
9928
9929</DL>
9930<P>
9931
9932The following GNU Emacs style escape sequences are available when
9933specifying key sequences:
9934</P><P>
9935
9936<DL COMPACT>
9937<DT><CODE><KBD>\C-</KBD></CODE>
9938<DD>control prefix
9939<DT><CODE><KBD>\M-</KBD></CODE>
9940<DD>meta prefix
9941<DT><CODE><KBD>\e</KBD></CODE>
9942<DD>an escape character
9943<DT><CODE><KBD>\\</KBD></CODE>
9944<DD>backslash
9945<DT><CODE><KBD>\"</KBD></CODE>
9946<DD><KBD>"</KBD>, a double quotation mark
9947<DT><CODE><KBD>\'</KBD></CODE>
9948<DD><KBD>'</KBD>, a single quote or apostrophe
9949</DL>
9950<P>
9951
9952In addition to the GNU Emacs style escape sequences, a second
9953set of backslash escapes is available:
9954</P><P>
9955
9956<DL COMPACT>
9957<DT><CODE>\a</CODE>
9958<DD>alert (bell)
9959<DT><CODE>\b</CODE>
9960<DD>backspace
9961<DT><CODE>\d</CODE>
9962<DD>delete
9963<DT><CODE>\f</CODE>
9964<DD>form feed
9965<DT><CODE>\n</CODE>
9966<DD>newline
9967<DT><CODE>\r</CODE>
9968<DD>carriage return
9969<DT><CODE>\t</CODE>
9970<DD>horizontal tab
9971<DT><CODE>\v</CODE>
9972<DD>vertical tab
9973<DT><CODE>\<VAR>nnn</VAR></CODE>
9974<DD>the eight-bit character whose value is the octal value <VAR>nnn</VAR>
9975(one to three digits)
9976<DT><CODE>\x<VAR>HH</VAR></CODE>
9977<DD>the eight-bit character whose value is the hexadecimal value <VAR>HH</VAR>
9978(one or two hex digits)
9979</DL>
9980<P>
9981
9982When entering the text of a macro, single or double quotes must
9983be used to indicate a macro definition.
9984Unquoted text is assumed to be a function name.
9985In the macro body, the backslash escapes described above are expanded.
9986Backslash will quote any other character in the macro text,
9987including <SAMP>`"'</SAMP> and <SAMP>`''</SAMP>.
9988For example, the following binding will make <SAMP>`<KBD>C-x</KBD> \'</SAMP>
9989insert a single <SAMP>`\'</SAMP> into the line:
9990<TABLE><tr><td>&nbsp;</td><td class=example><pre>"\C-x\\": "\\"
9991</pre></td></tr></table></P><P>
9992
9993</DL>
9994<P>
9995
9996<A NAME="Conditional Init Constructs"></A>
9997<HR SIZE="6">
9998<A NAME="SEC105"></A>
9999<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10000<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC104"> &lt; </A>]</TD>
10001<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &gt; </A>]</TD>
10002<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &lt;&lt; </A>]</TD>
10003<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
10004<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
10005<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10006<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10007<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10008<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10009</TR></TABLE>
10010<H3> 8.3.2 Conditional Init Constructs </H3>
10011<!--docid::SEC105::-->
10012<P>
10013
10014Readline implements a facility similar in spirit to the conditional
10015compilation features of the C preprocessor which allows key
10016bindings and variable settings to be performed as the result
10017of tests. There are four parser directives used.
10018</P><P>
10019
10020<DL COMPACT>
10021<DT><CODE>$if</CODE>
10022<DD>The <CODE>$if</CODE> construct allows bindings to be made based on the
10023editing mode, the terminal being used, or the application using
10024Readline. The text of the test extends to the end of the line;
10025no characters are required to isolate it.
10026<P>
10027
10028<DL COMPACT>
10029<DT><CODE>mode</CODE>
10030<DD>The <CODE>mode=</CODE> form of the <CODE>$if</CODE> directive is used to test
10031whether Readline is in <CODE>emacs</CODE> or <CODE>vi</CODE> mode.
10032This may be used in conjunction
10033with the <SAMP>`set keymap'</SAMP> command, for instance, to set bindings in
10034the <CODE>emacs-standard</CODE> and <CODE>emacs-ctlx</CODE> keymaps only if
10035Readline is starting out in <CODE>emacs</CODE> mode.
10036<P>
10037
10038<DT><CODE>term</CODE>
10039<DD>The <CODE>term=</CODE> form may be used to include terminal-specific
10040key bindings, perhaps to bind the key sequences output by the
10041terminal's function keys. The word on the right side of the
10042<SAMP>`='</SAMP> is tested against both the full name of the terminal and
10043the portion of the terminal name before the first <SAMP>`-'</SAMP>. This
10044allows <CODE>sun</CODE> to match both <CODE>sun</CODE> and <CODE>sun-cmd</CODE>,
10045for instance.
10046<P>
10047
10048<DT><CODE>application</CODE>
10049<DD>The <VAR>application</VAR> construct is used to include
10050application-specific settings. Each program using the Readline
10051library sets the <VAR>application name</VAR>, and you can test for
10052a particular value.
10053This could be used to bind key sequences to functions useful for
10054a specific program. For instance, the following command adds a
10055key sequence that quotes the current or previous word in Bash:
10056<TABLE><tr><td>&nbsp;</td><td class=example><pre>$if Bash
10057# Quote the current or previous word
10058"\C-xq": "\eb\"\ef\""
10059$endif
10060</pre></td></tr></table></DL>
10061<P>
10062
10063<DT><CODE>$endif</CODE>
10064<DD>This command, as seen in the previous example, terminates an
10065<CODE>$if</CODE> command.
10066<P>
10067
10068<DT><CODE>$else</CODE>
10069<DD>Commands in this branch of the <CODE>$if</CODE> directive are executed if
10070the test fails.
10071<P>
10072
10073<DT><CODE>$include</CODE>
10074<DD>This directive takes a single filename as an argument and reads commands
10075and bindings from that file.
10076For example, the following directive reads from <TT>`/etc/inputrc'</TT>:
10077<TABLE><tr><td>&nbsp;</td><td class=example><pre>$include /etc/inputrc
10078</pre></td></tr></table></DL>
10079<P>
10080
10081<A NAME="Sample Init File"></A>
10082<HR SIZE="6">
10083<A NAME="SEC106"></A>
10084<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10085<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC105"> &lt; </A>]</TD>
10086<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt; </A>]</TD>
10087<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt;&lt; </A>]</TD>
10088<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC103"> Up </A>]</TD>
10089<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &gt;&gt; </A>]</TD>
10090<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10091<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10092<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10093<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10094</TR></TABLE>
10095<H3> 8.3.3 Sample Init File </H3>
10096<!--docid::SEC106::-->
10097<P>
10098
10099Here is an example of an <VAR>inputrc</VAR> file. This illustrates key
10100binding, variable assignment, and conditional syntax.
10101</P><P>
10102
10103<TABLE><tr><td>&nbsp;</td><td class=example><pre># This file controls the behaviour of line input editing for
10104# programs that use the GNU Readline library. Existing
10105# programs include FTP, Bash, and GDB.
10106#
10107# You can re-read the inputrc file with C-x C-r.
10108# Lines beginning with '#' are comments.
10109#
10110# First, include any systemwide bindings and variable
10111# assignments from /etc/Inputrc
10112$include /etc/Inputrc
10113
10114#
10115# Set various bindings for emacs mode.
10116
10117set editing-mode emacs
10118
10119$if mode=emacs
10120
10121Meta-Control-h: backward-kill-word Text after the function name is ignored
10122
10123#
10124# Arrow keys in keypad mode
10125#
10126#"\M-OD": backward-char
10127#"\M-OC": forward-char
10128#"\M-OA": previous-history
10129#"\M-OB": next-history
10130#
10131# Arrow keys in ANSI mode
10132#
10133"\M-[D": backward-char
10134"\M-[C": forward-char
10135"\M-[A": previous-history
10136"\M-[B": next-history
10137#
10138# Arrow keys in 8 bit keypad mode
10139#
10140#"\M-\C-OD": backward-char
10141#"\M-\C-OC": forward-char
10142#"\M-\C-OA": previous-history
10143#"\M-\C-OB": next-history
10144#
10145# Arrow keys in 8 bit ANSI mode
10146#
10147#"\M-\C-[D": backward-char
10148#"\M-\C-[C": forward-char
10149#"\M-\C-[A": previous-history
10150#"\M-\C-[B": next-history
10151
10152C-q: quoted-insert
10153
10154$endif
10155
10156# An old-style binding. This happens to be the default.
10157TAB: complete
10158
10159# Macros that are convenient for shell interaction
10160$if Bash
10161# edit the path
10162"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
10163# prepare to type a quoted word --
10164# insert open and close double quotes
10165# and move to just after the open quote
10166"\C-x\"": "\"\"\C-b"
10167# insert a backslash (testing backslash escapes
10168# in sequences and macros)
10169"\C-x\\": "\\"
10170# Quote the current or previous word
10171"\C-xq": "\eb\"\ef\""
10172# Add a binding to refresh the line, which is unbound
10173"\C-xr": redraw-current-line
10174# Edit variable on current line.
10175"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
10176$endif
10177
10178# use a visible bell if one is available
10179set bell-style visible
10180
10181# don't strip characters to 7 bits when reading
10182set input-meta on
10183
10184# allow iso-latin1 characters to be inserted rather
10185# than converted to prefix-meta sequences
10186set convert-meta off
10187
10188# display characters with the eighth bit set directly
10189# rather than as meta-prefixed characters
10190set output-meta on
10191
10192# if there are more than 150 possible completions for
10193# a word, ask the user if he wants to see all of them
10194set completion-query-items 150
10195
10196# For FTP
10197$if Ftp
10198"\C-xg": "get \M-?"
10199"\C-xt": "put \M-?"
10200"\M-.": yank-last-arg
10201$endif
10202</pre></td></tr></table></P><P>
10203
10204<A NAME="Bindable Readline Commands"></A>
10205<HR SIZE="6">
10206<A NAME="SEC107"></A>
10207<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10208<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC106"> &lt; </A>]</TD>
10209<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &gt; </A>]</TD>
10210<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt;&lt; </A>]</TD>
10211<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
10212<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10213<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10214<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10215<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10216<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10217</TR></TABLE>
10218<H2> 8.4 Bindable Readline Commands </H2>
10219<!--docid::SEC107::-->
10220<P>
10221
10222<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
10223<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Moving about the line.</TD></TR>
10224<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Getting at previous lines.</TD></TR>
10225<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands for changing text.</TD></TR>
10226<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Commands for killing and yanking.</TD></TR>
10227<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Specifying numeric arguments, repeat counts.</TD></TR>
10228<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Getting Readline to do the typing for you.</TD></TR>
10229<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Saving and re-executing typed characters</TD></TR>
10230<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Other miscellaneous commands.</TD></TR>
10231</TABLE></BLOCKQUOTE>
10232<P>
10233
10234This section describes Readline commands that may be bound to key
10235sequences.
10236You can list your key bindings by executing
10237<CODE>bind -P</CODE> or, for a more terse format, suitable for an
10238<VAR>inputrc</VAR> file, <CODE>bind -p</CODE>. (See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>.)
10239Command names without an accompanying key sequence are unbound by default.
10240</P><P>
10241
10242In the following descriptions, <EM>point</EM> refers to the current cursor
10243position, and <EM>mark</EM> refers to a cursor position saved by the
10244<CODE>set-mark</CODE> command.
10245The text between the point and mark is referred to as the <EM>region</EM>.
10246</P><P>
10247
10248<A NAME="Commands For Moving"></A>
10249<HR SIZE="6">
10250<A NAME="SEC108"></A>
10251<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10252<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> &lt; </A>]</TD>
10253<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> &gt; </A>]</TD>
10254<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt;&lt; </A>]</TD>
10255<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10256<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10257<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10258<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10259<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10260<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10261</TR></TABLE>
10262<H3> 8.4.1 Commands For Moving </H3>
10263<!--docid::SEC108::-->
10264<DL COMPACT>
0001803f 10265<A NAME="IDX334"></A>
17345e5a 10266<DT><CODE>beginning-of-line (C-a)</CODE>
0001803f 10267<DD><A NAME="IDX335"></A>
17345e5a
JA
10268Move to the start of the current line.
10269<P>
10270
0001803f 10271<A NAME="IDX336"></A>
17345e5a 10272<DT><CODE>end-of-line (C-e)</CODE>
0001803f 10273<DD><A NAME="IDX337"></A>
17345e5a
JA
10274Move to the end of the line.
10275<P>
10276
0001803f 10277<A NAME="IDX338"></A>
17345e5a 10278<DT><CODE>forward-char (C-f)</CODE>
0001803f 10279<DD><A NAME="IDX339"></A>
17345e5a
JA
10280Move forward a character.
10281<P>
10282
0001803f 10283<A NAME="IDX340"></A>
17345e5a 10284<DT><CODE>backward-char (C-b)</CODE>
0001803f 10285<DD><A NAME="IDX341"></A>
17345e5a
JA
10286Move back a character.
10287<P>
10288
0001803f 10289<A NAME="IDX342"></A>
17345e5a 10290<DT><CODE>forward-word (M-f)</CODE>
0001803f 10291<DD><A NAME="IDX343"></A>
17345e5a
JA
10292Move forward to the end of the next word.
10293Words are composed of letters and digits.
10294<P>
10295
0001803f 10296<A NAME="IDX344"></A>
17345e5a 10297<DT><CODE>backward-word (M-b)</CODE>
0001803f 10298<DD><A NAME="IDX345"></A>
17345e5a
JA
10299Move back to the start of the current or previous word.
10300Words are composed of letters and digits.
10301<P>
10302
0001803f 10303<A NAME="IDX346"></A>
17345e5a 10304<DT><CODE>shell-forward-word ()</CODE>
0001803f 10305<DD><A NAME="IDX347"></A>
17345e5a
JA
10306Move forward to the end of the next word.
10307Words are delimited by non-quoted shell metacharacters.
10308<P>
10309
0001803f 10310<A NAME="IDX348"></A>
17345e5a 10311<DT><CODE>shell-backward-word ()</CODE>
0001803f 10312<DD><A NAME="IDX349"></A>
17345e5a
JA
10313Move back to the start of the current or previous word.
10314Words are delimited by non-quoted shell metacharacters.
10315<P>
10316
0001803f 10317<A NAME="IDX350"></A>
17345e5a 10318<DT><CODE>clear-screen (C-l)</CODE>
0001803f 10319<DD><A NAME="IDX351"></A>
17345e5a
JA
10320Clear the screen and redraw the current line,
10321leaving the current line at the top of the screen.
10322<P>
10323
0001803f 10324<A NAME="IDX352"></A>
17345e5a 10325<DT><CODE>redraw-current-line ()</CODE>
0001803f 10326<DD><A NAME="IDX353"></A>
17345e5a
JA
10327Refresh the current line. By default, this is unbound.
10328<P>
10329
10330</DL>
10331<P>
10332
10333<A NAME="Commands For History"></A>
10334<HR SIZE="6">
10335<A NAME="SEC109"></A>
10336<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10337<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC108"> &lt; </A>]</TD>
10338<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &gt; </A>]</TD>
10339<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &lt;&lt; </A>]</TD>
10340<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10341<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10342<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10343<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10344<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10345<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10346</TR></TABLE>
10347<H3> 8.4.2 Commands For Manipulating The History </H3>
10348<!--docid::SEC109::-->
10349<P>
10350
10351<DL COMPACT>
0001803f 10352<A NAME="IDX354"></A>
17345e5a 10353<DT><CODE>accept-line (Newline or Return)</CODE>
0001803f 10354<DD><A NAME="IDX355"></A>
17345e5a
JA
10355Accept the line regardless of where the cursor is.
10356If this line is
10357non-empty, add it to the history list according to the setting of
10358the <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE> variables.
10359If this line is a modified history line, then restore the history line
10360to its original state.
10361<P>
10362
0001803f 10363<A NAME="IDX356"></A>
17345e5a 10364<DT><CODE>previous-history (C-p)</CODE>
0001803f 10365<DD><A NAME="IDX357"></A>
17345e5a
JA
10366Move `back' through the history list, fetching the previous command.
10367<P>
10368
0001803f 10369<A NAME="IDX358"></A>
17345e5a 10370<DT><CODE>next-history (C-n)</CODE>
0001803f 10371<DD><A NAME="IDX359"></A>
17345e5a
JA
10372Move `forward' through the history list, fetching the next command.
10373<P>
10374
0001803f 10375<A NAME="IDX360"></A>
17345e5a 10376<DT><CODE>beginning-of-history (M-&#60;)</CODE>
0001803f 10377<DD><A NAME="IDX361"></A>
17345e5a
JA
10378Move to the first line in the history.
10379<P>
10380
0001803f 10381<A NAME="IDX362"></A>
17345e5a 10382<DT><CODE>end-of-history (M-&#62;)</CODE>
0001803f 10383<DD><A NAME="IDX363"></A>
17345e5a
JA
10384Move to the end of the input history, i.e., the line currently
10385being entered.
10386<P>
10387
0001803f 10388<A NAME="IDX364"></A>
17345e5a 10389<DT><CODE>reverse-search-history (C-r)</CODE>
0001803f 10390<DD><A NAME="IDX365"></A>
17345e5a
JA
10391Search backward starting at the current line and moving `up' through
10392the history as necessary. This is an incremental search.
10393<P>
10394
0001803f 10395<A NAME="IDX366"></A>
17345e5a 10396<DT><CODE>forward-search-history (C-s)</CODE>
0001803f 10397<DD><A NAME="IDX367"></A>
17345e5a
JA
10398Search forward starting at the current line and moving `down' through
10399the the history as necessary. This is an incremental search.
10400<P>
10401
0001803f 10402<A NAME="IDX368"></A>
17345e5a 10403<DT><CODE>non-incremental-reverse-search-history (M-p)</CODE>
0001803f 10404<DD><A NAME="IDX369"></A>
17345e5a
JA
10405Search backward starting at the current line and moving `up'
10406through the history as necessary using a non-incremental search
10407for a string supplied by the user.
10408<P>
10409
0001803f 10410<A NAME="IDX370"></A>
17345e5a 10411<DT><CODE>non-incremental-forward-search-history (M-n)</CODE>
0001803f 10412<DD><A NAME="IDX371"></A>
17345e5a
JA
10413Search forward starting at the current line and moving `down'
10414through the the history as necessary using a non-incremental search
10415for a string supplied by the user.
10416<P>
10417
0001803f 10418<A NAME="IDX372"></A>
17345e5a 10419<DT><CODE>history-search-forward ()</CODE>
0001803f 10420<DD><A NAME="IDX373"></A>
17345e5a
JA
10421Search forward through the history for the string of characters
10422between the start of the current line and the point.
10423This is a non-incremental search.
10424By default, this command is unbound.
10425<P>
10426
0001803f 10427<A NAME="IDX374"></A>
17345e5a 10428<DT><CODE>history-search-backward ()</CODE>
0001803f 10429<DD><A NAME="IDX375"></A>
17345e5a
JA
10430Search backward through the history for the string of characters
10431between the start of the current line and the point. This
10432is a non-incremental search. By default, this command is unbound.
10433<P>
10434
0001803f 10435<A NAME="IDX376"></A>
17345e5a 10436<DT><CODE>yank-nth-arg (M-C-y)</CODE>
0001803f 10437<DD><A NAME="IDX377"></A>
17345e5a
JA
10438Insert the first argument to the previous command (usually
10439the second word on the previous line) at point.
10440With an argument <VAR>n</VAR>,
10441insert the <VAR>n</VAR>th word from the previous command (the words
10442in the previous command begin with word 0). A negative argument
10443inserts the <VAR>n</VAR>th word from the end of the previous command.
10444Once the argument <VAR>n</VAR> is computed, the argument is extracted
10445as if the <SAMP>`!<VAR>n</VAR>'</SAMP> history expansion had been specified.
10446<P>
10447
0001803f 10448<A NAME="IDX378"></A>
17345e5a 10449<DT><CODE>yank-last-arg (M-. or M-_)</CODE>
0001803f 10450<DD><A NAME="IDX379"></A>
17345e5a
JA
10451Insert last argument to the previous command (the last word of the
10452previous history entry). With an
10453argument, behave exactly like <CODE>yank-nth-arg</CODE>.
10454Successive calls to <CODE>yank-last-arg</CODE> move back through the history
10455list, inserting the last argument of each line in turn.
10456The history expansion facilities are used to extract the last argument,
10457as if the <SAMP>`!$'</SAMP> history expansion had been specified.
10458<P>
10459
10460</DL>
10461<P>
10462
10463<A NAME="Commands For Text"></A>
10464<HR SIZE="6">
10465<A NAME="SEC110"></A>
10466<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10467<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC109"> &lt; </A>]</TD>
10468<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &gt; </A>]</TD>
10469<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &lt;&lt; </A>]</TD>
10470<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10471<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10472<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10473<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10474<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10475<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10476</TR></TABLE>
10477<H3> 8.4.3 Commands For Changing Text </H3>
10478<!--docid::SEC110::-->
10479<P>
10480
10481<DL COMPACT>
0001803f 10482<A NAME="IDX380"></A>
17345e5a 10483<DT><CODE>delete-char (C-d)</CODE>
0001803f 10484<DD><A NAME="IDX381"></A>
17345e5a
JA
10485Delete the character at point. If point is at the
10486beginning of the line, there are no characters in the line, and
10487the last character typed was not bound to <CODE>delete-char</CODE>, then
10488return EOF.
10489<P>
10490
0001803f 10491<A NAME="IDX382"></A>
17345e5a 10492<DT><CODE>backward-delete-char (Rubout)</CODE>
0001803f 10493<DD><A NAME="IDX383"></A>
17345e5a
JA
10494Delete the character behind the cursor. A numeric argument means
10495to kill the characters instead of deleting them.
10496<P>
10497
0001803f 10498<A NAME="IDX384"></A>
17345e5a 10499<DT><CODE>forward-backward-delete-char ()</CODE>
0001803f 10500<DD><A NAME="IDX385"></A>
17345e5a
JA
10501Delete the character under the cursor, unless the cursor is at the
10502end of the line, in which case the character behind the cursor is
10503deleted. By default, this is not bound to a key.
10504<P>
10505
0001803f 10506<A NAME="IDX386"></A>
17345e5a 10507<DT><CODE>quoted-insert (C-q or C-v)</CODE>
0001803f 10508<DD><A NAME="IDX387"></A>
17345e5a
JA
10509Add the next character typed to the line verbatim. This is
10510how to insert key sequences like <KBD>C-q</KBD>, for example.
10511<P>
10512
0001803f 10513<A NAME="IDX388"></A>
17345e5a 10514<DT><CODE>self-insert (a, b, A, 1, !, <small>...</small>)</CODE>
0001803f 10515<DD><A NAME="IDX389"></A>
17345e5a
JA
10516Insert yourself.
10517<P>
10518
0001803f 10519<A NAME="IDX390"></A>
17345e5a 10520<DT><CODE>transpose-chars (C-t)</CODE>
0001803f 10521<DD><A NAME="IDX391"></A>
17345e5a
JA
10522Drag the character before the cursor forward over
10523the character at the cursor, moving the
10524cursor forward as well. If the insertion point
10525is at the end of the line, then this
10526transposes the last two characters of the line.
10527Negative arguments have no effect.
10528<P>
10529
0001803f 10530<A NAME="IDX392"></A>
17345e5a 10531<DT><CODE>transpose-words (M-t)</CODE>
0001803f 10532<DD><A NAME="IDX393"></A>
17345e5a
JA
10533Drag the word before point past the word after point,
10534moving point past that word as well.
10535If the insertion point is at the end of the line, this transposes
10536the last two words on the line.
10537<P>
10538
0001803f 10539<A NAME="IDX394"></A>
17345e5a 10540<DT><CODE>upcase-word (M-u)</CODE>
0001803f 10541<DD><A NAME="IDX395"></A>
17345e5a
JA
10542Uppercase the current (or following) word. With a negative argument,
10543uppercase the previous word, but do not move the cursor.
10544<P>
10545
0001803f 10546<A NAME="IDX396"></A>
17345e5a 10547<DT><CODE>downcase-word (M-l)</CODE>
0001803f 10548<DD><A NAME="IDX397"></A>
17345e5a
JA
10549Lowercase the current (or following) word. With a negative argument,
10550lowercase the previous word, but do not move the cursor.
10551<P>
10552
0001803f 10553<A NAME="IDX398"></A>
17345e5a 10554<DT><CODE>capitalize-word (M-c)</CODE>
0001803f 10555<DD><A NAME="IDX399"></A>
17345e5a
JA
10556Capitalize the current (or following) word. With a negative argument,
10557capitalize the previous word, but do not move the cursor.
10558<P>
10559
0001803f 10560<A NAME="IDX400"></A>
17345e5a 10561<DT><CODE>overwrite-mode ()</CODE>
0001803f 10562<DD><A NAME="IDX401"></A>
17345e5a
JA
10563Toggle overwrite mode. With an explicit positive numeric argument,
10564switches to overwrite mode. With an explicit non-positive numeric
10565argument, switches to insert mode. This command affects only
10566<CODE>emacs</CODE> mode; <CODE>vi</CODE> mode does overwrite differently.
10567Each call to <CODE>readline()</CODE> starts in insert mode.
10568<P>
10569
10570In overwrite mode, characters bound to <CODE>self-insert</CODE> replace
10571the text at point rather than pushing the text to the right.
10572Characters bound to <CODE>backward-delete-char</CODE> replace the character
10573before point with a space.
10574</P><P>
10575
10576By default, this command is unbound.
10577</P><P>
10578
10579</DL>
10580<P>
10581
10582<A NAME="Commands For Killing"></A>
10583<HR SIZE="6">
10584<A NAME="SEC111"></A>
10585<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10586<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC110"> &lt; </A>]</TD>
10587<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &gt; </A>]</TD>
10588<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &lt;&lt; </A>]</TD>
10589<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10590<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10591<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10592<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10593<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10594<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10595</TR></TABLE>
10596<H3> 8.4.4 Killing And Yanking </H3>
10597<!--docid::SEC111::-->
10598<P>
10599
10600<DL COMPACT>
10601
0001803f 10602<A NAME="IDX402"></A>
17345e5a 10603<DT><CODE>kill-line (C-k)</CODE>
0001803f 10604<DD><A NAME="IDX403"></A>
17345e5a
JA
10605Kill the text from point to the end of the line.
10606<P>
10607
0001803f 10608<A NAME="IDX404"></A>
17345e5a 10609<DT><CODE>backward-kill-line (C-x Rubout)</CODE>
0001803f 10610<DD><A NAME="IDX405"></A>
17345e5a
JA
10611Kill backward to the beginning of the line.
10612<P>
10613
0001803f 10614<A NAME="IDX406"></A>
17345e5a 10615<DT><CODE>unix-line-discard (C-u)</CODE>
0001803f 10616<DD><A NAME="IDX407"></A>
17345e5a
JA
10617Kill backward from the cursor to the beginning of the current line.
10618<P>
10619
0001803f 10620<A NAME="IDX408"></A>
17345e5a 10621<DT><CODE>kill-whole-line ()</CODE>
0001803f 10622<DD><A NAME="IDX409"></A>
17345e5a
JA
10623Kill all characters on the current line, no matter where point is.
10624By default, this is unbound.
10625<P>
10626
0001803f 10627<A NAME="IDX410"></A>
17345e5a 10628<DT><CODE>kill-word (M-d)</CODE>
0001803f 10629<DD><A NAME="IDX411"></A>
17345e5a
JA
10630Kill from point to the end of the current word, or if between
10631words, to the end of the next word.
10632Word boundaries are the same as <CODE>forward-word</CODE>.
10633<P>
10634
0001803f 10635<A NAME="IDX412"></A>
17345e5a 10636<DT><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE>
0001803f 10637<DD><A NAME="IDX413"></A>
17345e5a
JA
10638Kill the word behind point.
10639Word boundaries are the same as <CODE>backward-word</CODE>.
10640<P>
10641
0001803f 10642<A NAME="IDX414"></A>
17345e5a 10643<DT><CODE>shell-kill-word ()</CODE>
0001803f 10644<DD><A NAME="IDX415"></A>
17345e5a
JA
10645Kill from point to the end of the current word, or if between
10646words, to the end of the next word.
10647Word boundaries are the same as <CODE>shell-forward-word</CODE>.
10648<P>
10649
0001803f 10650<A NAME="IDX416"></A>
17345e5a 10651<DT><CODE>backward-kill-word ()</CODE>
0001803f 10652<DD><A NAME="IDX417"></A>
17345e5a
JA
10653Kill the word behind point.
10654Word boundaries are the same as <CODE>shell-backward-word</CODE>.
10655<P>
10656
0001803f 10657<A NAME="IDX418"></A>
17345e5a 10658<DT><CODE>unix-word-rubout (C-w)</CODE>
0001803f 10659<DD><A NAME="IDX419"></A>
17345e5a
JA
10660Kill the word behind point, using white space as a word boundary.
10661The killed text is saved on the kill-ring.
10662<P>
10663
0001803f 10664<A NAME="IDX420"></A>
17345e5a 10665<DT><CODE>unix-filename-rubout ()</CODE>
0001803f 10666<DD><A NAME="IDX421"></A>
17345e5a
JA
10667Kill the word behind point, using white space and the slash character
10668as the word boundaries.
10669The killed text is saved on the kill-ring.
10670<P>
10671
0001803f 10672<A NAME="IDX422"></A>
17345e5a 10673<DT><CODE>delete-horizontal-space ()</CODE>
0001803f 10674<DD><A NAME="IDX423"></A>
17345e5a
JA
10675Delete all spaces and tabs around point. By default, this is unbound.
10676<P>
10677
0001803f 10678<A NAME="IDX424"></A>
17345e5a 10679<DT><CODE>kill-region ()</CODE>
0001803f 10680<DD><A NAME="IDX425"></A>
17345e5a
JA
10681Kill the text in the current region.
10682By default, this command is unbound.
10683<P>
10684
0001803f 10685<A NAME="IDX426"></A>
17345e5a 10686<DT><CODE>copy-region-as-kill ()</CODE>
0001803f 10687<DD><A NAME="IDX427"></A>
17345e5a
JA
10688Copy the text in the region to the kill buffer, so it can be yanked
10689right away. By default, this command is unbound.
10690<P>
10691
0001803f 10692<A NAME="IDX428"></A>
17345e5a 10693<DT><CODE>copy-backward-word ()</CODE>
0001803f 10694<DD><A NAME="IDX429"></A>
17345e5a
JA
10695Copy the word before point to the kill buffer.
10696The word boundaries are the same as <CODE>backward-word</CODE>.
10697By default, this command is unbound.
10698<P>
10699
0001803f 10700<A NAME="IDX430"></A>
17345e5a 10701<DT><CODE>copy-forward-word ()</CODE>
0001803f 10702<DD><A NAME="IDX431"></A>
17345e5a
JA
10703Copy the word following point to the kill buffer.
10704The word boundaries are the same as <CODE>forward-word</CODE>.
10705By default, this command is unbound.
10706<P>
10707
0001803f 10708<A NAME="IDX432"></A>
17345e5a 10709<DT><CODE>yank (C-y)</CODE>
0001803f 10710<DD><A NAME="IDX433"></A>
17345e5a
JA
10711Yank the top of the kill ring into the buffer at point.
10712<P>
10713
0001803f 10714<A NAME="IDX434"></A>
17345e5a 10715<DT><CODE>yank-pop (M-y)</CODE>
0001803f 10716<DD><A NAME="IDX435"></A>
17345e5a
JA
10717Rotate the kill-ring, and yank the new top. You can only do this if
10718the prior command is <CODE>yank</CODE> or <CODE>yank-pop</CODE>.
10719</DL>
10720<P>
10721
10722<A NAME="Numeric Arguments"></A>
10723<HR SIZE="6">
10724<A NAME="SEC112"></A>
10725<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10726<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC111"> &lt; </A>]</TD>
10727<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &gt; </A>]</TD>
10728<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &lt;&lt; </A>]</TD>
10729<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10730<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10731<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10732<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10733<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10734<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10735</TR></TABLE>
10736<H3> 8.4.5 Specifying Numeric Arguments </H3>
10737<!--docid::SEC112::-->
10738<DL COMPACT>
10739
0001803f 10740<A NAME="IDX436"></A>
17345e5a 10741<DT><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, <small>...</small> <KBD>M--</KBD>)</CODE>
0001803f 10742<DD><A NAME="IDX437"></A>
17345e5a
JA
10743Add this digit to the argument already accumulating, or start a new
10744argument. <KBD>M--</KBD> starts a negative argument.
10745<P>
10746
0001803f 10747<A NAME="IDX438"></A>
17345e5a 10748<DT><CODE>universal-argument ()</CODE>
0001803f 10749<DD><A NAME="IDX439"></A>
17345e5a
JA
10750This is another way to specify an argument.
10751If this command is followed by one or more digits, optionally with a
10752leading minus sign, those digits define the argument.
10753If the command is followed by digits, executing <CODE>universal-argument</CODE>
10754again ends the numeric argument, but is otherwise ignored.
10755As a special case, if this command is immediately followed by a
10756character that is neither a digit or minus sign, the argument count
10757for the next command is multiplied by four.
10758The argument count is initially one, so executing this function the
10759first time makes the argument count four, a second time makes the
10760argument count sixteen, and so on.
10761By default, this is not bound to a key.
10762</DL>
10763<P>
10764
10765<A NAME="Commands For Completion"></A>
10766<HR SIZE="6">
10767<A NAME="SEC113"></A>
10768<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10769<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC112"> &lt; </A>]</TD>
10770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &gt; </A>]</TD>
10771<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &lt;&lt; </A>]</TD>
10772<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10773<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10774<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10775<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10776<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10777<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10778</TR></TABLE>
10779<H3> 8.4.6 Letting Readline Type For You </H3>
10780<!--docid::SEC113::-->
10781<P>
10782
10783<DL COMPACT>
0001803f 10784<A NAME="IDX440"></A>
17345e5a 10785<DT><CODE>complete (<KBD>TAB</KBD>)</CODE>
0001803f 10786<DD><A NAME="IDX441"></A>
17345e5a
JA
10787Attempt to perform completion on the text before point.
10788The actual completion performed is application-specific.
10789Bash attempts completion treating the text as a variable (if the
10790text begins with <SAMP>`$'</SAMP>), username (if the text begins with
10791<SAMP>`~'</SAMP>), hostname (if the text begins with <SAMP>`@'</SAMP>), or
10792command (including aliases and functions) in turn. If none
10793of these produces a match, filename completion is attempted.
10794<P>
10795
0001803f 10796<A NAME="IDX442"></A>
17345e5a 10797<DT><CODE>possible-completions (M-?)</CODE>
0001803f 10798<DD><A NAME="IDX443"></A>
17345e5a
JA
10799List the possible completions of the text before point.
10800<P>
10801
0001803f 10802<A NAME="IDX444"></A>
17345e5a 10803<DT><CODE>insert-completions (M-*)</CODE>
0001803f 10804<DD><A NAME="IDX445"></A>
17345e5a
JA
10805Insert all completions of the text before point that would have
10806been generated by <CODE>possible-completions</CODE>.
10807<P>
10808
0001803f 10809<A NAME="IDX446"></A>
17345e5a 10810<DT><CODE>menu-complete ()</CODE>
0001803f 10811<DD><A NAME="IDX447"></A>
17345e5a
JA
10812Similar to <CODE>complete</CODE>, but replaces the word to be completed
10813with a single match from the list of possible completions.
10814Repeated execution of <CODE>menu-complete</CODE> steps through the list
10815of possible completions, inserting each match in turn.
10816At the end of the list of completions, the bell is rung
10817(subject to the setting of <CODE>bell-style</CODE>)
10818and the original text is restored.
10819An argument of <VAR>n</VAR> moves <VAR>n</VAR> positions forward in the list
10820of matches; a negative argument may be used to move backward
10821through the list.
10822This command is intended to be bound to <KBD>TAB</KBD>, but is unbound
10823by default.
10824<P>
10825
0001803f
CR
10826<A NAME="IDX448"></A>
10827<DT><CODE>menu-complete-backward ()</CODE>
10828<DD><A NAME="IDX449"></A>
10829Identical to <CODE>menu-complete</CODE>, but moves backward through the list
10830of possible completions, as if <CODE>menu-complete</CODE> had been given a
10831negative argument.
10832<P>
10833
10834<A NAME="IDX450"></A>
17345e5a 10835<DT><CODE>delete-char-or-list ()</CODE>
0001803f 10836<DD><A NAME="IDX451"></A>
17345e5a
JA
10837Deletes the character under the cursor if not at the beginning or
10838end of the line (like <CODE>delete-char</CODE>).
10839If at the end of the line, behaves identically to
10840<CODE>possible-completions</CODE>.
10841This command is unbound by default.
10842<P>
10843
0001803f 10844<A NAME="IDX452"></A>
17345e5a 10845<DT><CODE>complete-filename (M-/)</CODE>
0001803f 10846<DD><A NAME="IDX453"></A>
17345e5a
JA
10847Attempt filename completion on the text before point.
10848<P>
10849
0001803f 10850<A NAME="IDX454"></A>
17345e5a 10851<DT><CODE>possible-filename-completions (C-x /)</CODE>
0001803f 10852<DD><A NAME="IDX455"></A>
17345e5a
JA
10853List the possible completions of the text before point,
10854treating it as a filename.
10855<P>
10856
0001803f 10857<A NAME="IDX456"></A>
17345e5a 10858<DT><CODE>complete-username (M-~)</CODE>
0001803f 10859<DD><A NAME="IDX457"></A>
17345e5a
JA
10860Attempt completion on the text before point, treating
10861it as a username.
10862<P>
10863
0001803f 10864<A NAME="IDX458"></A>
17345e5a 10865<DT><CODE>possible-username-completions (C-x ~)</CODE>
0001803f 10866<DD><A NAME="IDX459"></A>
17345e5a
JA
10867List the possible completions of the text before point,
10868treating it as a username.
10869<P>
10870
0001803f 10871<A NAME="IDX460"></A>
17345e5a 10872<DT><CODE>complete-variable (M-$)</CODE>
0001803f 10873<DD><A NAME="IDX461"></A>
17345e5a
JA
10874Attempt completion on the text before point, treating
10875it as a shell variable.
10876<P>
10877
0001803f 10878<A NAME="IDX462"></A>
17345e5a 10879<DT><CODE>possible-variable-completions (C-x $)</CODE>
0001803f 10880<DD><A NAME="IDX463"></A>
17345e5a
JA
10881List the possible completions of the text before point,
10882treating it as a shell variable.
10883<P>
10884
0001803f 10885<A NAME="IDX464"></A>
17345e5a 10886<DT><CODE>complete-hostname (M-@)</CODE>
0001803f 10887<DD><A NAME="IDX465"></A>
17345e5a
JA
10888Attempt completion on the text before point, treating
10889it as a hostname.
10890<P>
10891
0001803f 10892<A NAME="IDX466"></A>
17345e5a 10893<DT><CODE>possible-hostname-completions (C-x @)</CODE>
0001803f 10894<DD><A NAME="IDX467"></A>
17345e5a
JA
10895List the possible completions of the text before point,
10896treating it as a hostname.
10897<P>
10898
0001803f 10899<A NAME="IDX468"></A>
17345e5a 10900<DT><CODE>complete-command (M-!)</CODE>
0001803f 10901<DD><A NAME="IDX469"></A>
17345e5a
JA
10902Attempt completion on the text before point, treating
10903it as a command name. Command completion attempts to
10904match the text against aliases, reserved words, shell
10905functions, shell builtins, and finally executable filenames,
10906in that order.
10907<P>
10908
0001803f 10909<A NAME="IDX470"></A>
17345e5a 10910<DT><CODE>possible-command-completions (C-x !)</CODE>
0001803f 10911<DD><A NAME="IDX471"></A>
17345e5a
JA
10912List the possible completions of the text before point,
10913treating it as a command name.
10914<P>
10915
0001803f 10916<A NAME="IDX472"></A>
17345e5a 10917<DT><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE>
0001803f 10918<DD><A NAME="IDX473"></A>
17345e5a
JA
10919Attempt completion on the text before point, comparing
10920the text against lines from the history list for possible
10921completion matches.
10922<P>
10923
0001803f 10924<A NAME="IDX474"></A>
17345e5a 10925<DT><CODE>dabbrev-expand ()</CODE>
0001803f 10926<DD><A NAME="IDX475"></A>
17345e5a
JA
10927Attempt menu completion on the text before point, comparing
10928the text against lines from the history list for possible
10929completion matches.
10930<P>
10931
0001803f 10932<A NAME="IDX476"></A>
17345e5a 10933<DT><CODE>complete-into-braces (M-{)</CODE>
0001803f 10934<DD><A NAME="IDX477"></A>
17345e5a
JA
10935Perform filename completion and insert the list of possible completions
10936enclosed within braces so the list is available to the shell
10937(see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>).
10938<P>
10939
10940</DL>
10941<P>
10942
10943<A NAME="Keyboard Macros"></A>
10944<HR SIZE="6">
10945<A NAME="SEC114"></A>
10946<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10947<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC113"> &lt; </A>]</TD>
10948<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &gt; </A>]</TD>
10949<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &lt;&lt; </A>]</TD>
10950<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10951<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10952<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10953<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10954<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10955<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10956</TR></TABLE>
10957<H3> 8.4.7 Keyboard Macros </H3>
10958<!--docid::SEC114::-->
10959<DL COMPACT>
10960
0001803f 10961<A NAME="IDX478"></A>
17345e5a 10962<DT><CODE>start-kbd-macro (C-x ()</CODE>
0001803f 10963<DD><A NAME="IDX479"></A>
17345e5a
JA
10964Begin saving the characters typed into the current keyboard macro.
10965<P>
10966
0001803f 10967<A NAME="IDX480"></A>
17345e5a 10968<DT><CODE>end-kbd-macro (C-x ))</CODE>
0001803f 10969<DD><A NAME="IDX481"></A>
17345e5a
JA
10970Stop saving the characters typed into the current keyboard macro
10971and save the definition.
10972<P>
10973
0001803f 10974<A NAME="IDX482"></A>
17345e5a 10975<DT><CODE>call-last-kbd-macro (C-x e)</CODE>
0001803f 10976<DD><A NAME="IDX483"></A>
17345e5a
JA
10977Re-execute the last keyboard macro defined, by making the characters
10978in the macro appear as if typed at the keyboard.
10979<P>
10980
10981</DL>
10982<P>
10983
10984<A NAME="Miscellaneous Commands"></A>
10985<HR SIZE="6">
10986<A NAME="SEC115"></A>
10987<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
10988<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC114"> &lt; </A>]</TD>
10989<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt; </A>]</TD>
10990<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt;&lt; </A>]</TD>
10991<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC107"> Up </A>]</TD>
10992<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &gt;&gt; </A>]</TD>
10993<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
10994<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
10995<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
10996<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
10997</TR></TABLE>
10998<H3> 8.4.8 Some Miscellaneous Commands </H3>
10999<!--docid::SEC115::-->
11000<DL COMPACT>
11001
0001803f 11002<A NAME="IDX484"></A>
17345e5a 11003<DT><CODE>re-read-init-file (C-x C-r)</CODE>
0001803f 11004<DD><A NAME="IDX485"></A>
17345e5a
JA
11005Read in the contents of the <VAR>inputrc</VAR> file, and incorporate
11006any bindings or variable assignments found there.
11007<P>
11008
0001803f 11009<A NAME="IDX486"></A>
17345e5a 11010<DT><CODE>abort (C-g)</CODE>
0001803f 11011<DD><A NAME="IDX487"></A>
17345e5a
JA
11012Abort the current editing command and
11013ring the terminal's bell (subject to the setting of
11014<CODE>bell-style</CODE>).
11015<P>
11016
0001803f 11017<A NAME="IDX488"></A>
17345e5a 11018<DT><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, <small>...</small>)</CODE>
0001803f 11019<DD><A NAME="IDX489"></A>
17345e5a
JA
11020If the metafied character <VAR>x</VAR> is lowercase, run the command
11021that is bound to the corresponding uppercase character.
11022<P>
11023
0001803f 11024<A NAME="IDX490"></A>
17345e5a 11025<DT><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE>
0001803f 11026<DD><A NAME="IDX491"></A>
17345e5a
JA
11027Metafy the next character typed. This is for keyboards
11028without a meta key. Typing <SAMP>`<KBD>ESC</KBD> f'</SAMP> is equivalent to typing
11029<KBD>M-f</KBD>.
11030<P>
11031
0001803f 11032<A NAME="IDX492"></A>
17345e5a 11033<DT><CODE>undo (C-_ or C-x C-u)</CODE>
0001803f 11034<DD><A NAME="IDX493"></A>
17345e5a
JA
11035Incremental undo, separately remembered for each line.
11036<P>
11037
0001803f 11038<A NAME="IDX494"></A>
17345e5a 11039<DT><CODE>revert-line (M-r)</CODE>
0001803f 11040<DD><A NAME="IDX495"></A>
17345e5a
JA
11041Undo all changes made to this line. This is like executing the <CODE>undo</CODE>
11042command enough times to get back to the beginning.
11043<P>
11044
0001803f 11045<A NAME="IDX496"></A>
17345e5a 11046<DT><CODE>tilde-expand (M-&#38;)</CODE>
0001803f 11047<DD><A NAME="IDX497"></A>
17345e5a
JA
11048Perform tilde expansion on the current word.
11049<P>
11050
0001803f 11051<A NAME="IDX498"></A>
17345e5a 11052<DT><CODE>set-mark (C-@)</CODE>
0001803f 11053<DD><A NAME="IDX499"></A>
17345e5a
JA
11054Set the mark to the point. If a
11055numeric argument is supplied, the mark is set to that position.
11056<P>
11057
0001803f 11058<A NAME="IDX500"></A>
17345e5a 11059<DT><CODE>exchange-point-and-mark (C-x C-x)</CODE>
0001803f 11060<DD><A NAME="IDX501"></A>
17345e5a
JA
11061Swap the point with the mark. The current cursor position is set to
11062the saved position, and the old cursor position is saved as the mark.
11063<P>
11064
0001803f 11065<A NAME="IDX502"></A>
17345e5a 11066<DT><CODE>character-search (C-])</CODE>
0001803f 11067<DD><A NAME="IDX503"></A>
17345e5a
JA
11068A character is read and point is moved to the next occurrence of that
11069character. A negative count searches for previous occurrences.
11070<P>
11071
0001803f 11072<A NAME="IDX504"></A>
17345e5a 11073<DT><CODE>character-search-backward (M-C-])</CODE>
0001803f 11074<DD><A NAME="IDX505"></A>
17345e5a
JA
11075A character is read and point is moved to the previous occurrence
11076of that character. A negative count searches for subsequent
11077occurrences.
11078<P>
11079
0001803f
CR
11080<A NAME="IDX506"></A>
11081<DT><CODE>skip-csi-sequence ()</CODE>
11082<DD><A NAME="IDX507"></A>
11083Read enough characters to consume a multi-key sequence such as those
11084defined for keys like Home and End. Such sequences begin with a
11085Control Sequence Indicator (CSI), usually ESC-[. If this sequence is
11086bound to "\e[", keys producing such sequences will have no effect
11087unless explicitly bound to a readline command, instead of inserting
11088stray characters into the editing buffer. This is unbound by default,
11089but usually bound to ESC-[.
11090<P>
11091
11092<A NAME="IDX508"></A>
17345e5a 11093<DT><CODE>insert-comment (M-#)</CODE>
0001803f 11094<DD><A NAME="IDX509"></A>
17345e5a
JA
11095Without a numeric argument, the value of the <CODE>comment-begin</CODE>
11096variable is inserted at the beginning of the current line.
11097If a numeric argument is supplied, this command acts as a toggle: if
11098the characters at the beginning of the line do not match the value
11099of <CODE>comment-begin</CODE>, the value is inserted, otherwise
11100the characters in <CODE>comment-begin</CODE> are deleted from the beginning of
11101the line.
11102In either case, the line is accepted as if a newline had been typed.
11103The default value of <CODE>comment-begin</CODE> causes this command
11104to make the current line a shell comment.
11105If a numeric argument causes the comment character to be removed, the line
11106will be executed by the shell.
11107<P>
11108
0001803f 11109<A NAME="IDX510"></A>
17345e5a 11110<DT><CODE>dump-functions ()</CODE>
0001803f 11111<DD><A NAME="IDX511"></A>
17345e5a
JA
11112Print all of the functions and their key bindings to the
11113Readline output stream. If a numeric argument is supplied,
11114the output is formatted in such a way that it can be made part
11115of an <VAR>inputrc</VAR> file. This command is unbound by default.
11116<P>
11117
0001803f 11118<A NAME="IDX512"></A>
17345e5a 11119<DT><CODE>dump-variables ()</CODE>
0001803f 11120<DD><A NAME="IDX513"></A>
17345e5a
JA
11121Print all of the settable variables and their values to the
11122Readline output stream. If a numeric argument is supplied,
11123the output is formatted in such a way that it can be made part
11124of an <VAR>inputrc</VAR> file. This command is unbound by default.
11125<P>
11126
0001803f 11127<A NAME="IDX514"></A>
17345e5a 11128<DT><CODE>dump-macros ()</CODE>
0001803f 11129<DD><A NAME="IDX515"></A>
17345e5a
JA
11130Print all of the Readline key sequences bound to macros and the
11131strings they output. If a numeric argument is supplied,
11132the output is formatted in such a way that it can be made part
11133of an <VAR>inputrc</VAR> file. This command is unbound by default.
11134<P>
11135
0001803f 11136<A NAME="IDX516"></A>
17345e5a 11137<DT><CODE>glob-complete-word (M-g)</CODE>
0001803f 11138<DD><A NAME="IDX517"></A>
17345e5a
JA
11139The word before point is treated as a pattern for pathname expansion,
11140with an asterisk implicitly appended. This pattern is used to
11141generate a list of matching file names for possible completions.
11142<P>
11143
0001803f 11144<A NAME="IDX518"></A>
17345e5a 11145<DT><CODE>glob-expand-word (C-x *)</CODE>
0001803f 11146<DD><A NAME="IDX519"></A>
17345e5a
JA
11147The word before point is treated as a pattern for pathname expansion,
11148and the list of matching file names is inserted, replacing the word.
11149If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11150pathname expansion.
11151<P>
11152
0001803f 11153<A NAME="IDX520"></A>
17345e5a 11154<DT><CODE>glob-list-expansions (C-x g)</CODE>
0001803f 11155<DD><A NAME="IDX521"></A>
17345e5a
JA
11156The list of expansions that would have been generated by
11157<CODE>glob-expand-word</CODE> is displayed, and the line is redrawn.
11158If a numeric argument is supplied, a <SAMP>`*'</SAMP> is appended before
11159pathname expansion.
11160<P>
11161
0001803f 11162<A NAME="IDX522"></A>
17345e5a 11163<DT><CODE>display-shell-version (C-x C-v)</CODE>
0001803f 11164<DD><A NAME="IDX523"></A>
17345e5a
JA
11165Display version information about the current instance of Bash.
11166<P>
11167
0001803f 11168<A NAME="IDX524"></A>
17345e5a 11169<DT><CODE>shell-expand-line (M-C-e)</CODE>
0001803f 11170<DD><A NAME="IDX525"></A>
17345e5a
JA
11171Expand the line as the shell does.
11172This performs alias and history expansion as well as all of the shell
11173word expansions (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
11174<P>
11175
0001803f 11176<A NAME="IDX526"></A>
17345e5a 11177<DT><CODE>history-expand-line (M-^)</CODE>
0001803f 11178<DD><A NAME="IDX527"></A>
17345e5a
JA
11179Perform history expansion on the current line.
11180<P>
11181
0001803f 11182<A NAME="IDX528"></A>
17345e5a 11183<DT><CODE>magic-space ()</CODE>
0001803f 11184<DD><A NAME="IDX529"></A>
17345e5a
JA
11185Perform history expansion on the current line and insert a space
11186(see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
11187<P>
11188
0001803f 11189<A NAME="IDX530"></A>
17345e5a 11190<DT><CODE>alias-expand-line ()</CODE>
0001803f 11191<DD><A NAME="IDX531"></A>
17345e5a
JA
11192Perform alias expansion on the current line (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
11193<P>
11194
0001803f 11195<A NAME="IDX532"></A>
17345e5a 11196<DT><CODE>history-and-alias-expand-line ()</CODE>
0001803f 11197<DD><A NAME="IDX533"></A>
17345e5a
JA
11198Perform history and alias expansion on the current line.
11199<P>
11200
0001803f 11201<A NAME="IDX534"></A>
17345e5a 11202<DT><CODE>insert-last-argument (M-. or M-_)</CODE>
0001803f 11203<DD><A NAME="IDX535"></A>
17345e5a
JA
11204A synonym for <CODE>yank-last-arg</CODE>.
11205<P>
11206
0001803f 11207<A NAME="IDX536"></A>
17345e5a 11208<DT><CODE>operate-and-get-next (C-o)</CODE>
0001803f 11209<DD><A NAME="IDX537"></A>
17345e5a
JA
11210Accept the current line for execution and fetch the next line
11211relative to the current line from the history for editing. Any
11212argument is ignored.
11213<P>
11214
0001803f 11215<A NAME="IDX538"></A>
17345e5a 11216<DT><CODE>edit-and-execute-command (C-xC-e)</CODE>
0001803f 11217<DD><A NAME="IDX539"></A>
17345e5a
JA
11218Invoke an editor on the current command line, and execute the result as shell
11219commands.
11220Bash attempts to invoke
11221<CODE>$VISUAL</CODE>, <CODE>$EDITOR</CODE>, and <CODE>emacs</CODE>
11222as the editor, in that order.
11223<P>
11224
11225</DL>
11226<P>
11227
11228<A NAME="Readline vi Mode"></A>
11229<HR SIZE="6">
11230<A NAME="SEC116"></A>
11231<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11232<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC115"> &lt; </A>]</TD>
11233<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &gt; </A>]</TD>
11234<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt;&lt; </A>]</TD>
11235<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11236<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
11237<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11238<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11239<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11240<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11241</TR></TABLE>
11242<H2> 8.5 Readline vi Mode </H2>
11243<!--docid::SEC116::-->
11244<P>
11245
11246While the Readline library does not have a full set of <CODE>vi</CODE>
11247editing functions, it does contain enough to allow simple editing
11248of the line. The Readline <CODE>vi</CODE> mode behaves as specified in
11249the POSIX 1003.2 standard.
11250</P><P>
11251
11252In order to switch interactively between <CODE>emacs</CODE> and <CODE>vi</CODE>
11253editing modes, use the <SAMP>`set -o emacs'</SAMP> and <SAMP>`set -o vi'</SAMP>
11254commands (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
11255The Readline default is <CODE>emacs</CODE> mode.
11256</P><P>
11257
11258When you enter a line in <CODE>vi</CODE> mode, you are already placed in
11259`insertion' mode, as if you had typed an <SAMP>`i'</SAMP>. Pressing <KBD>ESC</KBD>
11260switches you into `command' mode, where you can edit the text of the
11261line with the standard <CODE>vi</CODE> movement keys, move to previous
11262history lines with <SAMP>`k'</SAMP> and subsequent lines with <SAMP>`j'</SAMP>, and
11263so forth.
11264</P><P>
11265
11266<A NAME="Programmable Completion"></A>
11267<HR SIZE="6">
11268<A NAME="SEC117"></A>
11269<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11270<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC116"> &lt; </A>]</TD>
11271<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &gt; </A>]</TD>
11272<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &lt;&lt; </A>]</TD>
11273<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11274<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
11275<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11276<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11277<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11278<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11279</TR></TABLE>
11280<H2> 8.6 Programmable Completion </H2>
11281<!--docid::SEC117::-->
11282<P>
11283
11284When word completion is attempted for an argument to a command for
11285which a completion specification (a <VAR>compspec</VAR>) has been defined
11286using the <CODE>complete</CODE> builtin (see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>),
11287the programmable completion facilities are invoked.
11288</P><P>
11289
11290First, the command name is identified.
11291If a compspec has been defined for that command, the
11292compspec is used to generate the list of possible completions for the word.
0001803f
CR
11293If the command word is the empty string (completion attempted at the
11294beginning of an empty line), any compspec defined with
11295the <SAMP>`-E'</SAMP> option to <CODE>complete</CODE> is used.
17345e5a
JA
11296If the command word is a full pathname, a compspec for the full
11297pathname is searched for first.
11298If no compspec is found for the full pathname, an attempt is made to
11299find a compspec for the portion following the final slash.
0001803f
CR
11300If those searches do not result in a compspec, any compspec defined with
11301the <SAMP>`-D'</SAMP> option to <CODE>complete</CODE> is used as the default.
17345e5a
JA
11302</P><P>
11303
11304Once a compspec has been found, it is used to generate the list of
11305matching words.
11306If a compspec is not found, the default Bash completion
11307described above (see section <A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>) is performed.
11308</P><P>
11309
11310First, the actions specified by the compspec are used.
11311Only matches which are prefixed by the word being completed are
11312returned.
11313When the <SAMP>`-f'</SAMP> or <SAMP>`-d'</SAMP> option is used for filename or
11314directory name completion, the shell variable <CODE>FIGNORE</CODE> is
11315used to filter the matches.
11316See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>, for a description of <CODE>FIGNORE</CODE>.
11317</P><P>
11318
11319Any completions specified by a filename expansion pattern to the
11320<SAMP>`-G'</SAMP> option are generated next.
11321The words generated by the pattern need not match the word being completed.
11322The <CODE>GLOBIGNORE</CODE> shell variable is not used to filter the matches,
11323but the <CODE>FIGNORE</CODE> shell variable is used.
11324</P><P>
11325
11326Next, the string specified as the argument to the <SAMP>`-W'</SAMP> option
11327is considered.
11328The string is first split using the characters in the <CODE>IFS</CODE>
11329special variable as delimiters.
11330Shell quoting is honored.
11331Each word is then expanded using
11332brace expansion, tilde expansion, parameter and variable expansion,
11333command substitution, and arithmetic expansion,
11334as described above (see section <A HREF="bashref.html#SEC28">3.5 Shell Expansions</A>).
11335The results are split using the rules described above
11336(see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>).
11337The results of the expansion are prefix-matched against the word being
11338completed, and the matching words become the possible completions.
11339</P><P>
11340
11341After these matches have been generated, any shell function or command
11342specified with the <SAMP>`-F'</SAMP> and <SAMP>`-C'</SAMP> options is invoked.
11343When the command or function is invoked, the <CODE>COMP_LINE</CODE>,
11344<CODE>COMP_POINT</CODE>, <CODE>COMP_KEY</CODE>, and <CODE>COMP_TYPE</CODE> variables are
11345assigned values as described above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
11346If a shell function is being invoked, the <CODE>COMP_WORDS</CODE> and
11347<CODE>COMP_CWORD</CODE> variables are also set.
11348When the function or command is invoked, the first argument is the
11349name of the command whose arguments are being completed, the
11350second argument is the word being completed, and the third argument
11351is the word preceding the word being completed on the current command line.
11352No filtering of the generated completions against the word being completed
11353is performed; the function or command has complete freedom in generating
11354the matches.
11355</P><P>
11356
11357Any function specified with <SAMP>`-F'</SAMP> is invoked first.
11358The function may use any of the shell facilities, including the
11359<CODE>compgen</CODE> and <CODE>compopt</CODE> builtins described below
11360(see section <A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>), to generate the matches.
11361It must put the possible completions in the <CODE>COMPREPLY</CODE> array
11362variable.
11363</P><P>
11364
11365Next, any command specified with the <SAMP>`-C'</SAMP> option is invoked
11366in an environment equivalent to command substitution.
11367It should print a list of completions, one per line, to
11368the standard output.
11369Backslash may be used to escape a newline, if necessary.
11370</P><P>
11371
11372After all of the possible completions are generated, any filter
11373specified with the <SAMP>`-X'</SAMP> option is applied to the list.
11374The filter is a pattern as used for pathname expansion; a <SAMP>`&#38;'</SAMP>
11375in the pattern is replaced with the text of the word being completed.
11376A literal <SAMP>`&#38;'</SAMP> may be escaped with a backslash; the backslash
11377is removed before attempting a match.
11378Any completion that matches the pattern will be removed from the list.
11379A leading <SAMP>`!'</SAMP> negates the pattern; in this case any completion
11380not matching the pattern will be removed.
11381</P><P>
11382
11383Finally, any prefix and suffix specified with the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP>
11384options are added to each member of the completion list, and the result is
11385returned to the Readline completion code as the list of possible
11386completions.
11387</P><P>
11388
11389If the previously-applied actions do not generate any matches, and the
11390<SAMP>`-o dirnames'</SAMP> option was supplied to <CODE>complete</CODE> when the
11391compspec was defined, directory name completion is attempted.
11392</P><P>
11393
11394If the <SAMP>`-o plusdirs'</SAMP> option was supplied to <CODE>complete</CODE> when
11395the compspec was defined, directory name completion is attempted and any
11396matches are added to the results of the other actions.
11397</P><P>
11398
11399By default, if a compspec is found, whatever it generates is returned to
11400the completion code as the full set of possible completions.
11401The default Bash completions are not attempted, and the Readline default
11402of filename completion is disabled.
11403If the <SAMP>`-o bashdefault'</SAMP> option was supplied to <CODE>complete</CODE> when
11404the compspec was defined, the default Bash completions are attempted
11405if the compspec generates no matches.
11406If the <SAMP>`-o default'</SAMP> option was supplied to <CODE>complete</CODE> when the
11407compspec was defined, Readline's default completion will be performed
11408if the compspec (and, if attempted, the default Bash completions)
11409generate no matches.
11410</P><P>
11411
11412When a compspec indicates that directory name completion is desired,
11413the programmable completion functions force Readline to append a slash
11414to completed names which are symbolic links to directories, subject to
11415the value of the <VAR>mark-directories</VAR> Readline variable, regardless
11416of the setting of the <VAR>mark-symlinked-directories</VAR> Readline variable.
11417</P><P>
11418
0001803f
CR
11419There is some support for dynamically modifying completions. This is
11420most useful when used in combination with a default completion specified
11421with <SAMP>`-D'</SAMP>. It's possible for shell functions executed as completion
11422handlers to indicate that completion should be retried by returning an
11423exit status of 124. If a shell function returns 124, and changes
11424the compspec associated with the command on which completion is being
11425attempted (supplied as the first argument when the function is executed),
11426programmable completion restarts from the beginning, with an
11427attempt to find a compspec for that command. This allows a set of
11428completions to be built dynamically as completion is attempted, rather than
11429being loaded all at once.
11430</P><P>
11431
11432For instance, assuming that there is a library of compspecs, each kept in a
11433file corresponding to the name of the command, the following default
11434completion function would load completions dynamically:
11435</P><P>
11436
11437<TABLE><tr><td>&nbsp;</td><td class=example><pre>_completion_loader()
11438{
11439 . "/etc/bash_completion.d/$1.sh" &#62;/dev/null 2&#62;&#38;1 &#38;&#38; return 124
11440}
11441complete -D -F _completion_loader
11442</pre></td></tr></table></P><P>
11443
17345e5a
JA
11444<A NAME="Programmable Completion Builtins"></A>
11445<HR SIZE="6">
11446<A NAME="SEC118"></A>
11447<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11448<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC117"> &lt; </A>]</TD>
11449<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt; </A>]</TD>
11450<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> &lt;&lt; </A>]</TD>
11451<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC95"> Up </A>]</TD>
11452<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &gt;&gt; </A>]</TD>
11453<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11454<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11455<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11456<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11457</TR></TABLE>
11458<H2> 8.7 Programmable Completion Builtins </H2>
11459<!--docid::SEC118::-->
11460<P>
11461
11462Two builtin commands are available to manipulate the programmable completion
11463facilities.
11464</P><P>
11465
11466<DL COMPACT>
11467<DT><CODE>compgen</CODE>
0001803f 11468<DD><A NAME="IDX540"></A>
17345e5a
JA
11469<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>compgen [<VAR>option</VAR>] [<VAR>word</VAR>]</CODE>
11470</pre></td></tr></table><P>
11471
11472Generate possible completion matches for <VAR>word</VAR> according to
11473the <VAR>option</VAR>s, which may be any option accepted by the
11474<CODE>complete</CODE>
11475builtin with the exception of <SAMP>`-p'</SAMP> and <SAMP>`-r'</SAMP>, and write
11476the matches to the standard output.
11477When using the <SAMP>`-F'</SAMP> or <SAMP>`-C'</SAMP> options, the various shell variables
11478set by the programmable completion facilities, while available, will not
11479have useful values.
11480</P><P>
11481
11482The matches will be generated in the same way as if the programmable
11483completion code had generated them directly from a completion specification
11484with the same flags.
11485If <VAR>word</VAR> is specified, only those completions matching <VAR>word</VAR>
11486will be displayed.
11487</P><P>
11488
11489The return value is true unless an invalid option is supplied, or no
11490matches were generated.
11491</P><P>
11492
11493<DT><CODE>complete</CODE>
0001803f
CR
11494<DD><A NAME="IDX541"></A>
11495<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>complete [-abcdefgjksuv] [-o <VAR>comp-option</VAR>] [-DE] [-A <VAR>action</VAR>] [-G <VAR>globpat</VAR>] [-W <VAR>wordlist</VAR>]
17345e5a
JA
11496[-F <VAR>function</VAR>] [-C <VAR>command</VAR>] [-X <VAR>filterpat</VAR>]
11497[-P <VAR>prefix</VAR>] [-S <VAR>suffix</VAR>] <VAR>name</VAR> [<VAR>name</VAR> <small>...</small>]</CODE>
0001803f 11498<CODE>complete -pr [-DE] [<VAR>name</VAR> <small>...</small>]</CODE>
17345e5a
JA
11499</pre></td></tr></table><P>
11500
11501Specify how arguments to each <VAR>name</VAR> should be completed.
11502If the <SAMP>`-p'</SAMP> option is supplied, or if no options are supplied, existing
11503completion specifications are printed in a way that allows them to be
11504reused as input.
11505The <SAMP>`-r'</SAMP> option removes a completion specification for
11506each <VAR>name</VAR>, or, if no <VAR>name</VAR>s are supplied, all
11507completion specifications.
0001803f
CR
11508The <SAMP>`-D'</SAMP> option indicates that the remaining options and actions should
11509apply to the "default" command completion; that is, completion attempted
11510on a command for which no completion has previously been defined.
17345e5a
JA
11511The <SAMP>`-E'</SAMP> option indicates that the remaining options and actions should
11512apply to "empty" command completion; that is, completion attempted on a
11513blank line.
11514</P><P>
11515
11516The process of applying these completion specifications when word completion
0001803f
CR
11517is attempted is described above (see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>). The
11518<SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
17345e5a
JA
11519</P><P>
11520
11521Other options, if specified, have the following meanings.
11522The arguments to the <SAMP>`-G'</SAMP>, <SAMP>`-W'</SAMP>, and <SAMP>`-X'</SAMP> options
11523(and, if necessary, the <SAMP>`-P'</SAMP> and <SAMP>`-S'</SAMP> options)
11524should be quoted to protect them from expansion before the
11525<CODE>complete</CODE> builtin is invoked.
11526</P><P>
11527
11528<DL COMPACT>
11529<DT><CODE>-o <VAR>comp-option</VAR></CODE>
11530<DD>The <VAR>comp-option</VAR> controls several aspects of the compspec's behavior
11531beyond the simple generation of completions.
11532<VAR>comp-option</VAR> may be one of:
11533<P>
11534
11535<DL COMPACT>
11536
11537<DT><CODE>bashdefault</CODE>
11538<DD>Perform the rest of the default Bash completions if the compspec
11539generates no matches.
11540<P>
11541
11542<DT><CODE>default</CODE>
11543<DD>Use Readline's default filename completion if the compspec generates
11544no matches.
11545<P>
11546
11547<DT><CODE>dirnames</CODE>
11548<DD>Perform directory name completion if the compspec generates no matches.
11549<P>
11550
11551<DT><CODE>filenames</CODE>
11552<DD>Tell Readline that the compspec generates filenames, so it can perform any
11553filename-specific processing (like adding a slash to directory names
11554quoting special characters, or suppressing trailing spaces).
11555This option is intended to be used with shell functions specified
11556with <SAMP>`-F'</SAMP>.
11557<P>
11558
11559<DT><CODE>nospace</CODE>
11560<DD>Tell Readline not to append a space (the default) to words completed at
11561the end of the line.
11562<P>
11563
11564<DT><CODE>plusdirs</CODE>
11565<DD>After any matches defined by the compspec are generated,
11566directory name completion is attempted and any
11567matches are added to the results of the other actions.
11568<P>
11569
11570</DL>
11571<P>
11572
11573<DT><CODE>-A <VAR>action</VAR></CODE>
11574<DD>The <VAR>action</VAR> may be one of the following to generate a list of possible
11575completions:
11576<P>
11577
11578<DL COMPACT>
11579<DT><CODE>alias</CODE>
11580<DD>Alias names. May also be specified as <SAMP>`-a'</SAMP>.
11581<P>
11582
11583<DT><CODE>arrayvar</CODE>
11584<DD>Array variable names.
11585<P>
11586
11587<DT><CODE>binding</CODE>
11588<DD>Readline key binding names (see section <A HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A>).
11589<P>
11590
11591<DT><CODE>builtin</CODE>
11592<DD>Names of shell builtin commands. May also be specified as <SAMP>`-b'</SAMP>.
11593<P>
11594
11595<DT><CODE>command</CODE>
11596<DD>Command names. May also be specified as <SAMP>`-c'</SAMP>.
11597<P>
11598
11599<DT><CODE>directory</CODE>
11600<DD>Directory names. May also be specified as <SAMP>`-d'</SAMP>.
11601<P>
11602
11603<DT><CODE>disabled</CODE>
11604<DD>Names of disabled shell builtins.
11605<P>
11606
11607<DT><CODE>enabled</CODE>
11608<DD>Names of enabled shell builtins.
11609<P>
11610
11611<DT><CODE>export</CODE>
11612<DD>Names of exported shell variables. May also be specified as <SAMP>`-e'</SAMP>.
11613<P>
11614
11615<DT><CODE>file</CODE>
11616<DD>File names. May also be specified as <SAMP>`-f'</SAMP>.
11617<P>
11618
11619<DT><CODE>function</CODE>
11620<DD>Names of shell functions.
11621<P>
11622
11623<DT><CODE>group</CODE>
11624<DD>Group names. May also be specified as <SAMP>`-g'</SAMP>.
11625<P>
11626
11627<DT><CODE>helptopic</CODE>
11628<DD>Help topics as accepted by the <CODE>help</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
11629<P>
11630
11631<DT><CODE>hostname</CODE>
11632<DD>Hostnames, as taken from the file specified by the
11633<CODE>HOSTFILE</CODE> shell variable (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>).
11634<P>
11635
11636<DT><CODE>job</CODE>
11637<DD>Job names, if job control is active. May also be specified as <SAMP>`-j'</SAMP>.
11638<P>
11639
11640<DT><CODE>keyword</CODE>
11641<DD>Shell reserved words. May also be specified as <SAMP>`-k'</SAMP>.
11642<P>
11643
11644<DT><CODE>running</CODE>
11645<DD>Names of running jobs, if job control is active.
11646<P>
11647
11648<DT><CODE>service</CODE>
11649<DD>Service names. May also be specified as <SAMP>`-s'</SAMP>.
11650<P>
11651
11652<DT><CODE>setopt</CODE>
11653<DD>Valid arguments for the <SAMP>`-o'</SAMP> option to the <CODE>set</CODE> builtin
11654(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
11655<P>
11656
11657<DT><CODE>shopt</CODE>
11658<DD>Shell option names as accepted by the <CODE>shopt</CODE> builtin
11659(see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
11660<P>
11661
11662<DT><CODE>signal</CODE>
11663<DD>Signal names.
11664<P>
11665
11666<DT><CODE>stopped</CODE>
11667<DD>Names of stopped jobs, if job control is active.
11668<P>
11669
11670<DT><CODE>user</CODE>
11671<DD>User names. May also be specified as <SAMP>`-u'</SAMP>.
11672<P>
11673
11674<DT><CODE>variable</CODE>
11675<DD>Names of all shell variables. May also be specified as <SAMP>`-v'</SAMP>.
11676</DL>
11677<P>
11678
11679<DT><CODE>-G <VAR>globpat</VAR></CODE>
11680<DD>The filename expansion pattern <VAR>globpat</VAR> is expanded to generate
11681the possible completions.
11682<P>
11683
11684<DT><CODE>-W <VAR>wordlist</VAR></CODE>
11685<DD>The <VAR>wordlist</VAR> is split using the characters in the
11686<CODE>IFS</CODE> special variable as delimiters, and each resultant word
11687is expanded.
11688The possible completions are the members of the resultant list which
11689match the word being completed.
11690<P>
11691
11692<DT><CODE>-C <VAR>command</VAR></CODE>
11693<DD><VAR>command</VAR> is executed in a subshell environment, and its output is
11694used as the possible completions.
11695<P>
11696
11697<DT><CODE>-F <VAR>function</VAR></CODE>
11698<DD>The shell function <VAR>function</VAR> is executed in the current shell
11699environment.
11700When it finishes, the possible completions are retrieved from the value
11701of the <CODE>COMPREPLY</CODE> array variable.
11702<P>
11703
11704<DT><CODE>-X <VAR>filterpat</VAR></CODE>
11705<DD><VAR>filterpat</VAR> is a pattern as used for filename expansion.
11706It is applied to the list of possible completions generated by the
11707preceding options and arguments, and each completion matching
11708<VAR>filterpat</VAR> is removed from the list.
11709A leading <SAMP>`!'</SAMP> in <VAR>filterpat</VAR> negates the pattern; in this
11710case, any completion not matching <VAR>filterpat</VAR> is removed.
11711<P>
11712
11713<DT><CODE>-P <VAR>prefix</VAR></CODE>
11714<DD><VAR>prefix</VAR> is added at the beginning of each possible completion
11715after all other options have been applied.
11716<P>
11717
11718<DT><CODE>-S <VAR>suffix</VAR></CODE>
11719<DD><VAR>suffix</VAR> is appended to each possible completion
11720after all other options have been applied.
11721</DL>
11722<P>
11723
11724The return value is true unless an invalid option is supplied, an option
11725other than <SAMP>`-p'</SAMP> or <SAMP>`-r'</SAMP> is supplied without a <VAR>name</VAR>
11726argument, an attempt is made to remove a completion specification for
11727a <VAR>name</VAR> for which no specification exists, or
11728an error occurs adding a completion specification.
11729</P><P>
11730
11731<DT><CODE>compopt</CODE>
0001803f
CR
11732<DD><A NAME="IDX542"></A>
11733<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>compopt</CODE> [-o <VAR>option</VAR>] [-DE] [+o <VAR>option</VAR>] [<VAR>name</VAR>]
17345e5a
JA
11734</pre></td></tr></table>Modify completion options for each <VAR>name</VAR> according to the
11735<VAR>option</VAR>s, or for the currently-execution completion if no <VAR>name</VAR>s
11736are supplied.
11737If no <VAR>option</VAR>s are given, display the completion options for each
11738<VAR>name</VAR> or the current completion.
11739The possible values of <VAR>option</VAR> are those valid for the <CODE>complete</CODE>
11740builtin described above.
0001803f
CR
11741The <SAMP>`-D'</SAMP> option indicates that the remaining options should
11742apply to the "default" command completion; that is, completion attempted
11743on a command for which no completion has previously been defined.
11744The <SAMP>`-E'</SAMP> option indicates that the remaining options should
11745apply to "empty" command completion; that is, completion attempted on a
11746blank line.
17345e5a
JA
11747<P>
11748
0001803f
CR
11749The <SAMP>`-D'</SAMP> option takes precedence over <SAMP>`-E'</SAMP>.
11750</P><P>
11751
17345e5a
JA
11752The return value is true unless an invalid option is supplied, an attempt
11753is made to modify the options for a <VAR>name</VAR> for which no completion
11754specification exists, or an output error occurs.
11755</P><P>
11756
11757</DL>
11758<P>
11759
0001803f 11760<A NAME="IDX543"></A>
17345e5a
JA
11761</P><P>
11762
11763<A NAME="Using History Interactively"></A>
11764<HR SIZE="6">
11765<A NAME="SEC119"></A>
11766<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11767<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC118"> &lt; </A>]</TD>
11768<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> &gt; </A>]</TD>
11769<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
11770<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
11771<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11772<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11773<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11774<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11775<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11776</TR></TABLE>
11777<H1> 9. Using History Interactively </H1>
11778<!--docid::SEC119::-->
11779<P>
11780
11781This chapter describes how to use the GNU History Library
11782interactively, from a user's standpoint.
11783It should be considered a user's guide.
11784For information on using the GNU History Library in other programs,
11785see the GNU Readline Library Manual.
11786</P><P>
11787
11788<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
11789<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How Bash lets you manipulate your command
11790 history.</TD></TR>
11791<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
11792 the command history.</TD></TR>
11793<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What it feels like using History as a user.</TD></TR>
11794</TABLE></BLOCKQUOTE>
11795<P>
11796
11797<A NAME="Bash History Facilities"></A>
11798<HR SIZE="6">
11799<A NAME="SEC120"></A>
11800<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11801<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> &lt; </A>]</TD>
11802<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &gt; </A>]</TD>
11803<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
11804<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
11805<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11806<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11807<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11808<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11809<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11810</TR></TABLE>
11811<H2> 9.1 Bash History Facilities </H2>
11812<!--docid::SEC120::-->
11813<P>
11814
11815When the <SAMP>`-o history'</SAMP> option to the <CODE>set</CODE> builtin
11816is enabled (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>),
11817the shell provides access to the <EM>command history</EM>,
11818the list of commands previously typed.
11819The value of the <CODE>HISTSIZE</CODE> shell variable is used as the
11820number of commands to save in a history list.
11821The text of the last <CODE>$HISTSIZE</CODE>
11822commands (default 500) is saved.
11823The shell stores each command in the history list prior to
11824parameter and variable expansion
11825but after history expansion is performed, subject to the
11826values of the shell variables
11827<CODE>HISTIGNORE</CODE> and <CODE>HISTCONTROL</CODE>.
11828</P><P>
11829
11830When the shell starts up, the history is initialized from the
11831file named by the <CODE>HISTFILE</CODE> variable (default <TT>`~/.bash_history'</TT>).
11832The file named by the value of <CODE>HISTFILE</CODE> is truncated, if
11833necessary, to contain no more than the number of lines specified by
11834the value of the <CODE>HISTFILESIZE</CODE> variable.
11835When an interactive shell exits, the last
11836<CODE>$HISTSIZE</CODE> lines are copied from the history list to the file
11837named by <CODE>$HISTFILE</CODE>.
11838If the <CODE>histappend</CODE> shell option is set (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>),
11839the lines are appended to the history file,
11840otherwise the history file is overwritten.
11841If <CODE>HISTFILE</CODE>
11842is unset, or if the history file is unwritable, the history is
11843not saved. After saving the history, the history file is truncated
11844to contain no more than <CODE>$HISTFILESIZE</CODE>
11845lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed.
11846</P><P>
11847
11848If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information
11849associated with each history entry is written to the history file,
11850marked with the history comment character.
11851When the history file is read, lines beginning with the history
11852comment character followed immediately by a digit are interpreted
11853as timestamps for the previous history line.
11854</P><P>
11855
11856The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute
11857a portion of the history list.
11858The <CODE>history</CODE> builtin may be used to display or modify the history
11859list and manipulate the history file.
11860When using command-line editing, search commands
11861are available in each editing mode that provide access to the
11862history list (see section <A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>).
11863</P><P>
11864
11865The shell allows control over which commands are saved on the history
11866list. The <CODE>HISTCONTROL</CODE> and <CODE>HISTIGNORE</CODE>
11867variables may be set to cause the shell to save only a subset of the
11868commands entered.
11869The <CODE>cmdhist</CODE>
11870shell option, if enabled, causes the shell to attempt to save each
11871line of a multi-line command in the same history entry, adding
11872semicolons where necessary to preserve syntactic correctness.
11873The <CODE>lithist</CODE>
11874shell option causes the shell to save the command with embedded newlines
11875instead of semicolons.
11876The <CODE>shopt</CODE> builtin is used to set these options.
11877See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of <CODE>shopt</CODE>.
11878</P><P>
11879
11880<A NAME="Bash History Builtins"></A>
11881<HR SIZE="6">
11882<A NAME="SEC121"></A>
11883<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
11884<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC120"> &lt; </A>]</TD>
11885<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &gt; </A>]</TD>
11886<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &lt;&lt; </A>]</TD>
11887<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
11888<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
11889<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
11890<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
11891<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
11892<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
11893</TR></TABLE>
11894<H2> 9.2 Bash History Builtins </H2>
11895<!--docid::SEC121::-->
11896<P>
11897
11898Bash provides two builtin commands which manipulate the
11899history list and history file.
11900</P><P>
11901
11902<DL COMPACT>
11903
11904<DT><CODE>fc</CODE>
0001803f 11905<DD><A NAME="IDX544"></A>
17345e5a
JA
11906<TABLE><tr><td>&nbsp;</td><td class=example><pre><CODE>fc [-e <VAR>ename</VAR>] [-lnr] [<VAR>first</VAR>] [<VAR>last</VAR>]</CODE>
11907<CODE>fc -s [<VAR>pat</VAR>=<VAR>rep</VAR>] [<VAR>command</VAR>]</CODE>
11908</pre></td></tr></table><P>
11909
11910Fix Command. In the first form, a range of commands from <VAR>first</VAR> to
11911<VAR>last</VAR> is selected from the history list. Both <VAR>first</VAR> and
11912<VAR>last</VAR> may be specified as a string (to locate the most recent
11913command beginning with that string) or as a number (an index into the
11914history list, where a negative number is used as an offset from the
11915current command number). If <VAR>last</VAR> is not specified it is set to
11916<VAR>first</VAR>. If <VAR>first</VAR> is not specified it is set to the previous
11917command for editing and -16 for listing. If the <SAMP>`-l'</SAMP> flag is
11918given, the commands are listed on standard output. The <SAMP>`-n'</SAMP> flag
11919suppresses the command numbers when listing. The <SAMP>`-r'</SAMP> flag
11920reverses the order of the listing. Otherwise, the editor given by
11921<VAR>ename</VAR> is invoked on a file containing those commands. If
11922<VAR>ename</VAR> is not given, the value of the following variable expansion
11923is used: <CODE>${FCEDIT:-${EDITOR:-vi}}</CODE>. This says to use the
11924value of the <CODE>FCEDIT</CODE> variable if set, or the value of the
11925<CODE>EDITOR</CODE> variable if that is set, or <CODE>vi</CODE> if neither is set.
11926When editing is complete, the edited commands are echoed and executed.
11927</P><P>
11928
11929In the second form, <VAR>command</VAR> is re-executed after each instance
11930of <VAR>pat</VAR> in the selected command is replaced by <VAR>rep</VAR>.
11931</P><P>
11932
11933A useful alias to use with the <CODE>fc</CODE> command is <CODE>r='fc -s'</CODE>, so
11934that typing <SAMP>`r cc'</SAMP> runs the last command beginning with <CODE>cc</CODE>
11935and typing <SAMP>`r'</SAMP> re-executes the last command (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
11936</P><P>
11937
11938<DT><CODE>history</CODE>
0001803f 11939<DD><A NAME="IDX545"></A>
17345e5a
JA
11940<TABLE><tr><td>&nbsp;</td><td class=example><pre>history [<VAR>n</VAR>]
11941history -c
11942history -d <VAR>offset</VAR>
11943history [-anrw] [<VAR>filename</VAR>]
11944history -ps <VAR>arg</VAR>
11945</pre></td></tr></table><P>
11946
11947With no options, display the history list with line numbers.
11948Lines prefixed with a <SAMP>`*'</SAMP> have been modified.
11949An argument of <VAR>n</VAR> lists only the last <VAR>n</VAR> lines.
11950If the shell variable <CODE>HISTTIMEFORMAT</CODE> is set and not null,
11951it is used as a format string for <VAR>strftime</VAR> to display
11952the time stamp associated with each displayed history entry.
11953No intervening blank is printed between the formatted time stamp
11954and the history line.
11955</P><P>
11956
11957Options, if supplied, have the following meanings:
11958</P><P>
11959
11960<DL COMPACT>
11961<DT><CODE>-c</CODE>
11962<DD>Clear the history list. This may be combined
11963with the other options to replace the history list completely.
11964<P>
11965
11966<DT><CODE>-d <VAR>offset</VAR></CODE>
11967<DD>Delete the history entry at position <VAR>offset</VAR>.
11968<VAR>offset</VAR> should be specified as it appears when the history is
11969displayed.
11970<P>
11971
11972<DT><CODE>-a</CODE>
11973<DD>Append the new
11974history lines (history lines entered since the beginning of the
11975current Bash session) to the history file.
11976<P>
11977
11978<DT><CODE>-n</CODE>
11979<DD>Append the history lines not already read from the history file
11980to the current history list. These are lines appended to the history
11981file since the beginning of the current Bash session.
11982<P>
11983
11984<DT><CODE>-r</CODE>
11985<DD>Read the current history file and append its contents to
11986the history list.
11987<P>
11988
11989<DT><CODE>-w</CODE>
11990<DD>Write out the current history to the history file.
11991<P>
11992
11993<DT><CODE>-p</CODE>
11994<DD>Perform history substitution on the <VAR>arg</VAR>s and display the result
11995on the standard output, without storing the results in the history list.
11996<P>
11997
11998<DT><CODE>-s</CODE>
11999<DD>The <VAR>arg</VAR>s are added to the end of
12000the history list as a single entry.
12001<P>
12002
12003</DL>
12004<P>
12005
12006When any of the <SAMP>`-w'</SAMP>, <SAMP>`-r'</SAMP>, <SAMP>`-a'</SAMP>, or <SAMP>`-n'</SAMP> options is
12007used, if <VAR>filename</VAR>
12008is given, then it is used as the history file. If not, then
12009the value of the <CODE>HISTFILE</CODE> variable is used.
12010</P><P>
12011
12012</DL>
12013<P>
12014
12015<A NAME="History Interaction"></A>
12016<HR SIZE="6">
12017<A NAME="SEC122"></A>
12018<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12019<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC121"> &lt; </A>]</TD>
12020<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> &gt; </A>]</TD>
12021<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
12022<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC119"> Up </A>]</TD>
12023<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
12024<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12025<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12026<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12027<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12028</TR></TABLE>
12029<H2> 9.3 History Expansion </H2>
12030<!--docid::SEC122::-->
12031<P>
12032
12033The History library provides a history expansion feature that is similar
12034to the history expansion provided by <CODE>csh</CODE>. This section
12035describes the syntax used to manipulate the history information.
12036</P><P>
12037
12038History expansions introduce words from the history list into
12039the input stream, making it easy to repeat commands, insert the
12040arguments to a previous command into the current input line, or
12041fix errors in previous commands quickly.
12042</P><P>
12043
12044History expansion takes place in two parts. The first is to determine
12045which line from the history list should be used during substitution.
12046The second is to select portions of that line for inclusion into the
12047current one. The line selected from the history is called the
12048<EM>event</EM>, and the portions of that line that are acted upon are
12049called <EM>words</EM>. Various <EM>modifiers</EM> are available to manipulate
12050the selected words. The line is broken into words in the same fashion
12051that Bash does, so that several words
12052surrounded by quotes are considered one word.
12053History expansions are introduced by the appearance of the
12054history expansion character, which is <SAMP>`!'</SAMP> by default.
12055Only <SAMP>`\'</SAMP> and <SAMP>`''</SAMP> may be used to escape the history expansion
12056character.
12057</P><P>
12058
12059Several shell options settable with the <CODE>shopt</CODE>
12060builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>) may be used to tailor
12061the behavior of history expansion. If the
12062<CODE>histverify</CODE> shell option is enabled, and Readline
12063is being used, history substitutions are not immediately passed to
12064the shell parser.
12065Instead, the expanded line is reloaded into the Readline
12066editing buffer for further modification.
12067If Readline is being used, and the <CODE>histreedit</CODE>
12068shell option is enabled, a failed history expansion will be
12069reloaded into the Readline editing buffer for correction.
12070The <SAMP>`-p'</SAMP> option to the <CODE>history</CODE> builtin command
12071may be used to see what a history expansion will do before using it.
12072The <SAMP>`-s'</SAMP> option to the <CODE>history</CODE> builtin may be used to
12073add commands to the end of the history list without actually executing
12074them, so that they are available for subsequent recall.
12075This is most useful in conjunction with Readline.
12076</P><P>
12077
12078The shell allows control of the various characters used by the
12079history expansion mechanism with the <CODE>histchars</CODE> variable,
12080as explained above (see section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>). The shell uses
12081the history comment character to mark history timestamps when
12082writing the history file.
12083</P><P>
12084
12085<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12086<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to specify which history line to use.</TD></TR>
12087<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC124">9.3.2 Word Designators</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Specifying which words are of interest.</TD></TR>
12088<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC125">9.3.3 Modifiers</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Modifying the results of substitution.</TD></TR>
12089</TABLE></BLOCKQUOTE>
12090<P>
12091
12092<A NAME="Event Designators"></A>
12093<HR SIZE="6">
12094<A NAME="SEC123"></A>
12095<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12096<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> &lt; </A>]</TD>
12097<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> &gt; </A>]</TD>
12098<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
12099<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
12100<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
12101<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12102<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12103<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12104<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12105</TR></TABLE>
12106<H3> 9.3.1 Event Designators </H3>
12107<!--docid::SEC123::-->
12108<P>
12109
12110An event designator is a reference to a command line entry in the
12111history list.
0001803f 12112<A NAME="IDX546"></A>
17345e5a
JA
12113</P><P>
12114
12115<DL COMPACT>
12116
12117<DT><CODE>!</CODE>
12118<DD>Start a history substitution, except when followed by a space, tab,
12119the end of the line, <SAMP>`='</SAMP> or <SAMP>`('</SAMP> (when the
12120<CODE>extglob</CODE> shell option is enabled using the <CODE>shopt</CODE> builtin).
12121<P>
12122
12123<DT><CODE>!<VAR>n</VAR></CODE>
12124<DD>Refer to command line <VAR>n</VAR>.
12125<P>
12126
12127<DT><CODE>!-<VAR>n</VAR></CODE>
12128<DD>Refer to the command <VAR>n</VAR> lines back.
12129<P>
12130
12131<DT><CODE>!!</CODE>
12132<DD>Refer to the previous command. This is a synonym for <SAMP>`!-1'</SAMP>.
12133<P>
12134
12135<DT><CODE>!<VAR>string</VAR></CODE>
12136<DD>Refer to the most recent command starting with <VAR>string</VAR>.
12137<P>
12138
12139<DT><CODE>!?<VAR>string</VAR>[?]</CODE>
12140<DD>Refer to the most recent command containing <VAR>string</VAR>. The trailing
12141<SAMP>`?'</SAMP> may be omitted if the <VAR>string</VAR> is followed immediately by
12142a newline.
12143<P>
12144
12145<DT><CODE>^<VAR>string1</VAR>^<VAR>string2</VAR>^</CODE>
12146<DD>Quick Substitution. Repeat the last command, replacing <VAR>string1</VAR>
12147with <VAR>string2</VAR>. Equivalent to
12148<CODE>!!:s/<VAR>string1</VAR>/<VAR>string2</VAR>/</CODE>.
12149<P>
12150
12151<DT><CODE>!#</CODE>
12152<DD>The entire command line typed so far.
12153<P>
12154
12155</DL>
12156<P>
12157
12158<A NAME="Word Designators"></A>
12159<HR SIZE="6">
12160<A NAME="SEC124"></A>
12161<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12162<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC123"> &lt; </A>]</TD>
12163<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &gt; </A>]</TD>
12164<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &lt;&lt; </A>]</TD>
12165<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
12166<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
12167<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12168<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12169<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12170<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12171</TR></TABLE>
12172<H3> 9.3.2 Word Designators </H3>
12173<!--docid::SEC124::-->
12174<P>
12175
12176Word designators are used to select desired words from the event.
12177A <SAMP>`:'</SAMP> separates the event specification from the word designator. It
12178may be omitted if the word designator begins with a <SAMP>`^'</SAMP>, <SAMP>`$'</SAMP>,
12179<SAMP>`*'</SAMP>, <SAMP>`-'</SAMP>, or <SAMP>`%'</SAMP>. Words are numbered from the beginning
12180of the line, with the first word being denoted by 0 (zero). Words are
12181inserted into the current line separated by single spaces.
12182</P><P>
12183
12184For example,
12185</P><P>
12186
12187<DL COMPACT>
12188<DT><CODE>!!</CODE>
12189<DD>designates the preceding command. When you type this, the preceding
12190command is repeated in toto.
12191<P>
12192
12193<DT><CODE>!!:$</CODE>
12194<DD>designates the last argument of the preceding command. This may be
12195shortened to <CODE>!$</CODE>.
12196<P>
12197
12198<DT><CODE>!fi:2</CODE>
12199<DD>designates the second argument of the most recent command starting with
12200the letters <CODE>fi</CODE>.
12201</DL>
12202<P>
12203
12204Here are the word designators:
12205
12206<DL COMPACT>
12207
12208<DT><CODE>0 (zero)</CODE>
12209<DD>The <CODE>0</CODE>th word. For many applications, this is the command word.
12210<P>
12211
12212<DT><CODE><VAR>n</VAR></CODE>
12213<DD>The <VAR>n</VAR>th word.
12214<P>
12215
12216<DT><CODE>^</CODE>
12217<DD>The first argument; that is, word 1.
12218<P>
12219
12220<DT><CODE>$</CODE>
12221<DD>The last argument.
12222<P>
12223
12224<DT><CODE>%</CODE>
12225<DD>The word matched by the most recent <SAMP>`?<VAR>string</VAR>?'</SAMP> search.
12226<P>
12227
12228<DT><CODE><VAR>x</VAR>-<VAR>y</VAR></CODE>
12229<DD>A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>.
12230<P>
12231
12232<DT><CODE>*</CODE>
12233<DD>All of the words, except the <CODE>0</CODE>th. This is a synonym for <SAMP>`1-$'</SAMP>.
12234It is not an error to use <SAMP>`*'</SAMP> if there is just one word in the event;
12235the empty string is returned in that case.
12236<P>
12237
12238<DT><CODE><VAR>x</VAR>*</CODE>
12239<DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP>
12240<P>
12241
12242<DT><CODE><VAR>x</VAR>-</CODE>
12243<DD>Abbreviates <SAMP>`<VAR>x</VAR>-$'</SAMP> like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omits the last word.
12244<P>
12245
12246</DL>
12247<P>
12248
12249If a word designator is supplied without an event specification, the
12250previous command is used as the event.
12251</P><P>
12252
12253<A NAME="Modifiers"></A>
12254<HR SIZE="6">
12255<A NAME="SEC125"></A>
12256<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12257<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC124"> &lt; </A>]</TD>
12258<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt; </A>]</TD>
12259<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
12260<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC122"> Up </A>]</TD>
12261<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &gt;&gt; </A>]</TD>
12262<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12263<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12264<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12265<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12266</TR></TABLE>
12267<H3> 9.3.3 Modifiers </H3>
12268<!--docid::SEC125::-->
12269<P>
12270
12271After the optional word designator, you can add a sequence of one or more
12272of the following modifiers, each preceded by a <SAMP>`:'</SAMP>.
12273</P><P>
12274
12275<DL COMPACT>
12276
12277<DT><CODE>h</CODE>
12278<DD>Remove a trailing pathname component, leaving only the head.
12279<P>
12280
12281<DT><CODE>t</CODE>
12282<DD>Remove all leading pathname components, leaving the tail.
12283<P>
12284
12285<DT><CODE>r</CODE>
12286<DD>Remove a trailing suffix of the form <SAMP>`.<VAR>suffix</VAR>'</SAMP>, leaving
12287the basename.
12288<P>
12289
12290<DT><CODE>e</CODE>
12291<DD>Remove all but the trailing suffix.
12292<P>
12293
12294<DT><CODE>p</CODE>
12295<DD>Print the new command but do not execute it.
12296<P>
12297
12298<DT><CODE>q</CODE>
12299<DD>Quote the substituted words, escaping further substitutions.
12300<P>
12301
12302<DT><CODE>x</CODE>
12303<DD>Quote the substituted words as with <SAMP>`q'</SAMP>,
12304but break into words at spaces, tabs, and newlines.
12305<P>
12306
12307<DT><CODE>s/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>
12308<DD>Substitute <VAR>new</VAR> for the first occurrence of <VAR>old</VAR> in the
12309event line. Any delimiter may be used in place of <SAMP>`/'</SAMP>.
12310The delimiter may be quoted in <VAR>old</VAR> and <VAR>new</VAR>
12311with a single backslash. If <SAMP>`&#38;'</SAMP> appears in <VAR>new</VAR>,
12312it is replaced by <VAR>old</VAR>. A single backslash will quote
12313the <SAMP>`&#38;'</SAMP>. The final delimiter is optional if it is the last
12314character on the input line.
12315<P>
12316
12317<DT><CODE>&#38;</CODE>
12318<DD>Repeat the previous substitution.
12319<P>
12320
12321<DT><CODE>g</CODE>
12322<DD><DT><CODE>a</CODE>
12323<DD>Cause changes to be applied over the entire event line. Used in
12324conjunction with <SAMP>`s'</SAMP>, as in <CODE>gs/<VAR>old</VAR>/<VAR>new</VAR>/</CODE>,
12325or with <SAMP>`&#38;'</SAMP>.
12326<P>
12327
12328<DT><CODE>G</CODE>
12329<DD>Apply the following <SAMP>`s'</SAMP> modifier once to each word in the event.
12330<P>
12331
12332</DL>
12333<P>
12334
12335<A NAME="Installing Bash"></A>
12336<HR SIZE="6">
12337<A NAME="SEC126"></A>
12338<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12339<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC125"> &lt; </A>]</TD>
12340<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> &gt; </A>]</TD>
12341<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC4"> &lt;&lt; </A>]</TD>
12342<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
12343<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12344<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12345<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12346<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12347<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12348</TR></TABLE>
12349<H1> 10. Installing Bash </H1>
12350<!--docid::SEC126::-->
12351<P>
12352
12353This chapter provides basic instructions for installing Bash on
12354the various supported platforms. The distribution supports the
12355GNU operating systems, nearly every version of Unix, and several
12356non-Unix systems such as BeOS and Interix.
12357Other independent ports exist for
12358MS-DOS, OS/2, and Windows platforms.
12359</P><P>
12360
12361<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
12362<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Installation instructions.</TD></TR>
12363<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC128">10.2 Compilers and Options</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to set special options for various
12364 systems.</TD></TR>
12365<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
12366 than one kind of system from
12367 the same source tree.</TD></TR>
12368<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC130">10.4 Installation Names</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to set the various paths used by the installation.</TD></TR>
12369<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC131">10.5 Specifying the System Type</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to configure Bash for a particular system.</TD></TR>
12370<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC132">10.6 Sharing Defaults</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to share default configuration values among GNU
12371 programs.</TD></TR>
12372<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC133">10.7 Operation Controls</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Options recognized by the configuration program.</TD></TR>
12373<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC134">10.8 Optional Features</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">How to enable and disable optional features when
12374 building Bash.</TD></TR>
12375</TABLE></BLOCKQUOTE>
12376<P>
12377
12378<A NAME="Basic Installation"></A>
12379<HR SIZE="6">
12380<A NAME="SEC127"></A>
12381<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12382<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt; </A>]</TD>
12383<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &gt; </A>]</TD>
12384<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt;&lt; </A>]</TD>
12385<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12386<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12387<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12388<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12389<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12390<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12391</TR></TABLE>
12392<H2> 10.1 Basic Installation </H2>
12393<!--docid::SEC127::-->
12394<P>
12395
12396These are installation instructions for Bash.
12397</P><P>
12398
12399The simplest way to compile Bash is:
12400</P><P>
12401
12402<OL>
12403<LI>
12404<CODE>cd</CODE> to the directory containing the source code and type
12405<SAMP>`./configure'</SAMP> to configure Bash for your system. If you're
12406using <CODE>csh</CODE> on an old version of System V, you might need to
12407type <SAMP>`sh ./configure'</SAMP> instead to prevent <CODE>csh</CODE> from trying
12408to execute <CODE>configure</CODE> itself.
12409<P>
12410
12411Running <CODE>configure</CODE> takes some time.
12412While running, it prints messages telling which features it is
12413checking for.
12414</P><P>
12415
12416<LI>
12417Type <SAMP>`make'</SAMP> to compile Bash and build the <CODE>bashbug</CODE> bug
12418reporting script.
12419<P>
12420
12421<LI>
12422Optionally, type <SAMP>`make tests'</SAMP> to run the Bash test suite.
12423<P>
12424
12425<LI>
12426Type <SAMP>`make install'</SAMP> to install <CODE>bash</CODE> and <CODE>bashbug</CODE>.
12427This will also install the manual pages and Info file.
12428<P>
12429
12430</OL>
12431<P>
12432
12433The <CODE>configure</CODE> shell script attempts to guess correct
12434values for various system-dependent variables used during
12435compilation. It uses those values to create a <TT>`Makefile'</TT> in
12436each directory of the package (the top directory, the
12437<TT>`builtins'</TT>, <TT>`doc'</TT>, and <TT>`support'</TT> directories,
12438each directory under <TT>`lib'</TT>, and several others). It also creates a
12439<TT>`config.h'</TT> file containing system-dependent definitions.
12440Finally, it creates a shell script named <CODE>config.status</CODE> that you
12441can run in the future to recreate the current configuration, a
12442file <TT>`config.cache'</TT> that saves the results of its tests to
12443speed up reconfiguring, and a file <TT>`config.log'</TT> containing
12444compiler output (useful mainly for debugging <CODE>configure</CODE>).
12445If at some point
12446<TT>`config.cache'</TT> contains results you don't want to keep, you
12447may remove or edit it.
12448</P><P>
12449
12450To find out more about the options and arguments that the
12451<CODE>configure</CODE> script understands, type
12452</P><P>
12453
12454<TABLE><tr><td>&nbsp;</td><td class=example><pre>bash-2.04$ ./configure --help
12455</pre></td></tr></table></P><P>
12456
12457at the Bash prompt in your Bash source directory.
12458</P><P>
12459
12460If you need to do unusual things to compile Bash, please
12461try to figure out how <CODE>configure</CODE> could check whether or not
12462to do them, and mail diffs or instructions to
12463<A HREF="mailto:bash-maintainers@gnu.org">bash-maintainers@gnu.org</A> so they can be
12464considered for the next release.
12465</P><P>
12466
12467The file <TT>`configure.in'</TT> is used to create <CODE>configure</CODE>
12468by a program called Autoconf. You only need
12469<TT>`configure.in'</TT> if you want to change it or regenerate
12470<CODE>configure</CODE> using a newer version of Autoconf. If
12471you do this, make sure you are using Autoconf version 2.50 or
12472newer.
12473</P><P>
12474
12475You can remove the program binaries and object files from the
12476source code directory by typing <SAMP>`make clean'</SAMP>. To also remove the
12477files that <CODE>configure</CODE> created (so you can compile Bash for
12478a different kind of computer), type <SAMP>`make distclean'</SAMP>.
12479</P><P>
12480
12481<A NAME="Compilers and Options"></A>
12482<HR SIZE="6">
12483<A NAME="SEC128"></A>
12484<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12485<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC127"> &lt; </A>]</TD>
12486<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &gt; </A>]</TD>
12487<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &lt;&lt; </A>]</TD>
12488<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12489<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12490<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12491<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12492<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12493<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12494</TR></TABLE>
12495<H2> 10.2 Compilers and Options </H2>
12496<!--docid::SEC128::-->
12497<P>
12498
12499Some systems require unusual options for compilation or linking
12500that the <CODE>configure</CODE> script does not know about. You can
12501give <CODE>configure</CODE> initial values for variables by setting
12502them in the environment. Using a Bourne-compatible shell, you
12503can do that on the command line like this:
12504</P><P>
12505
12506<TABLE><tr><td>&nbsp;</td><td class=example><pre>CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
12507</pre></td></tr></table></P><P>
12508
12509On systems that have the <CODE>env</CODE> program, you can do it like this:
12510</P><P>
12511
12512<TABLE><tr><td>&nbsp;</td><td class=example><pre>env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
12513</pre></td></tr></table></P><P>
12514
12515The configuration process uses GCC to build Bash if it
12516is available.
12517</P><P>
12518
12519<A NAME="Compiling For Multiple Architectures"></A>
12520<HR SIZE="6">
12521<A NAME="SEC129"></A>
12522<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12523<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC128"> &lt; </A>]</TD>
12524<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &gt; </A>]</TD>
12525<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &lt;&lt; </A>]</TD>
12526<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12527<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12528<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12529<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12530<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12531<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12532</TR></TABLE>
12533<H2> 10.3 Compiling For Multiple Architectures </H2>
12534<!--docid::SEC129::-->
12535<P>
12536
12537You can compile Bash for more than one kind of computer at the
12538same time, by placing the object files for each architecture in their
12539own directory. To do this, you must use a version of <CODE>make</CODE> that
12540supports the <CODE>VPATH</CODE> variable, such as GNU <CODE>make</CODE>.
12541<CODE>cd</CODE> to the
12542directory where you want the object files and executables to go and run
12543the <CODE>configure</CODE> script from the source directory. You may need to
12544supply the <SAMP>`--srcdir=PATH'</SAMP> argument to tell <CODE>configure</CODE> where the
12545source files are. <CODE>configure</CODE> automatically checks for the
12546source code in the directory that <CODE>configure</CODE> is in and in `..'.
12547</P><P>
12548
12549If you have to use a <CODE>make</CODE> that does not supports the <CODE>VPATH</CODE>
12550variable, you can compile Bash for one architecture at a
12551time in the source code directory. After you have installed
12552Bash for one architecture, use <SAMP>`make distclean'</SAMP> before
12553reconfiguring for another architecture.
12554</P><P>
12555
12556Alternatively, if your system supports symbolic links, you can use the
12557<TT>`support/mkclone'</TT> script to create a build tree which has
12558symbolic links back to each file in the source directory. Here's an
12559example that creates a build directory in the current directory from a
12560source directory <TT>`/usr/gnu/src/bash-2.0'</TT>:
12561</P><P>
12562
12563<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 .
12564</pre></td></tr></table></P><P>
12565
12566The <CODE>mkclone</CODE> script requires Bash, so you must have already built
12567Bash for at least one architecture before you can create build
12568directories for other architectures.
12569</P><P>
12570
12571<A NAME="Installation Names"></A>
12572<HR SIZE="6">
12573<A NAME="SEC130"></A>
12574<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12575<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC129"> &lt; </A>]</TD>
12576<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &gt; </A>]</TD>
12577<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &lt;&lt; </A>]</TD>
12578<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12579<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12580<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12581<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12582<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12583<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12584</TR></TABLE>
12585<H2> 10.4 Installation Names </H2>
12586<!--docid::SEC130::-->
12587<P>
12588
12589By default, <SAMP>`make install'</SAMP> will install into
12590<TT>`/usr/local/bin'</TT>, <TT>`/usr/local/man'</TT>, etc. You can
12591specify an installation prefix other than <TT>`/usr/local'</TT> by
12592giving <CODE>configure</CODE> the option <SAMP>`--prefix=<VAR>PATH</VAR>'</SAMP>,
12593or by specifying a value for the <CODE>DESTDIR</CODE> <SAMP>`make'</SAMP>
12594variable when running <SAMP>`make install'</SAMP>.
12595</P><P>
12596
12597You can specify separate installation prefixes for
12598architecture-specific files and architecture-independent files.
12599If you give <CODE>configure</CODE> the option
12600<SAMP>`--exec-prefix=<VAR>PATH</VAR>'</SAMP>, <SAMP>`make install'</SAMP> will use
12601<VAR>PATH</VAR> as the prefix for installing programs and libraries.
12602Documentation and other data files will still use the regular prefix.
12603</P><P>
12604
12605<A NAME="Specifying the System Type"></A>
12606<HR SIZE="6">
12607<A NAME="SEC131"></A>
12608<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12609<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC130"> &lt; </A>]</TD>
12610<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &gt; </A>]</TD>
12611<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &lt;&lt; </A>]</TD>
12612<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12613<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12614<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12615<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12616<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12617<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12618</TR></TABLE>
12619<H2> 10.5 Specifying the System Type </H2>
12620<!--docid::SEC131::-->
12621<P>
12622
12623There may be some features <CODE>configure</CODE> can not figure out
12624automatically, but need to determine by the type of host Bash
12625will run on. Usually <CODE>configure</CODE> can figure that
12626out, but if it prints a message saying it can not guess the host
12627type, give it the <SAMP>`--host=TYPE'</SAMP> option. <SAMP>`TYPE'</SAMP> can
12628either be a short name for the system type, such as <SAMP>`sun4'</SAMP>,
12629or a canonical name with three fields: <SAMP>`CPU-COMPANY-SYSTEM'</SAMP>
12630(e.g., <SAMP>`i386-unknown-freebsd4.2'</SAMP>).
12631</P><P>
12632
12633See the file <TT>`support/config.sub'</TT> for the possible
12634values of each field.
12635</P><P>
12636
12637<A NAME="Sharing Defaults"></A>
12638<HR SIZE="6">
12639<A NAME="SEC132"></A>
12640<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12641<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC131"> &lt; </A>]</TD>
12642<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &gt; </A>]</TD>
12643<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &lt;&lt; </A>]</TD>
12644<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12645<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12646<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12647<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12648<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12649<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12650</TR></TABLE>
12651<H2> 10.6 Sharing Defaults </H2>
12652<!--docid::SEC132::-->
12653<P>
12654
12655If you want to set default values for <CODE>configure</CODE> scripts to
12656share, you can create a site shell script called
12657<CODE>config.site</CODE> that gives default values for variables like
12658<CODE>CC</CODE>, <CODE>cache_file</CODE>, and <CODE>prefix</CODE>. <CODE>configure</CODE>
12659looks for <TT>`PREFIX/share/config.site'</TT> if it exists, then
12660<TT>`PREFIX/etc/config.site'</TT> if it exists. Or, you can set the
12661<CODE>CONFIG_SITE</CODE> environment variable to the location of the site
12662script. A warning: the Bash <CODE>configure</CODE> looks for a site script,
12663but not all <CODE>configure</CODE> scripts do.
12664</P><P>
12665
12666<A NAME="Operation Controls"></A>
12667<HR SIZE="6">
12668<A NAME="SEC133"></A>
12669<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12670<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC132"> &lt; </A>]</TD>
12671<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &gt; </A>]</TD>
12672<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &lt;&lt; </A>]</TD>
12673<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12674<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12675<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12676<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12677<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12678<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12679</TR></TABLE>
12680<H2> 10.7 Operation Controls </H2>
12681<!--docid::SEC133::-->
12682<P>
12683
12684<CODE>configure</CODE> recognizes the following options to control how it
12685operates.
12686</P><P>
12687
12688<DL COMPACT>
12689
12690<DT><CODE>--cache-file=<VAR>file</VAR></CODE>
12691<DD>Use and save the results of the tests in
12692<VAR>file</VAR> instead of <TT>`./config.cache'</TT>. Set <VAR>file</VAR> to
12693<TT>`/dev/null'</TT> to disable caching, for debugging
12694<CODE>configure</CODE>.
12695<P>
12696
12697<DT><CODE>--help</CODE>
12698<DD>Print a summary of the options to <CODE>configure</CODE>, and exit.
12699<P>
12700
12701<DT><CODE>--quiet</CODE>
12702<DD><DT><CODE>--silent</CODE>
12703<DD><DT><CODE>-q</CODE>
12704<DD>Do not print messages saying which checks are being made.
12705<P>
12706
12707<DT><CODE>--srcdir=<VAR>dir</VAR></CODE>
12708<DD>Look for the Bash source code in directory <VAR>dir</VAR>. Usually
12709<CODE>configure</CODE> can determine that directory automatically.
12710<P>
12711
12712<DT><CODE>--version</CODE>
12713<DD>Print the version of Autoconf used to generate the <CODE>configure</CODE>
12714script, and exit.
12715</DL>
12716<P>
12717
12718<CODE>configure</CODE> also accepts some other, not widely used, boilerplate
12719options. <SAMP>`configure --help'</SAMP> prints the complete list.
12720</P><P>
12721
12722<A NAME="Optional Features"></A>
12723<HR SIZE="6">
12724<A NAME="SEC134"></A>
12725<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
12726<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC133"> &lt; </A>]</TD>
12727<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt; </A>]</TD>
12728<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt;&lt; </A>]</TD>
12729<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> Up </A>]</TD>
12730<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &gt;&gt; </A>]</TD>
12731<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
12732<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
12733<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
12734<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
12735</TR></TABLE>
12736<H2> 10.8 Optional Features </H2>
12737<!--docid::SEC134::-->
12738<P>
12739
12740The Bash <CODE>configure</CODE> has a number of <SAMP>`--enable-<VAR>feature</VAR>'</SAMP>
12741options, where <VAR>feature</VAR> indicates an optional part of Bash.
12742There are also several <SAMP>`--with-<VAR>package</VAR>'</SAMP> options,
12743where <VAR>package</VAR> is something like <SAMP>`bash-malloc'</SAMP> or <SAMP>`purify'</SAMP>.
12744To turn off the default use of a package, use
12745<SAMP>`--without-<VAR>package</VAR>'</SAMP>. To configure Bash without a feature
12746that is enabled by default, use <SAMP>`--disable-<VAR>feature</VAR>'</SAMP>.
12747</P><P>
12748
12749Here is a complete list of the <SAMP>`--enable-'</SAMP> and
12750<SAMP>`--with-'</SAMP> options that the Bash <CODE>configure</CODE> recognizes.
12751</P><P>
12752
12753<DL COMPACT>
12754<DT><CODE>--with-afs</CODE>
12755<DD>Define if you are using the Andrew File System from Transarc.
12756<P>
12757
12758<DT><CODE>--with-bash-malloc</CODE>
12759<DD>Use the Bash version of
12760<CODE>malloc</CODE> in the directory <TT>`lib/malloc'</TT>. This is not the same
12761<CODE>malloc</CODE> that appears in GNU libc, but an older version
12762originally derived from the 4.2 BSD <CODE>malloc</CODE>. This <CODE>malloc</CODE>
12763is very fast, but wastes some space on each allocation.
12764This option is enabled by default.
12765The <TT>`NOTES'</TT> file contains a list of systems for
12766which this should be turned off, and <CODE>configure</CODE> disables this
12767option automatically for a number of systems.
12768<P>
12769
12770<DT><CODE>--with-curses</CODE>
12771<DD>Use the curses library instead of the termcap library. This should
12772be supplied if your system has an inadequate or incomplete termcap
12773database.
12774<P>
12775
12776<DT><CODE>--with-gnu-malloc</CODE>
12777<DD>A synonym for <CODE>--with-bash-malloc</CODE>.
12778<P>
12779
12780<DT><CODE>--with-installed-readline[=<VAR>PREFIX</VAR>]</CODE>
12781<DD>Define this to make Bash link with a locally-installed version of Readline
12782rather than the version in <TT>`lib/readline'</TT>. This works only with
12783Readline 5.0 and later versions. If <VAR>PREFIX</VAR> is <CODE>yes</CODE> or not
12784supplied, <CODE>configure</CODE> uses the values of the make variables
12785<CODE>includedir</CODE> and <CODE>libdir</CODE>, which are subdirectories of <CODE>prefix</CODE>
12786by default, to find the installed version of Readline if it is not in
12787the standard system include and library directories.
12788If <VAR>PREFIX</VAR> is <CODE>no</CODE>, Bash links with the version in
12789<TT>`lib/readline'</TT>.
12790If <VAR>PREFIX</VAR> is set to any other value, <CODE>configure</CODE> treats it as
12791a directory pathname and looks for
12792the installed version of Readline in subdirectories of that directory
12793(include files in <VAR>PREFIX</VAR>/<CODE>include</CODE> and the library in
12794<VAR>PREFIX</VAR>/<CODE>lib</CODE>).
12795<P>
12796
12797<DT><CODE>--with-purify</CODE>
12798<DD>Define this to use the Purify memory allocation checker from Rational
12799Software.
12800<P>
12801
12802<DT><CODE>--enable-minimal-config</CODE>
12803<DD>This produces a shell with minimal features, close to the historical
12804Bourne shell.
12805</DL>
12806<P>
12807
12808There are several <SAMP>`--enable-'</SAMP> options that alter how Bash is
12809compiled and linked, rather than changing run-time features.
12810</P><P>
12811
12812<DL COMPACT>
12813<DT><CODE>--enable-largefile</CODE>
12814<DD>Enable support for <A HREF="http://www.sas.com/standards/large_file/x_open.20Mar96.html">large files</A> if the operating system requires special compiler options
12815to build programs which can access large files. This is enabled by
12816default, if the operating system provides large file support.
12817<P>
12818
12819<DT><CODE>--enable-profiling</CODE>
12820<DD>This builds a Bash binary that produces profiling information to be
12821processed by <CODE>gprof</CODE> each time it is executed.
12822<P>
12823
12824<DT><CODE>--enable-static-link</CODE>
12825<DD>This causes Bash to be linked statically, if <CODE>gcc</CODE> is being used.
12826This could be used to build a version to use as root's shell.
12827</DL>
12828<P>
12829
12830The <SAMP>`minimal-config'</SAMP> option can be used to disable all of
12831the following options, but it is processed first, so individual
12832options may be enabled using <SAMP>`enable-<VAR>feature</VAR>'</SAMP>.
12833</P><P>
12834
12835All of the following options except for <SAMP>`disabled-builtins'</SAMP> and
12836<SAMP>`xpg-echo-default'</SAMP> are
12837enabled by default, unless the operating system does not provide the
12838necessary support.
12839</P><P>
12840
12841<DL COMPACT>
12842<DT><CODE>--enable-alias</CODE>
12843<DD>Allow alias expansion and include the <CODE>alias</CODE> and <CODE>unalias</CODE>
12844builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
12845<P>
12846
12847<DT><CODE>--enable-arith-for-command</CODE>
12848<DD>Include support for the alternate form of the <CODE>for</CODE> command
12849that behaves like the C language <CODE>for</CODE> statement
12850(see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
12851<P>
12852
12853<DT><CODE>--enable-array-variables</CODE>
12854<DD>Include support for one-dimensional array shell variables
12855(see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>).
12856<P>
12857
12858<DT><CODE>--enable-bang-history</CODE>
12859<DD>Include support for <CODE>csh</CODE>-like history substitution
12860(see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
12861<P>
12862
12863<DT><CODE>--enable-brace-expansion</CODE>
12864<DD>Include <CODE>csh</CODE>-like brace expansion
12865( <CODE>b{a,b}c</CODE> ==> <CODE>bac bbc</CODE> ).
12866See <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>, for a complete description.
12867<P>
12868
12869<DT><CODE>--enable-casemod-attributes</CODE>
12870<DD>Include support for case-modifying attributes in the <CODE>declare</CODE> builtin
12871and assignment statements. Variables with the <VAR>uppercase</VAR> attribute,
12872for example, will have their values converted to uppercase upon assignment.
12873<P>
12874
12875<DT><CODE>--enable-casemod-expansion</CODE>
12876<DD>Include support for case-modifying word expansions.
12877<P>
12878
12879<DT><CODE>--enable-command-timing</CODE>
12880<DD>Include support for recognizing <CODE>time</CODE> as a reserved word and for
12881displaying timing statistics for the pipeline following <CODE>time</CODE>
12882(see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12883This allows pipelines as well as shell builtins and functions to be timed.
12884<P>
12885
12886<DT><CODE>--enable-cond-command</CODE>
12887<DD>Include support for the <CODE>[[</CODE> conditional command.
12888(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12889<P>
12890
12891<DT><CODE>--enable-cond-regexp</CODE>
12892<DD>Include support for matching POSIX regular expressions using the
12893<SAMP>`=~'</SAMP> binary operator in the <CODE>[[</CODE> conditional command.
12894(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12895<P>
12896
12897<DT><CODE>--enable-coprocesses</CODE>
12898<DD>Include support for coprocesses and the <CODE>coproc</CODE> reserved word
12899(see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
12900<P>
12901
12902<DT><CODE>--enable-debugger</CODE>
12903<DD>Include support for the bash debugger (distributed separately).
12904<P>
12905
12906<DT><CODE>--enable-directory-stack</CODE>
12907<DD>Include support for a <CODE>csh</CODE>-like directory stack and the
12908<CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins
12909(see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
12910<P>
12911
12912<DT><CODE>--enable-disabled-builtins</CODE>
12913<DD>Allow builtin commands to be invoked via <SAMP>`builtin xxx'</SAMP>
12914even after <CODE>xxx</CODE> has been disabled using <SAMP>`enable -n xxx'</SAMP>.
12915See <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for details of the <CODE>builtin</CODE> and
12916<CODE>enable</CODE> builtin commands.
12917<P>
12918
12919<DT><CODE>--enable-dparen-arithmetic</CODE>
12920<DD>Include support for the <CODE>((<small>...</small>))</CODE> command
12921(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12922<P>
12923
12924<DT><CODE>--enable-extended-glob</CODE>
12925<DD>Include support for the extended pattern matching features described
12926above under <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>.
12927<P>
12928
0001803f
CR
12929<DT><CODE>--enable-extended-glob-default</CODE>
12930<DD>Set the default value of the <VAR>extglob</VAR> shell option described
12931above under <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A> to be enabled.
12932<P>
12933
17345e5a
JA
12934<DT><CODE>--enable-help-builtin</CODE>
12935<DD>Include the <CODE>help</CODE> builtin, which displays help on shell builtins and
12936variables (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
12937<P>
12938
12939<DT><CODE>--enable-history</CODE>
12940<DD>Include command history and the <CODE>fc</CODE> and <CODE>history</CODE>
12941builtin commands (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>).
12942<P>
12943
12944<DT><CODE>--enable-job-control</CODE>
12945<DD>This enables the job control features (see section <A HREF="bashref.html#SEC91">7. Job Control</A>),
12946if the operating system supports them.
12947<P>
12948
12949<DT><CODE>--enable-multibyte</CODE>
12950<DD>This enables support for multibyte characters if the operating
12951system provides the necessary support.
12952<P>
12953
12954<DT><CODE>--enable-net-redirections</CODE>
12955<DD>This enables the special handling of filenames of the form
12956<CODE>/dev/tcp/<VAR>host</VAR>/<VAR>port</VAR></CODE> and
12957<CODE>/dev/udp/<VAR>host</VAR>/<VAR>port</VAR></CODE>
12958when used in redirections (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
12959<P>
12960
12961<DT><CODE>--enable-process-substitution</CODE>
12962<DD>This enables process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>) if
12963the operating system provides the necessary support.
12964<P>
12965
12966<DT><CODE>--enable-progcomp</CODE>
12967<DD>Enable the programmable completion facilities
12968(see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>).
12969If Readline is not enabled, this option has no effect.
12970<P>
12971
12972<DT><CODE>--enable-prompt-string-decoding</CODE>
12973<DD>Turn on the interpretation of a number of backslash-escaped characters
12974in the <CODE>$PS1</CODE>, <CODE>$PS2</CODE>, <CODE>$PS3</CODE>, and <CODE>$PS4</CODE> prompt
12975strings. See <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>, for a complete list of prompt
12976string escape sequences.
12977<P>
12978
12979<DT><CODE>--enable-readline</CODE>
12980<DD>Include support for command-line editing and history with the Bash
12981version of the Readline library (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>).
12982<P>
12983
12984<DT><CODE>--enable-restricted</CODE>
12985<DD>Include support for a <EM>restricted shell</EM>. If this is enabled, Bash,
12986when called as <CODE>rbash</CODE>, enters a restricted mode. See
12987<A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>, for a description of restricted mode.
12988<P>
12989
12990<DT><CODE>--enable-select</CODE>
12991<DD>Include the <CODE>select</CODE> builtin, which allows the generation of simple
12992menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
12993<P>
12994
12995<DT><CODE>--enable-separate-helpfiles</CODE>
12996<DD>Use external files for the documentation displayed by the <CODE>help</CODE> builtin
12997instead of storing the text internally.
12998<P>
12999
13000<DT><CODE>--enable-single-help-strings</CODE>
13001<DD>Store the text displayed by the <CODE>help</CODE> builtin as a single string for
13002each help topic. This aids in translating the text to different languages.
13003You may need to disable this if your compiler cannot handle very long string
13004literals.
13005<P>
13006
13007<DT><CODE>--enable-strict-posix-default</CODE>
13008<DD>Make Bash POSIX-conformant by default (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
13009<P>
13010
13011<DT><CODE>--enable-usg-echo-default</CODE>
13012<DD>A synonym for <CODE>--enable-xpg-echo-default</CODE>.
13013<P>
13014
13015<DT><CODE>--enable-xpg-echo-default</CODE>
13016<DD>Make the <CODE>echo</CODE> builtin expand backslash-escaped characters by default,
13017without requiring the <SAMP>`-e'</SAMP> option.
13018This sets the default value of the <CODE>xpg_echo</CODE> shell option to <CODE>on</CODE>,
13019which makes the Bash <CODE>echo</CODE> behave more like the version specified in
13020the Single Unix Specification, version 3.
13021See section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>, for a description of the escape sequences that
13022<CODE>echo</CODE> recognizes.
13023<P>
13024
13025</DL>
13026<P>
13027
13028The file <TT>`config-top.h'</TT> contains C Preprocessor
13029<SAMP>`#define'</SAMP> statements for options which are not settable from
13030<CODE>configure</CODE>.
13031Some of these are not meant to be changed; beware of the consequences if
13032you do.
13033Read the comments associated with each definition for more
13034information about its effect.
13035</P><P>
13036
13037<A NAME="Reporting Bugs"></A>
13038<HR SIZE="6">
13039<A NAME="SEC135"></A>
13040<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13041<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC134"> &lt; </A>]</TD>
13042<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &gt; </A>]</TD>
13043<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC126"> &lt;&lt; </A>]</TD>
13044<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13045<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &gt;&gt; </A>]</TD>
13046<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13047<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13048<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13049<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13050</TR></TABLE>
13051<H1> A. Reporting Bugs </H1>
13052<!--docid::SEC135::-->
13053<P>
13054
13055Please report all bugs you find in Bash.
13056But first, you should
13057make sure that it really is a bug, and that it appears in the latest
13058version of Bash.
13059The latest version of Bash is always available for FTP from
0001803f 13060<A HREF="ftp://ftp.gnu.org/pub/gnu/bash/">ftp://ftp.gnu.org/pub/gnu/bash/</A>.
17345e5a
JA
13061</P><P>
13062
13063Once you have determined that a bug actually exists, use the
13064<CODE>bashbug</CODE> command to submit a bug report.
13065If you have a fix, you are encouraged to mail that as well!
13066Suggestions and `philosophical' bug reports may be mailed
13067to <A HREF="mailto:bug-bash@gnu.org">bug-bash@gnu.org</A> or posted to the Usenet
13068newsgroup <CODE>gnu.bash.bug</CODE>.
13069</P><P>
13070
13071All bug reports should include:
13072<UL>
13073<LI>
13074The version number of Bash.
13075<LI>
13076The hardware and operating system.
13077<LI>
13078The compiler used to compile Bash.
13079<LI>
13080A description of the bug behaviour.
13081<LI>
13082A short script or `recipe' which exercises the bug and may be used
13083to reproduce it.
13084</UL>
13085<P>
13086
13087<CODE>bashbug</CODE> inserts the first three items automatically into
13088the template it provides for filing a bug report.
13089</P><P>
13090
13091Please send all reports concerning this manual to
0001803f 13092<A HREF="mailto:chet.ramey@case.edu">chet.ramey@case.edu</A>.
17345e5a
JA
13093</P><P>
13094
13095<A NAME="Major Differences From The Bourne Shell"></A>
13096<HR SIZE="6">
13097<A NAME="SEC136"></A>
13098<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13099<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC135"> &lt; </A>]</TD>
13100<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &gt; </A>]</TD>
13101<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &lt;&lt; </A>]</TD>
13102<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13103<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt;&gt; </A>]</TD>
13104<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13105<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13106<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13107<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13108</TR></TABLE>
13109<H1> B. Major Differences From The Bourne Shell </H1>
13110<!--docid::SEC136::-->
13111<P>
13112
13113Bash implements essentially the same grammar, parameter and
13114variable expansion, redirection, and quoting as the Bourne Shell.
13115Bash uses the POSIX standard as the specification of
13116how these features are to be implemented. There are some
13117differences between the traditional Bourne shell and Bash; this
13118section quickly details the differences of significance. A
13119number of these differences are explained in greater depth in
13120previous sections.
13121This section uses the version of <CODE>sh</CODE> included in SVR4.2 (the
13122last version of the historical Bourne shell) as the baseline reference.
13123</P><P>
13124
13125<UL>
13126
13127<LI>
13128Bash is POSIX-conformant, even where the POSIX specification
13129differs from traditional <CODE>sh</CODE> behavior (see section <A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>).
13130<P>
13131
13132<LI>
13133Bash has multi-character invocation options (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
13134<P>
13135
13136<LI>
13137Bash has command-line editing (see section <A HREF="bashref.html#SEC95">8. Command Line Editing</A>) and
13138the <CODE>bind</CODE> builtin.
13139<P>
13140
13141<LI>
13142Bash provides a programmable word completion mechanism
13143(see section <A HREF="bashref.html#SEC117">8.6 Programmable Completion</A>), and builtin commands
13144<CODE>complete</CODE>, <CODE>compgen</CODE>, and <CODE>compopt</CODE>, to
13145manipulate it.
13146<P>
13147
13148<LI>
13149Bash has command history (see section <A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>) and the
13150<CODE>history</CODE> and <CODE>fc</CODE> builtins to manipulate it.
13151The Bash history list maintains timestamp information and uses the
13152value of the <CODE>HISTTIMEFORMAT</CODE> variable to display it.
13153<P>
13154
13155<LI>
13156Bash implements <CODE>csh</CODE>-like history expansion
13157(see section <A HREF="bashref.html#SEC122">9.3 History Expansion</A>).
13158<P>
13159
13160<LI>
13161Bash has one-dimensional array variables (see section <A HREF="bashref.html#SEC85">6.7 Arrays</A>), and the
13162appropriate variable expansions and assignment syntax to use them.
13163Several of the Bash builtins take options to act on arrays.
13164Bash provides a number of built-in array variables.
13165<P>
13166
13167<LI>
13168The <CODE>$'<small>...</small>'</CODE> quoting syntax, which expands ANSI-C
13169backslash-escaped characters in the text between the single quotes,
13170is supported (see section <A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>).
13171<P>
13172
13173<LI>
13174Bash supports the <CODE>$"<small>...</small>"</CODE> quoting syntax to do
13175locale-specific translation of the characters between the double
13176quotes. The <SAMP>`-D'</SAMP>, <SAMP>`--dump-strings'</SAMP>, and <SAMP>`--dump-po-strings'</SAMP>
13177invocation options list the translatable strings found in a script
13178(see section <A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>).
13179<P>
13180
13181<LI>
13182Bash implements the <CODE>!</CODE> keyword to negate the return value of
13183a pipeline (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13184Very useful when an <CODE>if</CODE> statement needs to act only if a test fails.
13185The Bash <SAMP>`-o pipefail'</SAMP> option to <CODE>set</CODE> will cause a pipeline to
13186return a failure status if any command fails.
13187<P>
13188
13189<LI>
13190Bash has the <CODE>time</CODE> reserved word and command timing (see section <A HREF="bashref.html#SEC17">3.2.2 Pipelines</A>).
13191The display of the timing statistics may be controlled with the
13192<CODE>TIMEFORMAT</CODE> variable.
13193<P>
13194
13195<LI>
13196Bash implements the <CODE>for (( <VAR>expr1</VAR> ; <VAR>expr2</VAR> ; <VAR>expr3</VAR> ))</CODE>
13197arithmetic for command, similar to the C language (see section <A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>).
13198<P>
13199
13200<LI>
13201Bash includes the <CODE>select</CODE> compound command, which allows the
13202generation of simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
13203<P>
13204
13205<LI>
13206Bash includes the <CODE>[[</CODE> compound command, which makes conditional
13207testing part of the shell grammar (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>), including
13208optional regular expression matching.
13209<P>
13210
13211<LI>
13212Bash provides optional case-insensitive matching for the <CODE>case</CODE> and
13213<CODE>[[</CODE> constructs.
13214<P>
13215
13216<LI>
13217Bash includes brace expansion (see section <A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>) and tilde
13218expansion (see section <A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>).
13219<P>
13220
13221<LI>
13222Bash implements command aliases and the <CODE>alias</CODE> and <CODE>unalias</CODE>
13223builtins (see section <A HREF="bashref.html#SEC84">6.6 Aliases</A>).
13224<P>
13225
13226<LI>
13227Bash provides shell arithmetic, the <CODE>((</CODE> compound command
13228(see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>),
13229and arithmetic expansion (see section <A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>).
13230<P>
13231
13232<LI>
13233Variables present in the shell's initial environment are automatically
13234exported to child processes. The Bourne shell does not normally do
13235this unless the variables are explicitly marked using the <CODE>export</CODE>
13236command.
13237<P>
13238
13239<LI>
13240Bash supports the <SAMP>`+='</SAMP> assignment operator, which appends to the value
13241of the variable named on the left hand side.
13242<P>
13243
13244<LI>
13245Bash includes the POSIX pattern removal <SAMP>`%'</SAMP>, <SAMP>`#'</SAMP>, <SAMP>`%%'</SAMP>
13246and <SAMP>`##'</SAMP> expansions to remove leading or trailing substrings from
13247variable values (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13248<P>
13249
13250<LI>
13251The expansion <CODE>${#xx}</CODE>, which returns the length of <CODE>${xx}</CODE>,
13252is supported (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13253<P>
13254
13255<LI>
13256The expansion <CODE>${var:</CODE><VAR>offset</VAR><CODE>[:</CODE><VAR>length</VAR><CODE>]}</CODE>,
13257which expands to the substring of <CODE>var</CODE>'s value of length
13258<VAR>length</VAR>, beginning at <VAR>offset</VAR>, is present
13259(see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13260<P>
13261
13262<LI>
13263The expansion
13264<CODE>${var/[/]</CODE><VAR>pattern</VAR><CODE>[/</CODE><VAR>replacement</VAR><CODE>]}</CODE>,
13265which matches <VAR>pattern</VAR> and replaces it with <VAR>replacement</VAR> in
13266the value of <CODE>var</CODE>, is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13267<P>
13268
13269<LI>
13270The expansion <CODE>${!<VAR>prefix}*</VAR></CODE> expansion, which expands to
13271the names of all shell variables whose names begin with <VAR>prefix</VAR>,
13272is available (see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13273<P>
13274
13275<LI>
13276Bash has <VAR>indirect</VAR> variable expansion using <CODE>${!word}</CODE>
13277(see section <A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>).
13278<P>
13279
13280<LI>
13281Bash can expand positional parameters beyond <CODE>$9</CODE> using
13282<CODE>${<VAR>num</VAR>}</CODE>.
13283<P>
13284
13285<LI>
13286The POSIX <CODE>$()</CODE> form of command substitution
13287is implemented (see section <A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>),
13288and preferred to the Bourne shell's <CODE>"</CODE> (which
13289is also implemented for backwards compatibility).
13290<P>
13291
13292<LI>
13293Bash has process substitution (see section <A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>).
13294<P>
13295
13296<LI>
13297Bash automatically assigns variables that provide information about the
13298current user (<CODE>UID</CODE>, <CODE>EUID</CODE>, and <CODE>GROUPS</CODE>), the current host
13299(<CODE>HOSTTYPE</CODE>, <CODE>OSTYPE</CODE>, <CODE>MACHTYPE</CODE>, and <CODE>HOSTNAME</CODE>),
13300and the instance of Bash that is running (<CODE>BASH</CODE>,
13301<CODE>BASH_VERSION</CODE>, and <CODE>BASH_VERSINFO</CODE>). See section <A HREF="bashref.html#SEC67">5.2 Bash Variables</A>,
13302for details.
13303<P>
13304
13305<LI>
13306The <CODE>IFS</CODE> variable is used to split only the results of expansion,
13307not all words (see section <A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>).
13308This closes a longstanding shell security hole.
13309<P>
13310
13311<LI>
13312Bash implements the full set of POSIX filename expansion operators,
13313including <VAR>character classes</VAR>, <VAR>equivalence classes</VAR>, and
13314<VAR>collating symbols</VAR> (see section <A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>).
13315<P>
13316
13317<LI>
13318Bash implements extended pattern matching features when the <CODE>extglob</CODE>
13319shell option is enabled (see section <A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>).
13320<P>
13321
13322<LI>
13323It is possible to have a variable and a function with the same name;
13324<CODE>sh</CODE> does not separate the two name spaces.
13325<P>
13326
13327<LI>
13328Bash functions are permitted to have local variables using the
13329<CODE>local</CODE> builtin, and thus useful recursive functions may be written
13330(see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13331<P>
13332
13333<LI>
13334Variable assignments preceding commands affect only that command, even
13335builtins and functions (see section <A HREF="bashref.html#SEC54">3.7.4 Environment</A>).
13336In <CODE>sh</CODE>, all variable assignments
13337preceding commands are global unless the command is executed from the
13338file system.
13339<P>
13340
13341<LI>
13342Bash performs filename expansion on filenames specified as operands
13343to input and output redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13344<P>
13345
13346<LI>
13347Bash contains the <SAMP>`&#60;&#62;'</SAMP> redirection operator, allowing a file to be
13348opened for both reading and writing, and the <SAMP>`&#38;&#62;'</SAMP> redirection
13349operator, for directing standard output and standard error to the same
13350file (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13351<P>
13352
13353<LI>
13354Bash includes the <SAMP>`&#60;&#60;&#60;'</SAMP> redirection operator, allowing a string to
13355be used as the standard input to a command.
13356<P>
13357
13358<LI>
13359Bash implements the <SAMP>`[n]&#60;&#38;<VAR>word</VAR>'</SAMP> and <SAMP>`[n]&#62;&#38;<VAR>word</VAR>'</SAMP>
13360redirection operators, which move one file descriptor to another.
13361<P>
13362
13363<LI>
13364Bash treats a number of filenames specially when they are
13365used in redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13366<P>
13367
13368<LI>
13369Bash can open network connections to arbitrary machines and services
13370with the redirection operators (see section <A HREF="bashref.html#SEC39">3.6 Redirections</A>).
13371<P>
13372
13373<LI>
13374The <CODE>noclobber</CODE> option is available to avoid overwriting existing
13375files with output redirection (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13376The <SAMP>`&#62;|'</SAMP> redirection operator may be used to override <CODE>noclobber</CODE>.
13377<P>
13378
13379<LI>
13380The Bash <CODE>cd</CODE> and <CODE>pwd</CODE> builtins (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
13381each take <SAMP>`-L'</SAMP> and <SAMP>`-P'</SAMP> options to switch between logical and
13382physical modes.
13383<P>
13384
13385<LI>
13386Bash allows a function to override a builtin with the same name, and provides
13387access to that builtin's functionality within the function via the
13388<CODE>builtin</CODE> and <CODE>command</CODE> builtins (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13389<P>
13390
13391<LI>
13392The <CODE>command</CODE> builtin allows selective disabling of functions
13393when command lookup is performed (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13394<P>
13395
13396<LI>
13397Individual builtins may be enabled or disabled using the <CODE>enable</CODE>
13398builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13399<P>
13400
13401<LI>
13402The Bash <CODE>exec</CODE> builtin takes additional options that allow users
13403to control the contents of the environment passed to the executed
13404command, and what the zeroth argument to the command is to be
13405(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13406<P>
13407
13408<LI>
13409Shell functions may be exported to children via the environment
13410using <CODE>export -f</CODE> (see section <A HREF="bashref.html#SEC24">3.3 Shell Functions</A>).
13411<P>
13412
13413<LI>
13414The Bash <CODE>export</CODE>, <CODE>readonly</CODE>, and <CODE>declare</CODE> builtins can
13415take a <SAMP>`-f'</SAMP> option to act on shell functions, a <SAMP>`-p'</SAMP> option to
13416display variables with various attributes set in a format that can be
13417used as shell input, a <SAMP>`-n'</SAMP> option to remove various variable
13418attributes, and <SAMP>`name=value'</SAMP> arguments to set variable attributes
13419and values simultaneously.
13420<P>
13421
13422<LI>
13423The Bash <CODE>hash</CODE> builtin allows a name to be associated with
13424an arbitrary filename, even when that filename cannot be found by
13425searching the <CODE>$PATH</CODE>, using <SAMP>`hash -p'</SAMP>
13426(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13427<P>
13428
13429<LI>
13430Bash includes a <CODE>help</CODE> builtin for quick reference to shell
13431facilities (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13432<P>
13433
13434<LI>
13435The <CODE>printf</CODE> builtin is available to display formatted output
13436(see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13437<P>
13438
13439<LI>
13440The Bash <CODE>read</CODE> builtin (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>)
13441will read a line ending in <SAMP>`\'</SAMP> with
13442the <SAMP>`-r'</SAMP> option, and will use the <CODE>REPLY</CODE> variable as a
13443default if no non-option arguments are supplied.
13444The Bash <CODE>read</CODE> builtin
13445also accepts a prompt string with the <SAMP>`-p'</SAMP> option and will use
13446Readline to obtain the line when given the <SAMP>`-e'</SAMP> option.
13447The <CODE>read</CODE> builtin also has additional options to control input:
13448the <SAMP>`-s'</SAMP> option will turn off echoing of input characters as
13449they are read, the <SAMP>`-t'</SAMP> option will allow <CODE>read</CODE> to time out
13450if input does not arrive within a specified number of seconds, the
13451<SAMP>`-n'</SAMP> option will allow reading only a specified number of
13452characters rather than a full line, and the <SAMP>`-d'</SAMP> option will read
13453until a particular character rather than newline.
13454<P>
13455
13456<LI>
13457The <CODE>return</CODE> builtin may be used to abort execution of scripts
13458executed with the <CODE>.</CODE> or <CODE>source</CODE> builtins
13459(see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13460<P>
13461
13462<LI>
13463Bash includes the <CODE>shopt</CODE> builtin, for finer control of shell
13464optional capabilities (see section <A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>), and allows these options
13465to be set and unset at shell invocation (see section <A HREF="bashref.html#SEC69">6.1 Invoking Bash</A>).
13466<P>
13467
13468<LI>
13469Bash has much more optional behavior controllable with the <CODE>set</CODE>
13470builtin (see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13471<P>
13472
13473<LI>
13474The <SAMP>`-x'</SAMP> (<CODE>xtrace</CODE>) option displays commands other than
13475simple commands when performing an execution trace
13476(see section <A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>).
13477<P>
13478
13479<LI>
13480The <CODE>test</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>)
13481is slightly different, as it implements the POSIX algorithm,
13482which specifies the behavior based on the number of arguments.
13483<P>
13484
13485<LI>
13486Bash includes the <CODE>caller</CODE> builtin, which displays the context of
13487any active subroutine call (a shell function or a script executed with
13488the <CODE>.</CODE> or <CODE>source</CODE> builtins). This supports the bash
13489debugger.
13490<P>
13491
13492<LI>
13493The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a
13494<CODE>DEBUG</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE>.
13495Commands specified with a <CODE>DEBUG</CODE> trap are executed before every
13496simple command, <CODE>for</CODE> command, <CODE>case</CODE> command,
13497<CODE>select</CODE> command, every arithmetic <CODE>for</CODE> command, and before
13498the first command executes in a shell function.
13499The <CODE>DEBUG</CODE> trap is not inherited by shell functions unless the
13500function has been given the <CODE>trace</CODE> attribute or the
13501<CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13502The <CODE>extdebug</CODE> shell option has additional effects on the
13503<CODE>DEBUG</CODE> trap.
13504<P>
13505
13506The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows an
13507<CODE>ERR</CODE> pseudo-signal specification, similar to <CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13508Commands specified with an <CODE>ERR</CODE> trap are executed after a simple
13509command fails, with a few exceptions.
13510The <CODE>ERR</CODE> trap is not inherited by shell functions unless the
13511<CODE>-o errtrace</CODE> option to the <CODE>set</CODE> builtin is enabled.
13512</P><P>
13513
13514The <CODE>trap</CODE> builtin (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>) allows a
13515<CODE>RETURN</CODE> pseudo-signal specification, similar to
13516<CODE>EXIT</CODE> and <CODE>DEBUG</CODE>.
13517Commands specified with an <CODE>RETURN</CODE> trap are executed before
13518execution resumes after a shell function or a shell script executed with
13519<CODE>.</CODE> or <CODE>source</CODE> returns.
13520The <CODE>RETURN</CODE> trap is not inherited by shell functions unless the
13521function has been given the <CODE>trace</CODE> attribute or the
13522<CODE>functrace</CODE> option has been enabled using the <CODE>shopt</CODE> builtin.
13523</P><P>
13524
13525<LI>
13526The Bash <CODE>type</CODE> builtin is more extensive and gives more information
13527about the names it finds (see section <A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>).
13528<P>
13529
13530<LI>
13531The Bash <CODE>umask</CODE> builtin permits a <SAMP>`-p'</SAMP> option to cause
13532the output to be displayed in the form of a <CODE>umask</CODE> command
13533that may be reused as input (see section <A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>).
13534<P>
13535
13536<LI>
13537Bash implements a <CODE>csh</CODE>-like directory stack, and provides the
13538<CODE>pushd</CODE>, <CODE>popd</CODE>, and <CODE>dirs</CODE> builtins to manipulate it
13539(see section <A HREF="bashref.html#SEC86">6.8 The Directory Stack</A>).
13540Bash also makes the directory stack visible as the value of the
13541<CODE>DIRSTACK</CODE> shell variable.
13542<P>
13543
13544<LI>
13545Bash interprets special backslash-escaped characters in the prompt
13546strings when interactive (see section <A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>).
13547<P>
13548
13549<LI>
13550The Bash restricted mode is more useful (see section <A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>);
13551the SVR4.2 shell restricted mode is too limited.
13552<P>
13553
13554<LI>
13555The <CODE>disown</CODE> builtin can remove a job from the internal shell
13556job table (see section <A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>) or suppress the sending
13557of <CODE>SIGHUP</CODE> to a job when the shell exits as the result of a
13558<CODE>SIGHUP</CODE>.
13559<P>
13560
13561<LI>
13562Bash includes a number of features to support a separate debugger for
13563shell scripts.
13564<P>
13565
13566<LI>
13567The SVR4.2 shell has two privilege-related builtins
13568(<CODE>mldmode</CODE> and <CODE>priv</CODE>) not present in Bash.
13569<P>
13570
13571<LI>
13572Bash does not have the <CODE>stop</CODE> or <CODE>newgrp</CODE> builtins.
13573<P>
13574
13575<LI>
13576Bash does not use the <CODE>SHACCT</CODE> variable or perform shell accounting.
13577<P>
13578
13579<LI>
13580The SVR4.2 <CODE>sh</CODE> uses a <CODE>TIMEOUT</CODE> variable like Bash uses
13581<CODE>TMOUT</CODE>.
13582<P>
13583
13584</UL>
13585<P>
13586
13587More features unique to Bash may be found in <A HREF="bashref.html#SEC68">6. Bash Features</A>.
13588</P><P>
13589
13590<HR SIZE="6">
13591<A NAME="SEC137"></A>
13592<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13593<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &lt; </A>]</TD>
13594<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt; </A>]</TD>
13595<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> &lt;&lt; </A>]</TD>
13596<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC136"> Up </A>]</TD>
13597<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &gt;&gt; </A>]</TD>
13598<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13599<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13600<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13601<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13602</TR></TABLE>
13603<H2> B.1 Implementation Differences From The SVR4.2 Shell </H2>
13604<!--docid::SEC137::-->
13605<P>
13606
13607Since Bash is a completely new implementation, it does not suffer from
13608many of the limitations of the SVR4.2 shell. For instance:
13609</P><P>
13610
13611<UL>
13612
13613<LI>
13614Bash does not fork a subshell when redirecting into or out of
13615a shell control structure such as an <CODE>if</CODE> or <CODE>while</CODE>
13616statement.
13617<P>
13618
13619<LI>
13620Bash does not allow unbalanced quotes. The SVR4.2 shell will silently
13621insert a needed closing quote at <CODE>EOF</CODE> under certain circumstances.
13622This can be the cause of some hard-to-find errors.
13623<P>
13624
13625<LI>
13626The SVR4.2 shell uses a baroque memory management scheme based on
13627trapping <CODE>SIGSEGV</CODE>. If the shell is started from a process with
13628<CODE>SIGSEGV</CODE> blocked (e.g., by using the <CODE>system()</CODE> C library
13629function call), it misbehaves badly.
13630<P>
13631
13632<LI>
13633In a questionable attempt at security, the SVR4.2 shell,
13634when invoked without the <SAMP>`-p'</SAMP> option, will alter its real
13635and effective UID and GID if they are less than some
13636magic threshold value, commonly 100.
13637This can lead to unexpected results.
13638<P>
13639
13640<LI>
13641The SVR4.2 shell does not allow users to trap <CODE>SIGSEGV</CODE>,
13642<CODE>SIGALRM</CODE>, or <CODE>SIGCHLD</CODE>.
13643<P>
13644
13645<LI>
13646The SVR4.2 shell does not allow the <CODE>IFS</CODE>, <CODE>MAILCHECK</CODE>,
13647<CODE>PATH</CODE>, <CODE>PS1</CODE>, or <CODE>PS2</CODE> variables to be unset.
13648<P>
13649
13650<LI>
13651The SVR4.2 shell treats <SAMP>`^'</SAMP> as the undocumented equivalent of
13652<SAMP>`|'</SAMP>.
13653<P>
13654
13655<LI>
13656Bash allows multiple option arguments when it is invoked (<CODE>-x -v</CODE>);
13657the SVR4.2 shell allows only one option argument (<CODE>-xv</CODE>). In
13658fact, some versions of the shell dump core if the second argument begins
13659with a <SAMP>`-'</SAMP>.
13660<P>
13661
13662<LI>
13663The SVR4.2 shell exits a script if any builtin fails; Bash exits
13664a script only if one of the POSIX special builtins fails, and
13665only for certain failures, as enumerated in the POSIX standard.
13666<P>
13667
13668<LI>
13669The SVR4.2 shell behaves differently when invoked as <CODE>jsh</CODE>
13670(it turns on job control).
13671</UL>
13672<P>
13673
13674<A NAME="GNU Free Documentation License"></A>
13675<HR SIZE="6">
13676<A NAME="SEC138"></A>
13677<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
13678<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC137"> &lt; </A>]</TD>
13679<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &gt; </A>]</TD>
13680<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &lt;&lt; </A>]</TD>
13681<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
13682<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &gt;&gt; </A>]</TD>
13683<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
13684<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
13685<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
13686<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
13687</TR></TABLE>
13688<H1> C. GNU Free Documentation License </H1>
13689<!--docid::SEC138::-->
13690<P>
13691
13692<center>
0001803f 13693 Version 1.3, 3 November 2008
17345e5a
JA
13694</center>
13695</P><P>
13696
0001803f
CR
13697<TABLE><tr><td>&nbsp;</td><td class=display><pre style="font-family: serif">Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
13698<A HREF="http://fsf.org/">http://fsf.org/</A>
17345e5a
JA
13699
13700Everyone is permitted to copy and distribute verbatim copies
13701of this license document, but changing it is not allowed.
13702</pre></td></tr></table></P><P>
13703
13704<OL>
13705<LI>
13706PREAMBLE
13707<P>
13708
13709The purpose of this License is to make a manual, textbook, or other
13710functional and useful document <EM>free</EM> in the sense of freedom: to
13711assure everyone the effective freedom to copy and redistribute it,
13712with or without modifying it, either commercially or noncommercially.
13713Secondarily, this License preserves for the author and publisher a way
13714to get credit for their work, while not being considered responsible
13715for modifications made by others.
13716</P><P>
13717
13718This License is a kind of "copyleft", which means that derivative
13719works of the document must themselves be free in the same sense. It
13720complements the GNU General Public License, which is a copyleft
13721license designed for free software.
13722</P><P>
13723
13724We have designed this License in order to use it for manuals for free
13725software, because free software needs free documentation: a free
13726program should come with manuals providing the same freedoms that the
13727software does. But this License is not limited to software manuals;
13728it can be used for any textual work, regardless of subject matter or
13729whether it is published as a printed book. We recommend this License
13730principally for works whose purpose is instruction or reference.
13731</P><P>
13732
13733<LI>
13734APPLICABILITY AND DEFINITIONS
13735<P>
13736
13737This License applies to any manual or other work, in any medium, that
13738contains a notice placed by the copyright holder saying it can be
13739distributed under the terms of this License. Such a notice grants a
13740world-wide, royalty-free license, unlimited in duration, to use that
13741work under the conditions stated herein. The "Document", below,
13742refers to any such manual or work. Any member of the public is a
13743licensee, and is addressed as "you". You accept the license if you
13744copy, modify or distribute the work in a way requiring permission
13745under copyright law.
13746</P><P>
13747
13748A "Modified Version" of the Document means any work containing the
13749Document or a portion of it, either copied verbatim, or with
13750modifications and/or translated into another language.
13751</P><P>
13752
13753A "Secondary Section" is a named appendix or a front-matter section
13754of the Document that deals exclusively with the relationship of the
13755publishers or authors of the Document to the Document's overall
13756subject (or to related matters) and contains nothing that could fall
13757directly within that overall subject. (Thus, if the Document is in
13758part a textbook of mathematics, a Secondary Section may not explain
13759any mathematics.) The relationship could be a matter of historical
13760connection with the subject or with related matters, or of legal,
13761commercial, philosophical, ethical or political position regarding
13762them.
13763</P><P>
13764
13765The "Invariant Sections" are certain Secondary Sections whose titles
13766are designated, as being those of Invariant Sections, in the notice
13767that says that the Document is released under this License. If a
13768section does not fit the above definition of Secondary then it is not
13769allowed to be designated as Invariant. The Document may contain zero
13770Invariant Sections. If the Document does not identify any Invariant
13771Sections then there are none.
13772</P><P>
13773
13774The "Cover Texts" are certain short passages of text that are listed,
13775as Front-Cover Texts or Back-Cover Texts, in the notice that says that
13776the Document is released under this License. A Front-Cover Text may
13777be at most 5 words, and a Back-Cover Text may be at most 25 words.
13778</P><P>
13779
13780A "Transparent" copy of the Document means a machine-readable copy,
13781represented in a format whose specification is available to the
13782general public, that is suitable for revising the document
13783straightforwardly with generic text editors or (for images composed of
13784pixels) generic paint programs or (for drawings) some widely available
13785drawing editor, and that is suitable for input to text formatters or
13786for automatic translation to a variety of formats suitable for input
13787to text formatters. A copy made in an otherwise Transparent file
13788format whose markup, or absence of markup, has been arranged to thwart
13789or discourage subsequent modification by readers is not Transparent.
13790An image format is not Transparent if used for any substantial amount
13791of text. A copy that is not "Transparent" is called "Opaque".
13792</P><P>
13793
13794Examples of suitable formats for Transparent copies include plain
13795ASCII without markup, Texinfo input format, LaTeX input
13796format, <FONT SIZE="-1">SGML</FONT> or <FONT SIZE="-1">XML</FONT> using a publicly available
13797<FONT SIZE="-1">DTD</FONT>, and standard-conforming simple <FONT SIZE="-1">HTML</FONT>,
13798PostScript or <FONT SIZE="-1">PDF</FONT> designed for human modification. Examples
13799of transparent image formats include <FONT SIZE="-1">PNG</FONT>, <FONT SIZE="-1">XCF</FONT> and
13800<FONT SIZE="-1">JPG</FONT>. Opaque formats include proprietary formats that can be
13801read and edited only by proprietary word processors, <FONT SIZE="-1">SGML</FONT> or
13802<FONT SIZE="-1">XML</FONT> for which the <FONT SIZE="-1">DTD</FONT> and/or processing tools are
13803not generally available, and the machine-generated <FONT SIZE="-1">HTML</FONT>,
13804PostScript or <FONT SIZE="-1">PDF</FONT> produced by some word processors for
13805output purposes only.
13806</P><P>
13807
13808The "Title Page" means, for a printed book, the title page itself,
13809plus such following pages as are needed to hold, legibly, the material
13810this License requires to appear in the title page. For works in
13811formats which do not have any title page as such, "Title Page" means
13812the text near the most prominent appearance of the work's title,
13813preceding the beginning of the body of the text.
13814</P><P>
13815
0001803f
CR
13816The "publisher" means any person or entity that distributes copies
13817of the Document to the public.
13818</P><P>
13819
17345e5a
JA
13820A section "Entitled XYZ" means a named subunit of the Document whose
13821title either is precisely XYZ or contains XYZ in parentheses following
13822text that translates XYZ in another language. (Here XYZ stands for a
13823specific section name mentioned below, such as "Acknowledgements",
13824"Dedications", "Endorsements", or "History".) To "Preserve the Title"
13825of such a section when you modify the Document means that it remains a
13826section "Entitled XYZ" according to this definition.
13827</P><P>
13828
13829The Document may include Warranty Disclaimers next to the notice which
13830states that this License applies to the Document. These Warranty
13831Disclaimers are considered to be included by reference in this
13832License, but only as regards disclaiming warranties: any other
13833implication that these Warranty Disclaimers may have is void and has
13834no effect on the meaning of this License.
13835</P><P>
13836
13837<LI>
13838VERBATIM COPYING
13839<P>
13840
13841You may copy and distribute the Document in any medium, either
13842commercially or noncommercially, provided that this License, the
13843copyright notices, and the license notice saying this License applies
13844to the Document are reproduced in all copies, and that you add no other
13845conditions whatsoever to those of this License. You may not use
13846technical measures to obstruct or control the reading or further
13847copying of the copies you make or distribute. However, you may accept
13848compensation in exchange for copies. If you distribute a large enough
13849number of copies you must also follow the conditions in section 3.
13850</P><P>
13851
13852You may also lend copies, under the same conditions stated above, and
13853you may publicly display copies.
13854</P><P>
13855
13856<LI>
13857COPYING IN QUANTITY
13858<P>
13859
13860If you publish printed copies (or copies in media that commonly have
13861printed covers) of the Document, numbering more than 100, and the
13862Document's license notice requires Cover Texts, you must enclose the
13863copies in covers that carry, clearly and legibly, all these Cover
13864Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
13865the back cover. Both covers must also clearly and legibly identify
13866you as the publisher of these copies. The front cover must present
13867the full title with all words of the title equally prominent and
13868visible. You may add other material on the covers in addition.
13869Copying with changes limited to the covers, as long as they preserve
13870the title of the Document and satisfy these conditions, can be treated
13871as verbatim copying in other respects.
13872</P><P>
13873
13874If the required texts for either cover are too voluminous to fit
13875legibly, you should put the first ones listed (as many as fit
13876reasonably) on the actual cover, and continue the rest onto adjacent
13877pages.
13878</P><P>
13879
13880If you publish or distribute Opaque copies of the Document numbering
13881more than 100, you must either include a machine-readable Transparent
13882copy along with each Opaque copy, or state in or with each Opaque copy
13883a computer-network location from which the general network-using
13884public has access to download using public-standard network protocols
13885a complete Transparent copy of the Document, free of added material.
13886If you use the latter option, you must take reasonably prudent steps,
13887when you begin distribution of Opaque copies in quantity, to ensure
13888that this Transparent copy will remain thus accessible at the stated
13889location until at least one year after the last time you distribute an
13890Opaque copy (directly or through your agents or retailers) of that
13891edition to the public.
13892</P><P>
13893
13894It is requested, but not required, that you contact the authors of the
13895Document well before redistributing any large number of copies, to give
13896them a chance to provide you with an updated version of the Document.
13897</P><P>
13898
13899<LI>
13900MODIFICATIONS
13901<P>
13902
13903You may copy and distribute a Modified Version of the Document under
13904the conditions of sections 2 and 3 above, provided that you release
13905the Modified Version under precisely this License, with the Modified
13906Version filling the role of the Document, thus licensing distribution
13907and modification of the Modified Version to whoever possesses a copy
13908of it. In addition, you must do these things in the Modified Version:
13909</P><P>
13910
13911<OL>
13912<LI>
13913Use in the Title Page (and on the covers, if any) a title distinct
13914from that of the Document, and from those of previous versions
13915(which should, if there were any, be listed in the History section
13916of the Document). You may use the same title as a previous version
13917if the original publisher of that version gives permission.
13918<P>
13919
13920<LI>
13921List on the Title Page, as authors, one or more persons or entities
13922responsible for authorship of the modifications in the Modified
13923Version, together with at least five of the principal authors of the
13924Document (all of its principal authors, if it has fewer than five),
13925unless they release you from this requirement.
13926<P>
13927
13928<LI>
13929State on the Title page the name of the publisher of the
13930Modified Version, as the publisher.
13931<P>
13932
13933<LI>
13934Preserve all the copyright notices of the Document.
13935<P>
13936
13937<LI>
13938Add an appropriate copyright notice for your modifications
13939adjacent to the other copyright notices.
13940<P>
13941
13942<LI>
13943Include, immediately after the copyright notices, a license notice
13944giving the public permission to use the Modified Version under the
13945terms of this License, in the form shown in the Addendum below.
13946<P>
13947
13948<LI>
13949Preserve in that license notice the full lists of Invariant Sections
13950and required Cover Texts given in the Document's license notice.
13951<P>
13952
13953<LI>
13954Include an unaltered copy of this License.
13955<P>
13956
13957<LI>
13958Preserve the section Entitled "History", Preserve its Title, and add
13959to it an item stating at least the title, year, new authors, and
13960publisher of the Modified Version as given on the Title Page. If
13961there is no section Entitled "History" in the Document, create one
13962stating the title, year, authors, and publisher of the Document as
13963given on its Title Page, then add an item describing the Modified
13964Version as stated in the previous sentence.
13965<P>
13966
13967<LI>
13968Preserve the network location, if any, given in the Document for
13969public access to a Transparent copy of the Document, and likewise
13970the network locations given in the Document for previous versions
13971it was based on. These may be placed in the "History" section.
13972You may omit a network location for a work that was published at
13973least four years before the Document itself, or if the original
13974publisher of the version it refers to gives permission.
13975<P>
13976
13977<LI>
13978For any section Entitled "Acknowledgements" or "Dedications", Preserve
13979the Title of the section, and preserve in the section all the
13980substance and tone of each of the contributor acknowledgements and/or
13981dedications given therein.
13982<P>
13983
13984<LI>
13985Preserve all the Invariant Sections of the Document,
13986unaltered in their text and in their titles. Section numbers
13987or the equivalent are not considered part of the section titles.
13988<P>
13989
13990<LI>
13991Delete any section Entitled "Endorsements". Such a section
13992may not be included in the Modified Version.
13993<P>
13994
13995<LI>
13996Do not retitle any existing section to be Entitled "Endorsements" or
13997to conflict in title with any Invariant Section.
13998<P>
13999
14000<LI>
14001Preserve any Warranty Disclaimers.
14002</OL>
14003<P>
14004
14005If the Modified Version includes new front-matter sections or
14006appendices that qualify as Secondary Sections and contain no material
14007copied from the Document, you may at your option designate some or all
14008of these sections as invariant. To do this, add their titles to the
14009list of Invariant Sections in the Modified Version's license notice.
14010These titles must be distinct from any other section titles.
14011</P><P>
14012
14013You may add a section Entitled "Endorsements", provided it contains
14014nothing but endorsements of your Modified Version by various
14015parties--for example, statements of peer review or that the text has
14016been approved by an organization as the authoritative definition of a
14017standard.
14018</P><P>
14019
14020You may add a passage of up to five words as a Front-Cover Text, and a
14021passage of up to 25 words as a Back-Cover Text, to the end of the list
14022of Cover Texts in the Modified Version. Only one passage of
14023Front-Cover Text and one of Back-Cover Text may be added by (or
14024through arrangements made by) any one entity. If the Document already
14025includes a cover text for the same cover, previously added by you or
14026by arrangement made by the same entity you are acting on behalf of,
14027you may not add another; but you may replace the old one, on explicit
14028permission from the previous publisher that added the old one.
14029</P><P>
14030
14031The author(s) and publisher(s) of the Document do not by this License
14032give permission to use their names for publicity for or to assert or
14033imply endorsement of any Modified Version.
14034</P><P>
14035
14036<LI>
14037COMBINING DOCUMENTS
14038<P>
14039
14040You may combine the Document with other documents released under this
14041License, under the terms defined in section 4 above for modified
14042versions, provided that you include in the combination all of the
14043Invariant Sections of all of the original documents, unmodified, and
14044list them all as Invariant Sections of your combined work in its
14045license notice, and that you preserve all their Warranty Disclaimers.
14046</P><P>
14047
14048The combined work need only contain one copy of this License, and
14049multiple identical Invariant Sections may be replaced with a single
14050copy. If there are multiple Invariant Sections with the same name but
14051different contents, make the title of each such section unique by
14052adding at the end of it, in parentheses, the name of the original
14053author or publisher of that section if known, or else a unique number.
14054Make the same adjustment to the section titles in the list of
14055Invariant Sections in the license notice of the combined work.
14056</P><P>
14057
14058In the combination, you must combine any sections Entitled "History"
14059in the various original documents, forming one section Entitled
14060"History"; likewise combine any sections Entitled "Acknowledgements",
14061and any sections Entitled "Dedications". You must delete all
14062sections Entitled "Endorsements."
14063</P><P>
14064
14065<LI>
14066COLLECTIONS OF DOCUMENTS
14067<P>
14068
14069You may make a collection consisting of the Document and other documents
14070released under this License, and replace the individual copies of this
14071License in the various documents with a single copy that is included in
14072the collection, provided that you follow the rules of this License for
14073verbatim copying of each of the documents in all other respects.
14074</P><P>
14075
14076You may extract a single document from such a collection, and distribute
14077it individually under this License, provided you insert a copy of this
14078License into the extracted document, and follow this License in all
14079other respects regarding verbatim copying of that document.
14080</P><P>
14081
14082<LI>
14083AGGREGATION WITH INDEPENDENT WORKS
14084<P>
14085
14086A compilation of the Document or its derivatives with other separate
14087and independent documents or works, in or on a volume of a storage or
14088distribution medium, is called an "aggregate" if the copyright
14089resulting from the compilation is not used to limit the legal rights
14090of the compilation's users beyond what the individual works permit.
14091When the Document is included in an aggregate, this License does not
14092apply to the other works in the aggregate which are not themselves
14093derivative works of the Document.
14094</P><P>
14095
14096If the Cover Text requirement of section 3 is applicable to these
14097copies of the Document, then if the Document is less than one half of
14098the entire aggregate, the Document's Cover Texts may be placed on
14099covers that bracket the Document within the aggregate, or the
14100electronic equivalent of covers if the Document is in electronic form.
14101Otherwise they must appear on printed covers that bracket the whole
14102aggregate.
14103</P><P>
14104
14105<LI>
14106TRANSLATION
14107<P>
14108
14109Translation is considered a kind of modification, so you may
14110distribute translations of the Document under the terms of section 4.
14111Replacing Invariant Sections with translations requires special
14112permission from their copyright holders, but you may include
14113translations of some or all Invariant Sections in addition to the
14114original versions of these Invariant Sections. You may include a
14115translation of this License, and all the license notices in the
14116Document, and any Warranty Disclaimers, provided that you also include
14117the original English version of this License and the original versions
14118of those notices and disclaimers. In case of a disagreement between
14119the translation and the original version of this License or a notice
14120or disclaimer, the original version will prevail.
14121</P><P>
14122
14123If a section in the Document is Entitled "Acknowledgements",
14124"Dedications", or "History", the requirement (section 4) to Preserve
14125its Title (section 1) will typically require changing the actual
14126title.
14127</P><P>
14128
14129<LI>
14130TERMINATION
14131<P>
14132
0001803f
CR
14133You may not copy, modify, sublicense, or distribute the Document
14134except as expressly provided under this License. Any attempt
14135otherwise to copy, modify, sublicense, or distribute it is void, and
14136will automatically terminate your rights under this License.
14137</P><P>
14138
14139However, if you cease all violation of this License, then your license
14140from a particular copyright holder is reinstated (a) provisionally,
14141unless and until the copyright holder explicitly and finally
14142terminates your license, and (b) permanently, if the copyright holder
14143fails to notify you of the violation by some reasonable means prior to
1414460 days after the cessation.
14145</P><P>
14146
14147Moreover, your license from a particular copyright holder is
14148reinstated permanently if the copyright holder notifies you of the
14149violation by some reasonable means, this is the first time you have
14150received notice of violation of this License (for any work) from that
14151copyright holder, and you cure the violation prior to 30 days after
14152your receipt of the notice.
14153</P><P>
14154
14155Termination of your rights under this section does not terminate the
14156licenses of parties who have received copies or rights from you under
14157this License. If your rights have been terminated and not permanently
14158reinstated, receipt of a copy of some or all of the same material does
14159not give you any rights to use it.
17345e5a
JA
14160</P><P>
14161
14162<LI>
14163FUTURE REVISIONS OF THIS LICENSE
14164<P>
14165
14166The Free Software Foundation may publish new, revised versions
14167of the GNU Free Documentation License from time to time. Such new
14168versions will be similar in spirit to the present version, but may
14169differ in detail to address new problems or concerns. See
14170<A HREF="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</A>.
14171</P><P>
14172
14173Each version of the License is given a distinguishing version number.
14174If the Document specifies that a particular numbered version of this
14175License "or any later version" applies to it, you have the option of
14176following the terms and conditions either of that specified version or
14177of any later version that has been published (not as a draft) by the
14178Free Software Foundation. If the Document does not specify a version
14179number of this License, you may choose any version ever published (not
0001803f
CR
14180as a draft) by the Free Software Foundation. If the Document
14181specifies that a proxy can decide which future versions of this
14182License can be used, that proxy's public statement of acceptance of a
14183version permanently authorizes you to choose that version for the
14184Document.
14185</P><P>
14186
14187<LI>
14188RELICENSING
14189<P>
14190
14191"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
14192World Wide Web server that publishes copyrightable works and also
14193provides prominent facilities for anybody to edit those works. A
14194public wiki that anybody can edit is an example of such a server. A
14195"Massive Multiauthor Collaboration" (or "MMC") contained in the
14196site means any set of copyrightable works thus published on the MMC
14197site.
14198</P><P>
14199
14200"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
14201license published by Creative Commons Corporation, a not-for-profit
14202corporation with a principal place of business in San Francisco,
14203California, as well as future copyleft versions of that license
14204published by that same organization.
14205</P><P>
14206
14207"Incorporate" means to publish or republish a Document, in whole or
14208in part, as part of another Document.
14209</P><P>
14210
14211An MMC is "eligible for relicensing" if it is licensed under this
14212License, and if all works that were first published under this License
14213somewhere other than this MMC, and subsequently incorporated in whole
14214or in part into the MMC, (1) had no cover texts or invariant sections,
14215and (2) were thus incorporated prior to November 1, 2008.
14216</P><P>
14217
14218The operator of an MMC Site may republish an MMC contained in the site
14219under CC-BY-SA on the same site at any time before August 1, 2009,
14220provided the MMC is eligible for relicensing.
14221</P><P>
14222
17345e5a
JA
14223</OL>
14224<P>
14225
14226<A NAME="SEC139"></A>
14227<H2> ADDENDUM: How to use this License for your documents </H2>
14228<!--docid::SEC139::-->
14229<P>
14230
14231To use this License in a document you have written, include a copy of
14232the License in the document and put the following copyright and
14233license notices just after the title page:
14234</P><P>
14235
14236<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre> Copyright (C) <VAR>year</VAR> <VAR>your name</VAR>.
14237 Permission is granted to copy, distribute and/or modify this document
0001803f 14238 under the terms of the GNU Free Documentation License, Version 1.3
17345e5a
JA
14239 or any later version published by the Free Software Foundation;
14240 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
14241 Texts. A copy of the license is included in the section entitled ``GNU
14242 Free Documentation License''.
14243</FONT></pre></td></tr></table></P><P>
14244
14245If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
14246replace the "with<small>...</small>Texts." line with this:
14247</P><P>
14248
14249<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre> with the Invariant Sections being <VAR>list their titles</VAR>, with
14250 the Front-Cover Texts being <VAR>list</VAR>, and with the Back-Cover Texts
14251 being <VAR>list</VAR>.
14252</FONT></pre></td></tr></table></P><P>
14253
14254If you have Invariant Sections without Cover Texts, or some other
14255combination of the three, merge those two alternatives to suit the
14256situation.
14257</P><P>
14258
14259If your document contains nontrivial examples of program code, we
14260recommend releasing these examples in parallel under your choice of
14261free software license, such as the GNU General Public License,
14262to permit their use in free software.
14263</P><P>
14264
14265<A NAME="Indexes"></A>
14266<HR SIZE="6">
14267<A NAME="SEC140"></A>
14268<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14269<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC138"> &lt; </A>]</TD>
14270<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> &gt; </A>]</TD>
14271<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
14272<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top"> Up </A>]</TD>
14273<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14274<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14275<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14276<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14277<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14278</TR></TABLE>
14279<H1> D. Indexes </H1>
14280<!--docid::SEC140::-->
14281<P>
14282
14283<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
14284<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of Bash builtin commands.</TD></TR>
14285<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of Bash reserved words.</TD></TR>
14286<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Quick reference helps you find the
14287 variable you want.</TD></TR>
14288<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC144">D.4 Function Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Index of bindable Readline functions.</TD></TR>
14289<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="bashref.html#SEC145">D.5 Concept Index</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">General index for concepts described in
14290 this manual.</TD></TR>
14291</TABLE></BLOCKQUOTE>
14292<P>
14293
14294<A NAME="Builtin Index"></A>
14295<HR SIZE="6">
14296<A NAME="SEC141"></A>
14297<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14298<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> &lt; </A>]</TD>
14299<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &gt; </A>]</TD>
14300<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
14301<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14302<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14303<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14304<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14305<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14306<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14307</TR></TABLE>
14308<H2> D.1 Index of Shell Builtin Commands </H2>
14309<!--docid::SEC141::-->
14310<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#bt_." style="text-decoration:none"><b>.</b></A>
14311 &nbsp;
14312<A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14313 &nbsp;
14314<A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14315 &nbsp;
14316<BR>
14317<A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14318 &nbsp;
14319<A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14320 &nbsp;
14321<A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14322 &nbsp;
14323<A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14324 &nbsp;
14325<A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14326 &nbsp;
14327<A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14328 &nbsp;
14329<A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14330 &nbsp;
14331<A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14332 &nbsp;
14333<A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14334 &nbsp;
14335<A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14336 &nbsp;
14337<A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14338 &nbsp;
14339<A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14340 &nbsp;
14341<A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14342 &nbsp;
14343<A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14344 &nbsp;
14345<A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14346 &nbsp;
14347<A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14348 &nbsp;
14349<A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14350 &nbsp;
14351<A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14352 &nbsp;
14353</td></tr></table><br><P></P>
14354<TABLE border=0>
14355<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14356<TR><TD COLSPAN=3> <HR></TD></TR>
14357<TR><TH><A NAME="bt_."></A>.</TH><TD></TD><TD></TD></TR>
14358<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX69"><CODE>.</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14359<TR><TD COLSPAN=3> <HR></TD></TR>
14360<TR><TH><A NAME="bt_:"></A>:</TH><TD></TD><TD></TD></TR>
14361<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX68"><CODE>:</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14362<TR><TD COLSPAN=3> <HR></TD></TR>
14363<TR><TH><A NAME="bt_["></A>[</TH><TD></TD><TD></TD></TR>
14364<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX84"><CODE>[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14365<TR><TD COLSPAN=3> <HR></TD></TR>
14366<TR><TH><A NAME="bt_A"></A>A</TH><TD></TD><TD></TD></TR>
14367<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX89"><CODE>alias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14368<TR><TD COLSPAN=3> <HR></TD></TR>
14369<TR><TH><A NAME="bt_B"></A>B</TH><TD></TD><TD></TD></TR>
0001803f 14370<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX293"><CODE>bg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
17345e5a
JA
14371<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX90"><CODE>bind</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14372<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX70"><CODE>break</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14373<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX91"><CODE>builtin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14374<TR><TD COLSPAN=3> <HR></TD></TR>
14375<TR><TH><A NAME="bt_C"></A>C</TH><TD></TD><TD></TD></TR>
14376<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX92"><CODE>caller</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14377<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX71"><CODE>cd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14378<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX93"><CODE>command</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
0001803f
CR
14379<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX540"><CODE>compgen</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14380<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX541"><CODE>complete</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
14381<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX542"><CODE>compopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
17345e5a
JA
14382<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX72"><CODE>continue</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14383<TR><TD COLSPAN=3> <HR></TD></TR>
14384<TR><TH><A NAME="bt_D"></A>D</TH><TD></TD><TD></TD></TR>
14385<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX94"><CODE>declare</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
0001803f
CR
14386<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX290"><CODE>dirs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
14387<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX298"><CODE>disown</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
17345e5a
JA
14388<TR><TD COLSPAN=3> <HR></TD></TR>
14389<TR><TH><A NAME="bt_E"></A>E</TH><TD></TD><TD></TD></TR>
14390<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX95"><CODE>echo</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14391<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX96"><CODE>enable</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14392<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX73"><CODE>eval</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14393<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX74"><CODE>exec</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14394<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX75"><CODE>exit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14395<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX76"><CODE>export</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14396<TR><TD COLSPAN=3> <HR></TD></TR>
14397<TR><TH><A NAME="bt_F"></A>F</TH><TD></TD><TD></TD></TR>
0001803f
CR
14398<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX544"><CODE>fc</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
14399<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX294"><CODE>fg</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
17345e5a
JA
14400<TR><TD COLSPAN=3> <HR></TD></TR>
14401<TR><TH><A NAME="bt_G"></A>G</TH><TD></TD><TD></TD></TR>
14402<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX77"><CODE>getopts</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14403<TR><TD COLSPAN=3> <HR></TD></TR>
14404<TR><TH><A NAME="bt_H"></A>H</TH><TD></TD><TD></TD></TR>
14405<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX78"><CODE>hash</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14406<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX97"><CODE>help</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
0001803f 14407<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX545"><CODE>history</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
17345e5a
JA
14408<TR><TD COLSPAN=3> <HR></TD></TR>
14409<TR><TH><A NAME="bt_J"></A>J</TH><TD></TD><TD></TD></TR>
0001803f 14410<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX295"><CODE>jobs</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
17345e5a
JA
14411<TR><TD COLSPAN=3> <HR></TD></TR>
14412<TR><TH><A NAME="bt_K"></A>K</TH><TD></TD><TD></TD></TR>
0001803f 14413<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX296"><CODE>kill</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
17345e5a
JA
14414<TR><TD COLSPAN=3> <HR></TD></TR>
14415<TR><TH><A NAME="bt_L"></A>L</TH><TD></TD><TD></TD></TR>
14416<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX98"><CODE>let</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14417<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX99"><CODE>local</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14418<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX100"><CODE>logout</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14419<TR><TD COLSPAN=3> <HR></TD></TR>
14420<TR><TH><A NAME="bt_M"></A>M</TH><TD></TD><TD></TD></TR>
14421<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX101"><CODE>mapfile</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14422<TR><TD COLSPAN=3> <HR></TD></TR>
14423<TR><TH><A NAME="bt_P"></A>P</TH><TD></TD><TD></TD></TR>
0001803f 14424<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX291"><CODE>popd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
17345e5a 14425<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX102"><CODE>printf</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
0001803f 14426<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX292"><CODE>pushd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A></TD></TR>
17345e5a
JA
14427<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX79"><CODE>pwd</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14428<TR><TD COLSPAN=3> <HR></TD></TR>
14429<TR><TH><A NAME="bt_R"></A>R</TH><TD></TD><TD></TD></TR>
14430<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX103"><CODE>read</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14431<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX104"><CODE>readarray</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14432<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX80"><CODE>readonly</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14433<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX81"><CODE>return</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14434<TR><TD COLSPAN=3> <HR></TD></TR>
14435<TR><TH><A NAME="bt_S"></A>S</TH><TD></TD><TD></TD></TR>
14436<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX110"><CODE>set</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A></TD></TR>
14437<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX82"><CODE>shift</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14438<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX111"><CODE>shopt</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A></TD></TR>
14439<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX105"><CODE>source</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
0001803f 14440<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX299"><CODE>suspend</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
17345e5a
JA
14441<TR><TD COLSPAN=3> <HR></TD></TR>
14442<TR><TH><A NAME="bt_T"></A>T</TH><TD></TD><TD></TD></TR>
14443<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX83"><CODE>test</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14444<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX85"><CODE>times</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14445<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX86"><CODE>trap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14446<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX106"><CODE>type</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14447<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX107"><CODE>typeset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14448<TR><TD COLSPAN=3> <HR></TD></TR>
14449<TR><TH><A NAME="bt_U"></A>U</TH><TD></TD><TD></TD></TR>
14450<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX108"><CODE>ulimit</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14451<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX87"><CODE>umask</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14452<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX109"><CODE>unalias</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A></TD></TR>
14453<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX88"><CODE>unset</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A></TD></TR>
14454<TR><TD COLSPAN=3> <HR></TD></TR>
14455<TR><TH><A NAME="bt_W"></A>W</TH><TD></TD><TD></TD></TR>
0001803f 14456<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX297"><CODE>wait</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC93">7.2 Job Control Builtins</A></TD></TR>
17345e5a
JA
14457<TR><TD COLSPAN=3> <HR></TD></TR>
14458</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>
14459 &nbsp;
14460<A HREF="bashref.html#bt_:" style="text-decoration:none"><b>:</b></A>
14461 &nbsp;
14462<A HREF="bashref.html#bt_[" style="text-decoration:none"><b>[</b></A>
14463 &nbsp;
14464<BR>
14465<A HREF="bashref.html#bt_A" style="text-decoration:none"><b>A</b></A>
14466 &nbsp;
14467<A HREF="bashref.html#bt_B" style="text-decoration:none"><b>B</b></A>
14468 &nbsp;
14469<A HREF="bashref.html#bt_C" style="text-decoration:none"><b>C</b></A>
14470 &nbsp;
14471<A HREF="bashref.html#bt_D" style="text-decoration:none"><b>D</b></A>
14472 &nbsp;
14473<A HREF="bashref.html#bt_E" style="text-decoration:none"><b>E</b></A>
14474 &nbsp;
14475<A HREF="bashref.html#bt_F" style="text-decoration:none"><b>F</b></A>
14476 &nbsp;
14477<A HREF="bashref.html#bt_G" style="text-decoration:none"><b>G</b></A>
14478 &nbsp;
14479<A HREF="bashref.html#bt_H" style="text-decoration:none"><b>H</b></A>
14480 &nbsp;
14481<A HREF="bashref.html#bt_J" style="text-decoration:none"><b>J</b></A>
14482 &nbsp;
14483<A HREF="bashref.html#bt_K" style="text-decoration:none"><b>K</b></A>
14484 &nbsp;
14485<A HREF="bashref.html#bt_L" style="text-decoration:none"><b>L</b></A>
14486 &nbsp;
14487<A HREF="bashref.html#bt_M" style="text-decoration:none"><b>M</b></A>
14488 &nbsp;
14489<A HREF="bashref.html#bt_P" style="text-decoration:none"><b>P</b></A>
14490 &nbsp;
14491<A HREF="bashref.html#bt_R" style="text-decoration:none"><b>R</b></A>
14492 &nbsp;
14493<A HREF="bashref.html#bt_S" style="text-decoration:none"><b>S</b></A>
14494 &nbsp;
14495<A HREF="bashref.html#bt_T" style="text-decoration:none"><b>T</b></A>
14496 &nbsp;
14497<A HREF="bashref.html#bt_U" style="text-decoration:none"><b>U</b></A>
14498 &nbsp;
14499<A HREF="bashref.html#bt_W" style="text-decoration:none"><b>W</b></A>
14500 &nbsp;
14501</td></tr></table><br><P>
14502
14503<A NAME="Reserved Word Index"></A>
14504<HR SIZE="6">
14505<A NAME="SEC142"></A>
14506<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14507<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC141"> &lt; </A>]</TD>
14508<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &gt; </A>]</TD>
14509<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &lt;&lt; </A>]</TD>
14510<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14511<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14512<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14513<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14514<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14515<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14516</TR></TABLE>
14517<H2> D.2 Index of Shell Reserved Words </H2>
14518<!--docid::SEC142::-->
14519<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14520 &nbsp;
14521<A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14522 &nbsp;
14523<A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14524 &nbsp;
14525<A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14526 &nbsp;
14527<A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14528 &nbsp;
14529<BR>
14530<A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14531 &nbsp;
14532<A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14533 &nbsp;
14534<A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14535 &nbsp;
14536<A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14537 &nbsp;
14538<A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14539 &nbsp;
14540<A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14541 &nbsp;
14542<A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14543 &nbsp;
14544<A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14545 &nbsp;
14546<A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14547 &nbsp;
14548</td></tr></table><br><P></P>
14549<TABLE border=0>
14550<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14551<TR><TD COLSPAN=3> <HR></TD></TR>
14552<TR><TH><A NAME="rw_!"></A>!</TH><TD></TD><TD></TD></TR>
14553<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX25"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
14554<TR><TD COLSPAN=3> <HR></TD></TR>
14555<TR><TH><A NAME="rw_["></A>[</TH><TD></TD><TD></TD></TR>
14556<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX41"><CODE>[[</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14557<TR><TD COLSPAN=3> <HR></TD></TR>
14558<TR><TH><A NAME="rw_]"></A>]</TH><TD></TD><TD></TD></TR>
14559<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX42"><CODE>]]</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14560<TR><TD COLSPAN=3> <HR></TD></TR>
14561<TR><TH><A NAME="rw_{"></A>{</TH><TD></TD><TD></TD></TR>
14562<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX43"><CODE>{</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR>
14563<TR><TD COLSPAN=3> <HR></TD></TR>
14564<TR><TH><A NAME="rw_}"></A>}</TH><TD></TD><TD></TD></TR>
14565<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX44"><CODE>}</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR>
14566<TR><TD COLSPAN=3> <HR></TD></TR>
14567<TR><TH><A NAME="rw_C"></A>C</TH><TD></TD><TD></TD></TR>
14568<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX37"><CODE>case</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14569<TR><TD COLSPAN=3> <HR></TD></TR>
14570<TR><TH><A NAME="rw_D"></A>D</TH><TD></TD><TD></TD></TR>
14571<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX28"><CODE>do</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14572<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX29"><CODE>done</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14573<TR><TD COLSPAN=3> <HR></TD></TR>
14574<TR><TH><A NAME="rw_E"></A>E</TH><TD></TD><TD></TD></TR>
14575<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX35"><CODE>elif</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14576<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX34"><CODE>else</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14577<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX39"><CODE>esac</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14578<TR><TD COLSPAN=3> <HR></TD></TR>
14579<TR><TH><A NAME="rw_F"></A>F</TH><TD></TD><TD></TD></TR>
14580<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX36"><CODE>fi</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14581<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX31"><CODE>for</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14582<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX45"><CODE>function</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR>
14583<TR><TD COLSPAN=3> <HR></TD></TR>
14584<TR><TH><A NAME="rw_I"></A>I</TH><TD></TD><TD></TD></TR>
14585<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX32"><CODE>if</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14586<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX38"><CODE>in</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14587<TR><TD COLSPAN=3> <HR></TD></TR>
14588<TR><TH><A NAME="rw_S"></A>S</TH><TD></TD><TD></TD></TR>
14589<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX40"><CODE>select</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14590<TR><TD COLSPAN=3> <HR></TD></TR>
14591<TR><TH><A NAME="rw_T"></A>T</TH><TD></TD><TD></TD></TR>
14592<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX33"><CODE>then</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
14593<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX24"><CODE>time</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
14594<TR><TD COLSPAN=3> <HR></TD></TR>
14595<TR><TH><A NAME="rw_U"></A>U</TH><TD></TD><TD></TD></TR>
14596<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX27"><CODE>until</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14597<TR><TD COLSPAN=3> <HR></TD></TR>
14598<TR><TH><A NAME="rw_W"></A>W</TH><TD></TD><TD></TD></TR>
14599<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX30"><CODE>while</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
14600<TR><TD COLSPAN=3> <HR></TD></TR>
14601</TABLE><P></P><table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#rw_!" style="text-decoration:none"><b>!</b></A>
14602 &nbsp;
14603<A HREF="bashref.html#rw_[" style="text-decoration:none"><b>[</b></A>
14604 &nbsp;
14605<A HREF="bashref.html#rw_]" style="text-decoration:none"><b>]</b></A>
14606 &nbsp;
14607<A HREF="bashref.html#rw_{" style="text-decoration:none"><b>{</b></A>
14608 &nbsp;
14609<A HREF="bashref.html#rw_}" style="text-decoration:none"><b>}</b></A>
14610 &nbsp;
14611<BR>
14612<A HREF="bashref.html#rw_C" style="text-decoration:none"><b>C</b></A>
14613 &nbsp;
14614<A HREF="bashref.html#rw_D" style="text-decoration:none"><b>D</b></A>
14615 &nbsp;
14616<A HREF="bashref.html#rw_E" style="text-decoration:none"><b>E</b></A>
14617 &nbsp;
14618<A HREF="bashref.html#rw_F" style="text-decoration:none"><b>F</b></A>
14619 &nbsp;
14620<A HREF="bashref.html#rw_I" style="text-decoration:none"><b>I</b></A>
14621 &nbsp;
14622<A HREF="bashref.html#rw_S" style="text-decoration:none"><b>S</b></A>
14623 &nbsp;
14624<A HREF="bashref.html#rw_T" style="text-decoration:none"><b>T</b></A>
14625 &nbsp;
14626<A HREF="bashref.html#rw_U" style="text-decoration:none"><b>U</b></A>
14627 &nbsp;
14628<A HREF="bashref.html#rw_W" style="text-decoration:none"><b>W</b></A>
14629 &nbsp;
14630</td></tr></table><br><P>
14631
14632<A NAME="Variable Index"></A>
14633<HR SIZE="6">
14634<A NAME="SEC143"></A>
14635<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
14636<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC142"> &lt; </A>]</TD>
14637<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &gt; </A>]</TD>
14638<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &lt;&lt; </A>]</TD>
14639<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
14640<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
14641<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
14642<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
14643<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
14644<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
14645</TR></TABLE>
14646<H2> D.3 Parameter and Variable Index </H2>
14647<!--docid::SEC143::-->
14648<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#vr_!" style="text-decoration:none"><b>!</b></A>
14649 &nbsp;
14650<A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
14651 &nbsp;
14652<A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
14653 &nbsp;
14654<A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
14655 &nbsp;
14656<A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
14657 &nbsp;
14658<A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
14659 &nbsp;
14660<A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
14661 &nbsp;
14662<A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
14663 &nbsp;
14664<A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
14665 &nbsp;
14666<BR>
14667<A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
14668 &nbsp;
14669<A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
14670 &nbsp;
14671<A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
14672 &nbsp;
14673<A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
14674 &nbsp;
14675<A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
14676 &nbsp;
14677<A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
14678 &nbsp;
14679<A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
14680 &nbsp;
14681<A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
14682 &nbsp;
14683<A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
14684 &nbsp;
14685<A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
14686 &nbsp;
14687<A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
14688 &nbsp;
14689<A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
14690 &nbsp;
14691<A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
14692 &nbsp;
14693<A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
14694 &nbsp;
14695<A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
14696 &nbsp;
14697<A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
14698 &nbsp;
14699<A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
14700 &nbsp;
14701<A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
14702 &nbsp;
14703<A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
14704 &nbsp;
14705</td></tr></table><br><P></P>
14706<TABLE border=0>
14707<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
14708<TR><TD COLSPAN=3> <HR></TD></TR>
14709<TR><TH><A NAME="vr_!"></A>!</TH><TD></TD><TD></TD></TR>
14710<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX58"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14711<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX59"><CODE>!</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14712<TR><TD COLSPAN=3> <HR></TD></TR>
14713<TR><TH><A NAME="vr_#"></A>#</TH><TD></TD><TD></TD></TR>
14714<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX50"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14715<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX51"><CODE>#</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14716<TR><TD COLSPAN=3> <HR></TD></TR>
14717<TR><TH><A NAME="vr_$"></A>$</TH><TD></TD><TD></TD></TR>
14718<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX56"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14719<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX57"><CODE>$</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14720<TR><TD COLSPAN=3> <HR></TD></TR>
14721<TR><TH><A NAME="vr_*"></A>*</TH><TD></TD><TD></TD></TR>
14722<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX46"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14723<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX47"><CODE>*</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14724<TR><TD COLSPAN=3> <HR></TD></TR>
14725<TR><TH><A NAME="vr_-"></A>-</TH><TD></TD><TD></TD></TR>
14726<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX54"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14727<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX55"><CODE>-</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14728<TR><TD COLSPAN=3> <HR></TD></TR>
14729<TR><TH><A NAME="vr_0"></A>0</TH><TD></TD><TD></TD></TR>
14730<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX60"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14731<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX61"><CODE>0</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14732<TR><TD COLSPAN=3> <HR></TD></TR>
14733<TR><TH><A NAME="vr_?"></A>?</TH><TD></TD><TD></TD></TR>
14734<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX52"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14735<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX53"><CODE>?</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14736<TR><TD COLSPAN=3> <HR></TD></TR>
14737<TR><TH><A NAME="vr_@"></A>@</TH><TD></TD><TD></TD></TR>
14738<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX48"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14739<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX49"><CODE>@</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14740<TR><TD COLSPAN=3> <HR></TD></TR>
14741<TR><TH><A NAME="vr__"></A>_</TH><TD></TD><TD></TD></TR>
14742<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX62"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14743<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX63"><CODE>_</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
14744<TR><TD COLSPAN=3> <HR></TD></TR>
14745<TR><TH><A NAME="vr_A"></A>A</TH><TD></TD><TD></TD></TR>
0001803f
CR
14746<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX300"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
14747<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX301"><CODE>auto_resume</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
17345e5a
JA
14748<TR><TD COLSPAN=3> <HR></TD></TR>
14749<TR><TH><A NAME="vr_B"></A>B</TH><TD></TD><TD></TD></TR>
14750<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX132"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14751<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX133"><CODE>BASH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
0001803f
CR
14752<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX138"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14753<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX139"><CODE>BASH_ALIASES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14754<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX140"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14755<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX141"><CODE>BASH_ARGC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14756<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX142"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14757<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX143"><CODE>BASH_ARGV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14758<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX144"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14759<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX145"><CODE>BASH_CMDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14760<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX146"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14761<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX147"><CODE>BASH_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14762<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX148"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14763<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX149"><CODE>BASH_ENV</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14764<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX150"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14765<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX151"><CODE>BASH_EXECUTION_STRING</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14766<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX152"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14767<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX153"><CODE>BASH_LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14768<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX154"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14769<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX155"><CODE>BASH_REMATCH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14770<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX156"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14771<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX157"><CODE>BASH_SOURCE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14772<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX158"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14773<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX159"><CODE>BASH_SUBSHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14774<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX160"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14775<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX161"><CODE>BASH_VERSINFO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14776<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX162"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14777<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX163"><CODE>BASH_VERSION</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14778<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX164"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14779<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX165"><CODE>BASH_XTRACEFD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14780<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX134"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14781<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX135"><CODE>BASHOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14782<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX136"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14783<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX137"><CODE>BASHPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14784<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX307"><CODE>bell-style</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14785<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX308"><CODE>bind-tty-special-chars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14786<TR><TD COLSPAN=3> <HR></TD></TR>
14787<TR><TH><A NAME="vr_C"></A>C</TH><TD></TD><TD></TD></TR>
14788<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX112"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14789<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX113"><CODE>CDPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14790<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX166"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14791<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX167"><CODE>COLUMNS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14792<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX309"><CODE>comment-begin</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14793<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX168"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14794<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX169"><CODE>COMP_CWORD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14795<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX176"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14796<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX177"><CODE>COMP_KEY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14797<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX170"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14798<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX171"><CODE>COMP_LINE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14799<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX172"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14800<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX173"><CODE>COMP_POINT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14801<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX174"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14802<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX175"><CODE>COMP_TYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14803<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX178"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14804<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX179"><CODE>COMP_WORDBREAKS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14805<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX180"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14806<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX181"><CODE>COMP_WORDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14807<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX310"><CODE>completion-prefix-display-length</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14808<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX311"><CODE>completion-query-items</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14809<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX182"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14810<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX183"><CODE>COMPREPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14811<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX312"><CODE>convert-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14812<TR><TD COLSPAN=3> <HR></TD></TR>
14813<TR><TH><A NAME="vr_D"></A>D</TH><TD></TD><TD></TD></TR>
0001803f
CR
14814<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX184"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14815<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX185"><CODE>DIRSTACK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14816<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX313"><CODE>disable-completion</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14817<TR><TD COLSPAN=3> <HR></TD></TR>
14818<TR><TH><A NAME="vr_E"></A>E</TH><TD></TD><TD></TD></TR>
0001803f
CR
14819<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX314"><CODE>editing-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14820<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX186"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14821<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX187"><CODE>EMACS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14822<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX315"><CODE>enable-keypad</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14823<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX188"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14824<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX189"><CODE>EUID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14825<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX316"><CODE>expand-tilde</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14826<TR><TD COLSPAN=3> <HR></TD></TR>
14827<TR><TH><A NAME="vr_F"></A>F</TH><TD></TD><TD></TD></TR>
0001803f
CR
14828<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX190"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14829<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX191"><CODE>FCEDIT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14830<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX192"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14831<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX193"><CODE>FIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14832<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX194"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14833<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX195"><CODE>FUNCNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14834<TR><TD COLSPAN=3> <HR></TD></TR>
14835<TR><TH><A NAME="vr_G"></A>G</TH><TD></TD><TD></TD></TR>
0001803f
CR
14836<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX196"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14837<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX197"><CODE>GLOBIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14838<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX198"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14839<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX199"><CODE>GROUPS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14840<TR><TD COLSPAN=3> <HR></TD></TR>
14841<TR><TH><A NAME="vr_H"></A>H</TH><TD></TD><TD></TD></TR>
0001803f
CR
14842<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX200"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14843<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX201"><CODE>histchars</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14844<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX202"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14845<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX203"><CODE>HISTCMD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14846<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX204"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14847<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX205"><CODE>HISTCONTROL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14848<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX206"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14849<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX207"><CODE>HISTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14850<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX208"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14851<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX209"><CODE>HISTFILESIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14852<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX210"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14853<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX211"><CODE>HISTIGNORE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14854<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX317"><CODE>history-preserve-point</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14855<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX318"><CODE>history-size</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14856<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX212"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14857<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX213"><CODE>HISTSIZE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14858<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX214"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14859<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX215"><CODE>HISTTIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14860<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX114"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14861<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX115"><CODE>HOME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14862<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX319"><CODE>horizontal-scroll-mode</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14863<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX216"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14864<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX217"><CODE>HOSTFILE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14865<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX218"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14866<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX219"><CODE>HOSTNAME</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14867<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX220"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14868<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX221"><CODE>HOSTTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14869<TR><TD COLSPAN=3> <HR></TD></TR>
14870<TR><TH><A NAME="vr_I"></A>I</TH><TD></TD><TD></TD></TR>
14871<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX116"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14872<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX117"><CODE>IFS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14873<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX222"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14874<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX223"><CODE>IGNOREEOF</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14875<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX320"><CODE>input-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14876<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX224"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14877<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX225"><CODE>INPUTRC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14878<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX322"><CODE>isearch-terminators</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14879<TR><TD COLSPAN=3> <HR></TD></TR>
14880<TR><TH><A NAME="vr_K"></A>K</TH><TD></TD><TD></TD></TR>
0001803f 14881<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX323"><CODE>keymap</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14882<TR><TD COLSPAN=3> <HR></TD></TR>
14883<TR><TH><A NAME="vr_L"></A>L</TH><TD></TD><TD></TD></TR>
0001803f
CR
14884<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX226"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14885<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX227"><CODE>LANG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14886<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX228"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14887<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX229"><CODE>LC_ALL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14888<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX230"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14889<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX231"><CODE>LC_COLLATE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14890<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX232"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14891<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX233"><CODE>LC_CTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a 14892<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX21"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
0001803f
CR
14893<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX234"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14894<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX235"><CODE>LC_MESSAGES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14895<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX236"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14896<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX237"><CODE>LC_NUMERIC</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14897<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX238"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14898<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX239"><CODE>LINENO</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14899<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX240"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14900<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX241"><CODE>LINES</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14901<TR><TD COLSPAN=3> <HR></TD></TR>
14902<TR><TH><A NAME="vr_M"></A>M</TH><TD></TD><TD></TD></TR>
0001803f
CR
14903<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX242"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14904<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX243"><CODE>MACHTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14905<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX118"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14906<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX119"><CODE>MAIL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14907<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX244"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14908<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX245"><CODE>MAILCHECK</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14909<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX120"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14910<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX121"><CODE>MAILPATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14911<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX324"><CODE>mark-modified-lines</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14912<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX325"><CODE>mark-symlinked-directories</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14913<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX326"><CODE>match-hidden-files</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14914<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX321"><CODE>meta-flag</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14915<TR><TD COLSPAN=3> <HR></TD></TR>
14916<TR><TH><A NAME="vr_O"></A>O</TH><TD></TD><TD></TD></TR>
0001803f
CR
14917<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX246"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14918<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX247"><CODE>OLDPWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14919<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX122"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14920<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX123"><CODE>OPTARG</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14921<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX248"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14922<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX249"><CODE>OPTERR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14923<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX124"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14924<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX125"><CODE>OPTIND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14925<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX250"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14926<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX251"><CODE>OSTYPE</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14927<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX327"><CODE>output-meta</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14928<TR><TD COLSPAN=3> <HR></TD></TR>
14929<TR><TH><A NAME="vr_P"></A>P</TH><TD></TD><TD></TD></TR>
0001803f 14930<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX328"><CODE>page-completions</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14931<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX126"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14932<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX127"><CODE>PATH</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14933<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX252"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14934<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX253"><CODE>PIPESTATUS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14935<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX254"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14936<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX255"><CODE>POSIXLY_CORRECT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14937<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX256"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14938<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX257"><CODE>PPID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14939<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX258"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14940<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX259"><CODE>PROMPT_COMMAND</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14941<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX260"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14942<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX261"><CODE>PROMPT_DIRTRIM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14943<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX128"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14944<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX129"><CODE>PS1</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14945<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX130"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
14946<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX131"><CODE>PS2</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A></TD></TR>
0001803f
CR
14947<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX262"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14948<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX263"><CODE>PS3</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14949<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX264"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14950<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX265"><CODE>PS4</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14951<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX266"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14952<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX267"><CODE>PWD</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14953<TR><TD COLSPAN=3> <HR></TD></TR>
14954<TR><TH><A NAME="vr_R"></A>R</TH><TD></TD><TD></TD></TR>
0001803f
CR
14955<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX268"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14956<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX269"><CODE>RANDOM</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14957<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX270"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14958<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX271"><CODE>REPLY</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14959<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX329"><CODE>revert-all-at-newline</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14960<TR><TD COLSPAN=3> <HR></TD></TR>
14961<TR><TH><A NAME="vr_S"></A>S</TH><TD></TD><TD></TD></TR>
0001803f
CR
14962<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX272"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14963<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX273"><CODE>SECONDS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14964<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX274"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14965<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX275"><CODE>SHELL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14966<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX276"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14967<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX277"><CODE>SHELLOPTS</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14968<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX278"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14969<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX279"><CODE>SHLVL</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14970<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX330"><CODE>show-all-if-ambiguous</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14971<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX331"><CODE>show-all-if-unmodified</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
14972<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX332"><CODE>skip-completed-text</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14973<TR><TD COLSPAN=3> <HR></TD></TR>
14974<TR><TH><A NAME="vr_T"></A>T</TH><TD></TD><TD></TD></TR>
14975<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX22"><CODE>TEXTDOMAIN</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
14976<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX23"><CODE>TEXTDOMAINDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
0001803f
CR
14977<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX280"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14978<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX281"><CODE>TIMEFORMAT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14979<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX282"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14980<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX283"><CODE>TMOUT</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14981<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX284"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14982<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX285"><CODE>TMPDIR</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14983<TR><TD COLSPAN=3> <HR></TD></TR>
14984<TR><TH><A NAME="vr_U"></A>U</TH><TD></TD><TD></TD></TR>
0001803f
CR
14985<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX286"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
14986<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX287"><CODE>UID</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC67">5.2 Bash Variables</A></TD></TR>
17345e5a
JA
14987<TR><TD COLSPAN=3> <HR></TD></TR>
14988<TR><TH><A NAME="vr_V"></A>V</TH><TD></TD><TD></TD></TR>
0001803f 14989<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX333"><CODE>visible-stats</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
14990<TR><TD COLSPAN=3> <HR></TD></TR>
14991</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>
14992 &nbsp;
14993<A HREF="bashref.html#vr_#" style="text-decoration:none"><b>#</b></A>
14994 &nbsp;
14995<A HREF="bashref.html#vr_$" style="text-decoration:none"><b>$</b></A>
14996 &nbsp;
14997<A HREF="bashref.html#vr_*" style="text-decoration:none"><b>*</b></A>
14998 &nbsp;
14999<A HREF="bashref.html#vr_-" style="text-decoration:none"><b>-</b></A>
15000 &nbsp;
15001<A HREF="bashref.html#vr_0" style="text-decoration:none"><b>0</b></A>
15002 &nbsp;
15003<A HREF="bashref.html#vr_?" style="text-decoration:none"><b>?</b></A>
15004 &nbsp;
15005<A HREF="bashref.html#vr_@" style="text-decoration:none"><b>@</b></A>
15006 &nbsp;
15007<A HREF="bashref.html#vr__" style="text-decoration:none"><b>_</b></A>
15008 &nbsp;
15009<BR>
15010<A HREF="bashref.html#vr_A" style="text-decoration:none"><b>A</b></A>
15011 &nbsp;
15012<A HREF="bashref.html#vr_B" style="text-decoration:none"><b>B</b></A>
15013 &nbsp;
15014<A HREF="bashref.html#vr_C" style="text-decoration:none"><b>C</b></A>
15015 &nbsp;
15016<A HREF="bashref.html#vr_D" style="text-decoration:none"><b>D</b></A>
15017 &nbsp;
15018<A HREF="bashref.html#vr_E" style="text-decoration:none"><b>E</b></A>
15019 &nbsp;
15020<A HREF="bashref.html#vr_F" style="text-decoration:none"><b>F</b></A>
15021 &nbsp;
15022<A HREF="bashref.html#vr_G" style="text-decoration:none"><b>G</b></A>
15023 &nbsp;
15024<A HREF="bashref.html#vr_H" style="text-decoration:none"><b>H</b></A>
15025 &nbsp;
15026<A HREF="bashref.html#vr_I" style="text-decoration:none"><b>I</b></A>
15027 &nbsp;
15028<A HREF="bashref.html#vr_K" style="text-decoration:none"><b>K</b></A>
15029 &nbsp;
15030<A HREF="bashref.html#vr_L" style="text-decoration:none"><b>L</b></A>
15031 &nbsp;
15032<A HREF="bashref.html#vr_M" style="text-decoration:none"><b>M</b></A>
15033 &nbsp;
15034<A HREF="bashref.html#vr_O" style="text-decoration:none"><b>O</b></A>
15035 &nbsp;
15036<A HREF="bashref.html#vr_P" style="text-decoration:none"><b>P</b></A>
15037 &nbsp;
15038<A HREF="bashref.html#vr_R" style="text-decoration:none"><b>R</b></A>
15039 &nbsp;
15040<A HREF="bashref.html#vr_S" style="text-decoration:none"><b>S</b></A>
15041 &nbsp;
15042<A HREF="bashref.html#vr_T" style="text-decoration:none"><b>T</b></A>
15043 &nbsp;
15044<A HREF="bashref.html#vr_U" style="text-decoration:none"><b>U</b></A>
15045 &nbsp;
15046<A HREF="bashref.html#vr_V" style="text-decoration:none"><b>V</b></A>
15047 &nbsp;
15048</td></tr></table><br><P>
15049
15050<A NAME="Function Index"></A>
15051<HR SIZE="6">
15052<A NAME="SEC144"></A>
15053<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15054<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC143"> &lt; </A>]</TD>
15055<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> &gt; </A>]</TD>
15056<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC145"> &lt;&lt; </A>]</TD>
15057<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
15058<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
15059<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15060<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15061<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15062<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15063</TR></TABLE>
15064<H2> D.4 Function Index </H2>
15065<!--docid::SEC144::-->
15066<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#fn_A" style="text-decoration:none"><b>A</b></A>
15067 &nbsp;
15068<A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
15069 &nbsp;
15070<A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
15071 &nbsp;
15072<A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
15073 &nbsp;
15074<A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
15075 &nbsp;
15076<A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
15077 &nbsp;
15078<A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
15079 &nbsp;
15080<A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
15081 &nbsp;
15082<A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
15083 &nbsp;
15084<A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
15085 &nbsp;
15086<A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
15087 &nbsp;
15088<A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
15089 &nbsp;
15090<A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
15091 &nbsp;
15092<A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
15093 &nbsp;
15094<A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
15095 &nbsp;
15096<A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
15097 &nbsp;
15098<A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
15099 &nbsp;
15100<A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
15101 &nbsp;
15102<A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
15103 &nbsp;
15104<A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
15105 &nbsp;
15106</td></tr></table><br><P></P>
15107<TABLE border=0>
15108<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15109<TR><TD COLSPAN=3> <HR></TD></TR>
15110<TR><TH><A NAME="fn_A"></A>A</TH><TD></TD><TD></TD></TR>
0001803f
CR
15111<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX486"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15112<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX487"><CODE>abort (C-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15113<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX354"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15114<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX355"><CODE>accept-line (Newline or Return)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15115<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX530"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15116<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX531"><CODE>alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
17345e5a
JA
15117<TR><TD COLSPAN=3> <HR></TD></TR>
15118<TR><TH><A NAME="fn_B"></A>B</TH><TD></TD><TD></TD></TR>
0001803f
CR
15119<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX340"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15120<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX341"><CODE>backward-char (C-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15121<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX382"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15122<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX383"><CODE>backward-delete-char (Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15123<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX404"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15124<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX405"><CODE>backward-kill-line (C-x Rubout)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15125<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX416"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15126<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX417"><CODE>backward-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15127<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX412"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15128<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX413"><CODE>backward-kill-word (M-<KBD>DEL</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15129<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX344"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15130<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX345"><CODE>backward-word (M-b)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15131<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX360"><CODE>beginning-of-history (M-&#38;#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15132<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX361"><CODE>beginning-of-history (M-&#38;#60;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15133<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX334"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15134<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX335"><CODE>beginning-of-line (C-a)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
17345e5a
JA
15135<TR><TD COLSPAN=3> <HR></TD></TR>
15136<TR><TH><A NAME="fn_C"></A>C</TH><TD></TD><TD></TD></TR>
0001803f
CR
15137<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX482"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15138<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX483"><CODE>call-last-kbd-macro (C-x e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15139<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX398"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15140<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX399"><CODE>capitalize-word (M-c)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15141<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX502"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15142<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX503"><CODE>character-search (C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15143<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX504"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15144<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX505"><CODE>character-search-backward (M-C-])</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15145<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX350"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15146<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX351"><CODE>clear-screen (C-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15147<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX440"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15148<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX441"><CODE>complete (<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15149<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX468"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15150<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX469"><CODE>complete-command (M-!)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15151<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX452"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15152<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX453"><CODE>complete-filename (M-/)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15153<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX464"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15154<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX465"><CODE>complete-hostname (M-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15155<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX476"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15156<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX477"><CODE>complete-into-braces (M-{)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15157<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX456"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15158<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX457"><CODE>complete-username (M-~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15159<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX460"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15160<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX461"><CODE>complete-variable (M-$)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15161<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX428"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15162<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX429"><CODE>copy-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15163<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX430"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15164<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX431"><CODE>copy-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15165<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX426"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15166<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX427"><CODE>copy-region-as-kill ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
17345e5a
JA
15167<TR><TD COLSPAN=3> <HR></TD></TR>
15168<TR><TH><A NAME="fn_D"></A>D</TH><TD></TD><TD></TD></TR>
0001803f
CR
15169<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX474"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15170<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX475"><CODE>dabbrev-expand ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15171<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX380"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15172<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX381"><CODE>delete-char (C-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15173<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX450"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15174<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX451"><CODE>delete-char-or-list ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15175<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX422"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15176<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX423"><CODE>delete-horizontal-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15177<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX436"><CODE>digit-argument (<KBD>M-0</KBD>, <KBD>M-1</KBD>, &#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>
15178<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX437"><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>
15179<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX522"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15180<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX523"><CODE>display-shell-version (C-x C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15181<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX488"><CODE>do-uppercase-version (M-a, M-b, M-<VAR>x</VAR>, &#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>
15182<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX489"><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>
15183<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX396"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15184<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX397"><CODE>downcase-word (M-l)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15185<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX510"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15186<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX511"><CODE>dump-functions ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15187<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX514"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15188<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX515"><CODE>dump-macros ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15189<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX512"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15190<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX513"><CODE>dump-variables ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15191<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX472"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15192<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX473"><CODE>dynamic-complete-history (M-<KBD>TAB</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
17345e5a
JA
15193<TR><TD COLSPAN=3> <HR></TD></TR>
15194<TR><TH><A NAME="fn_E"></A>E</TH><TD></TD><TD></TD></TR>
0001803f
CR
15195<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX538"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15196<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX539"><CODE>edit-and-execute-command (C-xC-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15197<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX480"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15198<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX481"><CODE>end-kbd-macro (C-x ))</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15199<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX362"><CODE>end-of-history (M-&#38;#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15200<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX363"><CODE>end-of-history (M-&#38;#62;)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15201<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX336"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15202<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX337"><CODE>end-of-line (C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15203<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX500"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15204<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX501"><CODE>exchange-point-and-mark (C-x C-x)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
17345e5a
JA
15205<TR><TD COLSPAN=3> <HR></TD></TR>
15206<TR><TH><A NAME="fn_F"></A>F</TH><TD></TD><TD></TD></TR>
0001803f
CR
15207<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX384"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15208<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX385"><CODE>forward-backward-delete-char ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15209<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX338"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15210<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX339"><CODE>forward-char (C-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15211<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX366"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15212<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX367"><CODE>forward-search-history (C-s)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15213<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX342"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15214<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX343"><CODE>forward-word (M-f)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
17345e5a
JA
15215<TR><TD COLSPAN=3> <HR></TD></TR>
15216<TR><TH><A NAME="fn_G"></A>G</TH><TD></TD><TD></TD></TR>
0001803f
CR
15217<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX516"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15218<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX517"><CODE>glob-complete-word (M-g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15219<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX518"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15220<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX519"><CODE>glob-expand-word (C-x *)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15221<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX520"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15222<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX521"><CODE>glob-list-expansions (C-x g)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
17345e5a
JA
15223<TR><TD COLSPAN=3> <HR></TD></TR>
15224<TR><TH><A NAME="fn_H"></A>H</TH><TD></TD><TD></TD></TR>
0001803f
CR
15225<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX532"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15226<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX533"><CODE>history-and-alias-expand-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15227<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX526"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15228<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX527"><CODE>history-expand-line (M-^)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15229<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX374"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15230<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX375"><CODE>history-search-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15231<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX372"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15232<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX373"><CODE>history-search-forward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
17345e5a
JA
15233<TR><TD COLSPAN=3> <HR></TD></TR>
15234<TR><TH><A NAME="fn_I"></A>I</TH><TD></TD><TD></TD></TR>
0001803f
CR
15235<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX508"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15236<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX509"><CODE>insert-comment (M-#)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15237<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX444"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15238<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX445"><CODE>insert-completions (M-*)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15239<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX534"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15240<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX535"><CODE>insert-last-argument (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
17345e5a
JA
15241<TR><TD COLSPAN=3> <HR></TD></TR>
15242<TR><TH><A NAME="fn_K"></A>K</TH><TD></TD><TD></TD></TR>
0001803f
CR
15243<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX402"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15244<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX403"><CODE>kill-line (C-k)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15245<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX424"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15246<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX425"><CODE>kill-region ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15247<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX408"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15248<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX409"><CODE>kill-whole-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15249<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX410"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15250<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX411"><CODE>kill-word (M-d)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
17345e5a
JA
15251<TR><TD COLSPAN=3> <HR></TD></TR>
15252<TR><TH><A NAME="fn_M"></A>M</TH><TD></TD><TD></TD></TR>
0001803f
CR
15253<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX528"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15254<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX529"><CODE>magic-space ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15255<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX446"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15256<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX447"><CODE>menu-complete ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15257<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX448"><CODE>menu-complete-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15258<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX449"><CODE>menu-complete-backward ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
17345e5a
JA
15259<TR><TD COLSPAN=3> <HR></TD></TR>
15260<TR><TH><A NAME="fn_N"></A>N</TH><TD></TD><TD></TD></TR>
0001803f
CR
15261<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX358"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15262<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX359"><CODE>next-history (C-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15263<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX370"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15264<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX371"><CODE>non-incremental-forward-search-history (M-n)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15265<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX368"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15266<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX369"><CODE>non-incremental-reverse-search-history (M-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
17345e5a
JA
15267<TR><TD COLSPAN=3> <HR></TD></TR>
15268<TR><TH><A NAME="fn_O"></A>O</TH><TD></TD><TD></TD></TR>
0001803f
CR
15269<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX536"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15270<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX537"><CODE>operate-and-get-next (C-o)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15271<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX400"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15272<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX401"><CODE>overwrite-mode ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
17345e5a
JA
15273<TR><TD COLSPAN=3> <HR></TD></TR>
15274<TR><TH><A NAME="fn_P"></A>P</TH><TD></TD><TD></TD></TR>
0001803f
CR
15275<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX470"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15276<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX471"><CODE>possible-command-completions (C-x !)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15277<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX442"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15278<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX443"><CODE>possible-completions (M-?)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15279<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX454"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15280<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX455"><CODE>possible-filename-completions (C-x /)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15281<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX466"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15282<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX467"><CODE>possible-hostname-completions (C-x @)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15283<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX458"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15284<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX459"><CODE>possible-username-completions (C-x ~)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15285<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX462"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15286<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX463"><CODE>possible-variable-completions (C-x $)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A></TD></TR>
15287<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX490"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15288<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX491"><CODE>prefix-meta (<KBD>ESC</KBD>)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15289<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX356"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15290<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX357"><CODE>previous-history (C-p)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
17345e5a
JA
15291<TR><TD COLSPAN=3> <HR></TD></TR>
15292<TR><TH><A NAME="fn_Q"></A>Q</TH><TD></TD><TD></TD></TR>
0001803f
CR
15293<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX386"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15294<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX387"><CODE>quoted-insert (C-q or C-v)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
17345e5a
JA
15295<TR><TD COLSPAN=3> <HR></TD></TR>
15296<TR><TH><A NAME="fn_R"></A>R</TH><TD></TD><TD></TD></TR>
0001803f
CR
15297<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX484"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15298<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX485"><CODE>re-read-init-file (C-x C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15299<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX352"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15300<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX353"><CODE>redraw-current-line ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15301<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX364"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15302<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX365"><CODE>reverse-search-history (C-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15303<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX494"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15304<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX495"><CODE>revert-line (M-r)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
17345e5a
JA
15305<TR><TD COLSPAN=3> <HR></TD></TR>
15306<TR><TH><A NAME="fn_S"></A>S</TH><TD></TD><TD></TD></TR>
0001803f
CR
15307<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX388"><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>
15308<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX389"><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>
15309<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX498"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15310<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX499"><CODE>set-mark (C-@)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15311<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX348"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15312<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX349"><CODE>shell-backward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15313<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX524"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15314<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX525"><CODE>shell-expand-line (M-C-e)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15315<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX346"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15316<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX347"><CODE>shell-forward-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A></TD></TR>
15317<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX414"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15318<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX415"><CODE>shell-kill-word ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15319<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX506"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15320<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX507"><CODE>skip-csi-sequence ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15321<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX478"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
15322<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX479"><CODE>start-kbd-macro (C-x ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A></TD></TR>
17345e5a
JA
15323<TR><TD COLSPAN=3> <HR></TD></TR>
15324<TR><TH><A NAME="fn_T"></A>T</TH><TD></TD><TD></TD></TR>
0001803f
CR
15325<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX496"><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>
15326<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX497"><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>
15327<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX390"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15328<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX391"><CODE>transpose-chars (C-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15329<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX392"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15330<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX393"><CODE>transpose-words (M-t)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
17345e5a
JA
15331<TR><TD COLSPAN=3> <HR></TD></TR>
15332<TR><TH><A NAME="fn_U"></A>U</TH><TD></TD><TD></TD></TR>
0001803f
CR
15333<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX492"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15334<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX493"><CODE>undo (C-_ or C-x C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A></TD></TR>
15335<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX438"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15336<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX439"><CODE>universal-argument ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A></TD></TR>
15337<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX420"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15338<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX421"><CODE>unix-filename-rubout ()</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15339<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX406"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15340<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX407"><CODE>unix-line-discard (C-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15341<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX418"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15342<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX419"><CODE>unix-word-rubout (C-w)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15343<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX394"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
15344<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX395"><CODE>upcase-word (M-u)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A></TD></TR>
17345e5a
JA
15345<TR><TD COLSPAN=3> <HR></TD></TR>
15346<TR><TH><A NAME="fn_Y"></A>Y</TH><TD></TD><TD></TD></TR>
0001803f
CR
15347<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX432"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15348<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX433"><CODE>yank (C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15349<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX378"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15350<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX379"><CODE>yank-last-arg (M-. or M-_)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15351<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX376"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15352<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX377"><CODE>yank-nth-arg (M-C-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A></TD></TR>
15353<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX434"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
15354<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX435"><CODE>yank-pop (M-y)</CODE></A></TD><TD valign=top><A HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A></TD></TR>
17345e5a
JA
15355<TR><TD COLSPAN=3> <HR></TD></TR>
15356</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>
15357 &nbsp;
15358<A HREF="bashref.html#fn_B" style="text-decoration:none"><b>B</b></A>
15359 &nbsp;
15360<A HREF="bashref.html#fn_C" style="text-decoration:none"><b>C</b></A>
15361 &nbsp;
15362<A HREF="bashref.html#fn_D" style="text-decoration:none"><b>D</b></A>
15363 &nbsp;
15364<A HREF="bashref.html#fn_E" style="text-decoration:none"><b>E</b></A>
15365 &nbsp;
15366<A HREF="bashref.html#fn_F" style="text-decoration:none"><b>F</b></A>
15367 &nbsp;
15368<A HREF="bashref.html#fn_G" style="text-decoration:none"><b>G</b></A>
15369 &nbsp;
15370<A HREF="bashref.html#fn_H" style="text-decoration:none"><b>H</b></A>
15371 &nbsp;
15372<A HREF="bashref.html#fn_I" style="text-decoration:none"><b>I</b></A>
15373 &nbsp;
15374<A HREF="bashref.html#fn_K" style="text-decoration:none"><b>K</b></A>
15375 &nbsp;
15376<A HREF="bashref.html#fn_M" style="text-decoration:none"><b>M</b></A>
15377 &nbsp;
15378<A HREF="bashref.html#fn_N" style="text-decoration:none"><b>N</b></A>
15379 &nbsp;
15380<A HREF="bashref.html#fn_O" style="text-decoration:none"><b>O</b></A>
15381 &nbsp;
15382<A HREF="bashref.html#fn_P" style="text-decoration:none"><b>P</b></A>
15383 &nbsp;
15384<A HREF="bashref.html#fn_Q" style="text-decoration:none"><b>Q</b></A>
15385 &nbsp;
15386<A HREF="bashref.html#fn_R" style="text-decoration:none"><b>R</b></A>
15387 &nbsp;
15388<A HREF="bashref.html#fn_S" style="text-decoration:none"><b>S</b></A>
15389 &nbsp;
15390<A HREF="bashref.html#fn_T" style="text-decoration:none"><b>T</b></A>
15391 &nbsp;
15392<A HREF="bashref.html#fn_U" style="text-decoration:none"><b>U</b></A>
15393 &nbsp;
15394<A HREF="bashref.html#fn_Y" style="text-decoration:none"><b>Y</b></A>
15395 &nbsp;
15396</td></tr></table><br><P>
15397
15398<A NAME="Concept Index"></A>
15399<HR SIZE="6">
15400<A NAME="SEC145"></A>
15401<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15402<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC144"> &lt; </A>]</TD>
15403<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt; ]</TD>
15404<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
15405<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140"> Up </A>]</TD>
15406<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
15407<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15408<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15409<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15410<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15411</TR></TABLE>
15412<H2> D.5 Concept Index </H2>
15413<!--docid::SEC145::-->
15414<table><tr><th valign=top>Jump to: &nbsp; </th><td><A HREF="bashref.html#cp_A" style="text-decoration:none"><b>A</b></A>
15415 &nbsp;
15416<A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15417 &nbsp;
15418<A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15419 &nbsp;
15420<A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15421 &nbsp;
15422<A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15423 &nbsp;
15424<A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15425 &nbsp;
15426<A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15427 &nbsp;
15428<A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15429 &nbsp;
15430<A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15431 &nbsp;
15432<A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15433 &nbsp;
15434<A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15435 &nbsp;
15436<A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15437 &nbsp;
15438<A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15439 &nbsp;
15440<A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15441 &nbsp;
15442<A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15443 &nbsp;
15444<A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15445 &nbsp;
15446<A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15447 &nbsp;
15448<A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15449 &nbsp;
15450<A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15451 &nbsp;
15452<A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15453 &nbsp;
15454<A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15455 &nbsp;
15456<A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15457 &nbsp;
15458</td></tr></table><br><P></P>
15459<TABLE border=0>
15460<TR><TD></TD><TH ALIGN=LEFT>Index Entry</TH><TH ALIGN=LEFT> Section</TH></TR>
15461<TR><TD COLSPAN=3> <HR></TD></TR>
15462<TR><TH><A NAME="cp_A"></A>A</TH><TD></TD><TD></TD></TR>
15463<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC84">alias expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC84">6.6 Aliases</A></TD></TR>
15464<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">arithmetic evaluation</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15465<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">arithmetic expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD></TR>
15466<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">arithmetic, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15467<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC85">arrays</A></TD><TD valign=top><A HREF="bashref.html#SEC85">6.7 Arrays</A></TD></TR>
15468<TR><TD COLSPAN=3> <HR></TD></TR>
15469<TR><TH><A NAME="cp_B"></A>B</TH><TD></TD><TD></TD></TR>
15470<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">background</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15471<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">Bash configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15472<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">Bash installation</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15473<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC5">Bourne shell</A></TD><TD valign=top><A HREF="bashref.html#SEC5">3. Basic Shell Features</A></TD></TR>
15474<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">brace expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD></TR>
15475<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX2">builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15476<TR><TD COLSPAN=3> <HR></TD></TR>
15477<TR><TH><A NAME="cp_C"></A>C</TH><TD></TD><TD></TD></TR>
15478<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">command editing</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR>
15479<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">command execution</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD></TR>
15480<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC51">command expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A></TD></TR>
15481<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC120">command history</A></TD><TD valign=top><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD></TR>
15482<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC52">command search</A></TD><TD valign=top><A HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A></TD></TR>
15483<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC32">command substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC32">3.5.4 Command Substitution</A></TD></TR>
15484<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX26">command timing</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
15485<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC19">commands, compound</A></TD><TD valign=top><A HREF="bashref.html#SEC19">3.2.4 Compound Commands</A></TD></TR>
15486<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC21">commands, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A></TD></TR>
15487<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC22">commands, grouping</A></TD><TD valign=top><A HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A></TD></TR>
15488<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC18">commands, lists</A></TD><TD valign=top><A HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A></TD></TR>
15489<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC20">commands, looping</A></TD><TD valign=top><A HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A></TD></TR>
15490<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC17">commands, pipelines</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
15491<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC15">commands, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC15">3.2 Shell Commands</A></TD></TR>
15492<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC16">commands, simple</A></TD><TD valign=top><A HREF="bashref.html#SEC16">3.2.1 Simple Commands</A></TD></TR>
15493<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC14">comments, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC14">3.1.3 Comments</A></TD></TR>
15494<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC118">completion builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
15495<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">configuration</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15496<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX3">control operator</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15497<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC23">coprocess</A></TD><TD valign=top><A HREF="bashref.html#SEC23">3.2.5 Coprocesses</A></TD></TR>
15498<TR><TD COLSPAN=3> <HR></TD></TR>
15499<TR><TH><A NAME="cp_D"></A>D</TH><TD></TD><TD></TD></TR>
15500<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC86">directory stack</A></TD><TD valign=top><A HREF="bashref.html#SEC86">6.8 The Directory Stack</A></TD></TR>
15501<TR><TD COLSPAN=3> <HR></TD></TR>
15502<TR><TH><A NAME="cp_E"></A>E</TH><TD></TD><TD></TD></TR>
15503<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">editing command lines</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR>
15504<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC54">environment</A></TD><TD valign=top><A HREF="bashref.html#SEC54">3.7.4 Environment</A></TD></TR>
15505<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">evaluation, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15506<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC123">event designators</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD></TR>
15507<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC53">execution environment</A></TD><TD valign=top><A HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A></TD></TR>
15508<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX4">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15509<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC55">exit status</A></TD><TD valign=top><A HREF="bashref.html#SEC55">3.7.5 Exit Status</A></TD></TR>
15510<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC28">expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC28">3.5 Shell Expansions</A></TD></TR>
15511<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC33">expansion, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A></TD></TR>
15512<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC29">expansion, brace</A></TD><TD valign=top><A HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A></TD></TR>
15513<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX64">expansion, filename</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15514<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">expansion, parameter</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD></TR>
15515<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX65">expansion, pathname</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15516<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">expansion, tilde</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD></TR>
15517<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">expressions, arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15518<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC82">expressions, conditional</A></TD><TD valign=top><A HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A></TD></TR>
15519<TR><TD COLSPAN=3> <HR></TD></TR>
15520<TR><TH><A NAME="cp_F"></A>F</TH><TD></TD><TD></TD></TR>
15521<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX5">field</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15522<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX6">filename</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15523<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX66">filename expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15524<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">foreground</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15525<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">functions, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR>
15526<TR><TD COLSPAN=3> <HR></TD></TR>
15527<TR><TH><A NAME="cp_H"></A>H</TH><TD></TD><TD></TD></TR>
15528<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC121">history builtins</A></TD><TD valign=top><A HREF="bashref.html#SEC121">9.2 Bash History Builtins</A></TD></TR>
0001803f 15529<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX546">history events</A></TD><TD valign=top><A HREF="bashref.html#SEC123">9.3.1 Event Designators</A></TD></TR>
17345e5a
JA
15530<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC122">history expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC122">9.3 History Expansion</A></TD></TR>
15531<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC120">history list</A></TD><TD valign=top><A HREF="bashref.html#SEC120">9.1 Bash History Facilities</A></TD></TR>
0001803f 15532<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX543">History, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A></TD></TR>
17345e5a
JA
15533<TR><TD COLSPAN=3> <HR></TD></TR>
15534<TR><TH><A NAME="cp_I"></A>I</TH><TD></TD><TD></TD></TR>
15535<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX11">identifier</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15536<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC103">initialization file, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC103">8.3 Readline Init File</A></TD></TR>
15537<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC127">installation</A></TD><TD valign=top><A HREF="bashref.html#SEC127">10.1 Basic Installation</A></TD></TR>
15538<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC97">interaction, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC97">8.2 Readline Interaction</A></TD></TR>
0001803f 15539<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX289">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR>
17345e5a
JA
15540<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC78">interactive shell</A></TD><TD valign=top><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD></TR>
15541<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">internationalization</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15542<TR><TD COLSPAN=3> <HR></TD></TR>
15543<TR><TH><A NAME="cp_J"></A>J</TH><TD></TD><TD></TD></TR>
15544<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX7">job</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15545<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX8">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15546<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">job control</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15547<TR><TD COLSPAN=3> <HR></TD></TR>
15548<TR><TH><A NAME="cp_K"></A>K</TH><TD></TD><TD></TD></TR>
0001803f
CR
15549<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX305">kill ring</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
15550<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX303">killing text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
17345e5a
JA
15551<TR><TD COLSPAN=3> <HR></TD></TR>
15552<TR><TH><A NAME="cp_L"></A>L</TH><TD></TD><TD></TD></TR>
15553<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">localization</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
0001803f 15554<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX288">login shell</A></TD><TD valign=top><A HREF="bashref.html#SEC69">6.1 Invoking Bash</A></TD></TR>
17345e5a
JA
15555<TR><TD COLSPAN=3> <HR></TD></TR>
15556<TR><TH><A NAME="cp_M"></A>M</TH><TD></TD><TD></TD></TR>
15557<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC37">matching, pattern</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD></TR>
15558<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX9">metacharacter</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15559<TR><TD COLSPAN=3> <HR></TD></TR>
15560<TR><TH><A NAME="cp_N"></A>N</TH><TD></TD><TD></TD></TR>
15561<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX10">name</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15562<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">native languages</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15563<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC98">notation, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A></TD></TR>
15564<TR><TD COLSPAN=3> <HR></TD></TR>
15565<TR><TH><A NAME="cp_O"></A>O</TH><TD></TD><TD></TD></TR>
15566<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX12">operator, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15567<TR><TD COLSPAN=3> <HR></TD></TR>
15568<TR><TH><A NAME="cp_P"></A>P</TH><TD></TD><TD></TD></TR>
15569<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC31">parameter expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A></TD></TR>
15570<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">parameters</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR>
15571<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC26">parameters, positional</A></TD><TD valign=top><A HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A></TD></TR>
15572<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC27">parameters, special</A></TD><TD valign=top><A HREF="bashref.html#SEC27">3.4.2 Special Parameters</A></TD></TR>
15573<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX67">pathname expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A></TD></TR>
15574<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC37">pattern matching</A></TD><TD valign=top><A HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A></TD></TR>
15575<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC17">pipeline</A></TD><TD valign=top><A HREF="bashref.html#SEC17">3.2.2 Pipelines</A></TD></TR>
15576<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX1">POSIX</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15577<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC90">POSIX Mode</A></TD><TD valign=top><A HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A></TD></TR>
15578<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX13">process group</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15579<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX14">process group ID</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15580<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC34">process substitution</A></TD><TD valign=top><A HREF="bashref.html#SEC34">3.5.6 Process Substitution</A></TD></TR>
15581<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC117">programmable completion</A></TD><TD valign=top><A HREF="bashref.html#SEC117">8.6 Programmable Completion</A></TD></TR>
15582<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC88">prompting</A></TD><TD valign=top><A HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A></TD></TR>
15583<TR><TD COLSPAN=3> <HR></TD></TR>
15584<TR><TH><A NAME="cp_Q"></A>Q</TH><TD></TD><TD></TD></TR>
15585<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC8">quoting</A></TD><TD valign=top><A HREF="bashref.html#SEC8">3.1.2 Quoting</A></TD></TR>
15586<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC12">quoting, ANSI</A></TD><TD valign=top><A HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A></TD></TR>
15587<TR><TD COLSPAN=3> <HR></TD></TR>
15588<TR><TH><A NAME="cp_R"></A>R</TH><TD></TD><TD></TD></TR>
0001803f 15589<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX302">Readline, how to use</A></TD><TD valign=top><A HREF="bashref.html#SEC94">7.3 Job Control Variables</A></TD></TR>
17345e5a
JA
15590<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC39">redirection</A></TD><TD valign=top><A HREF="bashref.html#SEC39">3.6 Redirections</A></TD></TR>
15591<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX15">reserved word</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15592<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC89">restricted shell</A></TD><TD valign=top><A HREF="bashref.html#SEC89">6.10 The Restricted Shell</A></TD></TR>
15593<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX16">return status</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15594<TR><TD COLSPAN=3> <HR></TD></TR>
15595<TR><TH><A NAME="cp_S"></A>S</TH><TD></TD><TD></TD></TR>
15596<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC83">shell arithmetic</A></TD><TD valign=top><A HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A></TD></TR>
15597<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC24">shell function</A></TD><TD valign=top><A HREF="bashref.html#SEC24">3.3 Shell Functions</A></TD></TR>
15598<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC57">shell script</A></TD><TD valign=top><A HREF="bashref.html#SEC57">3.8 Shell Scripts</A></TD></TR>
15599<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">shell variable</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR>
15600<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC78">shell, interactive</A></TD><TD valign=top><A HREF="bashref.html#SEC78">6.3 Interactive Shells</A></TD></TR>
15601<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX17">signal</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15602<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC56">signal handling</A></TD><TD valign=top><A HREF="bashref.html#SEC56">3.7.6 Signals</A></TD></TR>
15603<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX18">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15604<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC64">special builtin</A></TD><TD valign=top><A HREF="bashref.html#SEC64">4.4 Special Builtins</A></TD></TR>
15605<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC70">startup files</A></TD><TD valign=top><A HREF="bashref.html#SEC70">6.2 Bash Startup Files</A></TD></TR>
15606<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC92">suspending jobs</A></TD><TD valign=top><A HREF="bashref.html#SEC92">7.1 Job Control Basics</A></TD></TR>
15607<TR><TD COLSPAN=3> <HR></TD></TR>
15608<TR><TH><A NAME="cp_T"></A>T</TH><TD></TD><TD></TD></TR>
15609<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC30">tilde expansion</A></TD><TD valign=top><A HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A></TD></TR>
15610<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX19">token</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15611<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC13">translation, native languages</A></TD><TD valign=top><A HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A></TD></TR>
15612<TR><TD COLSPAN=3> <HR></TD></TR>
15613<TR><TH><A NAME="cp_V"></A>V</TH><TD></TD><TD></TD></TR>
15614<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC25">variable, shell</A></TD><TD valign=top><A HREF="bashref.html#SEC25">3.4 Shell Parameters</A></TD></TR>
0001803f 15615<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX306">variables, readline</A></TD><TD valign=top><A HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A></TD></TR>
17345e5a
JA
15616<TR><TD COLSPAN=3> <HR></TD></TR>
15617<TR><TH><A NAME="cp_W"></A>W</TH><TD></TD><TD></TD></TR>
15618<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX20">word</A></TD><TD valign=top><A HREF="bashref.html#SEC4">2. Definitions</A></TD></TR>
15619<TR><TD></TD><TD valign=top><A HREF="bashref.html#SEC35">word splitting</A></TD><TD valign=top><A HREF="bashref.html#SEC35">3.5.7 Word Splitting</A></TD></TR>
15620<TR><TD COLSPAN=3> <HR></TD></TR>
15621<TR><TH><A NAME="cp_Y"></A>Y</TH><TD></TD><TD></TD></TR>
0001803f 15622<TR><TD></TD><TD valign=top><A HREF="bashref.html#IDX304">yanking text</A></TD><TD valign=top><A HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A></TD></TR>
17345e5a
JA
15623<TR><TD COLSPAN=3> <HR></TD></TR>
15624</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>
15625 &nbsp;
15626<A HREF="bashref.html#cp_B" style="text-decoration:none"><b>B</b></A>
15627 &nbsp;
15628<A HREF="bashref.html#cp_C" style="text-decoration:none"><b>C</b></A>
15629 &nbsp;
15630<A HREF="bashref.html#cp_D" style="text-decoration:none"><b>D</b></A>
15631 &nbsp;
15632<A HREF="bashref.html#cp_E" style="text-decoration:none"><b>E</b></A>
15633 &nbsp;
15634<A HREF="bashref.html#cp_F" style="text-decoration:none"><b>F</b></A>
15635 &nbsp;
15636<A HREF="bashref.html#cp_H" style="text-decoration:none"><b>H</b></A>
15637 &nbsp;
15638<A HREF="bashref.html#cp_I" style="text-decoration:none"><b>I</b></A>
15639 &nbsp;
15640<A HREF="bashref.html#cp_J" style="text-decoration:none"><b>J</b></A>
15641 &nbsp;
15642<A HREF="bashref.html#cp_K" style="text-decoration:none"><b>K</b></A>
15643 &nbsp;
15644<A HREF="bashref.html#cp_L" style="text-decoration:none"><b>L</b></A>
15645 &nbsp;
15646<A HREF="bashref.html#cp_M" style="text-decoration:none"><b>M</b></A>
15647 &nbsp;
15648<A HREF="bashref.html#cp_N" style="text-decoration:none"><b>N</b></A>
15649 &nbsp;
15650<A HREF="bashref.html#cp_O" style="text-decoration:none"><b>O</b></A>
15651 &nbsp;
15652<A HREF="bashref.html#cp_P" style="text-decoration:none"><b>P</b></A>
15653 &nbsp;
15654<A HREF="bashref.html#cp_Q" style="text-decoration:none"><b>Q</b></A>
15655 &nbsp;
15656<A HREF="bashref.html#cp_R" style="text-decoration:none"><b>R</b></A>
15657 &nbsp;
15658<A HREF="bashref.html#cp_S" style="text-decoration:none"><b>S</b></A>
15659 &nbsp;
15660<A HREF="bashref.html#cp_T" style="text-decoration:none"><b>T</b></A>
15661 &nbsp;
15662<A HREF="bashref.html#cp_V" style="text-decoration:none"><b>V</b></A>
15663 &nbsp;
15664<A HREF="bashref.html#cp_W" style="text-decoration:none"><b>W</b></A>
15665 &nbsp;
15666<A HREF="bashref.html#cp_Y" style="text-decoration:none"><b>Y</b></A>
15667 &nbsp;
15668</td></tr></table><br><P>
15669
15670<HR SIZE="6">
15671<A NAME="SEC_Contents"></A>
15672<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
15673<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
15674<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
15675<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
15676<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
15677</TR></TABLE>
15678<H1>Table of Contents</H1>
15679<UL>
15680<A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
15681<BR>
15682<UL>
15683<A NAME="TOC2" HREF="bashref.html#SEC2">1.1 What is Bash?</A>
15684<BR>
15685<A NAME="TOC3" HREF="bashref.html#SEC3">1.2 What is a shell?</A>
15686<BR>
15687</UL>
15688<A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
15689<BR>
15690<A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
15691<BR>
15692<UL>
15693<A NAME="TOC6" HREF="bashref.html#SEC6">3.1 Shell Syntax</A>
15694<BR>
15695<UL>
15696<A NAME="TOC7" HREF="bashref.html#SEC7">3.1.1 Shell Operation</A>
15697<BR>
15698<A NAME="TOC8" HREF="bashref.html#SEC8">3.1.2 Quoting</A>
15699<BR>
15700<UL>
15701<A NAME="TOC9" HREF="bashref.html#SEC9">3.1.2.1 Escape Character</A>
15702<BR>
15703<A NAME="TOC10" HREF="bashref.html#SEC10">3.1.2.2 Single Quotes</A>
15704<BR>
15705<A NAME="TOC11" HREF="bashref.html#SEC11">3.1.2.3 Double Quotes</A>
15706<BR>
15707<A NAME="TOC12" HREF="bashref.html#SEC12">3.1.2.4 ANSI-C Quoting</A>
15708<BR>
15709<A NAME="TOC13" HREF="bashref.html#SEC13">3.1.2.5 Locale-Specific Translation</A>
15710<BR>
15711</UL>
15712<A NAME="TOC14" HREF="bashref.html#SEC14">3.1.3 Comments</A>
15713<BR>
15714</UL>
15715<A NAME="TOC15" HREF="bashref.html#SEC15">3.2 Shell Commands</A>
15716<BR>
15717<UL>
15718<A NAME="TOC16" HREF="bashref.html#SEC16">3.2.1 Simple Commands</A>
15719<BR>
15720<A NAME="TOC17" HREF="bashref.html#SEC17">3.2.2 Pipelines</A>
15721<BR>
15722<A NAME="TOC18" HREF="bashref.html#SEC18">3.2.3 Lists of Commands</A>
15723<BR>
15724<A NAME="TOC19" HREF="bashref.html#SEC19">3.2.4 Compound Commands</A>
15725<BR>
15726<UL>
15727<A NAME="TOC20" HREF="bashref.html#SEC20">3.2.4.1 Looping Constructs</A>
15728<BR>
15729<A NAME="TOC21" HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>
15730<BR>
15731<A NAME="TOC22" HREF="bashref.html#SEC22">3.2.4.3 Grouping Commands</A>
15732<BR>
15733</UL>
15734<A NAME="TOC23" HREF="bashref.html#SEC23">3.2.5 Coprocesses</A>
15735<BR>
15736</UL>
15737<A NAME="TOC24" HREF="bashref.html#SEC24">3.3 Shell Functions</A>
15738<BR>
15739<A NAME="TOC25" HREF="bashref.html#SEC25">3.4 Shell Parameters</A>
15740<BR>
15741<UL>
15742<A NAME="TOC26" HREF="bashref.html#SEC26">3.4.1 Positional Parameters</A>
15743<BR>
15744<A NAME="TOC27" HREF="bashref.html#SEC27">3.4.2 Special Parameters</A>
15745<BR>
15746</UL>
15747<A NAME="TOC28" HREF="bashref.html#SEC28">3.5 Shell Expansions</A>
15748<BR>
15749<UL>
15750<A NAME="TOC29" HREF="bashref.html#SEC29">3.5.1 Brace Expansion</A>
15751<BR>
15752<A NAME="TOC30" HREF="bashref.html#SEC30">3.5.2 Tilde Expansion</A>
15753<BR>
15754<A NAME="TOC31" HREF="bashref.html#SEC31">3.5.3 Shell Parameter Expansion</A>
15755<BR>
15756<A NAME="TOC32" HREF="bashref.html#SEC32">3.5.4 Command Substitution</A>
15757<BR>
15758<A NAME="TOC33" HREF="bashref.html#SEC33">3.5.5 Arithmetic Expansion</A>
15759<BR>
15760<A NAME="TOC34" HREF="bashref.html#SEC34">3.5.6 Process Substitution</A>
15761<BR>
15762<A NAME="TOC35" HREF="bashref.html#SEC35">3.5.7 Word Splitting</A>
15763<BR>
15764<A NAME="TOC36" HREF="bashref.html#SEC36">3.5.8 Filename Expansion</A>
15765<BR>
15766<UL>
15767<A NAME="TOC37" HREF="bashref.html#SEC37">3.5.8.1 Pattern Matching</A>
15768<BR>
15769</UL>
15770<A NAME="TOC38" HREF="bashref.html#SEC38">3.5.9 Quote Removal</A>
15771<BR>
15772</UL>
15773<A NAME="TOC39" HREF="bashref.html#SEC39">3.6 Redirections</A>
15774<BR>
15775<UL>
15776<A NAME="TOC40" HREF="bashref.html#SEC40">3.6.1 Redirecting Input</A>
15777<BR>
15778<A NAME="TOC41" HREF="bashref.html#SEC41">3.6.2 Redirecting Output</A>
15779<BR>
15780<A NAME="TOC42" HREF="bashref.html#SEC42">3.6.3 Appending Redirected Output</A>
15781<BR>
15782<A NAME="TOC43" HREF="bashref.html#SEC43">3.6.4 Redirecting Standard Output and Standard Error</A>
15783<BR>
15784<A NAME="TOC44" HREF="bashref.html#SEC44">3.6.5 Appending Standard Output and Standard Error</A>
15785<BR>
15786<A NAME="TOC45" HREF="bashref.html#SEC45">3.6.6 Here Documents</A>
15787<BR>
15788<A NAME="TOC46" HREF="bashref.html#SEC46">3.6.7 Here Strings</A>
15789<BR>
15790<A NAME="TOC47" HREF="bashref.html#SEC47">3.6.8 Duplicating File Descriptors</A>
15791<BR>
15792<A NAME="TOC48" HREF="bashref.html#SEC48">3.6.9 Moving File Descriptors</A>
15793<BR>
15794<A NAME="TOC49" HREF="bashref.html#SEC49">3.6.10 Opening File Descriptors for Reading and Writing</A>
15795<BR>
15796</UL>
15797<A NAME="TOC50" HREF="bashref.html#SEC50">3.7 Executing Commands</A>
15798<BR>
15799<UL>
15800<A NAME="TOC51" HREF="bashref.html#SEC51">3.7.1 Simple Command Expansion</A>
15801<BR>
15802<A NAME="TOC52" HREF="bashref.html#SEC52">3.7.2 Command Search and Execution</A>
15803<BR>
15804<A NAME="TOC53" HREF="bashref.html#SEC53">3.7.3 Command Execution Environment</A>
15805<BR>
15806<A NAME="TOC54" HREF="bashref.html#SEC54">3.7.4 Environment</A>
15807<BR>
15808<A NAME="TOC55" HREF="bashref.html#SEC55">3.7.5 Exit Status</A>
15809<BR>
15810<A NAME="TOC56" HREF="bashref.html#SEC56">3.7.6 Signals</A>
15811<BR>
15812</UL>
15813<A NAME="TOC57" HREF="bashref.html#SEC57">3.8 Shell Scripts</A>
15814<BR>
15815</UL>
15816<A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>
15817<BR>
15818<UL>
15819<A NAME="TOC59" HREF="bashref.html#SEC59">4.1 Bourne Shell Builtins</A>
15820<BR>
15821<A NAME="TOC60" HREF="bashref.html#SEC60">4.2 Bash Builtin Commands</A>
15822<BR>
15823<A NAME="TOC61" HREF="bashref.html#SEC61">4.3 Modifying Shell Behavior</A>
15824<BR>
15825<UL>
15826<A NAME="TOC62" HREF="bashref.html#SEC62">4.3.1 The Set Builtin</A>
15827<BR>
15828<A NAME="TOC63" HREF="bashref.html#SEC63">4.3.2 The Shopt Builtin</A>
15829<BR>
15830</UL>
15831<A NAME="TOC64" HREF="bashref.html#SEC64">4.4 Special Builtins</A>
15832<BR>
15833</UL>
15834<A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A>
15835<BR>
15836<UL>
15837<A NAME="TOC66" HREF="bashref.html#SEC66">5.1 Bourne Shell Variables</A>
15838<BR>
15839<A NAME="TOC67" HREF="bashref.html#SEC67">5.2 Bash Variables</A>
15840<BR>
15841</UL>
15842<A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A>
15843<BR>
15844<UL>
15845<A NAME="TOC69" HREF="bashref.html#SEC69">6.1 Invoking Bash</A>
15846<BR>
15847<A NAME="TOC70" HREF="bashref.html#SEC70">6.2 Bash Startup Files</A>
15848<BR>
15849<A NAME="TOC78" HREF="bashref.html#SEC78">6.3 Interactive Shells</A>
15850<BR>
15851<UL>
15852<A NAME="TOC79" HREF="bashref.html#SEC79">6.3.1 What is an Interactive Shell?</A>
15853<BR>
15854<A NAME="TOC80" HREF="bashref.html#SEC80">6.3.2 Is this Shell Interactive?</A>
15855<BR>
15856<A NAME="TOC81" HREF="bashref.html#SEC81">6.3.3 Interactive Shell Behavior</A>
15857<BR>
15858</UL>
15859<A NAME="TOC82" HREF="bashref.html#SEC82">6.4 Bash Conditional Expressions</A>
15860<BR>
15861<A NAME="TOC83" HREF="bashref.html#SEC83">6.5 Shell Arithmetic</A>
15862<BR>
15863<A NAME="TOC84" HREF="bashref.html#SEC84">6.6 Aliases</A>
15864<BR>
15865<A NAME="TOC85" HREF="bashref.html#SEC85">6.7 Arrays</A>
15866<BR>
15867<A NAME="TOC86" HREF="bashref.html#SEC86">6.8 The Directory Stack</A>
15868<BR>
15869<UL>
15870<A NAME="TOC87" HREF="bashref.html#SEC87">6.8.1 Directory Stack Builtins</A>
15871<BR>
15872</UL>
15873<A NAME="TOC88" HREF="bashref.html#SEC88">6.9 Controlling the Prompt</A>
15874<BR>
15875<A NAME="TOC89" HREF="bashref.html#SEC89">6.10 The Restricted Shell</A>
15876<BR>
15877<A NAME="TOC90" HREF="bashref.html#SEC90">6.11 Bash POSIX Mode</A>
15878<BR>
15879</UL>
15880<A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A>
15881<BR>
15882<UL>
15883<A NAME="TOC92" HREF="bashref.html#SEC92">7.1 Job Control Basics</A>
15884<BR>
15885<A NAME="TOC93" HREF="bashref.html#SEC93">7.2 Job Control Builtins</A>
15886<BR>
15887<A NAME="TOC94" HREF="bashref.html#SEC94">7.3 Job Control Variables</A>
15888<BR>
15889</UL>
15890<A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A>
15891<BR>
15892<UL>
15893<A NAME="TOC96" HREF="bashref.html#SEC96">8.1 Introduction to Line Editing</A>
15894<BR>
15895<A NAME="TOC97" HREF="bashref.html#SEC97">8.2 Readline Interaction</A>
15896<BR>
15897<UL>
15898<A NAME="TOC98" HREF="bashref.html#SEC98">8.2.1 Readline Bare Essentials</A>
15899<BR>
15900<A NAME="TOC99" HREF="bashref.html#SEC99">8.2.2 Readline Movement Commands</A>
15901<BR>
15902<A NAME="TOC100" HREF="bashref.html#SEC100">8.2.3 Readline Killing Commands</A>
15903<BR>
15904<A NAME="TOC101" HREF="bashref.html#SEC101">8.2.4 Readline Arguments</A>
15905<BR>
15906<A NAME="TOC102" HREF="bashref.html#SEC102">8.2.5 Searching for Commands in the History</A>
15907<BR>
15908</UL>
15909<A NAME="TOC103" HREF="bashref.html#SEC103">8.3 Readline Init File</A>
15910<BR>
15911<UL>
15912<A NAME="TOC104" HREF="bashref.html#SEC104">8.3.1 Readline Init File Syntax</A>
15913<BR>
15914<A NAME="TOC105" HREF="bashref.html#SEC105">8.3.2 Conditional Init Constructs</A>
15915<BR>
15916<A NAME="TOC106" HREF="bashref.html#SEC106">8.3.3 Sample Init File</A>
15917<BR>
15918</UL>
15919<A NAME="TOC107" HREF="bashref.html#SEC107">8.4 Bindable Readline Commands</A>
15920<BR>
15921<UL>
15922<A NAME="TOC108" HREF="bashref.html#SEC108">8.4.1 Commands For Moving</A>
15923<BR>
15924<A NAME="TOC109" HREF="bashref.html#SEC109">8.4.2 Commands For Manipulating The History</A>
15925<BR>
15926<A NAME="TOC110" HREF="bashref.html#SEC110">8.4.3 Commands For Changing Text</A>
15927<BR>
15928<A NAME="TOC111" HREF="bashref.html#SEC111">8.4.4 Killing And Yanking</A>
15929<BR>
15930<A NAME="TOC112" HREF="bashref.html#SEC112">8.4.5 Specifying Numeric Arguments</A>
15931<BR>
15932<A NAME="TOC113" HREF="bashref.html#SEC113">8.4.6 Letting Readline Type For You</A>
15933<BR>
15934<A NAME="TOC114" HREF="bashref.html#SEC114">8.4.7 Keyboard Macros</A>
15935<BR>
15936<A NAME="TOC115" HREF="bashref.html#SEC115">8.4.8 Some Miscellaneous Commands</A>
15937<BR>
15938</UL>
15939<A NAME="TOC116" HREF="bashref.html#SEC116">8.5 Readline vi Mode</A>
15940<BR>
15941<A NAME="TOC117" HREF="bashref.html#SEC117">8.6 Programmable Completion</A>
15942<BR>
15943<A NAME="TOC118" HREF="bashref.html#SEC118">8.7 Programmable Completion Builtins</A>
15944<BR>
15945</UL>
15946<A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A>
15947<BR>
15948<UL>
15949<A NAME="TOC120" HREF="bashref.html#SEC120">9.1 Bash History Facilities</A>
15950<BR>
15951<A NAME="TOC121" HREF="bashref.html#SEC121">9.2 Bash History Builtins</A>
15952<BR>
15953<A NAME="TOC122" HREF="bashref.html#SEC122">9.3 History Expansion</A>
15954<BR>
15955<UL>
15956<A NAME="TOC123" HREF="bashref.html#SEC123">9.3.1 Event Designators</A>
15957<BR>
15958<A NAME="TOC124" HREF="bashref.html#SEC124">9.3.2 Word Designators</A>
15959<BR>
15960<A NAME="TOC125" HREF="bashref.html#SEC125">9.3.3 Modifiers</A>
15961<BR>
15962</UL>
15963</UL>
15964<A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A>
15965<BR>
15966<UL>
15967<A NAME="TOC127" HREF="bashref.html#SEC127">10.1 Basic Installation</A>
15968<BR>
15969<A NAME="TOC128" HREF="bashref.html#SEC128">10.2 Compilers and Options</A>
15970<BR>
15971<A NAME="TOC129" HREF="bashref.html#SEC129">10.3 Compiling For Multiple Architectures</A>
15972<BR>
15973<A NAME="TOC130" HREF="bashref.html#SEC130">10.4 Installation Names</A>
15974<BR>
15975<A NAME="TOC131" HREF="bashref.html#SEC131">10.5 Specifying the System Type</A>
15976<BR>
15977<A NAME="TOC132" HREF="bashref.html#SEC132">10.6 Sharing Defaults</A>
15978<BR>
15979<A NAME="TOC133" HREF="bashref.html#SEC133">10.7 Operation Controls</A>
15980<BR>
15981<A NAME="TOC134" HREF="bashref.html#SEC134">10.8 Optional Features</A>
15982<BR>
15983</UL>
15984<A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A>
15985<BR>
15986<A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A>
15987<BR>
15988<UL>
15989<A NAME="TOC137" HREF="bashref.html#SEC137">B.1 Implementation Differences From The SVR4.2 Shell</A>
15990<BR>
15991</UL>
15992<A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A>
15993<BR>
15994<A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A>
15995<BR>
15996<UL>
15997<A NAME="TOC141" HREF="bashref.html#SEC141">D.1 Index of Shell Builtin Commands</A>
15998<BR>
15999<A NAME="TOC142" HREF="bashref.html#SEC142">D.2 Index of Shell Reserved Words</A>
16000<BR>
16001<A NAME="TOC143" HREF="bashref.html#SEC143">D.3 Parameter and Variable Index</A>
16002<BR>
16003<A NAME="TOC144" HREF="bashref.html#SEC144">D.4 Function Index</A>
16004<BR>
16005<A NAME="TOC145" HREF="bashref.html#SEC145">D.5 Concept Index</A>
16006<BR>
16007</UL>
16008</UL>
16009<HR SIZE=1>
16010<A NAME="SEC_OVERVIEW"></A>
16011<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16012<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16013<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16014<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
16015<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16016</TR></TABLE>
16017<H1>Short Table of Contents</H1>
16018<BLOCKQUOTE>
16019<A NAME="TOC1" HREF="bashref.html#SEC1">1. Introduction</A>
16020<BR>
16021<A NAME="TOC4" HREF="bashref.html#SEC4">2. Definitions</A>
16022<BR>
16023<A NAME="TOC5" HREF="bashref.html#SEC5">3. Basic Shell Features</A>
16024<BR>
16025<A NAME="TOC58" HREF="bashref.html#SEC58">4. Shell Builtin Commands</A>
16026<BR>
16027<A NAME="TOC65" HREF="bashref.html#SEC65">5. Shell Variables</A>
16028<BR>
16029<A NAME="TOC68" HREF="bashref.html#SEC68">6. Bash Features</A>
16030<BR>
16031<A NAME="TOC91" HREF="bashref.html#SEC91">7. Job Control</A>
16032<BR>
16033<A NAME="TOC95" HREF="bashref.html#SEC95">8. Command Line Editing</A>
16034<BR>
16035<A NAME="TOC119" HREF="bashref.html#SEC119">9. Using History Interactively</A>
16036<BR>
16037<A NAME="TOC126" HREF="bashref.html#SEC126">10. Installing Bash</A>
16038<BR>
16039<A NAME="TOC135" HREF="bashref.html#SEC135">A. Reporting Bugs</A>
16040<BR>
16041<A NAME="TOC136" HREF="bashref.html#SEC136">B. Major Differences From The Bourne Shell</A>
16042<BR>
16043<A NAME="TOC138" HREF="bashref.html#SEC138">C. GNU Free Documentation License</A>
16044<BR>
16045<A NAME="TOC140" HREF="bashref.html#SEC140">D. Indexes</A>
16046<BR>
16047
16048</BLOCKQUOTE>
16049<HR SIZE=1>
16050<A NAME="SEC_About"></A>
16051<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
16052<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Top">Top</A>]</TD>
16053<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_Contents">Contents</A>]</TD>
16054<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC140">Index</A>]</TD>
16055<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
16056</TR></TABLE>
16057<H1>About this document</H1>
0001803f 16058This document was generated by <I>Chet Ramey</I> on <I>December, 29 2009</I>
17345e5a
JA
16059using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
16060"><I>texi2html</I></A>
16061<P></P>
16062The buttons in the navigation panels have the following meaning:
16063<P></P>
16064<table border = "1">
16065<TR>
16066<TH> Button </TH>
16067<TH> Name </TH>
16068<TH> Go to </TH>
16069<TH> From 1.2.3 go to</TH>
16070</TR>
16071<TR>
16072<TD ALIGN="CENTER">
16073 [ &lt; ] </TD>
16074<TD ALIGN="CENTER">
16075Back
16076</TD>
16077<TD>
16078previous section in reading order
16079</TD>
16080<TD>
160811.2.2
16082</TD>
16083</TR>
16084<TR>
16085<TD ALIGN="CENTER">
16086 [ &gt; ] </TD>
16087<TD ALIGN="CENTER">
16088Forward
16089</TD>
16090<TD>
16091next section in reading order
16092</TD>
16093<TD>
160941.2.4
16095</TD>
16096</TR>
16097<TR>
16098<TD ALIGN="CENTER">
16099 [ &lt;&lt; ] </TD>
16100<TD ALIGN="CENTER">
16101FastBack
16102</TD>
16103<TD>
16104previous or up-and-previous section
16105</TD>
16106<TD>
161071.1
16108</TD>
16109</TR>
16110<TR>
16111<TD ALIGN="CENTER">
16112 [ Up ] </TD>
16113<TD ALIGN="CENTER">
16114Up
16115</TD>
16116<TD>
16117up section
16118</TD>
16119<TD>
161201.2
16121</TD>
16122</TR>
16123<TR>
16124<TD ALIGN="CENTER">
16125 [ &gt;&gt; ] </TD>
16126<TD ALIGN="CENTER">
16127FastForward
16128</TD>
16129<TD>
16130next or up-and-next section
16131</TD>
16132<TD>
161331.3
16134</TD>
16135</TR>
16136<TR>
16137<TD ALIGN="CENTER">
16138 [Top] </TD>
16139<TD ALIGN="CENTER">
16140Top
16141</TD>
16142<TD>
16143cover (top) of document
16144</TD>
16145<TD>
16146 &nbsp;
16147</TD>
16148</TR>
16149<TR>
16150<TD ALIGN="CENTER">
16151 [Contents] </TD>
16152<TD ALIGN="CENTER">
16153Contents
16154</TD>
16155<TD>
16156table of contents
16157</TD>
16158<TD>
16159 &nbsp;
16160</TD>
16161</TR>
16162<TR>
16163<TD ALIGN="CENTER">
16164 [Index] </TD>
16165<TD ALIGN="CENTER">
16166Index
16167</TD>
16168<TD>
16169concept index
16170</TD>
16171<TD>
16172 &nbsp;
16173</TD>
16174</TR>
16175<TR>
16176<TD ALIGN="CENTER">
16177 [ ? ] </TD>
16178<TD ALIGN="CENTER">
16179About
16180</TD>
16181<TD>
16182this page
16183</TD>
16184<TD>
16185 &nbsp;
16186</TD>
16187</TR>
16188</TABLE>
16189<P></P>
16190where the <STRONG> Example </STRONG> assumes that the current position
16191is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
16192the following structure:
16193<UL>
16194<LI> 1. Section One </LI>
16195<UL>
16196<LI>1.1 Subsection One-One</LI>
16197<UL>
16198<LI> ... </LI>
16199</UL>
16200<LI>1.2 Subsection One-Two</LI>
16201<UL>
16202<LI>1.2.1 Subsubsection One-Two-One
16203</LI><LI>1.2.2 Subsubsection One-Two-Two
16204</LI><LI>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp; <STRONG>
16205&lt;== Current Position </STRONG>
16206</LI><LI>1.2.4 Subsubsection One-Two-Four
16207</LI></UL>
16208<LI>1.3 Subsection One-Three</LI>
16209<UL>
16210<LI> ... </LI>
16211</UL>
16212<LI>1.4 Subsection One-Four</LI>
16213</UL>
16214</UL>
16215
16216<HR SIZE=1>
16217<BR>
16218<FONT SIZE="-1">
16219This document was generated
0001803f 16220by <I>Chet Ramey</I> on <I>December, 29 2009</I>
17345e5a
JA
16221using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
16222"><I>texi2html</I></A>
16223
16224</BODY>
16225</HTML>